--- a/.hgtags Fri Nov 08 17:50:24 2013 -0500
+++ b/.hgtags Fri Nov 08 17:36:14 2013 -0800
@@ -235,3 +235,4 @@
b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111
ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112
4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113
+dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114
--- a/.hgtags-top-repo Fri Nov 08 17:50:24 2013 -0500
+++ b/.hgtags-top-repo Fri Nov 08 17:36:14 2013 -0800
@@ -235,3 +235,4 @@
d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111
547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112
6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113
+4f2011496393a26dcfd7b1f7787a3673ddd32599 jdk8-b114
--- a/common/autoconf/basics.m4 Fri Nov 08 17:50:24 2013 -0500
+++ b/common/autoconf/basics.m4 Fri Nov 08 17:36:14 2013 -0800
@@ -514,7 +514,7 @@
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
--- a/common/autoconf/generated-configure.sh Fri Nov 08 17:50:24 2013 -0500
+++ b/common/autoconf/generated-configure.sh Fri Nov 08 17:36:14 2013 -0800
@@ -3865,7 +3865,7 @@
#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:${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:${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:${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:${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:${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;}
--- a/corba/.hgtags Fri Nov 08 17:50:24 2013 -0500
+++ b/corba/.hgtags Fri Nov 08 17:36:14 2013 -0800
@@ -235,3 +235,4 @@
85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111
43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112
a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113
+0bbccf77c23e566170b88b52c2cf28e5d31ce927 jdk8-b114
--- a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -580,7 +580,7 @@
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;
--- a/corba/src/share/classes/javax/rmi/CORBA/Stub.java Fri Nov 08 17:50:24 2013 -0500
+++ b/corba/src/share/classes/javax/rmi/CORBA/Stub.java Fri Nov 08 17:36:14 2013 -0800
@@ -61,13 +61,11 @@
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 @@
// 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 @@
}
if (className == null) {
- className = defaultClassName;
+ return new com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl();
}
try {
--- a/corba/src/share/classes/javax/rmi/CORBA/Util.java Fri Nov 08 17:50:24 2013 -0500
+++ b/corba/src/share/classes/javax/rmi/CORBA/Util.java Fri Nov 08 17:36:14 2013 -0800
@@ -60,14 +60,11 @@
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 @@
// 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 @@
}
if (className == null) {
- className = defaultClassName;
+ return new com.sun.corba.se.impl.javax.rmi.CORBA.Util();
}
try {
--- a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java Fri Nov 08 17:50:24 2013 -0500
+++ b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java Fri Nov 08 17:36:14 2013 -0800
@@ -65,17 +65,14 @@
*/
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 @@
// 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 @@
}
}
if (className == null) {
- className = defaultPortableRemoteObjectImplName;
+ return new com.sun.corba.se.impl.javax.rmi.PortableRemoteObject();
}
try {
--- a/corba/src/share/classes/org/omg/CORBA/ORB.java Fri Nov 08 17:50:24 2013 -0500
+++ b/corba/src/share/classes/org/omg/CORBA/ORB.java Fri Nov 08 17:36:14 2013 -0800
@@ -174,15 +174,6 @@
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.
// TypeCodes should be immutable since they may be shared across
@@ -294,10 +285,11 @@
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 @@
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 @@
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;
}
--- a/hotspot/.hgtags Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/.hgtags Fri Nov 08 17:36:14 2013 -0800
@@ -389,3 +389,5 @@
23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55
4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113
82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56
+7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114
+3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57
--- a/hotspot/agent/src/os/bsd/ps_proc.c Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/agent/src/os/bsd/ps_proc.c Fri Nov 08 17:36:14 2013 -0800
@@ -131,7 +131,7 @@
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 @@
// 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");
--- a/hotspot/make/hotspot_version Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/make/hotspot_version Fri Nov 08 17:36:14 2013 -0800
@@ -35,7 +35,7 @@
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=56
+HS_BUILD_NUMBER=57
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -365,7 +365,7 @@
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;
}
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -4099,15 +4099,19 @@
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 @@
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 @@
// 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 @@
// 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 @@
// 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);
}
}
}
--- a/hotspot/src/cpu/sparc/vm/sparc.ad Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad Fri Nov 08 17:36:14 2013 -0800
@@ -1660,12 +1660,16 @@
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");
}
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -153,13 +153,9 @@
}
-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();
- Label cont;
- address compiled_entry = __ pc();
-
- 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 @@
// 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,29 +180,18 @@
__ 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
+ const Register index = G1_scratch;
+ __ get_cache_and_index_at_bcp(cache, index, 1, index_size);
+
+ 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);
- // 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);
- }
-
return entry;
}
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -2932,9 +2932,7 @@
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 @@
__ 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 @@
__ 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
--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1468,19 +1468,18 @@
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);
--- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -367,7 +367,7 @@
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);
}
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -5049,25 +5049,32 @@
}
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 @@
// 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 @@
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 @@
// 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");
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -150,13 +150,12 @@
}
-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 @@
__ 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 @@
// 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,33 +193,22 @@
__ 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()));
+ const Register cache = rbx;
+ const Register index = rcx;
+ __ get_cache_and_index_at_bcp(cache, index, 1, index_size);
+
+ 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);
- // 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);
- }
-
return entry;
}
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -166,7 +166,7 @@
}
-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,28 +183,16 @@
__ 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));
+ const Register cache = rbx;
+ const Register index = rcx;
+ __ get_cache_and_index_at_bcp(cache, index, 1, index_size);
+
+ 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);
- // 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);
- }
-
return entry;
}
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -2925,9 +2925,7 @@
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)));
}
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -2980,9 +2980,7 @@
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));
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1006,7 +1006,7 @@
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;
}
--- a/hotspot/src/cpu/zero/vm/globals_zero.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -57,6 +57,8 @@
// 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
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -945,17 +945,15 @@
// 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 @@
Bsd::_main_thread = pthread_self();
Bsd::clock_init();
- initial_time_count = os::elapsed_counter();
+ initial_time_count = javaTimeNanos();
#ifdef __APPLE__
// XXXDARWIN
--- a/hotspot/src/os/linux/vm/os_linux.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/os/linux/vm/os_linux.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1333,17 +1333,15 @@
// 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 @@
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;
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -79,6 +79,15 @@
# include <pthread_np.h>
#endif
+// needed by current_stack_region() workaround for Mavericks
+#if defined(__APPLE__)
+# include <errno.h>
+# include <sys/types.h>
+# include <sys/sysctl.h>
+# 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 @@
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;
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1873,7 +1873,7 @@
// 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;
}
}
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -57,6 +57,7 @@
_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
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -52,6 +52,7 @@
bool _has_finalizer;
bool _has_subklass;
bool _has_nonstatic_fields;
+ bool _has_default_methods;
ciFlags _flags;
jint _nonstatic_field_size;
@@ -171,6 +172,11 @@
}
}
+ 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);
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -131,6 +131,17 @@
}
}
+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::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()) {
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -78,6 +78,7 @@
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 @@
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.
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -173,8 +173,6 @@
/* 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 ) \
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -780,6 +780,10 @@
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);
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -158,8 +158,8 @@
// 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; }
--- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -78,7 +78,7 @@
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
--- a/hotspot/src/share/vm/interpreter/interpreter.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/interpreter/interpreter.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -329,15 +329,21 @@
//------------------------------------------------------------------------------------------------------------------------
// 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 @@
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
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -184,8 +184,9 @@
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 @@
#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 @@
}
}
- 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 @@
//------------------------------------------------------------------------------------------------------------------------
// 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);
+ }
}
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -120,8 +120,9 @@
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 @@
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
--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -53,7 +53,7 @@
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);
--- a/hotspot/src/share/vm/memory/metaspace.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/memory/metaspace.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -56,7 +56,7 @@
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 @@
#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 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
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 @@
}
#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 @@
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 @@
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 @@
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 @@
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());
--- a/hotspot/src/share/vm/memory/metaspace.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/memory/metaspace.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -115,13 +115,13 @@
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 @@
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 @@
static bool is_class_space_allocation(MetadataType mdType) {
return mdType == ClassType && using_class_space();
}
+
};
class MetaspaceAux : AllStatic {
--- a/hotspot/src/share/vm/memory/universe.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/memory/universe.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -677,13 +677,13 @@
// 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 @@
// 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 @@
// 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 @@
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 @@
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());
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -2393,15 +2393,38 @@
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;
--- a/hotspot/src/share/vm/oops/method.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/oops/method.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1515,7 +1515,10 @@
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;
}
--- a/hotspot/src/share/vm/opto/library_call.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/opto/library_call.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -2006,9 +2006,9 @@
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 @@
if (is_decrement) {
arg2 = longcon(1);
} else {
- Node* arg2 = argument(2); // type long
+ arg2 = argument(2); // type long
// argument(3) == TOP
}
--- a/hotspot/src/share/vm/opto/loopTransform.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -713,6 +713,10 @@
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:
--- a/hotspot/src/share/vm/opto/postaloc.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/opto/postaloc.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -97,7 +97,8 @@
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 @@
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 @@
u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input
}
if (u != NodeSentinel) { // Junk Phi. Remove
- block->remove_node(j--);
+ phi->replace_by(u);
+ j -= yank_if_dead(phi, block, &value, ®nd);
phi_dex--;
- _cfg.unmap_node_from_block(phi);
- phi->replace_by(u);
- phi->disconnect_inputs(NULL, C);
continue;
}
// Note that if value[pidx] exists, then we merged no new values here
--- a/hotspot/src/share/vm/opto/type.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/opto/type.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -2787,13 +2787,11 @@
//-----------------------------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 @@
// 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 @@
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 @@
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 {
--- a/hotspot/src/share/vm/opto/type.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/opto/type.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -63,7 +63,7 @@
class TypeOopPtr;
class TypeInstPtr;
class TypeAryPtr;
-class TypeKlassPtr;
+class TypeKlassPtr;
class TypeMetadataPtr;
//------------------------------Type-------------------------------------------
@@ -1202,6 +1202,9 @@
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
--- a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -29,8 +29,43 @@
#include "runtime/thread.hpp"
+// The closure for GetLoadedClasses
+class LoadedClassesClosure : public KlassClosure {
+private:
+ Stack<jclass, mtInternal> _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 @@
}
}
- // 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 @@
}
}
- 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 @@
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);
+
+ // Iterate through all classes in ClassLoaderDataGraph
+ // and collect them using the LoadedClassesClosure
+ ClassLoaderDataGraph::loaded_classes_do(&closure);
+ }
- // 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.
+ // Return results by extracting the collected contents into a list
+ // allocated via JvmtiEnv
+ jclass* result_list;
+ 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;
}
- // Post results
- jclass* result_list;
- jvmtiError err = env->Allocate(closure.get_count() * sizeof(jclass),
- (unsigned char**)&result_list);
- if (err != JVMTI_ERROR_NONE) {
- return err;
- }
- closure.extract(env, result_list);
- *classCountPtr = closure.get_count();
- *classesPtr = result_list;
- return JVMTI_ERROR_NONE;
+ return error;
}
jvmtiError
--- a/hotspot/src/share/vm/runtime/arguments.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1988,6 +1988,15 @@
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
--- a/hotspot/src/share/vm/runtime/handles.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/runtime/handles.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -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);
}
--- a/hotspot/src/share/vm/runtime/thread.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/runtime/thread.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1097,7 +1097,7 @@
// 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);
--- a/hotspot/src/share/vm/services/jmm.h Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/services/jmm.h Fri Nov 08 17:36:14 2013 -0800
@@ -78,6 +78,7 @@
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 */
--- a/hotspot/src/share/vm/services/management.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/services/management.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1032,6 +1032,9 @@
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());
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp Fri Nov 08 17:36:14 2013 -0800
@@ -368,8 +368,6 @@
// 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/inlining/InlineDefaultMethod.java Fri Nov 08 17:36:14 2013 -0800
@@ -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");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -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;
+ }
+}
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -24,6 +24,7 @@
/*
* @test
* @bug 8026844
+ * @bug 8027353
* @summary Test constant subtractExact
* @compile SubExactLConstantTest.java Verify.java
* @run main SubExactLConstantTest
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -24,6 +24,7 @@
/*
* @test
* @bug 8026844
+ * @bug 8027353
* @summary Test non constant subtractExact
* @compile SubExactLNonConstantTest.java Verify.java
* @run main SubExactLNonConstantTest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/startup/StartupOutput.java Fri Nov 08 17:36:14 2013 -0800
@@ -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);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java Fri Nov 08 17:36:14 2013 -0800
@@ -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);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -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, "<init>", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()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);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java Fri Nov 08 17:36:14 2013 -0800
@@ -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();
+ }
+}
--- a/jaxp/.hgtags Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/.hgtags Fri Nov 08 17:36:14 2013 -0800
@@ -235,3 +235,4 @@
17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111
c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112
0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113
+1b1e12117fe2840e5d21ae9a4b309e4f981f3ea8 jdk8-b114
--- a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java Fri Nov 08 17:36:14 2013 -0800
@@ -188,6 +188,19 @@
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
*/
public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -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);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 <E extends Enum<E>> int getIndex(Class<E> property, String propertyName) {
+ for (Enum<E> 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
+ }
+ }
+}
--- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -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.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * 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.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
+ * This code is free software; you can redistribute 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.
*
- * 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]"
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
*
- * 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.
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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;
--- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 @@
* 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,
@@ -73,15 +63,6 @@
/**
- * 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
*/
public XMLSecurityPropertyManager() {
@@ -94,86 +75,6 @@
}
/**
- * 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
* @return the index of the property if found; return -1 if not
@@ -198,28 +99,4 @@
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
- }
- }
}
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 @@
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;
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java Fri Nov 08 17:36:14 2013 -0800
@@ -42,6 +42,7 @@
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 @@
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 @@
il.append(new INVOKESTATIC(index));
}
else if (_isExtConstructor) {
- if (isSecureProcessing)
+ if (isSecureProcessing && !isExtensionFunctionEnabled)
translateUnallowedExtension(cpg, il);
final String clazz =
@@ -822,7 +825,7 @@
}
// Invoke function calls that are handled in separate classes
else {
- if (isSecureProcessing)
+ if (isSecureProcessing && !isExtensionFunctionEnabled)
translateUnallowedExtension(cpg, il);
final String clazz = _chosenMethod.getDeclaringClass().getName();
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java Fri Nov 08 17:36:14 2013 -0800
@@ -43,6 +43,8 @@
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 @@
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 @@
_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.
*/
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java Fri Nov 08 17:36:14 2013 -0800
@@ -74,12 +74,12 @@
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 @@
_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 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) {
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -95,7 +95,7 @@
_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);
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,12 +25,14 @@
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 @@
private XMLSecurityPropertyManager _xmlSecurityPropertyMgr;
private XMLSecurityManager _xmlSecurityManager;
+ private final FeatureManager _featureManager;
+
/**
* javax.xml.transform.sax.TransformerFactory implementation.
*/
@@ -240,10 +244,13 @@
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 @@
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 @@
_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 @@
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 @@
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 @@
}
// 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);
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -569,32 +569,13 @@
// 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 @@
// 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 @@
fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false);
+ resetCommon();
//fEntityManager.test();
} // reset(XMLComponentManager)
@@ -630,17 +609,7 @@
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 @@
//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 @@
fAttributes.getLength() > fElementAttributeLimit){
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"ElementAttributeLimit",
- new Object[]{rawname, new Integer(fAttributes.getLength()) },
+ new Object[]{rawname, fElementAttributeLimit },
XMLErrorReporter.SEVERITY_FATAL_ERROR );
}
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -256,7 +256,7 @@
fAttributes.getLength() > fElementAttributeLimit){
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"ElementAttributeLimit",
- new Object[]{rawname, new Integer(fAttributes.getLength()) },
+ new Object[]{rawname, fElementAttributeLimit },
XMLErrorReporter.SEVERITY_FATAL_ERROR );
}
--- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java Fri Nov 08 17:36:14 2013 -0800
@@ -211,7 +211,7 @@
if (i > 0) {
return uri.substring(i+1, uri.length());
}
- return "";
+ return uri;
}
/**
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java Fri Nov 08 17:36:14 2013 -0800
@@ -33,6 +33,7 @@
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 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;
+ }
}
/**
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,6 +30,7 @@
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 @@
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() {
+ 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 ) {
- this.xpath = xpath;
- this.prefixResolver = prefixResolver;
- this.functionResolver = functionResolver;
- this.variableResolver = variableResolver;
- this.featureSecureProcessing = false;
+ 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 ) {
+ 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 @@
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();
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -24,6 +24,8 @@
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 @@
private boolean _useServicesMechanism = true;
+ private final FeatureManager _featureManager;
+
public XPathFactoryImpl() {
this(true);
}
@@ -77,9 +81,12 @@
}
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 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 @@
}
_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 @@
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 @@
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,
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -35,6 +35,7 @@
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 @@
// 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 @@
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 @@
// 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 ) ;
--- a/jaxws/.hgtags Fri Nov 08 17:50:24 2013 -0500
+++ b/jaxws/.hgtags Fri Nov 08 17:36:14 2013 -0800
@@ -235,3 +235,4 @@
32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111
dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112
9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113
+9ad289610fc6effe9076280b7920d0f16470709f jdk8-b114
--- a/jdk/.hgtags Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/.hgtags Fri Nov 08 17:36:14 2013 -0800
@@ -235,3 +235,5 @@
719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111
f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112
5b4261b4b72af53e8e178933ef6bc6c7f8cdbc60 jdk8-b113
+f26a0c8071bde1e3b923713c75156e4a58955623 jdk8-b114
+f82b730c798b6bf38946baaba8a7d80fd5efaa70 jdk8-b115
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m Fri Nov 08 17:36:14 2013 -0800
@@ -163,7 +163,7 @@
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;
}
--- a/jdk/src/macosx/classes/com/apple/eawt/event/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/com/apple/eawt/event/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,7 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
+<title></title>
</head>
<body bgcolor="white">
Classes for receiving gesture events.
--- a/jdk/src/macosx/classes/com/apple/eawt/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/com/apple/eawt/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,7 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
+<title></title>
</head>
<body bgcolor="white">
Provides classes for integrating Java applications with the native application environment.
--- a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java Fri Nov 08 17:36:14 2013 -0800
@@ -244,7 +244,7 @@
* 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());
--- a/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java Fri Nov 08 17:36:14 2013 -0800
@@ -406,7 +406,7 @@
}
/** 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) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -3514,7 +3514,7 @@
* 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 @@
* 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 @@
* 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 @@
* 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.
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -179,7 +179,7 @@
}
/**
- * Paints the expand (toggle) part of a row. The reciever should NOT modify <code>clipBounds</code>, or
+ * Paints the expand (toggle) part of a row. The receiver should NOT modify <code>clipBounds</code>, or
* <code>insets</code>.
*/
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) {
--- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java Fri Nov 08 17:36:14 2013 -0800
@@ -93,9 +93,9 @@
}
if (fMenuItem instanceof JCheckBoxMenuItem) {
- setState(((JCheckBoxMenuItem)fMenuItem).isSelected());
+ forceSetState(fMenuItem.isSelected());
} else {
- setState(fMenuItem.getModel().isSelected());
+ forceSetState(fMenuItem.getModel().isSelected());
}
}
@@ -196,10 +196,10 @@
switch (e.getStateChange()) {
case ItemEvent.SELECTED:
- setState(true);
+ forceSetState(true);
break;
case ItemEvent.DESELECTED:
- setState(false);
+ forceSetState(false);
break;
}
}
@@ -210,4 +210,20 @@
((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);
+ }
}
--- a/jdk/src/macosx/classes/java/net/DefaultInterface.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/java/net/DefaultInterface.java Fri Nov 08 17:36:14 2013 -0800
@@ -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
--- a/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java Fri Nov 08 17:36:14 2013 -0800
@@ -122,7 +122,7 @@
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;
--- a/jdk/src/macosx/classes/sun/font/CFontManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/font/CFontManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -342,7 +342,7 @@
@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();
--- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -56,15 +56,6 @@
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 @@
// 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 @@
*/
@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) {
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java Fri Nov 08 17:36:14 2013 -0800
@@ -620,8 +620,7 @@
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 @@
}}
}, fAwtFocussedComponent);
- } catch (InterruptedException ie) { ie.printStackTrace(); }
- catch (InvocationTargetException ite) { ite.printStackTrace(); }
+ } catch (InvocationTargetException ite) { ite.printStackTrace(); }
synchronized(returnValue) { return returnValue; }
}
@@ -695,8 +693,7 @@
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 @@
}
}}
}, fAwtFocussedComponent);
- } catch (InterruptedException ie) { ie.printStackTrace(); }
- catch (InvocationTargetException ite) { ite.printStackTrace(); }
+ } catch (InvocationTargetException ite) { ite.printStackTrace(); }
synchronized(rect) { return rect; }
}
@@ -764,8 +760,7 @@
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
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java Fri Nov 08 17:36:14 2013 -0800
@@ -54,14 +54,6 @@
}
@Override
- public void enterFullScreenMode() {
- }
-
- @Override
- public void exitFullScreenMode() {
- }
-
- @Override
public SurfaceData replaceSurfaceData() {
return null;
}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java Fri Nov 08 17:36:14 2013 -0800
@@ -96,14 +96,6 @@
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);
}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Fri Nov 08 17:36:14 2013 -0800
@@ -63,6 +63,8 @@
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 @@
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 @@
@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 @@
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 @@
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 @@
@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 @@
//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 @@
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 @@
}
}
+ 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();
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java Fri Nov 08 17:36:14 2013 -0800
@@ -233,6 +233,10 @@
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
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java Fri Nov 08 17:36:14 2013 -0800
@@ -97,6 +97,6 @@
setVisible(true);
}
}, this);
- } catch (InterruptedException | InvocationTargetException ex) {}
+ } catch (InvocationTargetException ex) {}
}
}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java Fri Nov 08 17:36:14 2013 -0800
@@ -82,9 +82,6 @@
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);
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Fri Nov 08 17:36:14 2013 -0800
@@ -548,22 +548,18 @@
// 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);
--- a/jdk/src/macosx/native/sun/awt/AWTView.m Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/native/sun/awt/AWTView.m Fri Nov 08 17:36:14 2013 -0800
@@ -272,7 +272,6 @@
*/
- (void) keyDown: (NSEvent *)event {
-
fProcessingKeystroke = YES;
fKeyEventsNeeded = YES;
@@ -308,6 +307,23 @@
- (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 @@
// --- 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 @@
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];
--- a/jdk/src/macosx/native/sun/awt/AWTWindow.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/native/sun/awt/AWTWindow.h Fri Nov 08 17:36:14 2013 -0800
@@ -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
--- a/jdk/src/macosx/native/sun/awt/AWTWindow.m Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m Fri Nov 08 17:36:14 2013 -0800
@@ -122,6 +122,7 @@
@synthesize styleBits;
@synthesize isEnabled;
@synthesize ownerWindow;
+@synthesize preFullScreenLevel;
- (void) updateMinMaxSize:(BOOL)resizable {
if (resizable) {
@@ -501,20 +502,6 @@
// 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_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);
+}
+
--- a/jdk/src/macosx/native/sun/awt/CPrinterJob.m Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/native/sun/awt/CPrinterJob.m Fri Nov 08 17:36:14 2013 -0800
@@ -359,7 +359,11 @@
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 @@
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);
+ }
}
/*
--- a/jdk/src/macosx/native/sun/awt/CTextPipe.m Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/native/sun/awt/CTextPipe.m Fri Nov 08 17:36:14 2013 -0800
@@ -322,7 +322,7 @@
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.
-----------------------------------*/
--- a/jdk/src/macosx/native/sun/awt/CWrapper.m Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/native/sun/awt/CWrapper.m Fri Nov 08 17:36:14 2013 -0800
@@ -587,46 +587,6 @@
/*
* 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
* Signature: (J)J
*/
--- a/jdk/src/macosx/native/sun/awt/awt.m Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/native/sun/awt/awt.m Fri Nov 08 17:36:14 2013 -0800
@@ -312,15 +312,17 @@
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<NSApplicationDelegate> 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<NSApplicationDelegate> delegate = [ApplicationDelegate sharedDelegate];
+ if (delegate != nil) {
+ OSXAPP_SetApplicationDelegate(delegate);
+ }
+ }];
+ }
}
- (void)starter:(NSArray*)args {
--- a/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m Fri Nov 08 17:36:14 2013 -0800
@@ -341,6 +341,10 @@
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];
}
--- a/jdk/src/share/back/commonRef.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/back/commonRef.c Fri Nov 08 17:36:14 2013 -0800
@@ -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
--- a/jdk/src/share/back/eventFilter.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/back/eventFilter.c Fri Nov 08 17:36:14 2013 -0800
@@ -644,7 +644,7 @@
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
--- a/jdk/src/share/back/util.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/back/util.c Fri Nov 08 17:36:14 2013 -0800
@@ -1092,7 +1092,7 @@
* 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
--- a/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>name
* <dd>the name of the accessible entity
--- a/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 @@
* <int>456</int>
* </array></pre>
* is equivalent to {@code int[] array = {123, 456}} in Java code.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>length
* <dd>the array length
@@ -76,7 +76,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>length
* <dd>the array length
@@ -110,6 +110,20 @@
}
/**
+ * 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.
*
* @param type the base class
--- a/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* <string>true</string>
* </method></pre>
* which is equivalent to {@code Boolean.valueOf("true")} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* <string>127</string>
* </method></pre>
* which is equivalent to {@code Byte.decode("127")} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -33,7 +33,7 @@
* For example:<pre>
* <char>X</char></pre>
* which is equivalent to {@code Character.valueOf('X')} in Java code.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>code
* <dd>this attribute specifies character code
@@ -52,7 +52,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>code
* <dd>this attribute specifies character code
--- a/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
* <string>java.lang.Class</string>
* </method></pre>
* which is equivalent to {@code Class.forName("java.lang.Class")} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* <string>1.23e45</string>
* </method></pre>
* which is equivalent to {@code Double.valueOf("1.23e45")} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -126,7 +126,7 @@
/**
* Parses attributes of the element.
- * By default, the following atribute is supported:
+ * By default, the following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,7 +31,7 @@
* For example:<pre>
* <false/></pre>
* is equivalent to {@code false} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -43,7 +43,7 @@
* For example:<pre>
* <field name="id"><int>0</int></field></pre>
* is equivalent to {@code id = 0} in Java code.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>name
* <dd>the field name
@@ -62,7 +62,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>name
* <dd>the field name
--- a/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* <string>-1.23</string>
* </method></pre>
* which is equivalent to {@code Float.valueOf("-1.23")} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* <string>-1</string>
* </method></pre>
* which is equivalent to {@code Integer.decode("-1")} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,7 @@
* 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.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>version
* <dd>the Java version (not supported)
@@ -54,7 +54,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>version
* <dd>the Java version (not supported)
--- a/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* <string>0xFFFF</string>
* </method></pre>
* which is equivalent to {@code Long.decode("0xFFFF")} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -43,7 +43,7 @@
* <string>10</string>
* </method></pre>
* is equivalent to {@code Long.valueOf("10")} in Java code.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>name
* <dd>the method name
@@ -62,7 +62,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>name
* <dd>the method name
--- a/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -43,7 +43,7 @@
* <string>10</string>
* </new></pre>
* is equivalent to {@code new Long("10")} in Java code.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type of object for instantiation
@@ -63,7 +63,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type of object for instantiation
--- a/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,7 +31,7 @@
* For example:<pre>
* <null/></pre>
* is equivalent to {@code null} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -33,7 +33,7 @@
* This element looks like <void> element,
* but its value is always used as an argument for element
* that contains this one.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type is used for static methods and fields
@@ -64,7 +64,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type is used for static methods and fields
--- a/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -63,7 +63,7 @@
* <int>0</int>
* </method></pre>
* which is equivalent to {@code set(0)} in Java code.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>name
* <dd>the property name
@@ -85,7 +85,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>name
* <dd>the property name
--- a/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* <string>200</string>
* </method></pre>
* which is equivalent to {@code Short.decode("200")} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
* <string>
* <true>
* </string></pre>
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,7 +31,7 @@
* For example:<pre>
* <true/></pre>
* is equivalent to {@code true} in Java code.
- * <p>The following atribute is supported:
+ * <p>The following attribute is supported:
* <dl>
* <dt>id
* <dd>the identifier of the variable that is intended to store the result
--- a/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,7 +30,7 @@
* For example:<pre>
* <var id="id1" idref="id2"/></pre>
* is equivalent to {@code id1 = id2} in Java code.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>idref
* <dd>the identifier to refer to the variable
@@ -47,7 +47,7 @@
/**
* Parses attributes of the element.
- * The following atributes are supported:
+ * The following attributes are supported:
* <dl>
* <dt>idref
* <dd>the identifier to refer to the variable
--- a/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -29,7 +29,7 @@
* This element looks like <object> element,
* but its value is not used as an argument for element
* that contains this one.
- * <p>The following atributes are supported:
+ * <p>The following attributes are supported:
* <dl>
* <dt>class
* <dd>the type is used for static methods and fields
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java Fri Nov 08 17:36:14 2013 -0800
@@ -408,7 +408,7 @@
* 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 @@
* 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,
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java Fri Nov 08 17:36:14 2013 -0800
@@ -408,7 +408,7 @@
* 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 @@
* 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,
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java Fri Nov 08 17:36:14 2013 -0800
@@ -307,7 +307,7 @@
* 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 @@
* 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,
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java Fri Nov 08 17:36:14 2013 -0800
@@ -317,7 +317,7 @@
* 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 @@
* 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,
--- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -187,15 +187,24 @@
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 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 @@
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 @@
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 @@
}
} else {
throw new
- RuntimeException(I18N.getString("BMPImageReader3"));
+ IIOException(I18N.getString("BMPImageReader3"));
}
}
@@ -660,7 +683,11 @@
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 @@
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 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 @@
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 @@
default:
throw new
- RuntimeException(I18N.getString("BMPImageReader1"));
+ IIOException(I18N.getString("BMPImageReader1"));
}
break;
@@ -833,7 +872,7 @@
default:
throw new
- RuntimeException(I18N.getString("BMPImageReader1"));
+ IIOException(I18N.getString("BMPImageReader1"));
}
break;
@@ -874,7 +913,7 @@
default:
throw new
- RuntimeException(I18N.getString("BMPImageReader1"));
+ IIOException(I18N.getString("BMPImageReader1"));
}
case VERSION_4_8_BIT:
@@ -890,7 +929,7 @@
default:
throw new
- RuntimeException(I18N.getString("BMPImageReader1"));
+ IIOException(I18N.getString("BMPImageReader1"));
}
break;
--- a/jdk/src/share/classes/com/sun/imageio/plugins/common/StandardMetadataFormat.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/common/StandardMetadataFormat.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,7 @@
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) {
--- a/jdk/src/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties Fri Nov 08 17:36:14 2013 -0800
@@ -21,6 +21,8 @@
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 @@
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.
--- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -115,6 +115,8 @@
// 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 @@
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 @@
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;
}
}
--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java Fri Nov 08 17:36:14 2013 -0800
@@ -1368,7 +1368,7 @@
/**
* 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 {
--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java Fri Nov 08 17:36:14 2013 -0800
@@ -28,6 +28,7 @@
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 @@
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.
--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java Fri Nov 08 17:36:14 2013 -0800
@@ -78,7 +78,7 @@
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);
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -688,6 +688,21 @@
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 @@
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 @@
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,
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java Fri Nov 08 17:36:14 2013 -0800
@@ -1041,7 +1041,7 @@
}
/**
- * 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);
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Fri Nov 08 17:36:14 2013 -0800
@@ -304,7 +304,7 @@
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 @@
}
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);
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Fri Nov 08 17:36:14 2013 -0800
@@ -131,7 +131,7 @@
* Returns a <code>SynthPainter</code> that will route the appropriate
* calls to a <code>GTKEngine</code>.
*
- * @param state SynthContext indentifying requestor
+ * @param state SynthContext identifying requestor
* @return SynthPainter
*/
@Override
@@ -204,7 +204,7 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
* 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 @@
// 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);
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java Fri Nov 08 17:36:14 2013 -0800
@@ -86,19 +86,19 @@
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 @@
});
}
+ 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();
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java Fri Nov 08 17:36:14 2013 -0800
@@ -45,7 +45,7 @@
/**
* 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.
* <p>
* @param g Graphics context
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 @@
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
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java Fri Nov 08 17:36:14 2013 -0800
@@ -326,18 +326,27 @@
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(){
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java Fri Nov 08 17:36:14 2013 -0800
@@ -2012,7 +2012,7 @@
* results.
* </p>
*
- * @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
* <code>Component</code>.
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -50,7 +50,7 @@
* <li>The cursor blinks at about 1/2 second intervals.
* <li>The entire value is selected when focus is gained.
* <li>Shift-left-arrow and shift-right-arrow extend selection
- * <li>Cntrl-left-arrow and cntrl-right-arrow act like home and
+ * <li>Ctrl-left-arrow and ctrl-right-arrow act like home and
* end respectively.
* </ul>
* <p>
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -162,7 +162,7 @@
* 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) {
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Fri Nov 08 17:36:14 2013 -0800
@@ -190,7 +190,7 @@
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 (;;) {
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -106,7 +106,7 @@
Set<Entry> requiredEntries; // for the CP
Map<Attribute.Layout, int[]> backCountTable; // for layout callables
- int[][] attrCounts; // count attr. occurences
+ int[][] attrCounts; // count attr. occurrences
void setup() {
requiredEntries = new HashSet<>();
--- a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java Fri Nov 08 17:36:14 2013 -0800
@@ -70,7 +70,7 @@
* method).
* <p>
* If <code>arguments</code> 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
--- a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java Fri Nov 08 17:36:14 2013 -0800
@@ -250,7 +250,7 @@
*
* @param address
* The address to start listening for connections,
- * or <tt>null</tt> to listen on an address choosen
+ * or <tt>null</tt> 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 ListenKey startListening(String address) throws IOException;
/**
- * Listens on an address choosen by the transport service.
+ * Listens on an address chosen by the transport service.
*
* <p> This convenience method works as if by invoking {@link
* #startListening(String) startListening(<tt>null</tt>)}. </p>
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -1291,7 +1291,7 @@
* 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
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java Fri Nov 08 17:36:14 2013 -0800
@@ -644,7 +644,7 @@
/**
* 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<Method> getReadMethods(Class<?> clazz) {
// return cached result if available
@@ -682,7 +682,7 @@
* {@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;
--- a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Fri Nov 08 17:36:14 2013 -0800
@@ -35,7 +35,7 @@
*/
/**
- * Lexical error occured.
+ * Lexical error occurred.
*/
static final int LEXICAL_ERROR = 0;
@@ -114,10 +114,10 @@
* 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.
*/
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java Fri Nov 08 17:36:14 2013 -0800
@@ -70,7 +70,7 @@
* @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 @@
*
* @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 @@
*
* @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 @@
*
* @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 @@
*
* @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
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java Fri Nov 08 17:36:14 2013 -0800
@@ -127,7 +127,7 @@
* be retrieved. This list is composed of
* <CODE>SnmpVarBind</CODE> 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 @@
* OIDs from which the next variables should be retrieved.
* This list is composed of <CODE>SnmpVarBind</CODE> 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 @@
* following the first <CODE>nonRepeat</CODE> 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 @@
* be set. This list is composed of
* <CODE>SnmpVarBind</CODE> 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 @@
*
* @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 {
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java Fri Nov 08 17:36:14 2013 -0800
@@ -62,7 +62,7 @@
* be retrieved. This list is composed of
* <CODE>SnmpVarBind</CODE> 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 @@
* be retrieved. This list is composed of
* <CODE>SnmpVarBind</CODE> 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 @@
* following the first <CODE>nonRepeat</CODE> 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 @@
* be set. This list is composed of
* <CODE>SnmpVarBind</CODE> 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;
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java Fri Nov 08 17:36:14 2013 -0800
@@ -119,7 +119,7 @@
// 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.
//
/**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java Fri Nov 08 17:36:14 2013 -0800
@@ -435,7 +435,7 @@
* 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.
* <br> This function is mainly provided for backward compatibility.
*
* <p>
@@ -1088,7 +1088,7 @@
* @return <code>true</code> if the row can be placed in
* <i>notInService</i> 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 @@
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'
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java Fri Nov 08 17:36:14 2013 -0800
@@ -581,7 +581,7 @@
} 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'
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java Fri Nov 08 17:36:14 2013 -0800
@@ -480,7 +480,7 @@
* associated SnmpIndex.
* <p>
* 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.
* <br> This function is mainly provided for backward compatibility.
*
* @param index The SnmpIndex built from the given entry.
--- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java Fri Nov 08 17:36:14 2013 -0800
@@ -473,7 +473,7 @@
* @param specific The specific number of the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> 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 <CODE>bufferSize</CODE>.
*/
public void snmpV1Trap(int generic, int specific, SnmpVarBindList varBindList) throws IOException, SnmpStatusException;
@@ -563,7 +563,7 @@
* @param trapOid The OID identifying the trap.
* @param varBindList A list of <CODE>SnmpVarBind</CODE> 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 <CODE>bufferSize</CODE>.
*/
public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList) throws IOException, SnmpStatusException;
--- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -559,7 +559,7 @@
//
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;
--- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -52,7 +52,7 @@
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 @@
}
/**
- * 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,
--- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
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,
--- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -99,7 +99,7 @@
}
/**
- * 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<SnmpVarBind>
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java Fri Nov 08 17:36:14 2013 -0800
@@ -568,7 +568,7 @@
//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 @@
//System.err.println("ldap.unbind: " + ex);
}
- // Dont expect any response for the unbind request.
+ // Don't expect any response for the unbind request.
}
/**
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java Fri Nov 08 17:36:14 2013 -0800
@@ -191,7 +191,7 @@
/**
* 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 ) {
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java Fri Nov 08 17:36:14 2013 -0800
@@ -176,7 +176,7 @@
"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 =
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java Fri Nov 08 17:36:14 2013 -0800
@@ -862,7 +862,7 @@
--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 @@
}
// 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);
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -109,7 +109,7 @@
/**
* 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.
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java Fri Nov 08 17:36:14 2013 -0800
@@ -82,7 +82,7 @@
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);
--- a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java Fri Nov 08 17:36:14 2013 -0800
@@ -106,7 +106,7 @@
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().
--- a/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -51,15 +51,6 @@
private static final int MAX_READ_LENGTH = 8;
- /**
- * Constructs a new AiffParser object.
- */
- public AiffFileReader() {
- }
-
-
-
-
// METHODS TO IMPLEMENT AudioFileReader
/**
@@ -292,9 +283,15 @@
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 @@
return f;
}
-
-
-
}
--- a/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -49,13 +49,6 @@
*/
public final class AuFileReader extends SunFileReader {
- /**
- * Constructs a new AuFileReader object.
- */
- public AuFileReader() {
- }
-
-
// METHODS TO IMPLEMENT AudioFileReader
/**
@@ -90,7 +83,7 @@
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 @@
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 @@
return result;
}
-
-
-
}
--- a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java Fri Nov 08 17:36:14 2013 -0800
@@ -34,7 +34,7 @@
/**
* Constructs a <code>AudioSynthesizerPropertyInfo</code> object with a given
* name and value. The <code>description</code> and <code>choices</code>
- * are intialized by <code>null</code> values.
+ * are initialized by <code>null</code> values.
*
* @param name the name of the property
* @param value the current value or class used for values.
--- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java Fri Nov 08 17:36:14 2013 -0800
@@ -378,7 +378,7 @@
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 @@
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();
--- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
import javax.sound.sampled.SourceDataLine;
/**
- * SourceDataLine implemention for the SoftMixingMixer.
+ * SourceDataLine implementation for the SoftMixingMixer.
*
* @author Karl Helgason
*/
--- a/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -53,13 +53,6 @@
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
* need to read some data from the stream before determining whether they
@@ -304,6 +297,9 @@
}
// 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 @@
// 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 @@
format,
dataLength / format.getFrameSize());
}
-
}
--- a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java Fri Nov 08 17:36:14 2013 -0800
@@ -33,7 +33,7 @@
* {@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.
* <p>
* 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:
--- a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java Fri Nov 08 17:36:14 2013 -0800
@@ -170,7 +170,7 @@
* then no response body is being sent.
* <p>
* 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.
* <p>
* This method must be called prior to calling {@link #getResponseBody()}.
* @param rCode the response code to send
--- a/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java Fri Nov 08 17:36:14 2013 -0800
@@ -41,7 +41,7 @@
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);
}
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java Fri Nov 08 17:36:14 2013 -0800
@@ -110,7 +110,7 @@
* Returns an iterator over all the additional elements contained in the
* <code>EncryptionMethod</code>.
*
- * @return an <code>Iterator</code> over all the additional infomation
+ * @return an <code>Iterator</code> over all the additional information
* about the <code>EncryptionMethod</code>.
*/
Iterator<Element> getEncryptionMethodInformation();
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java Fri Nov 08 17:36:14 2013 -0800
@@ -63,7 +63,7 @@
*
* This includes:
*
- * Constuct a <CODE>ds:Reference</CODE> from an {@link org.w3c.dom.Element}.
+ * Constructs a <CODE>ds:Reference</CODE> from an {@link org.w3c.dom.Element}.
*
* <p>Create a new reference</p>
* <pre>
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java Fri Nov 08 17:36:14 2013 -0800
@@ -846,7 +846,7 @@
}
/**
- * 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.
--- a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -41,7 +41,7 @@
/**
* The standard implementation of the <code>CachedRowSet</code> 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 @@
private Vector<Object> rvh;
/**
- * The current postion of the cursor in this <code>CachedRowSetImpl</code>
+ * The current position of the cursor in this <code>CachedRowSetImpl</code>
* object.
* @serial
*/
private int cursorPos;
/**
- * The current postion of the cursor in this <code>CachedRowSetImpl</code>
+ * The current position of the cursor in this <code>CachedRowSetImpl</code>
* object not counting rows that have been deleted, if any.
* <P>
* For example, suppose that the cursor is on the last row of a rowset
@@ -236,7 +236,7 @@
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 @@
/*
* 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 @@
/**
* Returns a result set containing the original value of the rowset. The
* original value is the state of the <code>CachedRowSetImpl</code> after the
- * last population or synchronization (whichever occured most recently) with
+ * last population or synchronization (whichever occurred most recently) with
* the data source.
* <p>
* The cursor is positioned before the first row in the result set.
@@ -6300,7 +6300,7 @@
* Returns a result set containing the original value of the current
* row only.
* The original value is the state of the <code>CachedRowSetImpl</code> 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 @@
/**
- * Sets the designated paramter to the given <code>String</code> object.
+ * Sets the designated parameter to the given <code>String</code> object.
* The driver converts this to a SQL <code>NCHAR</code> or
* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
* (depending on the argument's
@@ -9081,7 +9081,7 @@
/**
- * Sets the designated paramter to the given <code>String</code> object.
+ * Sets the designated parameter to the given <code>String</code> object.
* The driver converts this to a SQL <code>NCHAR</code> or
* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>
* @param parameterName the name of the column to be set
@@ -9421,7 +9421,7 @@
* 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 @@
* @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 <code>CallableStatement</code>
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
--- a/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -39,7 +39,7 @@
/**
* The standard implementation of the <code>FilteredRowSet</code> 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
--- a/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
/**
* The standard implementation of the <code>JdbcRowSet</code> 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 @@
private ResultSet rs;
/**
- * The <code>RowSetMetaDataImpl</code> object that is contructed when
+ * The <code>RowSetMetaDataImpl</code> object that is constructed when
* a <code>ResultSet</code> object is passed to the <code>JdbcRowSet</code>
* constructor. This helps in constructing all metadata associated
* with the <code>ResultSet</code> object using the setter methods of
@@ -3152,7 +3152,7 @@
* <code>DatabaseMetaData</code> method, this method returns
* <code>null</code>.
*
- * @return the <code>Statment</code> object that produced
+ * @return the <code>Statement</code> object that produced
* this rowset's <code>ResultSet</code> object or <code>null</code>
* if the result set was produced some other way
* @throws SQLException if a database access error occurs
@@ -4748,7 +4748,7 @@
/**
- * Sets the designated paramter to the given <code>String</code> object.
+ * Sets the designated parameter to the given <code>String</code> object.
* The driver converts this to a SQL <code>NCHAR</code> or
* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
* (depending on the argument's
@@ -5883,7 +5883,7 @@
/**
- * Sets the designated paramter to the given <code>String</code> object.
+ * Sets the designated parameter to the given <code>String</code> object.
* The driver converts this to a SQL <code>NCHAR</code> or
* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>
* @param parameterName the name of the column to be set
@@ -6222,7 +6222,7 @@
* 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 @@
* @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 <code>CallableStatement</code>
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
--- a/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -42,7 +42,7 @@
/**
* The standard implementation of the <code>WebRowSet</code> interface. See the interface
- * defintion for full behaviour and implementation requirements.
+ * definition for full behavior and implementation requirements.
*
* @author Jonathan Bruce, Amit Handa
*/
--- a/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -4109,7 +4109,7 @@
/**
* Returns a result set containing the original value of the rowset. The
* original value is the state of the <code>CachedRowSetImpl</code> after the
- * last population or synchronization (whichever occured most recently) with
+ * last population or synchronization (whichever occurred most recently) with
* the data source.
* <p>
* The cursor is positioned before the first row in the result set.
@@ -4128,7 +4128,7 @@
* Returns a result set containing the original value of the current
* row only.
* The original value is the state of the <code>CachedRowSetImpl</code> 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
--- a/jdk/src/share/classes/com/sun/rowset/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/rowset/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -74,7 +74,7 @@
<h3>3.0 Extending the JDBC RowSet Implementations</h3>
The JDBC <code>RowSet</code> 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
--- a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java Fri Nov 08 17:36:14 2013 -0800
@@ -153,7 +153,7 @@
* 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}. </dd>
*
* <dt> <code>useSSL</code> </dt>
--- a/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java Fri Nov 08 17:36:14 2013 -0800
@@ -62,7 +62,7 @@
* 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)
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties Fri Nov 08 17:36:14 2013 -0800
@@ -144,12 +144,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties Fri Nov 08 17:36:14 2013 -0800
@@ -143,12 +143,12 @@
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
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Fri Nov 08 17:36:14 2013 -0800
@@ -44,7 +44,7 @@
private static final long serialVersionUID = -6236440836177601522L;
/**
- * Lexical error occured.
+ * Lexical error occurred.
*/
static final int LEXICAL_ERROR = 0;
@@ -123,10 +123,10 @@
* 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.
*/
--- a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js Fri Nov 08 17:36:14 2013 -0800
@@ -33,7 +33,7 @@
/**
* 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.
*
--- a/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java Fri Nov 08 17:36:14 2013 -0800
@@ -68,7 +68,7 @@
transport = new Transport() {
public String name() {
- return "dt_socket"; // for compatability reasons
+ return "dt_socket"; // for compatibility reasons
}
};
--- a/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java Fri Nov 08 17:36:14 2013 -0800
@@ -58,7 +58,7 @@
transport = new Transport() {
public String name() {
- return "dt_socket"; // for compatability reasons
+ return "dt_socket"; // for compatibility reasons
}
};
}
--- a/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,7 +31,7 @@
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);
*/
--- a/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -62,7 +62,7 @@
// 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<StackFrame> frames = null;
--- a/jdk/src/share/classes/java/awt/AWTEventMulticaster.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/AWTEventMulticaster.java Fri Nov 08 17:36:14 2013 -0800
@@ -998,7 +998,7 @@
* If a <code>null</code> listener is specified, this method returns an
* empty array. If the specified listener is not an instance of
* <code>AWTEventMulticaster</code>, 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 <code>java.util.EventListener</code>
--- a/jdk/src/share/classes/java/awt/AlphaComposite.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/AlphaComposite.java Fri Nov 08 17:36:14 2013 -0800
@@ -197,7 +197,7 @@
* <h3>Performance Considerations</h3>
*
* <p>
- * For performance reasons, it is preferrable that
+ * For performance reasons, it is preferable that
* <code>Raster</code> objects passed to the <code>compose</code>
* method of a {@link CompositeContext} object created by the
* <code>AlphaComposite</code> class have premultiplied data.
--- a/jdk/src/share/classes/java/awt/BasicStroke.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/BasicStroke.java Fri Nov 08 17:36:14 2013 -0800
@@ -88,7 +88,7 @@
* but also by the transform attribute of the
* <code>Graphics2D</code> object. Consider this code:
* <blockquote><tt>
- * // 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));
--- a/jdk/src/share/classes/java/awt/BorderLayout.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/BorderLayout.java Fri Nov 08 17:36:14 2013 -0800
@@ -69,7 +69,7 @@
* components, the latter constants are preferred.
* <p>
* 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 <code>NORTH</code>
* and <code>PAGE_START</code> constants in a container whose
@@ -206,7 +206,7 @@
*
* 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 <code>NORTH</code>
* and <code>BEFORE_FIRST_LINE</code> constants in a container whose
--- a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java Fri Nov 08 17:36:14 2013 -0800
@@ -180,7 +180,7 @@
}
/**
- * Sets this check box menu item to the specifed state.
+ * Sets this check box menu item to the specified state.
* The boolean value <code>true</code> indicates "on" while
* <code>false</code> indicates "off."
*
--- a/jdk/src/share/classes/java/awt/Choice.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Choice.java Fri Nov 08 17:36:14 2013 -0800
@@ -418,7 +418,7 @@
* an <code>ItemEvent</code>. The only way to trigger an
* <code>ItemEvent</code> 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
--- a/jdk/src/share/classes/java/awt/Component.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Component.java Fri Nov 08 17:36:14 2013 -0800
@@ -276,7 +276,7 @@
* @see #getFont
* @see #setFont
*/
- Font font;
+ volatile Font font;
/**
* The font which the peer is currently using.
@@ -1885,10 +1885,8 @@
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 @@
}
/**
- * 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 @@
* Returns an array of all the component listeners
* registered on this component.
*
- * @return all of this comonent's <code>ComponentListener</code>s
+ * @return all <code>ComponentListener</code>s of this component
* or an empty array if no component
* listeners are currently registered
*
--- a/jdk/src/share/classes/java/awt/Container.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Container.java Fri Nov 08 17:36:14 2013 -0800
@@ -959,7 +959,7 @@
*
* @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 @@
*
*
* @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; <code>-1</code> means insert at the end
* component
--- a/jdk/src/share/classes/java/awt/Dialog.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Dialog.java Fri Nov 08 17:36:14 2013 -0800
@@ -338,7 +338,7 @@
*
* @param owner the owner of the dialog or <code>null</code> 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 <code>false</code>, the dialog is <code>MODELESS</code>;
* if <code>true</code>, the modality type property is set to
* <code>DEFAULT_MODALITY_TYPE</code>
@@ -387,7 +387,7 @@
* this dialog has no owner
* @param title the title of the dialog or <code>null</code> 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 <code>false</code>, the dialog is <code>MODELESS</code>;
* if <code>true</code>, the modality type property is set to
* <code>DEFAULT_MODALITY_TYPE</code>
@@ -416,7 +416,7 @@
* has no owner
* @param title the title of the dialog or <code>null</code> 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 <code>false</code>, the dialog is <code>MODELESS</code>;
* if <code>true</code>, the modality type property is set to
* <code>DEFAULT_MODALITY_TYPE</code>
@@ -488,7 +488,7 @@
* dialog has no owner
* @param title the title of the dialog or <code>null</code> 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 <code>false</code>, the dialog is <code>MODELESS</code>;
* if <code>true</code>, the modality type property is set to
* <code>DEFAULT_MODALITY_TYPE</code>
@@ -519,7 +519,7 @@
* dialog has no owner
* @param title the title of the dialog or <code>null</code> 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 <code>false</code>, the dialog is <code>MODELESS</code>;
* if <code>true</code>, the modality type property is set to
* <code>DEFAULT_MODALITY_TYPE</code>
@@ -764,7 +764,7 @@
/**
* Indicates whether the dialog is modal.
* <p>
- * 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 <code>true</code> if this dialog window is modal;
--- a/jdk/src/share/classes/java/awt/Event.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Event.java Fri Nov 08 17:36:14 2013 -0800
@@ -29,14 +29,14 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* <code>Event</code> 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 <code>Event</code> 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.
* <p>
@@ -390,7 +390,7 @@
/**
* 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 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Creates an instance of <code>Event</code> with the specified target
@@ -660,7 +660,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Creates an instance of <code>Event</code>, with the specified target
@@ -681,7 +681,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Creates an instance of <code>Event</code> with the specified
@@ -696,7 +696,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Translates this event so that its <i>x</i> and <i>y</i>
@@ -717,7 +717,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Checks if the Shift key is down.
@@ -733,7 +733,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Checks if the Control key is down.
@@ -749,7 +749,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Checks if the Meta key is down.
@@ -766,7 +766,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
*/
void consume() {
@@ -784,7 +784,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
*/
boolean isConsumed() {
@@ -793,7 +793,7 @@
/*
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Returns the integer key-code associated with the key in this event,
@@ -811,7 +811,7 @@
/*
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Returns a new KeyEvent char which corresponds to the int key
@@ -828,7 +828,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Returns a string representing the state of this <code>Event</code>.
@@ -864,7 +864,7 @@
/**
* <b>NOTE:</b> The <code>Event</code> 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 <code>AWTEvent</code> class and its subclasses.
* <p>
* Returns a representation of this event's values as a string.
--- a/jdk/src/share/classes/java/awt/EventDispatchThread.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 @@
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 @@
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 @@
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 @@
}
}
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);
--- a/jdk/src/share/classes/java/awt/EventQueue.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/EventQueue.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 @@
}
}
- final boolean detachDispatchThread(EventDispatchThread edt, boolean forceDetach) {
+ final void detachDispatchThread(EventDispatchThread edt) {
/*
* Minimize discard possibility for non-posted events
*/
@@ -1090,17 +1090,9 @@
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 @@
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 {
--- a/jdk/src/share/classes/java/awt/Font.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Font.java Fri Nov 08 17:36:14 2013 -0800
@@ -1334,7 +1334,7 @@
* Indicates whether or not this <code>Font</code> object's style is
* PLAIN.
* @return <code>true</code> if this <code>Font</code> has a
- * PLAIN sytle;
+ * PLAIN style;
* <code>false</code> otherwise.
* @see java.awt.Font#getStyle
* @since JDK1.0
--- a/jdk/src/share/classes/java/awt/Graphics.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Graphics.java Fri Nov 08 17:36:14 2013 -0800
@@ -105,7 +105,7 @@
/**
* Constructs a new <code>Graphics</code> object.
- * This constructor is the default contructor for a graphics
+ * This constructor is the default constructor for a graphics
* context.
* <p>
* Since <code>Graphics</code> is an abstract class, applications
--- a/jdk/src/share/classes/java/awt/Graphics2D.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Graphics2D.java Fri Nov 08 17:36:14 2013 -0800
@@ -305,7 +305,7 @@
* aliasing or antialiasing is being used.
* <ul>
* <li> 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 @@
* @param s the <code>Shape</code> to check for a hit
* @param onStroke flag used to choose between testing the
* stroked or the filled shape. If the flag is <code>true</code>, the
- * <code>Stroke</code> oultine is tested. If the flag is
+ * <code>Stroke</code> outline is tested. If the flag is
* <code>false</code>, the filled <code>Shape</code> is tested.
* @return <code>true</code> if there is a hit; <code>false</code>
* otherwise.
@@ -1162,7 +1162,7 @@
* <code>Component</code>. To change the background
* of the <code>Component</code>, use appropriate methods of
* the <code>Component</code>.
- * @param color the background color that isused in
+ * @param color the background color that is used in
* subsequent calls to <code>clearRect</code>
* @see #getBackground
* @see java.awt.Graphics#clearRect
--- a/jdk/src/share/classes/java/awt/GraphicsDevice.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java Fri Nov 08 17:36:14 2013 -0800
@@ -162,7 +162,7 @@
* <code>GraphicsEnvironment</code>. Although there is
* no public method to set this <code>String</code>, a programmer can
* use the <code>String</code> for debugging purposes. Vendors of
- * the Java<sup><font size=-2>TM</font></sup> Runtime Environment can
+ * the Java™ Runtime Environment can
* format the return value of the <code>String</code>. To determine
* how to interpret the value of the <code>String</code>, contact the
* vendor of your Java Runtime. To find out who the vendor is, from
@@ -325,7 +325,14 @@
// 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);
--- a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java Fri Nov 08 17:36:14 2013 -0800
@@ -263,7 +263,7 @@
* available in this <code>GraphicsEnvironment</code>. 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 <code>deriveFont</code> method on the choosen instance.
+ * calling the <code>deriveFont</code> method on the chosen instance.
* <p>
* This method provides for the application the most precise control
* over which <code>Font</code> instance is used to render text.
--- a/jdk/src/share/classes/java/awt/GridBagLayout.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/GridBagLayout.java Fri Nov 08 17:36:14 2013 -0800
@@ -125,9 +125,9 @@
* <center><table BORDER=0 WIDTH=800
* SUMMARY="absolute, relative and baseline values as described above">
* <tr>
- * <th><P STYLE="TEXT-ALIGN:LEFT">Absolute Values</th>
- * <th><P STYLE="TEXT-ALIGN:LEFT">Orientation Relative Values</th>
- * <th><P STYLE="TEXT-ALIGN:LEFT">Baseline Relative Values</th>
+ * <th><P style="text-align:left">Absolute Values</th>
+ * <th><P style="text-align:left">Orientation Relative Values</th>
+ * <th><P style="text-align:left">Baseline Relative Values</th>
* </tr>
* <tr>
* <td>
@@ -255,10 +255,10 @@
* <center><table WIDTH=600 summary="layout">
* <tr ALIGN=CENTER>
* <td>
- * <img src="doc-files/GridBagLayout-1.gif" alt="The preceeding text describes this graphic (Figure 1)." style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/GridBagLayout-1.gif" alt="The preceding text describes this graphic (Figure 1)." style="float:center; margin: 7px 10px;">
* </td>
* <td>
- * <img src="doc-files/GridBagLayout-2.gif" alt="The preceeding text describes this graphic (Figure 2)." style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/GridBagLayout-2.gif" alt="The preceding text describes this graphic (Figure 2)." style="float:center; margin: 7px 10px;">
* </td>
* <tr ALIGN=CENTER>
* <td>Figure 2: Horizontal, Left-to-Right</td>
@@ -366,7 +366,7 @@
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 @@
* applied to the gridbag after all of the minimum row
* heights have been calculated.
* If <code>rowHeights</code> 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 <code>rowHeights</code>.
*
* @serial
@@ -533,7 +533,7 @@
* and returns <code>null</code>.
*
* @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 @@
/**
* 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 <code>GridBagLayout</code>
+ * order to satisfy the constraints of this <code>GridBagLayout</code>
* object.
* <p>
* Most applications do not call this method directly.
@@ -897,7 +897,7 @@
* <ol>
* <li>Figure out the dimensions of the layout grid.
* <li>Determine which cells the components occupy.
- * <li>Distribute the weights and min sizes amoung the rows/columns.
+ * <li>Distribute the weights and min sizes among the rows/columns.
* </ol>
*
* This also caches the minsizes for all the children when they are
@@ -979,7 +979,7 @@
/**
* 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 <code>getLayoutInfo</code>;
* refer to <code>getLayoutInfo</code> for details on parameters
@@ -1612,7 +1612,7 @@
/**
* 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 <code>adjustForGravity</code>;
@@ -1993,7 +1993,7 @@
/**
* 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 <code>getMinSize</code>;
* refer to <code>getMinSize</code> for details on parameters
@@ -2033,7 +2033,7 @@
/**
* 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 <code>arrangeGrid</code>;
* refer to <code>arrangeGrid</code> for details on the
@@ -2229,6 +2229,6 @@
}
}
- // Added for serial backwards compatability (4348425)
+ // Added for serial backwards compatibility (4348425)
static final long serialVersionUID = 8838754796412211005L;
}
--- a/jdk/src/share/classes/java/awt/KeyEventDispatcher.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/KeyEventDispatcher.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 @@
* @see KeyboardFocusManager#removeKeyEventDispatcher
* @since 1.4
*/
+@FunctionalInterface
public interface KeyEventDispatcher {
/**
--- a/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java Fri Nov 08 17:36:14 2013 -0800
@@ -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 @@
* @see KeyboardFocusManager#removeKeyEventPostProcessor
* @since 1.4
*/
+@FunctionalInterface
public interface KeyEventPostProcessor {
/**
--- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -2663,7 +2663,7 @@
* 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;
--- a/jdk/src/share/classes/java/awt/LinearGradientPaint.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/LinearGradientPaint.java Fri Nov 08 17:36:14 2013 -0800
@@ -94,7 +94,8 @@
* of the three cycle methods:
* <p>
* <center>
- * <img src = "doc-files/LinearGradientPaint.png" alt="LinearGradientPaint">
+ * <img src = "doc-files/LinearGradientPaint.png"
+ * alt="image showing the output of the example code">
* </center>
*
* @see java.awt.Paint
--- a/jdk/src/share/classes/java/awt/List.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/List.java Fri Nov 08 17:36:14 2013 -0800
@@ -797,7 +797,7 @@
}
/**
- * 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 @@
/*
* 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.
*/
--- a/jdk/src/share/classes/java/awt/MediaTracker.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/MediaTracker.java Fri Nov 08 17:36:14 2013 -0800
@@ -744,7 +744,7 @@
* All instances of <code>Image</code> 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
--- a/jdk/src/share/classes/java/awt/MenuComponent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/MenuComponent.java Fri Nov 08 17:36:14 2013 -0800
@@ -402,7 +402,7 @@
/**
* 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 @@
/**
* Gets the <code>Cursor</code> of this object.
*
- * @return the <code>Curso</code>, if supported, of the object;
+ * @return the <code>Cursor</code>, if supported, of the object;
* otherwise, <code>null</code>
*/
public Cursor getCursor() {
--- a/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -81,7 +81,7 @@
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
--- a/jdk/src/share/classes/java/awt/Polygon.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Polygon.java Fri Nov 08 17:36:14 2013 -0800
@@ -246,7 +246,7 @@
}
/*
- * 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) {
--- a/jdk/src/share/classes/java/awt/PopupMenu.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/PopupMenu.java Fri Nov 08 17:36:14 2013 -0800
@@ -150,7 +150,7 @@
* @exception IllegalArgumentException if this <code>PopupMenu</code>
* has a non-<code>Component</code> 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) {
--- a/jdk/src/share/classes/java/awt/RadialGradientPaint.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/RadialGradientPaint.java Fri Nov 08 17:36:14 2013 -0800
@@ -80,14 +80,16 @@
* 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.
* <center>
- * <img src = "doc-files/RadialGradientPaint-3.png" alt="RadialGradientPaint-3">
+ * <img src = "doc-files/RadialGradientPaint-3.png" alt="image showing the
+ * distance AB=BC, and AD=DE">
* </center>
* 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.
* <center>
- * <img src = "doc-files/RadialGradientPaint-4.png" alt="RadialGradientPaint-4">
+ * <img src = "doc-files/RadialGradientPaint-4.png" alt="image showing the
+ * distance of AB, BC, AD, and DE are all equal">
* </center>
* Note that some minor variations in distances may occur due to sampling at
* the granularity of a pixel.
@@ -117,7 +119,8 @@
* (centered) focus for each of the three cycle methods:
* <p>
* <center>
- * <img src = "doc-files/RadialGradientPaint-1.png" alt="RadialGradientPaint-1">
+ * <img src = "doc-files/RadialGradientPaint-1.png" alt="image showing the
+ * output of the sameple code">
* </center>
*
* <p>
@@ -141,7 +144,8 @@
* focus for each of the three cycle methods:
* <p>
* <center>
- * <img src = "doc-files/RadialGradientPaint-2.png" alt="RadialGradientPaint-2">
+ * <img src = "doc-files/RadialGradientPaint-2.png" alt="image showing the
+ * output of the sample code">
* </center>
*
* @see java.awt.Paint
--- a/jdk/src/share/classes/java/awt/RenderingHints.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/RenderingHints.java Fri Nov 08 17:36:14 2013 -0800
@@ -101,7 +101,7 @@
// - 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 @@
* 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
--- a/jdk/src/share/classes/java/awt/ScrollPane.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/ScrollPane.java Fri Nov 08 17:36:14 2013 -0800
@@ -425,8 +425,8 @@
/**
* 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.
*/
--- a/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java Fri Nov 08 17:36:14 2013 -0800
@@ -336,7 +336,7 @@
* 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);
--- a/jdk/src/share/classes/java/awt/Shape.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Shape.java Fri Nov 08 17:36:14 2013 -0800
@@ -269,7 +269,7 @@
* Tests if the interior of the <code>Shape</code> entirely contains
* the specified rectangular area. All coordinates that lie inside
* the rectangular area must lie within the <code>Shape</code> for the
- * entire rectanglar area to be considered contained within the
+ * entire rectangular area to be considered contained within the
* <code>Shape</code>.
* <p>
* The {@code Shape.contains()} method allows a {@code Shape}
--- a/jdk/src/share/classes/java/awt/TextComponent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/TextComponent.java Fri Nov 08 17:36:14 2013 -0800
@@ -1000,7 +1000,7 @@
* 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();
--- a/jdk/src/share/classes/java/awt/TextField.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/TextField.java Fri Nov 08 17:36:14 2013 -0800
@@ -405,7 +405,7 @@
}
/**
- * 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 @@
}
/**
- * 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
--- a/jdk/src/share/classes/java/awt/Toolkit.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Toolkit.java Fri Nov 08 17:36:14 2013 -0800
@@ -1457,7 +1457,7 @@
* <p>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
* <code>getBestCursorSize</code>
@@ -1809,8 +1809,7 @@
// This property should never be cached
if (propertyName.equals("awt.dynamicLayoutSupported")) {
- value = lazilyLoadDesktopProperty(propertyName);
- return value;
+ return getDefaultToolkit().lazilyLoadDesktopProperty(propertyName);
}
value = desktopProperties.get(propertyName);
--- a/jdk/src/share/classes/java/awt/Window.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/Window.java Fri Nov 08 17:36:14 2013 -0800
@@ -1656,7 +1656,7 @@
* 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 @@
}
/**
- * 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 @@
}
/**
- * 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 @@
* When the window is later shown, it will be always-on-top.
*
* <p> 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.
*
* <p><b>Note</b>: some platforms might not support always-on-top
* windows. To detect if always-on-top windows are supported by the
@@ -2978,11 +2976,11 @@
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 @@
* and either the {@code UnsupportedOperationException} or {@code
* IllegalComponentStateException} will be thrown.
* <p>
- * 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 @@
* <p>
* 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
--- a/jdk/src/share/classes/java/awt/color/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/color/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Provides classes for color spaces. It contains an
--- a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java Fri Nov 08 17:36:14 2013 -0800
@@ -104,7 +104,7 @@
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<InputStream> ioInputStreamClass = InputStream.class;
/**
* Tries to load a class from: the bootstrap loader, the system loader,
@@ -151,7 +151,7 @@
/*
* 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 @@
* @exception NullPointerException if either <code>primaryType</code>,
* <code>subType</code> or <code>representationClass</code> 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 @@
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 @@
return bestFlavor;
}
- private static Comparator textFlavorComparator;
+ private static Comparator<DataFlavor> textFlavorComparator;
static class TextFlavorComparator
extends DataTransferer.DataFlavorComparator {
@@ -1447,6 +1447,6 @@
/** Java class of objects this DataFlavor represents **/
- private Class representationClass;
+ private Class<?> representationClass;
} // class DataFlavor
--- a/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,7 +30,7 @@
/**
* 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.
*
--- a/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java Fri Nov 08 17:36:14 2013 -0800
@@ -33,7 +33,7 @@
/**
- * 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 @@
* 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 @@
public int hashCode() {
int code = Integer.MAX_VALUE/45; // "random" value for empty lists
String paramName = null;
- Enumeration enum_ = this.getNames();
+ Enumeration<String> 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 @@
String name = null;
String thisValue = null;
String thatValue = null;
- Set entries = parameters.entrySet();
- Iterator iterator = entries.iterator();
- Map.Entry entry = null;
+ Set<Map.Entry<String, String>> entries = parameters.entrySet();
+ Iterator<Map.Entry<String, String>> iterator = entries.iterator();
+ Map.Entry<String, String> 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 @@
* 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 @@
/**
* Retrieve an enumeration of all the names in this list.
*/
- public Enumeration getNames() {
+ public Enumeration<String> getNames() {
return parameters.keys();
}
@@ -279,15 +279,15 @@
// Heuristic: 8 characters per field
StringBuilder buffer = new StringBuilder(parameters.size() * 16);
- Enumeration keys = parameters.keys();
+ Enumeration<String> 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 @@
return newObj;
}
- private Hashtable parameters;
+ private Hashtable<String, String> parameters;
// below here be scary parsing related things
--- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java Fri Nov 08 17:36:14 2013 -0800
@@ -1324,7 +1324,7 @@
List<String> retval = null;
for (DataFlavor dataFlavor : convertMimeTypeToDataFlavors(type)) {
List<String> natives = getFlavorToNative().get(dataFlavor);
- if (!natives.isEmpty()) {
+ if (natives != null && !natives.isEmpty()) {
if (retval == null) {
retval = new ArrayList<>();
}
--- a/jdk/src/share/classes/java/awt/datatransfer/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/datatransfer/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Provides interfaces and classes for transferring data
--- a/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java Fri Nov 08 17:36:14 2013 -0800
@@ -50,8 +50,8 @@
/**
* 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.
* <P>
* @see java.awt.dnd.DragGestureRecognizer
--- a/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java Fri Nov 08 17:36:14 2013 -0800
@@ -46,7 +46,7 @@
* <p>
* The appropriate <code>DragGestureRecognizer</code>
* subclass instance is obtained from the
- * {@link DragSource} asssociated with
+ * {@link DragSource} associated with
* a particular <code>Component</code>, or from the <code>Toolkit</code> object via its
* {@link java.awt.Toolkit#createDragGestureRecognizer createDragGestureRecognizer()}
* method.
--- a/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -474,7 +474,7 @@
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) {
--- a/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
* over, or exits a drop site, when the drop action changes, and when the drag
* ends. The location for the generated <code>DragSourceEvent</code> specifies
* the mouse cursor location in screen coordinates at the moment this event
- * occured.
+ * occurred.
* <p>
* In a multi-screen environment without a virtual device, the cursor location is
* specified in the coordinate system of the <i>initiator</i>
@@ -71,7 +71,7 @@
/**
* 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 @@
/**
* 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 @@
/**
* This method returns a <code>Point</code> 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
* <code>null</code> if the cursor location is not specified for this
* event.
*
@@ -159,7 +159,7 @@
/**
* 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 @@
/**
* 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
--- a/jdk/src/share/classes/java/awt/dnd/DropTarget.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/dnd/DropTarget.java Fri Nov 08 17:36:14 2013 -0800
@@ -612,7 +612,7 @@
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 @@
}
/**
- * update autoscrolling with current cursor locn
+ * update autoscrolling with current cursor location
* <P>
* @param dragCursorLocn the <code>Point</code>
*/
--- a/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java Fri Nov 08 17:36:14 2013 -0800
@@ -29,7 +29,7 @@
* 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
*/
--- a/jdk/src/share/classes/java/awt/dnd/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/dnd/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Drag and Drop is a direct manipulation gesture found in many Graphical
@@ -51,18 +52,18 @@
associated with some presentation
element (<code>Component</code>) in the GUI, to initiate a Drag and Drop of
some potentially <code>Transferable</code> data.
-<P>
+<br><br>
<LI>1 or more <code>DropTarget</code>(s) come into/go out of
existence, associated
with presentation elements in the GUI (Components), potentially
capable of consuming <code>Transferable</code> data types.
-<P>
+<br><br>
<LI> A <code>DragGestureRecognizer</code> is
obtained from the <code>DragSource</code> and is
associated with a <code>Component</code> in order
to track and identify any Drag
initiating gesture by the user over the <code>Component</code>.
-<P>
+<br><br>
<LI> A user makes a Drag gesture over the <code>Component</code>,
which the registered
<code>DragGestureRecognizer</code> detects, and notifies its
@@ -76,13 +77,13 @@
recognizing mouse device gestures. Other abstract subclasses may be
provided by the platform to support other input devices or
particular <code>Component</code> class semantics.
- <P>
+<br><br>
<LI> The <code>DragGestureListener</code> causes the
<code>DragSource</code> to initiate the Drag
and Drop operation on behalf of the user, perhaps animating the
GUI Cursor and/or rendering an <code>Image</code> of the item(s) that are the
subject of the operation.
-<P>
+<br><br>
<LI> As the user gestures navigate over <code>Component</code>(s)
in the GUI with
associated <code>DropTarget</code>(s), the <code>DragSource</code>
@@ -111,11 +112,11 @@
<UL>
<LI> By the transfer "operation" selected by the user, and supported by
both the <code>DragSource</code> and <code>DropTarget</code>: Copy, Move or Reference(link).
-<P>
+<br><br>
<LI> By the intersection of the set of data types provided by the
<code>DragSource</code> and the set of data types comprehensible by the
<code>DropTarget</code>.
-<P>
+<br><br>
<LI>When the user terminates the drag operation, normally resulting in a
successful Drop, both the <code>DragSource</code> and <code>DropTarget</code>
receive
--- a/jdk/src/share/classes/java/awt/doc-files/AWTThreadIssues.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/doc-files/AWTThreadIssues.html Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,11 @@
questions.
-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
+<head>
+<title></title>
+</head>
<body bgcolor=white>
<h1 align=center>AWT Threading Issues</h1>
@@ -81,13 +85,13 @@
dispatched:
<ul>
<li> Sequentially.
- <dd> That is, it is not permitted that several events from
- this queue are dispatched simultaneously.
+ <dl><dd> That is, it is not permitted that several events from
+ this queue are dispatched simultaneously. </dd></dl>
<li> In the same order as they are enqueued.
- <dd> That is, if <code>AWTEvent</code> A is enqueued
+ <dl><dd> That is, if <code>AWTEvent</code> A is enqueued
to the <code>EventQueue</code> before
<code>AWTEvent</code> B then event B will not be
- dispatched before event A.
+ dispatched before event A.</dd></dl>
</ul>
<li> There is at least one alive non-daemon thread while there is at
least one displayable AWT or Swing component within the
--- a/jdk/src/share/classes/java/awt/doc-files/DesktopProperties.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/doc-files/DesktopProperties.html Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,11 @@
questions.
-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
+<head>
+<title></title>
+</head>
<body bgcolor=white>
<h1 align=center>AWT Desktop Properties</h1>
@@ -51,8 +55,8 @@
<p>
The following table summarizes the desktop properties documented
here, and their value types.
-<p>
-<table align="center" border="0" cellspacing="0" cellpadding="2" width="%95
+<br><br>
+<table align="center" border="0" cellspacing="0" cellpadding="2"
summary="Standard AWT Desktop Properties">
<tr bgcolor="#ccccff">
<th valign="TOP" align="LEFT">Property Name</th>
@@ -60,17 +64,17 @@
<th valign="TOP" align="LEFT">Summary Description</th>
</tr>
<tr>
-<td valign="TOP"><A href=#awt.font.desktophints>awt.font.desktophints</A</td>
-<td valign="TOP"><a href="../../util/Map.html">java.util.Map<a/></td>
-<td valign="TOP">Font smoothing (text antialiasing) settings.<a/></td>
+<td valign="TOP"><A href="#awt.font.desktophints">awt.font.desktophints</A></td>
+<td valign="TOP"><a href="../../util/Map.html">java.util.Map</a></td>
+<td valign="TOP">Font smoothing (text antialiasing) settings.</td>
</tr>
<tr>
-<td valign="TOP"><A href=#"sun.awt.enableExtraMouseButtons">sun.awt.enableExtraMouseButtons</A</td>
-<td valign="TOP"><a href="../../lang/Boolean.html">java.lang.Boolean<a/></td>
-<td valign="TOP">Controls if mouse events from extra buttons are to be generated or not<a/></td>
+<td valign="TOP"><A href="#sun.awt.enableExtraMouseButtons">sun.awt.enableExtraMouseButtons</A></td>
+<td valign="TOP"><a href="../../lang/Boolean.html">java.lang.Boolean</a></td>
+<td valign="TOP">Controls if mouse events from extra buttons are to be generated or not</td>
</tr>
</table>
-<p>
+
<h2>Desktop Font Rendering Hints</h2>
<b>Desktop Property: <A name="awt.font.desktophints">"awt.font.desktophints"</A></b>
<p>
@@ -84,14 +88,14 @@
<a href="../../../javax/swing/JComponent.html"> Swing components</a> which
are required to appear consistent with native desktop components or other
Swing components.
-<p>
+
<h3>Basic Usage</h3>
The standard desktop property named
<b>"awt.font.desktophints"</b>
can be used to obtain the rendering hints that best match the desktop settings.
The return value is a
-<a href="../../util/Map.html"> Map<a/> of
+<a href="../../util/Map.html"> Map</a> of
<a href="../RenderingHints.html"> <code>RenderingHints</code></a> which
can be directly applied to a <code>Graphics2D</code>.
<p>
@@ -105,7 +109,7 @@
}
</code></pre>
<h3>Advanced Usage Tips</h3>
-<p>
+
<h4>Listening for changes</h4>
<p>
An application can listen for changes in the property
@@ -161,7 +165,7 @@
if (hintsToSave.size() == 0) {
return savedHints;
}
- /* RenderingHints.keySet() returns Set<Object> */
+ /* 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 @@
<h3>Details</h3>
<ul>
<li>The return value will always be null or a <code>Map</code>
-<p>
+<br><br>
<li>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 <b>Headless</b> toolkit is one such example.
Therefore it is important to test against null before using the map.
-<p>
+<br><br>
<li>If non-null the value will be a <code>Map</code> of
<code>RenderingHints</code> such that every key is an instance of
<code>RenderingHints.Key</code> and the value is a legal value for that key.
-<p>
+<br><br>
<li>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 <code>Graphics2D</code>. If the map did not contain
@@ -204,7 +208,7 @@
<p>
An application can use <code>setRenderingHints(Map)</code> to reinitialise
all hints, but this would affect unrelated hints too.
-<p>
+<br><br>
<li>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
--- a/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html Fri Nov 08 17:36:14 2013 -0800
@@ -27,7 +27,7 @@
<html>
<head>
- <title align=center>The AWT Focus Subsystem</title>
+ <title>The AWT Focus Subsystem</title>
</head>
<body bgcolor="white">
@@ -660,16 +660,16 @@
FocusTraversalPolicy of its own. To do so, one needs to set Container's focus
traversal policy provider property to <code>true</code> with the call to
- <ul>
+ <blockquote>
<code>Container.setFocusTraversalPolicyProvider(boolean)</code>
- </ul>
+ </blockquote>
To determine whether a Container is a focus traversal policy provider, the
following method should be used:
- <ul>
+ <blockquote>
<code>Container.isFocusTraversalPolicyProvider()</code>
- </ul>
+ </blockquote>
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 @@
to use one of the following methods on <code>KeyboardFocusManager</code>:
<ul>
- <code>KeyboardFocusManager.focusNextComponent()</code>
- <code>KeyboardFocusManager.focusPreviousComponent()</code>
- <code>KeyboardFocusManager.upFocusCycle()</code>
- <code>KeyboardFocusManager.downFocusCycle()</code>
+ <li><code>KeyboardFocusManager.focusNextComponent()</code>
+ <li><code>KeyboardFocusManager.focusPreviousComponent()</code>
+ <li><code>KeyboardFocusManager.upFocusCycle()</code>
+ <li><code>KeyboardFocusManager.downFocusCycle()</code>
</ul>
<p>
@@ -1149,7 +1149,7 @@
<b>Microsoft Windows</b>: The Window is moved to front and becomes the focused
Window.
<br>
- </b>Solaris</b>: The Window is moved to front. In a point-to-focus focus
+ <b>Solaris</b>: 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.
--- a/jdk/src/share/classes/java/awt/doc-files/Modality.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/doc-files/Modality.html Fri Nov 08 17:36:14 2013 -0800
@@ -43,7 +43,7 @@
modality features and how to use them. It contains the following sections:
</p><ul>
<li><a href="#Definitions">Definitions</a></li>
- </li><li><a href="#ModalityTypes">Modality types</a></li>
+ <li><a href="#ModalityTypes">Modality types</a></li>
<li><a href="#ShowHideBlocking">Show/hide blocking</a></li>
<li><a href="#ModalExclusion">Modal exclusion</a></li>
<li><a href="#Related">Related AWT features</a></li>
@@ -54,13 +54,13 @@
</ul>
<a name="Definitions"></a>
- </p><h3>Definitions</h3>
+ <h3>Definitions</h3>
<p>
<u>Document</u> - 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.
</p><p>
<a name="ModalBlocked"></a>
@@ -73,7 +73,7 @@
<blockquote>
<hr>
<b>Warning!</b> 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.
<hr>
</blockquote>
@@ -92,12 +92,12 @@
</p><p>
<blockquote><hr>
<b>Note</b>: 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 <code>java.awt.Window</code> or any descendant class.
<hr></blockquote>
<a name="ModalityTypes"></a>
- </p><h3>Modality types</h3>
+ <h3>Modality types</h3>
<p>
There are four supported modality types :
@@ -163,11 +163,11 @@
<hr></blockquote>
<a name="ShowHideBlocking"></a>
- </p><h3>Show/hide blocking</h3>
+ <h3>Show/hide blocking</h3>
<p>
<u>Showing the window or modeless dialog: "F"</u><br>
- 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).
</ul>
- </p><p>
+ <p>
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 @@
</p><p>
<u>Showing the document-modal dialog: "M"</u><br>
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.
</p><p>
<u>Showing the application-modal dialog: "M"</u><br>
- 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 @@
</p><p>
<!-- <center> -->
</p>
- <table border="1" cols="5" rows="5">
+ <table border="1">
<caption>The Standard Blocking Matrix</caption>
<tbody><tr align="center">
<td align="center">current/shown</td>
@@ -293,11 +293,10 @@
<hr>
<b>Implementation note</b>: Changing the modal exclusion type for a visible window
may have no effect until it is hidden and then shown again.
- </hr>
</blockquote>
- <a name="Related"</a>
- </p><h3>Related AWT features</h3>
+ <a name="Related"></a>
+ <h3>Related AWT features</h3>
<p>
<u>Always-On-Top</u><br>
@@ -315,16 +314,16 @@
<p>
<u>Minimizing, maximizing and closing blocked windows</u><br>
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
<code>setVisible(false)</code> or <code>dispose()</code> methods on the blocked
window.
</p>
<p>
<u>Blocked windows activations</u><br>
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.
</p>
<p>
@@ -339,9 +338,9 @@
</li></ol>
If the modal dialog to be hidden does not have focus, the active window remains
unchanged.
- </p>
+
<a name="Security"></a>
- </p><h3>Security</h3>
+ <h3>Security</h3>
<p>
A special <code>AWTPermission</code>, <code>"toolkitModality"</code>,
@@ -386,35 +385,35 @@
<a name="Examples"></a>
</p><h3>Examples</h3>
- <table cols="2" border="0">
+ <table border="0">
<tbody><tr>
- <td align="left" valign="center">
+ <td align="left" >
<ol>
<li>Frame "F" is shown<br>
<li>Document-modal dialog "D<sub>i</sub>" is shown<br>
- <li>F becomes blocked by D<sub>i</sub> — it's in the same document<br>
+ <li>F becomes blocked by D<sub>i</sub> — it's in the same document<br>
<li>Document-modal dialog "D<sub>ii</sub>" is shown<br>
- <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> — it's in the
+ <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> — it's in the
same document<br>
</ol>
<br>
</td>
- <td align="center" valign="center">
+ <td align="center">
<img src="modal-example1.gif">
<br>
</td>
</tr>
<tr>
- <td align="left" valign="center">
+ <td align="left">
<ol>
<li>Frame "F" is shown<br>
<li>Document-modal dialog "D<sub>i</sub>" is shown<br>
- <li>F becomes blocked by D<sub>i</sub> — it's in the same document<br>
+ <li>F becomes blocked by D<sub>i</sub> — it's in the same document<br>
<li>Document-modal dialog "D<sub>ii</sub>" is shown<br>
- <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> —
+ <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> —
it's in the same document<br>
<li>D<sub>i</sub> is hidden<br>
- <li>F becomes blocked by D<sub>ii</sub> — it's in the same document<br>
+ <li>F becomes blocked by D<sub>ii</sub> — it's in the same document<br>
</ol>
<br>
</td>
@@ -424,45 +423,45 @@
</td>
</tr>
<tr>
- <td align="left" valign="center">
+ <td align="left">
<ol>
<li>Frame "F" is shown<br>
<li>Toolkit-modal dialog "D<sub>i</sub>" is created, but not shown<br>
<li>Document-modal dialog "D<sub>ii</sub>" is shown<br>
- <li>F becomes blocked by D<sub>ii</sub> — it's in the same document<br>
+ <li>F becomes blocked by D<sub>ii</sub> — it's in the same document<br>
<li>Application-modal dialog "D<sub>iii</sub>" is shown<br>
- <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> —
+ <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> —
it's in the same application<br>
<li>D<sub>i</sub> is shown<br>
- <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> — it's its owner<br>
- <li>D<sub>iii</sub> remains unblocked — it blocks D<sub>ii</sub> and
+ <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> — it's its owner<br>
+ <li>D<sub>iii</sub> remains unblocked — it blocks D<sub>ii</sub> and
D<sub>ii</sub> blocks D<sub>i</sub><br>
</ol>
<br>
</td>
- <td align="center" valign="center">
+ <td align="center">
<img src="modal-example3.gif">
<br>
</td>
</tr>
<tr>
- <td align="left" valign="center">
+ <td align="left">
<ol>
<li>Frame "F" is shown<br>
<li>Toolkit-modal dialog "D<sub>i</sub>" is created, but not shown<br>
<li>Document-modal dialog "D<sub>ii</sub>" is shown<br>
- <li>F becomes blocked by D<sub>ii</sub> — it's in the same document<br>
+ <li>F becomes blocked by D<sub>ii</sub> — it's in the same document<br>
<li>Application-modal dialog "D<sub>iii</sub>" is shown<br>
- <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> — it's in the
+ <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> — it's in the
same application<br>
<li>D<sub>i</sub> is shown<br>
- <li>D<sub>iii</sub> becomes blocked by D<sub>i</sub> — D<sub>i</sub>
+ <li>D<sub>iii</sub> becomes blocked by D<sub>i</sub> — D<sub>i</sub>
is not blocked<br>
<li>D<sub>i</sub> remains unblocked<br>
</ol>
<br>
</td>
- <td align="center" valign="center">
+ <td align="center">
<img src="modal-example4.gif">
<br>
</td>
--- a/jdk/src/share/classes/java/awt/event/ActionEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/event/ActionEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -95,7 +95,7 @@
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
--- a/jdk/src/share/classes/java/awt/event/InvocationEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/event/InvocationEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,8 @@
package java.awt.event;
+import sun.awt.AWTAccessor;
+
import java.awt.ActiveEvent;
import java.awt.AWTEvent;
@@ -56,6 +58,15 @@
*/
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 @@
/**
* 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 <code>run()</code> method of the <code>runnable</code>
@@ -147,7 +168,7 @@
* @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 @@
* @param notifier The {@code Object} whose <code>notifyAll</code>
* method will be called after
* <code>Runnable.run</code> has returned or
- * thrown an exception
+ * thrown an exception or after the event was
+ * disposed
* @param catchThrowables Specifies whether <code>dispatch</code>
* should catch Throwable when executing
* the <code>Runnable</code>'s <code>run</code>
@@ -185,7 +207,39 @@
*/
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 <code>InvocationEvent</code> with the specified
+ * source which will execute the runnable's <code>run</code>
+ * method when dispatched. If listener is non-<code>null</code>,
+ * <code>listener.run()</code> will be called immediately after
+ * <code>run</code> has returned, thrown an exception or the event
+ * was disposed.
+ * <p>This method throws an <code>IllegalArgumentException</code>
+ * if <code>source</code> is <code>null</code>.
+ *
+ * @param source The <code>Object</code> that originated
+ * the event
+ * @param runnable The <code>Runnable</code> whose
+ * <code>run</code> method will be
+ * executed
+ * @param listener The <code>Runnable</code>Runnable whose
+ * <code>run()</code> method will be called
+ * after the {@code InvocationEvent}
+ * was dispatched or disposed
+ * @param catchThrowables Specifies whether <code>dispatch</code>
+ * should catch Throwable when executing
+ * the <code>Runnable</code>'s <code>run</code>
+ * method, or should instead propagate those
+ * Throwables to the EventDispatchThread's
+ * dispatch loop
+ * @throws IllegalArgumentException if <code>source</code> is null
+ */
+ public InvocationEvent(Object source, Runnable runnable, Runnable listener,
+ boolean catchThrowables) {
+ this(source, INVOCATION_DEFAULT, runnable, null, listener, catchThrowables);
}
/**
@@ -208,7 +262,8 @@
* @param notifier The <code>Object</code> whose <code>notifyAll</code>
* method will be called after
* <code>Runnable.run</code> has returned or
- * thrown an exception
+ * thrown an exception or after the event was
+ * disposed
* @param catchThrowables Specifies whether <code>dispatch</code>
* should catch Throwable when executing the
* <code>Runnable</code>'s <code>run</code>
@@ -221,13 +276,18 @@
*/
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 <code>run()</code> method and notifies the
* notifier (if any) when <code>run()</code> has returned or thrown an exception.
@@ -251,13 +311,7 @@
runnable.run();
}
} finally {
- dispatched = true;
-
- if (notifier != null) {
- synchronized (notifier) {
- notifier.notifyAll();
- }
- }
+ finishedDispatching(true);
}
}
@@ -331,6 +385,25 @@
}
/**
+ * 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.
*
--- a/jdk/src/share/classes/java/awt/event/KeyEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/event/KeyEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -133,7 +133,7 @@
* 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.
* <p>
* An unspecified behavior will be caused if the {@code id} parameter
* of any particular {@code KeyEvent} instance is not
--- a/jdk/src/share/classes/java/awt/event/WindowEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/event/WindowEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -79,8 +79,10 @@
@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;
--- a/jdk/src/share/classes/java/awt/event/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/event/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Provides interfaces and classes for dealing with different
--- a/jdk/src/share/classes/java/awt/font/FontRenderContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/FontRenderContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -126,7 +126,7 @@
* anti-aliasing or fractional metrics.
* @param tx the transform which is used to scale typographical points
* to pixels in this <code>FontRenderContext</code>. 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 <code>IllegalArgumentException</code>.
--- a/jdk/src/share/classes/java/awt/font/GlyphMetrics.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/GlyphMetrics.java Fri Nov 08 17:36:14 2013 -0800
@@ -43,7 +43,7 @@
import java.awt.geom.Rectangle2D;
/**
- * The <code>GlyphMetrics</code> class represents infomation for a
+ * The <code>GlyphMetrics</code> 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. <code>GlyphMetrics</code>
@@ -143,24 +143,24 @@
* 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;
--- a/jdk/src/share/classes/java/awt/font/GlyphVector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/GlyphVector.java Fri Nov 08 17:36:14 2013 -0800
@@ -395,7 +395,7 @@
* 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 <code>GlyphVector</code>
* @param newTX the new transform of the glyph at <code>glyphIndex</code>
* @throws IndexOutOfBoundsException if <code>glyphIndex</code>
--- a/jdk/src/share/classes/java/awt/font/LineBreakMeasurer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/LineBreakMeasurer.java Fri Nov 08 17:36:14 2013 -0800
@@ -112,7 +112,7 @@
* <strong>Examples</strong>:<p>
* Rendering a paragraph in a component
* <blockquote>
- * <pre>
+ * <pre>{@code
* public void paint(Graphics graphics) {
*
* Point2D pen = new Point2D(10, 20);
@@ -137,13 +137,13 @@
* pen.y += layout.getDescent() + layout.getLeading();
* }
* }
- * </pre>
+ * }</pre>
* </blockquote>
* <p>
* Rendering text with tabs. For simplicity, the overall text
* direction is assumed to be left-to-right
* <blockquote>
- * <pre>
+ * <pre>{@code
* public void paint(Graphics graphics) {
*
* float leftMargin = 10, rightMargin = 310;
@@ -240,7 +240,7 @@
* verticalPos += maxDescent;
* }
* }
- * </pre>
+ * }</pre>
* </blockquote>
* @see TextLayout
*/
--- a/jdk/src/share/classes/java/awt/font/MultipleMaster.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/MultipleMaster.java Fri Nov 08 17:36:14 2013 -0800
@@ -41,7 +41,7 @@
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
--- a/jdk/src/share/classes/java/awt/font/NumericShaper.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/NumericShaper.java Fri Nov 08 17:36:14 2013 -0800
@@ -1212,7 +1212,7 @@
* For example, to check if a shaper shapes to Arabic, you would use the
* following:
* <blockquote>
- * <code>if ((shaper.getRanges() & shaper.ARABIC) != 0) { ... </code>
+ * <code>if ((shaper.getRanges() & shaper.ARABIC) != 0) { ... </code>
* </blockquote>
*
* <p>Note that this method supports only the bit mask-based
--- a/jdk/src/share/classes/java/awt/font/OpenType.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/OpenType.java Fri Nov 08 17:36:14 2013 -0800
@@ -33,7 +33,7 @@
* <p>
* For more information on TrueType and OpenType fonts, see the
* OpenType specification.
- * ( <a href=http://www.microsoft.com/typography/otspec/">http://www.microsoft.com/typography/otspec/l</a> ).
+ * ( <a href="http://www.microsoft.com/typography/otspec/">http://www.microsoft.com/typography/otspec/</a> ).
*/
public interface OpenType {
@@ -268,7 +268,7 @@
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;
--- a/jdk/src/share/classes/java/awt/font/TextLayout.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/TextLayout.java Fri Nov 08 17:36:14 2013 -0800
@@ -223,7 +223,7 @@
* 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 @@
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 @@
* The ascent is the distance from the top (right) of the
* <code>TextLayout</code> 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 @@
* Returns the descent of this <code>TextLayout</code>.
* The descent is the distance from the baseline to the bottom (left) of
* the <code>TextLayout</code>. 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.
--- a/jdk/src/share/classes/java/awt/font/TransformAttribute.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/TransformAttribute.java Fri Nov 08 17:36:14 2013 -0800
@@ -120,7 +120,7 @@
return this;
}
- // Added for serial backwards compatability (4348425)
+ // Added for serial backwards compatibility (4348425)
static final long serialVersionUID = 3356247357827709530L;
/**
--- a/jdk/src/share/classes/java/awt/font/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/font/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Provides classes and interface relating to fonts. It
--- a/jdk/src/share/classes/java/awt/geom/AffineTransform.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/geom/AffineTransform.java Fri Nov 08 17:36:14 2013 -0800
@@ -47,7 +47,7 @@
* [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
* </pre>
* <p>
- * <a name="quadrantapproximation"></a><h4>Handling 90-Degree Rotations</h4>
+ * <h4><a name="quadrantapproximation">Handling 90-Degree Rotations</a></h4>
* <p>
* In some variations of the <code>rotate</code> methods in the
* <code>AffineTransform</code> class, a double-precision argument
@@ -525,7 +525,7 @@
/**
* Constructs a new <code>AffineTransform</code> 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 @@
/**
* 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 @@
* 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 @@
* @param ptDst the specified <code>Point2D</code> that stores the
* result of transforming <code>ptSrc</code>
* @return the <code>ptDst</code> after transforming
- * <code>ptSrc</code> and stroring the result in <code>ptDst</code>.
+ * <code>ptSrc</code> and storing the result in <code>ptDst</code>.
* @since 1.2
*/
public Point2D transform(Point2D ptSrc, Point2D ptDst) {
--- a/jdk/src/share/classes/java/awt/geom/Line2D.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/geom/Line2D.java Fri Nov 08 17:36:14 2013 -0800
@@ -477,7 +477,7 @@
* direction is clockwise.
* <p>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.
* <p>If the point is colinear with the line segment, but
* not between the end points, then the value will be -1 if the point
--- a/jdk/src/share/classes/java/awt/geom/Path2D.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/geom/Path2D.java Fri Nov 08 17:36:14 2013 -0800
@@ -2064,7 +2064,7 @@
* @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,
--- a/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java Fri Nov 08 17:36:14 2013 -0800
@@ -511,7 +511,7 @@
/**
* Returns the X coordinate of the end point in
* <code>double</code> precision.
- * @return the x coordiante of the end point.
+ * @return the x coordinate of the end point.
* @since 1.2
*/
public abstract double getX2();
--- a/jdk/src/share/classes/java/awt/geom/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/geom/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Provides the Java 2D classes for defining and performing operations
--- a/jdk/src/share/classes/java/awt/im/InputContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/im/InputContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -98,7 +98,6 @@
* an input method or keyboard layout has been successfully selected. The
* following steps are taken until an input method has been selected:
*
- * <p>
* <ul>
* <li>
* If the currently selected input method or keyboard layout supports the
--- a/jdk/src/share/classes/java/awt/im/InputMethodRequests.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/im/InputMethodRequests.java Fri Nov 08 17:36:14 2013 -0800
@@ -83,7 +83,7 @@
* 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.
*
* <p>
--- a/jdk/src/share/classes/java/awt/image/BandedSampleModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/BandedSampleModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -39,7 +39,7 @@
* 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
--- a/jdk/src/share/classes/java/awt/image/BufferStrategy.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/BufferStrategy.java Fri Nov 08 17:36:14 2013 -0800
@@ -34,7 +34,7 @@
* to organize complex memory on a particular <code>Canvas</code> or
* <code>Window</code>. 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
* <code>GraphicsConfiguration</code> used when creating the
* <code>Canvas</code> or <code>Window</code>.
* <p>
--- a/jdk/src/share/classes/java/awt/image/BufferedImage.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java Fri Nov 08 17:36:14 2013 -0800
@@ -1336,7 +1336,7 @@
/**
* 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;
--- a/jdk/src/share/classes/java/awt/image/ComponentColorModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/ComponentColorModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -2318,7 +2318,7 @@
* and is not large enough to hold all the color and alpha components
* (starting at <code>normOffset</code>).
* <p>
- * 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
--- a/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -167,6 +167,7 @@
for (int i=0; i<numBands; i++) {
bankIndices[i] = 0;
}
+ verify();
}
@@ -244,24 +245,53 @@
throw new IllegalArgumentException("Length of bandOffsets must "+
"equal length of bankIndices.");
}
+ verify();
+ }
+
+ private void verify() {
+ int requiredSize = getBufferSize();
}
/**
* Returns the size of the data buffer (in data elements) needed
* for a data buffer that matches this ComponentSampleModel.
*/
- private long getBufferSize() {
+ private int getBufferSize() {
int maxBandOff=bandOffsets[0];
- for (int i=1; i<bandOffsets.length; i++)
+ for (int i=1; i<bandOffsets.length; i++) {
maxBandOff = Math.max(maxBandOff,bandOffsets[i]);
+ }
+
+ if (maxBandOff < 0 || maxBandOff > (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");
+ }
- long size = 0;
- if (maxBandOff >= 0)
- size += maxBandOff+1;
- if (pixelStride > 0)
- size += pixelStride * (width-1);
- if (scanlineStride > 0)
- size += scanlineStride*(height-1);
+ 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;
+
return size;
}
@@ -409,7 +439,7 @@
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 @@
*
* @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)) {
--- a/jdk/src/share/classes/java/awt/image/ImageConsumer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/ImageConsumer.java Fri Nov 08 17:36:14 2013 -0800
@@ -191,7 +191,7 @@
* 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
--- a/jdk/src/share/classes/java/awt/image/IndexColorModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/IndexColorModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -1152,7 +1152,7 @@
* @throws ClassCastException if <code>pixel</code> is not a
* primitive array of type <code>transferType</code>
* @throws UnsupportedOperationException if <code>transferType</code>
- * 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 @@
* array is not large enough to hold all of the color and alpha
* components starting at <code>offset</code>
* @throws UnsupportedOperationException if <code>transferType</code>
- * is not one of the supported transer types
+ * is not one of the supported transfer types
* @see WritableRaster#setDataElements
* @see SampleModel#setDataElements
*/
--- a/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -29,7 +29,7 @@
* 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
--- a/jdk/src/share/classes/java/awt/image/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Provides classes for creating and modifying images.
--- a/jdk/src/share/classes/java/awt/image/renderable/RenderableImage.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImage.java Fri Nov 08 17:36:14 2013 -0800
@@ -65,7 +65,7 @@
* 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 @@
*
* @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);
--- a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java Fri Nov 08 17:36:14 2013 -0800
@@ -236,7 +236,7 @@
*
* @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,
--- a/jdk/src/share/classes/java/awt/image/renderable/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/image/renderable/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Provides classes and interfaces for producing
--- a/jdk/src/share/classes/java/awt/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Contains all of the classes for creating user
@@ -53,7 +54,7 @@
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.
-<p>
+
<h2>Additional Specification</h2>
<ul>
--- a/jdk/src/share/classes/java/awt/print/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/awt/print/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
+<head><title></title></head>
<body bgcolor="white">
Provides classes and interfaces for a general printing API. The
--- a/jdk/src/share/classes/java/beans/AppletInitializer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/AppletInitializer.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,7 @@
/**
* <p>
* 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().
* </p>
--- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java Fri Nov 08 17:36:14 2013 -0800
@@ -273,7 +273,7 @@
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
--- a/jdk/src/share/classes/java/beans/EventHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/EventHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -611,7 +611,7 @@
* the empty string.
* The format of the <code>eventPropertyName</code> 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: <code>propertyName{.propertyName}*</code>
* where <code>propertyName</code> matches a method or
--- a/jdk/src/share/classes/java/beans/MethodDescriptor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java Fri Nov 08 17:36:14 2013 -0800
@@ -76,7 +76,7 @@
}
/**
- * Gets the method that this MethodDescriptor encapsualtes.
+ * Gets the method that this MethodDescriptor encapsulates.
*
* @return The low-level description of the method
*/
--- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java Fri Nov 08 17:36:14 2013 -0800
@@ -335,7 +335,7 @@
*/
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);
--- a/jdk/src/share/classes/java/beans/PropertyEditorSupport.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/PropertyEditorSupport.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,7 +30,7 @@
/**
* This is a support class to help build property editors.
* <p>
- * 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 {
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java Fri Nov 08 17:36:14 2013 -0800
@@ -302,7 +302,7 @@
/**
* 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 @@
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.
*/
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedListener.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedListener.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
/**
* 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 <code>BeanContextServiceRevokedEvent</code> received
* by this listener.
*/
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java Fri Nov 08 17:36:14 2013 -0800
@@ -620,7 +620,7 @@
/**
* 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
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java Fri Nov 08 17:36:14 2013 -0800
@@ -183,7 +183,7 @@
* into a <tt>BeanContext</tt>.
* </p>
* <p>
- * 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.
* </p>
*
* @param beanName the name of the Bean to instantiate within this BeanContext
--- a/jdk/src/share/classes/java/io/File.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/io/File.java Fri Nov 08 17:36:14 2013 -0800
@@ -1685,7 +1685,7 @@
* operation will fail if the user does not have permission to
* change the access permissions of this abstract pathname. If
* <code>executable</code> is <code>false</code> 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
--- a/jdk/src/share/classes/java/io/ObjectStreamConstants.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/io/ObjectStreamConstants.java Fri Nov 08 17:36:14 2013 -0800
@@ -219,7 +219,7 @@
* 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.
*
--- a/jdk/src/share/classes/java/io/PrintStream.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/io/PrintStream.java Fri Nov 08 17:36:14 2013 -0800
@@ -303,7 +303,7 @@
* 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
*
--- a/jdk/src/share/classes/java/lang/invoke/MethodType.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/lang/invoke/MethodType.java Fri Nov 08 17:36:14 2013 -0800
@@ -823,7 +823,7 @@
* So this method returns {@link #parameterCount() parameterCount} plus the
* number of long and double parameters (if any).
* <p>
- * 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 @@
* <em>plus</em> the number of long or double arguments
* at or after after the argument for the given parameter.
* <p>
- * 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 @@
* 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.
* <p>
- * 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 @@
* constructed by this method, because their component types are
* not all reachable from a common class loader.
* <p>
- * 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 @@
* Two distinct classes which share a common name but have different class loaders
* will appear identical when viewed within descriptor strings.
* <p>
- * 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.
--- a/jdk/src/share/classes/java/lang/management/CompilationMXBean.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/lang/management/CompilationMXBean.java Fri Nov 08 17:36:14 2013 -0800
@@ -74,7 +74,7 @@
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.
--- a/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java Fri Nov 08 17:36:14 2013 -0800
@@ -147,7 +147,7 @@
* 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 @@
* <hr>
* 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
--- a/jdk/src/share/classes/java/lang/management/ThreadInfo.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/lang/management/ThreadInfo.java Fri Nov 08 17:36:14 2013 -0800
@@ -492,7 +492,7 @@
* @return the thread ID of the owner thread of the object
* this thread is blocked on;
* <tt>-1</tt> 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
*/
--- a/jdk/src/share/classes/java/lang/management/ThreadMXBean.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java Fri Nov 08 17:36:14 2013 -0800
@@ -646,7 +646,7 @@
* 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
--- a/jdk/src/share/classes/java/net/Authenticator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/Authenticator.java Fri Nov 08 17:36:14 2013 -0800
@@ -358,7 +358,7 @@
* 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()
--- a/jdk/src/share/classes/java/net/CookieManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/CookieManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -143,7 +143,7 @@
*
* @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
--- a/jdk/src/share/classes/java/net/CookieStore.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/CookieStore.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,7 +48,7 @@
* <p>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.
*
* <p>If a cookie corresponding to the given URI already exists,
--- a/jdk/src/share/classes/java/net/DatagramSocket.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/DatagramSocket.java Fri Nov 08 17:36:14 2013 -0800
@@ -640,7 +640,7 @@
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) {
--- a/jdk/src/share/classes/java/net/InetSocketAddress.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/InetSocketAddress.java Fri Nov 08 17:36:14 2013 -0800
@@ -196,7 +196,7 @@
* If that attempt fails, the address will be flagged as <I>unresolved</I>.
* <p>
* 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.
* <P>
* A valid port value is between 0 and 65535.
--- a/jdk/src/share/classes/java/net/InterfaceAddress.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/InterfaceAddress.java Fri Nov 08 17:36:14 2013 -0800
@@ -56,7 +56,7 @@
}
/**
- * Returns an {@code InetAddress} for the brodcast address
+ * Returns an {@code InetAddress} for the broadcast address
* for this InterfaceAddress.
* <p>
* Only IPv4 networks have broadcast address therefore, in the case
--- a/jdk/src/share/classes/java/net/JarURLConnection.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/JarURLConnection.java Fri Nov 08 17:36:14 2013 -0800
@@ -82,7 +82,7 @@
*
* </dl>
*
- * <p>{@code !/} is refered to as the <em>separator</em>.
+ * <p>{@code !/} is referred to as the <em>separator</em>.
*
* <p>When constructing a JAR url via {@code new URL(context, spec)},
* the following rules apply:
@@ -223,7 +223,7 @@
* 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 @@
* 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
--- a/jdk/src/share/classes/java/net/ServerSocket.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/ServerSocket.java Fri Nov 08 17:36:14 2013 -0800
@@ -610,7 +610,7 @@
/**
* 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() {
--- a/jdk/src/share/classes/java/net/SocksSocketImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/SocksSocketImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -437,7 +437,7 @@
}
}
- // 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;
--- a/jdk/src/share/classes/java/net/StandardSocketOptions.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/StandardSocketOptions.java Fri Nov 08 17:36:14 2013 -0800
@@ -257,7 +257,7 @@
* 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.
*
* <p> The initial/default value of this socket option may be {@code null}
--- a/jdk/src/share/classes/java/net/URL.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/URL.java Fri Nov 08 17:36:14 2013 -0800
@@ -465,7 +465,7 @@
* 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 ".".
* <p>
* For a more detailed description of URL parsing, refer to RFC2396.
*
--- a/jdk/src/share/classes/java/net/URLConnection.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/URLConnection.java Fri Nov 08 17:36:14 2013 -0800
@@ -371,7 +371,7 @@
* java.net.SocketTimeoutException is raised. A timeout of zero is
* interpreted as an infinite timeout.
- * <p> Some non-standard implmentation of this method may ignore
+ * <p> 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 @@
*
* <p> 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
--- a/jdk/src/share/classes/java/net/URLDecoder.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/URLDecoder.java Fri Nov 08 17:36:14 2013 -0800
@@ -116,7 +116,7 @@
* "http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars">
* World Wide Web Consortium Recommendation</a> states that
* UTF-8 should be used. Not doing so may introduce
- * incompatibilites.</em>
+ * incompatibilities.</em>
*
* @param s the {@code String} to decode
* @param enc The name of a supported
--- a/jdk/src/share/classes/java/net/URLEncoder.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/net/URLEncoder.java Fri Nov 08 17:36:14 2013 -0800
@@ -185,7 +185,7 @@
* "http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars">
* World Wide Web Consortium Recommendation</a> states that
* UTF-8 should be used. Not doing so may introduce
- * incompatibilites.</em>
+ * incompatibilities.</em>
*
* @param s {@code String} to be translated.
* @param enc The name of a supported
--- a/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java Fri Nov 08 17:36:14 2013 -0800
@@ -199,7 +199,7 @@
*
* <p> The {@code initialSize} parameter may be used by the implementation
* as a <em>hint</em> 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.
*
* <p> The executor is intended to be used exclusively by the resulting
--- a/jdk/src/share/classes/java/nio/channels/DatagramChannel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/nio/channels/DatagramChannel.java Fri Nov 08 17:36:14 2013 -0800
@@ -153,7 +153,7 @@
* Opens a datagram channel.
*
* <p> 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.
*
--- a/jdk/src/share/classes/java/nio/channels/MembershipKey.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/nio/channels/MembershipKey.java Fri Nov 08 17:36:14 2013 -0800
@@ -103,7 +103,7 @@
* 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
--- a/jdk/src/share/classes/java/nio/channels/package-info.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/nio/channels/package-info.java Fri Nov 08 17:36:14 2013 -0800
@@ -269,7 +269,7 @@
* own asynchronous channel groups or configure the {@code ExecutorService}
* that will be used for the default group.
*
- * <p> As with selectors, the implementatin of asynchronous channels can be
+ * <p> 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
* <tt>{@link java.nio.channels.spi}</tt> package. It is not expected that many
--- a/jdk/src/share/classes/java/nio/charset/Charset.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/nio/charset/Charset.java Fri Nov 08 17:36:14 2013 -0800
@@ -201,7 +201,7 @@
*
* </ul>
*
- * 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
* <small>ZERO-WIDTH NON-BREAKING SPACE</small>.
*
--- a/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java Fri Nov 08 17:36:14 2013 -0800
@@ -81,7 +81,7 @@
/**
* 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 @@
* <p> 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.
*
* <p> Where there is insufficient space to store the attribute, or the
--- a/jdk/src/share/classes/java/rmi/MarshalledObject.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/rmi/MarshalledObject.java Fri Nov 08 17:36:14 2013 -0800
@@ -135,7 +135,7 @@
/**
* 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 <code>IOException</code> occurs while
@@ -182,7 +182,7 @@
* in the serialized representation.
*
* @param obj the object to compare with this <code>MarshalledObject</code>
- * @return <code>true</code> if the argument contains an equaivalent
+ * @return <code>true</code> if the argument contains an equivalent
* serialized object; <code>false</code> otherwise
* @since 1.2
*/
--- a/jdk/src/share/classes/java/security/AccessControlException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/security/AccessControlException.java Fri Nov 08 17:36:14 2013 -0800
@@ -44,7 +44,7 @@
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 @@
}
/**
- * 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.
--- a/jdk/src/share/classes/java/security/DigestOutputStream.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/security/DigestOutputStream.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
*
* <p>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.
*
* <p>It is possible to turn this stream on or off (see
--- a/jdk/src/share/classes/java/security/KeyStore.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/security/KeyStore.java Fri Nov 08 17:36:14 2013 -0800
@@ -1611,7 +1611,7 @@
* 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 @@
* 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
--- a/jdk/src/share/classes/java/security/ProtectionDomain.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/security/ProtectionDomain.java Fri Nov 08 17:36:14 2013 -0800
@@ -401,7 +401,7 @@
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
--- a/jdk/src/share/classes/java/security/Security.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/security/Security.java Fri Nov 08 17:36:14 2013 -0800
@@ -496,7 +496,7 @@
* <li> <i>{@literal <crypto_service>.<algorithm_or_type>
* <attribute_name>:<attribute_value>}</i>
* <p> 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
* <i>{@literal <algorithm_or_type>}</i> and the
* <i>{@literal <attribute_name>}</i>.
* <p> A provider satisfies this selection criterion iff the
@@ -570,7 +570,7 @@
* <li> <i>{@literal <crypto_service>}.
* {@literal <algorithm_or_type> <attribute_name>}</i>
* <p> 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
* <i>{@literal <algorithm_or_type>}</i>
* and the <i>{@literal <attribute_name>}</i>.
* <p> The value associated with the key must be a non-empty string.
--- a/jdk/src/share/classes/java/security/UnresolvedPermission.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/security/UnresolvedPermission.java Fri Nov 08 17:36:14 2013 -0800
@@ -441,7 +441,7 @@
*
* @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
*/
--- a/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java Fri Nov 08 17:36:14 2013 -0800
@@ -129,7 +129,7 @@
}
/**
- * 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
--- a/jdk/src/share/classes/java/security/spec/ECFieldF2m.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/security/spec/ECFieldF2m.java Fri Nov 08 17:36:14 2013 -0800
@@ -64,7 +64,7 @@
* 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.<p>
* Note: A valid reduction polynomial is either a
* trinomial (X^{@code m} + X^{@code k} + 1
--- a/jdk/src/share/classes/java/sql/Array.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/Array.java Fri Nov 08 17:36:14 2013 -0800
@@ -323,7 +323,7 @@
* element at index <code>index</code>. The result set has
* up to <code>count</code> 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;
--- a/jdk/src/share/classes/java/sql/BatchUpdateException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/BatchUpdateException.java Fri Nov 08 17:36:14 2013 -0800
@@ -143,7 +143,7 @@
* initialized by a call to the
* {@link Throwable#initCause(java.lang.Throwable)} method. The
* <code>SQLState</code> is initialized to <code>null</code>
- * and the vender code is initialized to 0.
+ * and the vendor code is initialized to 0.
* <p>
* <strong>Note:</strong> There is no validation of {@code updateCounts} for
* overflow and because of this it is recommended that you use the constructor
--- a/jdk/src/share/classes/java/sql/Blob.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/Blob.java Fri Nov 08 17:36:14 2013 -0800
@@ -158,7 +158,7 @@
* in the <code>Blob</code> object starting at the position
* <code>pos</code>. If the end of the <code>Blob</code> value is reached
* while writing the array of bytes, then the length of the <code>Blob</code>
- * value will be increased to accomodate the extra bytes.
+ * value will be increased to accommodate the extra bytes.
* <p>
* <b>Note:</b> If the value specified for <code>pos</code>
* is greater then the length+1 of the <code>BLOB</code> value then the
@@ -190,7 +190,7 @@
* in the <code>Blob</code> object starting at the position
* <code>pos</code>. If the end of the <code>Blob</code> value is reached
* while writing the array of bytes, then the length of the <code>Blob</code>
- * value will be increased to accomodate the extra bytes.
+ * value will be increased to accommodate the extra bytes.
* <p>
* <b>Note:</b> If the value specified for <code>pos</code>
* is greater then the length+1 of the <code>BLOB</code> value then the
@@ -224,7 +224,7 @@
* in the <code>Blob</code> object starting at the position
* <code>pos</code>. If the end of the <code>Blob</code> value is reached
* while writing to the stream, then the length of the <code>Blob</code>
- * value will be increased to accomodate the extra bytes.
+ * value will be increased to accommodate the extra bytes.
* <p>
* <b>Note:</b> If the value specified for <code>pos</code>
* is greater then the length+1 of the <code>BLOB</code> value then the
--- a/jdk/src/share/classes/java/sql/CallableStatement.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/CallableStatement.java Fri Nov 08 17:36:14 2013 -0800
@@ -1900,7 +1900,7 @@
* @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 <code>CallableStatement</code>
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
--- a/jdk/src/share/classes/java/sql/Clob.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/Clob.java Fri Nov 08 17:36:14 2013 -0800
@@ -172,7 +172,7 @@
* in the <code>Clob</code> object starting at the position
* <code>pos</code>. If the end of the <code>Clob</code> value is reached
* while writing the given string, then the length of the <code>Clob</code>
- * value will be increased to accomodate the extra characters.
+ * value will be increased to accommodate the extra characters.
* <p>
* <b>Note:</b> If the value specified for <code>pos</code>
* is greater then the length+1 of the <code>CLOB</code> value then the
@@ -202,7 +202,7 @@
* in the <code>Clob</code> object starting at the position
* <code>pos</code>. If the end of the <code>Clob</code> value is reached
* while writing the given string, then the length of the <code>Clob</code>
- * value will be increased to accomodate the extra characters.
+ * value will be increased to accommodate the extra characters.
* <p>
* <b>Note:</b> If the value specified for <code>pos</code>
* is greater then the length+1 of the <code>CLOB</code> value then the
@@ -235,7 +235,7 @@
* in the <code>Clob</code> object starting at the position
* <code>pos</code>. If the end of the <code>Clob</code> value is reached
* while writing characters to the stream, then the length of the <code>Clob</code>
- * value will be increased to accomodate the extra characters.
+ * value will be increased to accommodate the extra characters.
* <p>
* <b>Note:</b> If the value specified for <code>pos</code>
* is greater then the length+1 of the <code>CLOB</code> value then the
@@ -264,7 +264,7 @@
* in the <code>Clob</code> object starting at the position
* <code>pos</code>. If the end of the <code>Clob</code> value is reached
* while writing characters to the stream, then the length of the <code>Clob</code>
- * value will be increased to accomodate the extra characters.
+ * value will be increased to accommodate the extra characters.
* <p>
* <b>Note:</b> If the value specified for <code>pos</code>
* is greater then the length+1 of the <code>CLOB</code> value then the
--- a/jdk/src/share/classes/java/sql/Connection.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/Connection.java Fri Nov 08 17:36:14 2013 -0800
@@ -242,7 +242,7 @@
*
* @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
* <code>Connection</code> object is in auto-commit mode
* @see #setAutoCommit
*/
--- a/jdk/src/share/classes/java/sql/DataTruncation.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/DataTruncation.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,7 +30,7 @@
* (on writes) or reported as a
* <code>DataTruncation</code> warning (on reads)
* when a data values is unexpectedly truncated for reasons other than its having
- * execeeded <code>MaxFieldSize</code>.
+ * exceeded <code>MaxFieldSize</code>.
*
* <P>The SQLstate for a <code>DataTruncation</code> during read is <code>01004</code>.
* <P>The SQLstate for a <code>DataTruncation</code> during write is <code>22001</code>.
@@ -107,7 +107,7 @@
* <P>This may be -1 if the column or parameter index is unknown, in
* which case the <code>parameter</code> and <code>read</code> 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;
--- a/jdk/src/share/classes/java/sql/DatabaseMetaData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/DatabaseMetaData.java Fri Nov 08 17:36:14 2013 -0800
@@ -1701,7 +1701,7 @@
* <P>Only privileges matching the column name criteria are
* returned. They are ordered by COLUMN_NAME and PRIVILEGE.
*
- * <P>Each privilige description has the following columns:
+ * <P>Each privilege description has the following columns:
* <OL>
* <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
* <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
@@ -1747,7 +1747,7 @@
* <code>TABLE_SCHEM</code>, <code>TABLE_NAME</code>,
* and <code>PRIVILEGE</code>.
*
- * <P>Each privilige description has the following columns:
+ * <P>Each privilege description has the following columns:
* <OL>
* <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
* <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
@@ -3257,7 +3257,7 @@
boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException;
/**
- * Retrieves whether a <code>SQLException</code> while autoCommit is <code>true</code> inidcates
+ * Retrieves whether a <code>SQLException</code> while autoCommit is <code>true</code> indicates
* that all open ResultSets are closed, even ones that are holdable. When a <code>SQLException</code> occurs while
* autocommit is <code>true</code>, 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
--- a/jdk/src/share/classes/java/sql/DriverManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/DriverManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -59,7 +59,7 @@
* <code>my.sql.Driver</code>
* </pre>
*
- * <P>Applications no longer need to explictly load JDBC drivers using <code>Class.forName()</code>. Existing programs
+ * <P>Applications no longer need to explicitly load JDBC drivers using <code>Class.forName()</code>. Existing programs
* which currently load JDBC drivers using <code>Class.forName()</code> will continue to work without
* modification.
*
--- a/jdk/src/share/classes/java/sql/DriverPropertyInfo.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/DriverPropertyInfo.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
/**
* Constructs a <code>DriverPropertyInfo</code> object with a given
* name and value. The <code>description</code> and <code>choices</code>
- * are intialized to <code>null</code> and <code>required</code> is initialized
+ * are initialized to <code>null</code> and <code>required</code> is initialized
* to <code>false</code>.
*
* @param name the name of the property
--- a/jdk/src/share/classes/java/sql/PreparedStatement.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/PreparedStatement.java Fri Nov 08 17:36:14 2013 -0800
@@ -856,7 +856,7 @@
* this method is called on a closed <code>PreparedStatement</code>;
* 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
--- a/jdk/src/share/classes/java/sql/ResultSet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/ResultSet.java Fri Nov 08 17:36:14 2013 -0800
@@ -184,7 +184,7 @@
* <P>The closing of a <code>ResultSet</code> object does <strong>not</strong> close the <code>Blob</code>,
* <code>Clob</code> or <code>NClob</code> objects created by the <code>ResultSet</code>. <code>Blob</code>,
* <code>Clob</code> or <code>NClob</code> objects remain valid for at least the duration of the
- * transaction in which they are creataed, unless their <code>free</code> method is invoked.
+ * transaction in which they are created, unless their <code>free</code> method is invoked.
*<p>
* When a <code>ResultSet</code> is closed, any <code>ResultSetMetaData</code>
* instances that were created by calling the <code>getMetaData</code>
@@ -2423,7 +2423,7 @@
* <code>DatabaseMetaData</code> method, this method may return
* <code>null</code>.
*
- * @return the <code>Statment</code> object that produced
+ * @return the <code>Statement</code> object that produced
* this <code>ResultSet</code> object or <code>null</code>
* if the result set was produced some other way
* @exception SQLException if a database access error occurs
@@ -2749,7 +2749,7 @@
/**
* The constant indicating that open <code>ResultSet</code> 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 @@
/**
* The constant indicating that open <code>ResultSet</code> 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
*/
--- a/jdk/src/share/classes/java/sql/SQLException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLException.java Fri Nov 08 17:36:14 2013 -0800
@@ -107,7 +107,7 @@
/**
* Constructs a <code>SQLException</code> object with a given
* <code>reason</code>. The <code>SQLState</code> is initialized to
- * <code>null</code> and the vender code is initialized to 0.
+ * <code>null</code> and the vendor code is initialized to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
* initialized by a call to the
--- a/jdk/src/share/classes/java/sql/SQLFeatureNotSupportedException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLFeatureNotSupportedException.java Fri Nov 08 17:36:14 2013 -0800
@@ -60,7 +60,7 @@
/**
* Constructs a <code>SQLFeatureNotSupportedException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
@@ -118,7 +118,7 @@
* <code>cause==null</code> or to <code>cause.toString()</code> if
* <code>cause!=null</code>.
* <p>
- * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval bythe <code>getCause()</code> method); may be null indicating
+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
* the cause is non-existent or unknown.
* @since 1.6
*/
--- a/jdk/src/share/classes/java/sql/SQLIntegrityConstraintViolationException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLIntegrityConstraintViolationException.java Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
/**
* Constructs a <code>SQLIntegrityConstraintViolationException</code>
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLInvalidAuthorizationSpecException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLInvalidAuthorizationSpecException.java Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
/**
* Constructs a <code>SQLInvalidAuthorizationSpecException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLNonTransientConnectionException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLNonTransientConnectionException.java Fri Nov 08 17:36:14 2013 -0800
@@ -56,7 +56,7 @@
/**
* Constructs a <code>SQLNonTransientConnectionException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLNonTransientException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLNonTransientException.java Fri Nov 08 17:36:14 2013 -0800
@@ -54,7 +54,7 @@
/**
* Constructs a <code>SQLNonTransientException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLRecoverableException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLRecoverableException.java Fri Nov 08 17:36:14 2013 -0800
@@ -56,7 +56,7 @@
/**
* Constructs a <code>SQLRecoverableException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLSyntaxErrorException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLSyntaxErrorException.java Fri Nov 08 17:36:14 2013 -0800
@@ -54,7 +54,7 @@
/**
* Constructs a <code>SQLSyntaxErrorException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
@@ -112,7 +112,7 @@
* <code>cause==null</code> or to <code>cause.toString()</code> if
* <code>cause!=null</code>.
* <p>
- * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval bythe <code>getCause()</code> method); may be null indicating
+ * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
* the cause is non-existent or unknown.
* @since 1.6
*/
--- a/jdk/src/share/classes/java/sql/SQLTimeoutException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLTimeoutException.java Fri Nov 08 17:36:14 2013 -0800
@@ -54,7 +54,7 @@
/**
* Constructs a <code>SQLTimeoutException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLTransactionRollbackException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLTransactionRollbackException.java Fri Nov 08 17:36:14 2013 -0800
@@ -54,7 +54,7 @@
/**
* Constructs a <code>SQLTransactionRollbackException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLTransientConnectionException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLTransientConnectionException.java Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
/**
* Constructs a <code>SQLTransientConnectionException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLTransientException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLTransientException.java Fri Nov 08 17:36:14 2013 -0800
@@ -27,7 +27,7 @@
/**
* 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.
*<p>
*
@@ -53,7 +53,7 @@
/**
* Constructs a <code>SQLTransientException</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLWarning.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLWarning.java Fri Nov 08 17:36:14 2013 -0800
@@ -86,7 +86,7 @@
/**
* Constructs a <code>SQLWarning</code> object
* with a given <code>reason</code>. The <code>SQLState</code>
- * is initialized to <code>null</code> and the vender code is initialized
+ * is initialized to <code>null</code> and the vendor code is initialized
* to 0.
*
* The <code>cause</code> is not initialized, and may subsequently be
--- a/jdk/src/share/classes/java/sql/SQLXML.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/SQLXML.java Fri Nov 08 17:36:14 2013 -0800
@@ -362,7 +362,7 @@
*
* @param <T> 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:
* <pre>
* javax.xml.transform.dom.DOMSource - returns a DOMSource
--- a/jdk/src/share/classes/java/sql/Statement.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/Statement.java Fri Nov 08 17:36:14 2013 -0800
@@ -34,8 +34,8 @@
* <code>ResultSet</code> object is interleaved
* with the reading of another, each must have been generated by
* different <code>Statement</code> objects. All execution methods in the
- * <code>Statement</code> interface implicitly close a statment's current
- * <code>ResultSet</code> object if an open one exists.
+ * <code>Statement</code> interface implicitly close a current
+ * <code>ResultSet</code> object of the statement if an open one exists.
*
* @see Connection#createStatement
* @see ResultSet
@@ -445,7 +445,7 @@
/**
* 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
- * <code>ResultSet</code> objects genrated by this <code>Statement</code>.
+ * <code>ResultSet</code> objects generated by this <code>Statement</code>.
* If the value specified is zero, then the hint is ignored.
* The default value is zero.
*
@@ -501,7 +501,7 @@
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
* <code>Statement</code> object. The commands in this list can be
* executed as a batch by calling the method <code>executeBatch</code>.
* <P>
@@ -567,8 +567,8 @@
* <P>
* 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 <code>BatchUpdateException</code> obejct has been thrown.
+ * accommodate the option of continuing to process commands in a batch
+ * update after a <code>BatchUpdateException</code> 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 @@
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
--- a/jdk/src/share/classes/java/sql/Struct.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/Struct.java Fri Nov 08 17:36:14 2013 -0800
@@ -81,7 +81,7 @@
/**
* Produces the ordered values of the attributes of the SQL
* structured type that this <code>Struct</code> 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
--- a/jdk/src/share/classes/java/sql/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/sql/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -221,7 +221,7 @@
<lI>SQLException enhancements -- Added support for cause chaining; New SQLExceptions
added for common SQLState class value codes
<li>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
<li>Support added for accessing a SQL ROWID
<li>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
--- a/jdk/src/share/classes/java/text/BreakIterator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/text/BreakIterator.java Fri Nov 08 17:36:14 2013 -0800
@@ -338,7 +338,7 @@
* Otherwise, the iterator's current position is set to the returned boundary.
* The value returned is always less than the offset or the value
* <code>BreakIterator.DONE</code>.
- * @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
* <code>BreakIterator.DONE</code> if the first text boundary is passed in
* as the offset.
--- a/jdk/src/share/classes/java/text/ChoiceFormat.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/text/ChoiceFormat.java Fri Nov 08 17:36:14 2013 -0800
@@ -409,7 +409,7 @@
* @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.
--- a/jdk/src/share/classes/java/text/DigitList.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/text/DigitList.java Fri Nov 08 17:36:14 2013 -0800
@@ -483,7 +483,7 @@
*
* 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 @@
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;
--- a/jdk/src/share/classes/java/text/FieldPosition.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/text/FieldPosition.java Fri Nov 08 17:36:14 2013 -0800
@@ -136,7 +136,7 @@
* constant, <code>fieldID</code> 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) {
--- a/jdk/src/share/classes/java/text/Format.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/text/Format.java Fri Nov 08 17:36:14 2013 -0800
@@ -281,7 +281,7 @@
}
/**
- * Creates an <code>AttributedCharacterIterator</code> containg the
+ * Creates an <code>AttributedCharacterIterator</code> containing the
* concatenated contents of the passed in
* <code>AttributedCharacterIterator</code>s.
*
--- a/jdk/src/share/classes/java/text/RuleBasedCollator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/text/RuleBasedCollator.java Fri Nov 08 17:36:14 2013 -0800
@@ -671,7 +671,7 @@
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());
}
--- a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java Fri Nov 08 17:36:14 2013 -0800
@@ -158,7 +158,7 @@
* 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)
--- a/jdk/src/share/classes/java/time/zone/ZoneRules.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/time/zone/ZoneRules.java Fri Nov 08 17:36:14 2013 -0800
@@ -899,7 +899,7 @@
return transArray[i];
}
}
- // use last from preceeding year
+ // use last from preceding year
int lastHistoricYear = findYear(lastHistoric, lastHistoricOffset);
if (--year > lastHistoricYear) {
transArray = findTransitionArray(year);
--- a/jdk/src/share/classes/java/util/Arrays.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/Arrays.java Fri Nov 08 17:36:14 2013 -0800
@@ -1225,7 +1225,7 @@
*
* <p>The implementation was adapted from Tim Peters's list sort for Python
* (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
- * TimSort</a>). It uses techiques from Peter McIlroy's "Optimistic
+ * TimSort</a>). 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 @@
*
* <p>The implementation was adapted from Tim Peters's list sort for Python
* (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
- * TimSort</a>). It uses techiques from Peter McIlroy's "Optimistic
+ * TimSort</a>). 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 @@
*
* <p>The implementation was adapted from Tim Peters's list sort for Python
* (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
- * TimSort</a>). It uses techiques from Peter McIlroy's "Optimistic
+ * TimSort</a>). 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 @@
*
* <p>The implementation was adapted from Tim Peters's list sort for Python
* (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
- * TimSort</a>). It uses techiques from Peter McIlroy's "Optimistic
+ * TimSort</a>). 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.
--- a/jdk/src/share/classes/java/util/Locale.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/Locale.java Fri Nov 08 17:36:14 2013 -0800
@@ -1836,7 +1836,7 @@
* country<br>
* </blockquote>
* 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.
--- a/jdk/src/share/classes/java/util/MissingFormatWidthException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/MissingFormatWidthException.java Fri Nov 08 17:36:14 2013 -0800
@@ -28,7 +28,7 @@
/**
* Unchecked exception thrown when the format width is required.
*
- * <p> Unless otherwise specified, passing a <tt>null</tt> argument to anyg
+ * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
* method or constructor in this class will cause a {@link
* NullPointerException} to be thrown.
*
--- a/jdk/src/share/classes/java/util/PriorityQueue.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/PriorityQueue.java Fri Nov 08 17:36:14 2013 -0800
@@ -65,7 +65,7 @@
* java.util.concurrent.PriorityBlockingQueue} class.
*
* <p>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
--- a/jdk/src/share/classes/java/util/ResourceBundle.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/ResourceBundle.java Fri Nov 08 17:36:14 2013 -0800
@@ -1254,7 +1254,7 @@
* <p><code>getBundle</code> finds
* <code>foo/bar/Messages_fr.properties</code> and creates a
* <code>ResourceBundle</code> instance. Then, <code>getBundle</code>
- * 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
* <code>foo/bar/Messages.properties</code> is found in the list and
* <code>getBundle</code> creates a <code>ResourceBundle</code> instance
* that becomes the parent of the instance for
@@ -2240,7 +2240,7 @@
* <li>For an input <code>Locale</code> with a variant value consisting
* of multiple subtags separated by underscore, generate candidate
* <code>Locale</code>s by omitting the variant subtags one by one, then
- * insert them after every occurence of <code> Locale</code>s with the
+ * insert them after every occurrence of <code> Locale</code>s with the
* full variant value in the original list. For example, if the
* the variant consists of two subtags <em>V1</em> and <em>V2</em>:
*
@@ -2843,7 +2843,7 @@
* and <code>variant</code> are the language, script, country, and variant
* values of <code>locale</code>, 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 <code>baseName</code>
* is returned.
*
--- a/jdk/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java Fri Nov 08 17:36:14 2013 -0800
@@ -946,7 +946,7 @@
}
/**
- * 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 @@
}
/**
- * 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
*/
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Fri Nov 08 17:36:14 2013 -0800
@@ -265,7 +265,7 @@
* 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,
--- a/jdk/src/share/classes/java/util/concurrent/ExecutorCompletionService.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/concurrent/ExecutorCompletionService.java Fri Nov 08 17:36:14 2013 -0800
@@ -161,7 +161,7 @@
* @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}
*/
--- a/jdk/src/share/classes/java/util/jar/Manifest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/jar/Manifest.java Fri Nov 08 17:36:14 2013 -0800
@@ -63,7 +63,7 @@
* 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);
--- a/jdk/src/share/classes/java/util/regex/Pattern.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/java/util/regex/Pattern.java Fri Nov 08 17:36:14 2013 -0800
@@ -2438,7 +2438,7 @@
// single 0x0B). This breaks the range if '\v' is used as
// the start or end value, such as [\v-...] or [...-\v], in
// which a single definite value (0x0B) is expected. For
- // compatiblity concern '\013'/0x0B is returned if isrange.
+ // compatibility concern '\013'/0x0B is returned if isrange.
if (isrange)
return '\013';
if (create) root = new VertWS();
--- a/jdk/src/share/classes/javax/accessibility/AccessibleContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -480,7 +480,7 @@
* 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).
* <p>Note that the AccessibleRole class is also extensible, so
--- a/jdk/src/share/classes/javax/accessibility/AccessibleText.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleText.java Fri Nov 08 17:36:14 2013 -0800
@@ -175,7 +175,7 @@
* 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();
--- a/jdk/src/share/classes/javax/crypto/NullCipher.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/crypto/NullCipher.java Fri Nov 08 17:36:14 2013 -0800
@@ -27,7 +27,7 @@
/**
* 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.
--- a/jdk/src/share/classes/javax/crypto/NullCipherSpi.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/crypto/NullCipherSpi.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,7 +30,7 @@
/**
* 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
--- a/jdk/src/share/classes/javax/imageio/IIOParam.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/IIOParam.java Fri Nov 08 17:36:14 2013 -0800
@@ -95,7 +95,7 @@
/**
* An <code>ImageTypeSpecifier</code> 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
* <code>null</code>. By default, the value is <code>null</code>.
*/
protected ImageTypeSpecifier destinationType = null;
--- a/jdk/src/share/classes/javax/imageio/ImageIO.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/ImageIO.java Fri Nov 08 17:36:14 2013 -0800
@@ -102,7 +102,7 @@
* into the registry for later retrieval.
*
* <p> 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 @@
* it is the responsibility of the caller to close the stream, if desired.
*
* @param im a <code>RenderedImage</code> to be written.
- * @param formatName a <code>String</code> containg the informal
+ * @param formatName a <code>String</code> containing the informal
* name of the format.
* @param output an <code>ImageOutputStream</code> to be written to.
*
@@ -1499,7 +1499,7 @@
* discarded.
*
* @param im a <code>RenderedImage</code> to be written.
- * @param formatName a <code>String</code> containg the informal
+ * @param formatName a <code>String</code> containing the informal
* name of the format.
* @param output a <code>File</code> to be written to.
*
@@ -1551,7 +1551,7 @@
* <code>getCacheDirectory</code> will be used to control caching.
*
* @param im a <code>RenderedImage</code> to be written.
- * @param formatName a <code>String</code> containg the informal
+ * @param formatName a <code>String</code> containing the informal
* name of the format.
* @param output an <code>OutputStream</code> to be written to.
*
--- a/jdk/src/share/classes/javax/imageio/ImageReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/ImageReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -632,7 +632,7 @@
* Returns the aspect ratio of the given image (that is, its width
* divided by its height) as a <code>float</code>. 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 @@
* not associated with any particular image). If no such data
* exists, <code>null</code> is returned.
*
- * <p> The resuting metadata object is only responsible for
+ * <p> The resulting metadata object is only responsible for
* returning documents in the format named by
* <code>formatName</code>. Within any documents that are
* returned, only nodes whose names are members of
@@ -855,7 +855,7 @@
* if the reader does not support reading metadata or none
* is available.
*
- * <p> The resuting metadata object is only responsible for
+ * <p> The resulting metadata object is only responsible for
* returning documents in the format named by
* <code>formatName</code>. Within any documents that are
* returned, only nodes whose names are members of
@@ -1435,7 +1435,7 @@
*
* <p> This method is merely a convenience equivalent to calling
* <code>read(int, ImageReadParam)</code> with a read param
- * specifiying a source region having offsets of
+ * specifying a source region having offsets of
* <code>tileX*getTileWidth(imageIndex)</code>,
* <code>tileY*getTileHeight(imageIndex)</code> and width and
* height of <code>getTileWidth(imageIndex)</code>,
@@ -1948,7 +1948,7 @@
*
* <p> 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
* <code>IIOReadUpdateListener</code>s. In general, progressive
* updating is most effective when fetching images over a network
* connection that is very slow compared to local CPU processing;
--- a/jdk/src/share/classes/javax/imageio/ImageWriteParam.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/ImageWriteParam.java Fri Nov 08 17:36:14 2013 -0800
@@ -253,7 +253,7 @@
* <code>false</code>. Subclasses must set the value manually.
*
* <p> 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 <code>false</code>.
*/
protected boolean canOffsetTiles = false;
@@ -803,7 +803,7 @@
*
* <ul>
* <li><code>MODE_DISABLED</code> - No progression. Use this to
- * turn off progession.
+ * turn off progression.
*
* <li><code>MODE_COPY_FROM_METADATA</code> - The output image
* will use whatever progression parameters are found in the
--- a/jdk/src/share/classes/javax/imageio/ImageWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/ImageWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -423,7 +423,7 @@
// 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 <code>-1</code> indicates that
@@ -923,7 +923,7 @@
* <p> The default implementation throws an
* <code>IllegalStateException</code> if the output is
* <code>null</code>, and otherwise returns <code>false</code>
- * withour checking the value of <code>imageIndex</code>.
+ * without checking the value of <code>imageIndex</code>.
*
* @param imageIndex the index at which the image is to be
* inserted.
--- a/jdk/src/share/classes/javax/imageio/event/IIOReadProgressListener.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/event/IIOReadProgressListener.java Fri Nov 08 17:36:14 2013 -0800
@@ -62,7 +62,7 @@
void sequenceStarted(ImageReader source, int minIndex);
/**
- * Reports that a sequence of read operationshas completed.
+ * Reports that a sequence of read operations has completed.
* <code>ImageReader</code> implementations are required to call
* this method exactly once from their
* <code>readAll(Iterator)</code> method.
--- a/jdk/src/share/classes/javax/imageio/event/IIOReadUpdateListener.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/event/IIOReadUpdateListener.java Fri Nov 08 17:36:14 2013 -0800
@@ -58,7 +58,7 @@
* @param source the <code>ImageReader</code> object calling this
* method.
* @param theImage the <code>BufferedImage</code> 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 @@
* method.
* @param theThumbnail the <code>BufferedImage</code> 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.
--- a/jdk/src/share/classes/javax/imageio/event/IIOReadWarningListener.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/event/IIOReadWarningListener.java Fri Nov 08 17:36:14 2013 -0800
@@ -46,7 +46,7 @@
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.
--- a/jdk/src/share/classes/javax/imageio/event/IIOWriteWarningListener.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/event/IIOWriteWarningListener.java Fri Nov 08 17:36:14 2013 -0800
@@ -46,7 +46,7 @@
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.
--- a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadata.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadata.java Fri Nov 08 17:36:14 2013 -0800
@@ -45,7 +45,7 @@
* 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 <code>ImageReader</code> and an
* <code>ImageWriter</code> for different image formats. To convert
* between two native formats as losslessly as the image file formats
@@ -130,9 +130,9 @@
/**
* Constructs an empty <code>IIOMetadata</code> 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,
* <code>extraMetadataFormatNames</code> should not have length 0.
*/
protected IIOMetadata() {}
@@ -475,7 +475,7 @@
* Alters the internal state of this <code>IIOMetadata</code>
* object from a tree of XML DOM <code>Node</code>s 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 <code>IIOInvalidTreeException</code> will be
* thrown.
--- a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
*
* <p> N.B: classes that implement this interface should contain a
* method declared as <code>public static getInstance()</code> 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 <code>getInstance</code>.
*
@@ -307,7 +307,7 @@
* with child policy <code>CHILD_POLICY_REPEAT</code>. 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 @@
/**
* Returns a <code>String</code> containing a description of the
- * named element, or <code>null</code>. The desciption will be
+ * named element, or <code>null</code>. The description will be
* localized for the supplied <code>Locale</code> if possible.
*
* <p> If <code>locale</code> is <code>null</code>, the current
@@ -434,8 +434,8 @@
/**
* Returns one of the constants starting with
* <code>DATATYPE_</code>, indicating the format and
- * interpretation of the value of the given attribute within th
- * enamed element. If <code>getAttributeValueType</code> returns
+ * interpretation of the value of the given attribute within the
+ * named element. If <code>getAttributeValueType</code> returns
* <code>VALUE_LIST</code>, then the legal value is a
* whitespace-spearated list of values of the returned datatype.
*
@@ -460,7 +460,7 @@
* @param elementName the name of the element being queried.
* @param attrName the name of the attribute being queried.
*
- * @return <code>true</code> if the attribut must be present.
+ * @return <code>true</code> if the attribute must be present.
*
* @exception IllegalArgumentException if <code>elementName</code>
* is <code>null</code> or is not a legal element name for this
@@ -473,7 +473,7 @@
/**
* 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
* <code>String</code>, or <code>null</code> if no default value
* is available.
*
@@ -624,7 +624,7 @@
/**
* Returns a <code>String</code> containing a description of the
- * named attribute, or <code>null</code>. The desciption will be
+ * named attribute, or <code>null</code>. The description will be
* localized for the supplied <code>Locale</code> if possible.
*
* <p> If <code>locale</code> is <code>null</code>, the current
@@ -725,7 +725,7 @@
* <code>VALUE_ENUMERATION</code>.
*
* <p> The <code>Object</code> 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 <code>==</code> operator (as
* opposed to the <code>Object.equals</code> method).
*
--- a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -234,7 +234,7 @@
* name will be equal to <code>this.getClass().getName() +
* "Resources"</code>.
*
- * @param resourceBaseName a <code>String</code> containg the new
+ * @param resourceBaseName a <code>String</code> containing the new
* base name.
*
* @exception IllegalArgumentException if
@@ -381,7 +381,7 @@
*
* @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 <code>elementName</code>
@@ -991,7 +991,7 @@
/**
* Returns a <code>String</code> containing a description of the
- * named element, or <code>null</code>. The desciption will be
+ * named element, or <code>null</code>. The description will be
* localized for the supplied <code>Locale</code> if possible.
*
* <p> The default implementation will first locate a
@@ -1129,7 +1129,7 @@
/**
* Returns a <code>String</code> containing a description of the
- * named attribute, or <code>null</code>. The desciption will be
+ * named attribute, or <code>null</code>. The description will be
* localized for the supplied <code>Locale</code> if possible.
*
* <p> The default implementation will first locate a
--- a/jdk/src/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html Fri Nov 08 17:36:14 2013 -0800
@@ -228,7 +228,7 @@
<!-- 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 -->
--- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java Fri Nov 08 17:36:14 2013 -0800
@@ -341,7 +341,7 @@
* @exception IOException if the attempt to instantiate
* the reader fails.
* @exception IllegalArgumentException if the
- * <code>ImageReader</code>'s contructor throws an
+ * <code>ImageReader</code>'s constructor throws an
* <code>IllegalArgumentException</code> to indicate that the
* extension object is unsuitable.
*/
--- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java Fri Nov 08 17:36:14 2013 -0800
@@ -538,7 +538,7 @@
* Returns an <code>IIOMetadataFormat</code> object describing the
* given image metadata format, or <code>null</code> 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
* <code>getExtraImageMetadataFormatNames</code>.
*
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java Fri Nov 08 17:36:14 2013 -0800
@@ -550,7 +550,7 @@
* 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 <code>s</code> to write to.
* @param len the maximum number of <code>short</code>s to read.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
@@ -575,7 +575,7 @@
* 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 <code>c</code> to write to.
* @param len the maximum number of <code>char</code>s to read.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
@@ -600,7 +600,7 @@
* 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 <code>i</code> to write to.
* @param len the maximum number of <code>int</code>s to read.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
@@ -625,7 +625,7 @@
* 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 <code>l</code> to write to.
* @param len the maximum number of <code>long</code>s to read.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
@@ -650,7 +650,7 @@
* 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 <code>f</code> to write to.
* @param len the maximum number of <code>float</code>s to read.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
@@ -675,7 +675,7 @@
* 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 <code>d</code> to write to.
* @param len the maximum number of <code>double</code>s to read.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
@@ -904,7 +904,7 @@
/**
* 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
* <code>IndexOutOfBoundsException</code>.
*
--- a/jdk/src/share/classes/javax/management/relation/RelationService.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/management/relation/RelationService.java Fri Nov 08 17:36:14 2013 -0800
@@ -132,7 +132,7 @@
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 @@
* <P>Will check the role according to its corresponding role definition
* provided in relation's relation type
* <P>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 @@
* <P>Will check the role according to its corresponding role definition
* provided in relation's relation type
* <P>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 @@
}
// 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)
--- a/jdk/src/share/classes/javax/management/relation/RelationServiceMBean.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/management/relation/RelationServiceMBean.java Fri Nov 08 17:36:14 2013 -0800
@@ -699,7 +699,7 @@
* <P>Will check the role according to its corresponding role definition
* provided in relation's relation type
* <P>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 @@
* <P>Will check the role according to its corresponding role definition
* provided in relation's relation type
* <P>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
--- a/jdk/src/share/classes/javax/management/remote/rmi/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/management/remote/rmi/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -95,7 +95,7 @@
<code>rmi</code> or <code>iiop</code> in the
<code><em>protocol</em></code> part of the
<code>serviceURL</code> 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 <code>RMIConnectorServer</code>
--- a/jdk/src/share/classes/javax/naming/Binding.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/naming/Binding.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,7 +48,7 @@
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
* <tt>setObject</tt>.
* @serial
* @see #getObject
--- a/jdk/src/share/classes/javax/naming/InsufficientResourcesException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/naming/InsufficientResourcesException.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,7 +30,7 @@
* 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.
*<p>
* InsufficientResourcesException is different from LimitExceededException in that
--- a/jdk/src/share/classes/javax/naming/ldap/LdapName.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapName.java Fri Nov 08 17:36:14 2013 -0800
@@ -432,7 +432,7 @@
* 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 @@
* 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 <tt>Rdn</tt>s to add.
* @param posn The index at which to add the suffix RDNs.
--- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java Fri Nov 08 17:36:14 2013 -0800
@@ -116,7 +116,7 @@
* Constructs an Rdn from the given attribute set. See
* {@link javax.naming.directory.Attributes Attributes}.
* <p>
- * The string attribute values are not interpretted as
+ * The string attribute values are not interpreted as
* <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
* formatted RDN strings. That is, the values are used
* literally (not parsed) and assumed to be unescaped.
@@ -179,7 +179,7 @@
/**
* 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
* <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
* formatted RDN strings. That is, the values are used
* literally (not parsed) and assumed to be unescaped.
@@ -215,7 +215,7 @@
/*
* 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
* <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
* formatted RDN strings. That is the values are used
* literally (not parsed) and assumed to be unescaped.
@@ -343,7 +343,7 @@
* components in multi-valued Rdns (such as "ou=Sales+cn=Bob") is not
* significant.
* <p>
- * Type and value equalilty matching is done as below:
+ * Type and value equality matching is done as below:
* <ul>
* <li> The types are compared for equality with their case ignored.
* <li> String values with different but equivalent usage of quoting,
@@ -605,7 +605,7 @@
--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 @@
}
// 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);
--- a/jdk/src/share/classes/javax/net/ssl/SSLPeerUnverifiedException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/net/ssl/SSLPeerUnverifiedException.java Fri Nov 08 17:36:14 2013 -0800
@@ -46,7 +46,7 @@
/**
* Constructs an exception reporting that the SSL peer's
- * identity has not been verifiied.
+ * identity has not been verified.
*
* @param reason describes the problem.
*/
--- a/jdk/src/share/classes/javax/net/ssl/SSLSocket.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java Fri Nov 08 17:36:14 2013 -0800
@@ -78,7 +78,7 @@
* </UL>
*
* <P>If handshaking fails for any reason, the <code>SSLSocket</code>
- * is closed, and no futher communications can be done.
+ * is closed, and no further communications can be done.
*
* <P>There are two groups of cipher suites which you will need to know
* about when managing cipher suites: <UL>
--- a/jdk/src/share/classes/javax/print/CancelablePrintJob.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/CancelablePrintJob.java Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
* Stops further processing of a print job.
* <p>
* 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.
--- a/jdk/src/share/classes/javax/print/DocFlavor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/DocFlavor.java Fri Nov 08 17:36:14 2013 -0800
@@ -95,7 +95,7 @@
* <UL>
* <LI>
* Character array (<CODE>char[]</CODE>) -- The print data consists of the
- * Unicde characters in the array.
+ * Unicode characters in the array.
* <P>
* <LI>
* <code>String</code> --
@@ -163,7 +163,7 @@
* 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.
--- a/jdk/src/share/classes/javax/print/DocPrintJob.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/DocPrintJob.java Fri Nov 08 17:36:14 2013 -0800
@@ -102,7 +102,7 @@
* 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
--- a/jdk/src/share/classes/javax/print/MultiDoc.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/MultiDoc.java Fri Nov 08 17:36:14 2013 -0800
@@ -117,7 +117,7 @@
* @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;
--- a/jdk/src/share/classes/javax/print/PrintService.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/PrintService.java Fri Nov 08 17:36:14 2013 -0800
@@ -118,7 +118,7 @@
/**
* 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
--- a/jdk/src/share/classes/javax/print/attribute/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/attribute/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -1,3 +1,4 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>javax.print.attribute package</title>
@@ -30,7 +31,6 @@
Provides classes and interfaces
that describe the types of Java<sup><font size="-2">TM</font></sup> Print
Service attributes and how they can be collected into attribute sets.
-<P>
<H3>What is an Attribute?</H3>
When setting up a print job,
a client specifies two things:
@@ -71,7 +71,6 @@
which it achieves the results specified by the processing instructions.
Representing processing instructions as descriptive items
provides more flexibility for implementing print jobs.
-<P>
<h4>Attribute Categories and Values</h4>
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 @@
All of these classes extend <A HREF="HashAttributeSet.html">HashAttributeSet</A>
and enforce the restriction that the attribute set is only allowed to contain
the corresponding kind of attribute.
-<P>
<H3>Attribute Class Design</H3>
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 @@
<code>Attribute</code>. Most attribute classes also extend the appropriate
abstract syntax class to get the implementation. Consider the
<code>Sides</code> attribute class:
+<blockquote>
<pre>
-<blockquote>
public class Sides
extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
@@ -311,8 +309,8 @@
}
...
}
+</pre>
</blockquote>
-</pre>
<p>
Since every attribute class implements <code>Attribute</code>, every attribute
class must provide an implementation for the
@@ -363,9 +361,8 @@
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:
-<p>
+<blockquote>
<pre>
-<blockquote>
FileInputStream psStream;
try {
@@ -392,8 +389,8 @@
job.print(myDoc, aset);
} catch (PrintException pe) {}
}
+</pre>
</blockquote>
-</pre>
<P>
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
--- a/jdk/src/share/classes/javax/print/attribute/standard/MediaTray.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaTray.java Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
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);
--- a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java Fri Nov 08 17:36:14 2013 -0800
@@ -56,56 +56,56 @@
/**
* 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);
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java Fri Nov 08 17:36:14 2013 -0800
@@ -39,7 +39,7 @@
* will accept jobs even when the {@link PrinterState PrinterState} is STOPPED.
* <P>
* <B>IPP Compatibility:</B> 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
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
@@ -59,7 +59,7 @@
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);
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java Fri Nov 08 17:36:14 2013 -0800
@@ -50,7 +50,7 @@
* 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.
* <P>
--- a/jdk/src/share/classes/javax/print/attribute/standard/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/attribute/standard/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -1,3 +1,4 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>javax.print.attribute.standard package</title>
@@ -199,7 +200,6 @@
so there is no restricted <A HREF="../AttributeSet.html">
AttributeSet</A>
subinterface for them.
-<P>
<H4>Attribute Table</H4>
The table below lists all the printing attributes.
@@ -213,7 +213,6 @@
lists the supported-values attribute class, if any,
with which a print service
indicates the supported values for that attribute category.
-<P>
<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Lists all printing attributes as described in above text">
<TR BGCOLOR="#E5E5E5">
<TH VALIGN="bottom">Attribute Class</TH>
--- a/jdk/src/share/classes/javax/print/event/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/event/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -1,3 +1,4 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>javax.print.event package</title>
@@ -30,7 +31,7 @@
Package javax.print.event contains event classes and listener interfaces.
<p>
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.
<P>
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
--- a/jdk/src/share/classes/javax/print/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/print/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -1,3 +1,4 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>javax.print package</title>
@@ -52,7 +53,7 @@
implementations of <code>PrintServiceLookup</code>. The print-service provider
can dynamically install these <code>PrintServiceLookup</code> implementations
using the
-<a href="../../../technotes/guides/jar/jar.html#Service Provider">
+<a href="../../../technotes/guides/jar/jar.html#Service%20Provider">
SPI JAR file specification</a>.
<h3>Attribute Definitions</h3>
@@ -69,7 +70,7 @@
<a href="http://www.ietf.org/rfc/rfc2911.txt">
RFC 2911 Internet Printing Protocol, 1.1: Model and Semantics</a>, dated
September 2000. The attributes specified in <code>javax.print.attribute.standard</code>
-include common capabilites, such as: resolution, copies, media sizes,
+include common capabilities, such as: resolution, copies, media sizes,
job priority, and page ranges.
<h3>Document Type Specification</h3>
@@ -105,9 +106,8 @@
of a Postscript document on size A4 paper, creating a print job from
one of the returned print services, and calling print.
-<p>
+<blockquote>
<pre>
-<blockquote>
FileInputStream psStream;
try {
psStream = new FileInputStream("file.ps");
@@ -132,8 +132,8 @@
job.print(myDoc, aset);
} catch (PrintException pe) {}
}
+</pre>
</blockquote>
-</pre>
<P>
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
--- a/jdk/src/share/classes/javax/script/AbstractScriptEngine.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/script/AbstractScriptEngine.java Fri Nov 08 17:36:14 2013 -0800
@@ -255,7 +255,7 @@
*
* @param script A <code>String</code> containing the source of the script.
* @return The return value from <code>eval(String, ScriptContext)</code>
- * @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 {
--- a/jdk/src/share/classes/javax/script/CompiledScript.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/script/CompiledScript.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
* Each <code>CompiledScript</code> is associated with a <code>ScriptEngine</code> -- A call to an <code>eval</code>
* method of the <code>CompiledScript</code> causes the execution of the script by the
* <code>ScriptEngine</code>. Changes in the state of the <code>ScriptEngine</code> caused by execution
- * of tne <code>CompiledScript</code> may visible during subsequent executions of scripts by the engine.
+ * of the <code>CompiledScript</code> may visible during subsequent executions of scripts by the engine.
*
* @author Mike Grogan
* @since 1.6
--- a/jdk/src/share/classes/javax/script/Invocable.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/script/Invocable.java Fri Nov 08 17:36:14 2013 -0800
@@ -51,7 +51,7 @@
* @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 @@
* @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.
*/
--- a/jdk/src/share/classes/javax/script/ScriptEngine.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/script/ScriptEngine.java Fri Nov 08 17:36:14 2013 -0800
@@ -114,7 +114,7 @@
*
* @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
* <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
* implementations.
* @throws NullPointerException if either argument is null.
@@ -132,7 +132,7 @@
*
* @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 @@
*
* @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 @@
*
* @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 @@
*
* @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 @@
*
* @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;
--- a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -142,7 +142,7 @@
/**
* 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;
* <p>
* <pre>{@code
@@ -178,7 +178,7 @@
/**
* 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;
* <p>
* <pre><code>
@@ -196,7 +196,7 @@
/**
- * 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:
* <p>
* <pre>{@code
--- a/jdk/src/share/classes/javax/security/sasl/RealmChoiceCallback.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/security/sasl/RealmChoiceCallback.java Fri Nov 08 17:36:14 2013 -0800
@@ -46,7 +46,7 @@
* @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
--- a/jdk/src/share/classes/javax/security/sasl/Sasl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/security/sasl/Sasl.java Fri Nov 08 17:36:14 2013 -0800
@@ -172,7 +172,7 @@
*
* 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";
--- a/jdk/src/share/classes/javax/security/sasl/SaslClient.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/security/sasl/SaslClient.java Fri Nov 08 17:36:14 2013 -0800
@@ -123,7 +123,7 @@
* @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
--- a/jdk/src/share/classes/javax/security/sasl/SaslException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/security/sasl/SaslException.java Fri Nov 08 17:36:14 2013 -0800
@@ -107,7 +107,7 @@
/**
* 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
--- a/jdk/src/share/classes/javax/smartcardio/CardChannel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/smartcardio/CardChannel.java Fri Nov 08 17:36:14 2013 -0800
@@ -122,7 +122,7 @@
/**
* 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.
*
* <p>The command buffer must contain valid command APDU data starting
* at <code>command.position()</code> and the APDU must be
--- a/jdk/src/share/classes/javax/smartcardio/CardTerminal.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/smartcardio/CardTerminal.java Fri Nov 08 17:36:14 2013 -0800
@@ -28,7 +28,7 @@
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()}.
--- a/jdk/src/share/classes/javax/sound/midi/MidiDevice.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/midi/MidiDevice.java Fri Nov 08 17:36:14 2013 -0800
@@ -60,7 +60,7 @@
* <code>Receiver</code> or <code>Transmitter</code> that resulted in
* opening it. If more than one implicitly opening
* <code>Receiver</code> or <code>Transmitter</code> were obtained by
- * the application, the decive is closed after the last
+ * the application, the device is closed after the last
* <code>Receiver</code> or <code>Transmitter</code> has been
* closed. On the other hand, calling <code>getReceiver</code> or
* <code>getTransmitter</code> on the device instance directly does
--- a/jdk/src/share/classes/javax/sound/midi/MidiMessage.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/midi/MidiMessage.java Fri Nov 08 17:36:14 2013 -0800
@@ -59,7 +59,7 @@
* <p>
* 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.
--- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java Fri Nov 08 17:36:14 2013 -0800
@@ -120,7 +120,7 @@
* is optional.
*
* <p>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
* <code>MidiDevice.Info</code> objects is retrieved
* from the provider. Otherwise, or when these devices
--- a/jdk/src/share/classes/javax/sound/midi/ShortMessage.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/midi/ShortMessage.java Fri Nov 08 17:36:14 2013 -0800
@@ -94,7 +94,7 @@
// 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
--- a/jdk/src/share/classes/javax/sound/midi/Soundbank.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/midi/Soundbank.java Fri Nov 08 17:36:14 2013 -0800
@@ -100,7 +100,7 @@
/**
* 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();
--- a/jdk/src/share/classes/javax/sound/midi/Synthesizer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/midi/Synthesizer.java Fri Nov 08 17:36:14 2013 -0800
@@ -212,7 +212,7 @@
* @param from the <code>Instrument</code> object to be replaced
* @param to the <code>Instrument</code> object to be used in place
* of the old instrument, it should be loaded into the synthesizer
- * @return <code>true</code> if the instrument succeessfully remapped,
+ * @return <code>true</code> if the instrument successfully remapped,
* <code>false</code> if feature is not implemented by synthesizer
* @throws IllegalArgumentException if instrument
* <code>from</code> or instrument <code>to</code> aren't supported by
--- a/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,7 +31,7 @@
/**
* <code>AudioFormat</code> 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.
* <p>
* Every data line has an audio format associated with its data stream. The audio format of a source (playback) data line indicates
--- a/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java Fri Nov 08 17:36:14 2013 -0800
@@ -115,7 +115,7 @@
* is optional.
*
* <p>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
* <code>Mixer.Info</code> objects is retrieved
* from the provider. Otherwise, or when these mixers
* do not provide a subsequent match, the list is retrieved
--- a/jdk/src/share/classes/javax/sound/sampled/ReverbType.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sound/sampled/ReverbType.java Fri Nov 08 17:36:14 2013 -0800
@@ -42,7 +42,7 @@
* 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.
--- a/jdk/src/share/classes/javax/sql/PooledConnection.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/PooledConnection.java Fri Nov 08 17:36:14 2013 -0800
@@ -73,7 +73,7 @@
* if a fatal error has made the connection unusable.
*
* <p>
- * 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 <code>PreparedStatement</code> objects.
* When an application closes a prepared statement, it calls the
* <code>PreparedStatement</code>
--- a/jdk/src/share/classes/javax/sql/RowSet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/RowSet.java Fri Nov 08 17:36:14 2013 -0800
@@ -206,7 +206,7 @@
int getTransactionIsolation();
/**
- * Sets the transaction isolation level for this <code>RowSet</code> obejct.
+ * Sets the transaction isolation level for this <code>RowSet</code> object.
*
* @param level the transaction isolation level; one of
* <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
@@ -1438,7 +1438,7 @@
* 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 @@
* @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 <code>CallableStatement</code>
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
@@ -1956,7 +1956,7 @@
void setRowId(String parameterName, RowId x) throws SQLException;
/**
- * Sets the designated paramter to the given <code>String</code> object.
+ * Sets the designated parameter to the given <code>String</code> object.
* The driver converts this to a SQL <code>NCHAR</code> or
* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
* (depending on the argument's
@@ -1973,7 +1973,7 @@
void setNString(int parameterIndex, String value) throws SQLException;
/**
- * Sets the designated paramter to the given <code>String</code> object.
+ * Sets the designated parameter to the given <code>String</code> object.
* The driver converts this to a SQL <code>NCHAR</code> or
* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>
* @param parameterName the name of the column to be set
--- a/jdk/src/share/classes/javax/sql/StatementEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/StatementEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -53,7 +53,7 @@
* <p>
* @param con The <code>PooledConnection</code> that the closed or invalid
* <code>PreparedStatement</code>is associated with.
- * @param statement The <code>PreparedStatement</code> that is bieng closed or is invalid
+ * @param statement The <code>PreparedStatement</code> that is being closed or is invalid
* <p>
* @throws IllegalArgumentException if <code>con</code> is null.
*
--- a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java Fri Nov 08 17:36:14 2013 -0800
@@ -211,7 +211,7 @@
* to the driver or the DBMS. For example, the methods <code>setDate</code>,
* <code>setTime</code>, and <code>setTimestamp</code> can take a <code>Calendar</code>
* object as their third parameter. If the DBMS does not store time zone information,
- * the drivern uses the <code>Calendar</code> object to construct the <code>Date</code>,
+ * the driver uses the <code>Calendar</code> object to construct the <code>Date</code>,
* <code>Time</code>, or <code>Timestamp</code> object being set. As is true with other
* methods that provide additional information, the element in the array returned
* by <code>getParams</code> is an array instead of a simple <code>Object</code> instance.
@@ -3162,7 +3162,7 @@
* @return an array of <code>Object</code> instances that includes the
* parameter values that may be set in this <code>RowSet</code> 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 <code>RowSet</code> object or if not all parameters have
* been set
*/
@@ -3810,7 +3810,7 @@
* 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 @@
* @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 <code>CallableStatement</code>
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
@@ -4253,7 +4253,7 @@
}
/**
- * Sets the designated paramter to the given <code>String</code> object.
+ * Sets the designated parameter to the given <code>String</code> object.
* The driver converts this to a SQL <code>NCHAR</code> or
* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
* (depending on the argument's
@@ -4275,7 +4275,7 @@
/**
- * Sets the designated paramter to the given <code>String</code> object.
+ * Sets the designated parameter to the given <code>String</code> object.
* The driver converts this to a SQL <code>NCHAR</code> or
* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>
* @param parameterName the name of the column to be set
--- a/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java Fri Nov 08 17:36:14 2013 -0800
@@ -1104,7 +1104,7 @@
public SyncProvider getSyncProvider() throws SQLException;
/**
- * Sets the <code>SyncProvider</code> objec for this <code>CachedRowSet</code>
+ * Sets the <code>SyncProvider</code> object for this <code>CachedRowSet</code>
* object to the one specified. This method
* allows the <code>SyncProvider</code> object to be reset.
* <P>
@@ -1173,7 +1173,7 @@
* the last synchronization with the underlying data source. If there have been
* no synchronizations, the original value will be the value with which the
* <code>RowSet</code> object was populated. This method is called internally
- * when an aplication calls the method <code>acceptChanges</code> and the
+ * when an application calls the method <code>acceptChanges</code> and the
* <code>SyncProvider</code> 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.
--- a/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java Fri Nov 08 17:36:14 2013 -0800
@@ -359,7 +359,7 @@
* <code>RowSet</code> objects that have been added to this
* <code>JoinRowSet</code> object.
* This should return the 'n' number of RowSet contained
- * within the <code>JOIN</code> and maintain any updates that have occured while in
+ * within the <code>JOIN</code> and maintain any updates that have occurred while in
* this union.
*
* @return a <code>Collection</code> object consisting of the
--- a/jdk/src/share/classes/javax/sql/rowset/Joinable.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/Joinable.java Fri Nov 08 17:36:14 2013 -0800
@@ -76,7 +76,7 @@
* jrs.addRowSet(crs);
* </pre>
* In the previous example, <i>crs</i> is a <code>CachedRowSet</code> object that
- * has emplemented the <code>Joinable</code> interface. In the following example,
+ * has implemented the <code>Joinable</code> interface. In the following example,
* <i>crs2</i> has not, so it must supply the match column as an argument to the
* <code>addRowSet</code> method. This example assumes that column 1 is the match
* column.
@@ -250,7 +250,7 @@
* Unsets the designated columns as the match column for this <code>RowSet</code>
* object.
*
- * @param columnIdxes an arrary of <code>int</code> that identifies the indexes
+ * @param columnIdxes an array of <code>int</code> 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
--- a/jdk/src/share/classes/javax/sql/rowset/Predicate.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/Predicate.java Fri Nov 08 17:36:14 2013 -0800
@@ -131,7 +131,7 @@
* SQL index of a column in this <code>RowSet</code> object. This must
* have been passed to <code>Predicate</code> as one of the columns
* for filtering while initializing a <code>Predicate</code>
- * @return <code>true</code> ifrow value lies within the filter;
+ * @return <code>true</code> if row value lies within the filter;
* <code>false</code> otherwise
* @throws SQLException if the column is not part of filtering criteria
*/
--- a/jdk/src/share/classes/javax/sql/rowset/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -43,7 +43,7 @@
<ul>
<li><a href="#pkgspec">1.0 Package Specification</a>
<li><a href="#stdrowset">2.0 Standard RowSet Definitions</a>
-<li><a href="#impl">3.0 Implementater's Guide</a>
+<li><a href="#impl">3.0 Implementer's Guide</a>
<li><a href="#relspec">4.0 Related Specifications</a>
<li><a href="#reldocs">5.0 Related Documentation</a>
</ul>
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -71,7 +71,7 @@
* <code>WebRowSet</code> objects
* </UL>
* Note that the JDBC RowSet Implementations include the <code>SyncProvider</code>
- * implemtations <code>RIOptimisticProvider</code> and <code>RIXmlProvider</code>,
+ * implementations <code>RIOptimisticProvider</code> and <code>RIXmlProvider</code>,
* which satisfy this requirement.
* <P>
* The <code>SyncFactory</code> class provides accessor methods to assist
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java Fri Nov 08 17:36:14 2013 -0800
@@ -264,10 +264,10 @@
public static int INSERT_ROW_CONFLICT = 2;
/**
- * Indicates that <b>no</b> conflict occured while the <code>RowSet</code> object
+ * Indicates that <b>no</b> conflict occurred while the <code>RowSet</code> object
* was attempting to update, delete or insert a row in the data source. The values in
* the <code>SyncResolver</code> will contain <code>null</code> 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;
--- a/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,10 +37,10 @@
* <code>SyncProvider</code> abstract class so that it has finer grained
* transaction control.
* <p>
- * If one or more disconnected <code>RowSet</code> objects are particating
+ * If one or more disconnected <code>RowSet</code> 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 <code>CachedRowSet</code> constant <code>COMMIT_ON_ACCEPT_CHANGES</code>
* to <code>false</code> and use the <code>commit</code> and <code>rollback</code>
* methods defined in this interface to manage transaction boundaries.
--- a/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
* <P>
* <code>SyncProvider</code> implementations that supply XML data reader
* capabilities such as output XML stream capabilities can implement this
- * interface to provider standard <code>XmlReader</code> objects to
+ * interface to provide standard <code>XmlReader</code> objects to
* <code>WebRowSet</code> implementations.
* <p>
* An <code>XmlReader</code> object is registered as the
--- a/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
* <p>
* <code>SyncProvider</code> implementations that supply XML data writer
* capabilities such as output XML stream capabilities can implement this
- * interface to provider standard <code>XmlWriter</code> objects to
+ * interface to provide standard <code>XmlWriter</code> objects to
* <code>WebRowSet</code> implementations.
* <P>
* Writing a <code>WebRowSet</code> object includes printing the
--- a/jdk/src/share/classes/javax/swing/AbstractButton.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/AbstractButton.java Fri Nov 08 17:36:14 2013 -0800
@@ -330,7 +330,7 @@
/**
* Sets the state of the button. Note that this method does not
* trigger an <code>actionEvent</code>.
- * Call <code>doClick</code> to perform a programatic action change.
+ * Call <code>doClick</code> to perform a programmatic action change.
*
* @param b true if the button is selected, otherwise false
*/
@@ -2928,7 +2928,7 @@
* 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() {
--- a/jdk/src/share/classes/javax/swing/Action.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/Action.java Fri Nov 08 17:36:14 2013 -0800
@@ -98,10 +98,10 @@
* summary="Supported Action properties"
* valign="top" >
* <tr valign="top" align="left">
- * <th bgcolor="#CCCCFF" align="left">Component Property
- * <th bgcolor="#CCCCFF" align="left">Components
- * <th bgcolor="#CCCCFF" align="left">Action Key
- * <th bgcolor="#CCCCFF" align="left">Notes
+ * <th style="background-color:#CCCCFF" align="left">Component Property
+ * <th style="background-color:#CCCCFF" align="left">Components
+ * <th style="background-color:#CCCCFF" align="left">Action Key
+ * <th style="background-color:#CCCCFF" align="left">Notes
* <tr valign="top" align="left">
* <td><b><code>enabled</code></b>
* <td>All
--- a/jdk/src/share/classes/javax/swing/BoxLayout.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/BoxLayout.java Fri Nov 08 17:36:14 2013 -0800
@@ -338,7 +338,7 @@
* 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
--- a/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -786,7 +786,7 @@
* leadIndex and newLeadIndex is the new one.
* <p>
* 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.
* <p>
* Generate a single event for this change and notify all listeners.
--- a/jdk/src/share/classes/javax/swing/DefaultRowSorter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/DefaultRowSorter.java Fri Nov 08 17:36:14 2013 -0800
@@ -53,7 +53,7 @@
* <code>Collator.getInstance()</code> is used on the results of
* calling <code>toString</code> on the underlying objects. The
* <code>Comparator</code> is never passed <code>null</code>. A
- * <code>null</code> value is treated as occuring before a
+ * <code>null</code> value is treated as occurring before a
* non-<code>null</code> value, and two <code>null</code> values are
* considered equal.
* <p>
--- a/jdk/src/share/classes/javax/swing/GroupLayout.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/GroupLayout.java Fri Nov 08 17:36:14 2013 -0800
@@ -79,7 +79,7 @@
* 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.
- * <p align="center">
+ * <p style="text-align:center">
* <img src="doc-files/groupLayout.1.gif">
* <p>
* To reinforce that each axis is treated independently the diagram shows
@@ -101,7 +101,7 @@
* parallel group along the horizontal axis and the sequential group along
* the vertical axis.
* <p>
- * <p align="center">
+ * <p style="text-align:center">
* <img src="doc-files/groupLayout.2.gif">
* <p>
* As {@code c1} is the largest of the three components, the parallel
@@ -115,7 +115,7 @@
* <p>
* The following diagram shows a sequential group along both the horizontal
* and vertical axis.
- * <p align="center">
+ * <p style="text-align:center">
* <img src="doc-files/groupLayout.3.gif">
* <p>
* {@code GroupLayout} provides the ability to insert gaps between
@@ -172,7 +172,7 @@
* </pre>
* <p>
* When run the following is produced.
- * <p align="center">
+ * <p style="text-align:center">
* <img src="doc-files/groupLayout.example.png">
* <p>
* This layout consists of the following.
@@ -382,7 +382,7 @@
}
/**
- * 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 @@
* <p>
* 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 @@
}
/**
- * 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 @@
}
/**
- * 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 @@
* setHonorsVisibility} should be used.
* <p>
* 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 @@
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 @@
// 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 @@
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) {
--- a/jdk/src/share/classes/javax/swing/ImageIcon.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/ImageIcon.java Fri Nov 08 17:36:14 2013 -0800
@@ -80,8 +80,20 @@
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 {
--- a/jdk/src/share/classes/javax/swing/JApplet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JApplet.java Fri Nov 08 17:36:14 2013 -0800
@@ -46,9 +46,10 @@
* <code>java.applet.Applet</code>. <code>JApplet</code> contains a
* <code>JRootPane</code> as its only child. The <code>contentPane</code>
* should be the parent of any children of the <code>JApplet</code>.
- * As a convenience <code>add</code> and its variants, <code>remove</code> and
- * <code>setLayout</code> have been overridden to forward to the
- * <code>contentPane</code> 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:
* <pre>
* applet.add(child);
* </pre>
@@ -256,7 +257,7 @@
* <code>setLayout</code> are forwarded to the <code>contentPane</code>.
*
* @return true if <code>add</code> and <code>setLayout</code>
- * are fowarded; false otherwise
+ * are forwarded; false otherwise
*
* @see #addImpl
* @see #setLayout
--- a/jdk/src/share/classes/javax/swing/JComboBox.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JComboBox.java Fri Nov 08 17:36:14 2013 -0800
@@ -2143,7 +2143,7 @@
* 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).
* <p>Note that the AccessibleRole class is also extensible, so
--- a/jdk/src/share/classes/javax/swing/JComponent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JComponent.java Fri Nov 08 17:36:14 2013 -0800
@@ -316,7 +316,7 @@
/**
* <code>JPopupMenu</code> assigned to this component
- * and all of its childrens
+ * and all of its children
*/
private JPopupMenu popupMenu;
@@ -2020,7 +2020,7 @@
/**
* This method is now obsolete, please use a combination of
* <code>getActionMap()</code> and <code>getInputMap()</code> for
- * similiar behavior. For example, to bind the <code>KeyStroke</code>
+ * similar behavior. For example, to bind the <code>KeyStroke</code>
* <code>aKeyStroke</code> to the <code>Action</code> <code>anAction</code>
* now use:
* <pre>
@@ -2207,7 +2207,7 @@
/**
* This method is now obsolete, please use a combination of
* <code>getActionMap()</code> and <code>getInputMap()</code> for
- * similiar behavior.
+ * similar behavior.
*/
public void registerKeyboardAction(ActionListener anAction,KeyStroke aKeyStroke,int aCondition) {
registerKeyboardAction(anAction,null,aKeyStroke,aCondition);
@@ -5236,7 +5236,7 @@
*
* @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,
--- a/jdk/src/share/classes/javax/swing/JDialog.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JDialog.java Fri Nov 08 17:36:14 2013 -0800
@@ -44,9 +44,10 @@
* 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:
* <pre>
* dialog.add(child);
* </pre>
@@ -862,7 +863,7 @@
* {@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 @@
* This method is called by the constructor.
* <p>
* 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
--- a/jdk/src/share/classes/javax/swing/JFileChooser.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JFileChooser.java Fri Nov 08 17:36:14 2013 -0800
@@ -134,7 +134,7 @@
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;
--- a/jdk/src/share/classes/javax/swing/JFormattedTextField.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JFormattedTextField.java Fri Nov 08 17:36:14 2013 -0800
@@ -126,14 +126,14 @@
* policy is <code>JFormattedTextField.PERSIST</code>
* and the <code>JFormattedTextField</code> has been edited, the
* <code>AbstractFormatterFactory</code> 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
* <code>JFormattedTextField.COMMIT</code> and an exception
* is thrown from <code>stringToValue</code>, the
- * <code>AbstractFormatterFactory</code> will not be querired when focus is
+ * <code>AbstractFormatterFactory</code> will not be queried when focus is
* lost or gained.
* <p>
* <code>JFormattedTextField.AbstractFormatter</code>
- * is also responsible for determining when values are commited to
+ * is also responsible for determining when values are committed to
* the <code>JFormattedTextField</code>. Some
* <code>JFormattedTextField.AbstractFormatter</code>s will make new values
* available on every edit, and others will never commit the value. You can
@@ -184,7 +184,7 @@
/**
* Constant identifying that when focus is lost,
- * <code>commitEdit</code> should be invoked. If in commiting the
+ * <code>commitEdit</code> should be invoked. If in committing the
* new value a <code>ParseException</code> is thrown, the invalid
* value will remain.
*
@@ -194,7 +194,7 @@
/**
* Constant identifying that when focus is lost,
- * <code>commitEdit</code> should be invoked. If in commiting the new
+ * <code>commitEdit</code> should be invoked. If in committing the new
* value a <code>ParseException</code> is thrown, the value will be
* reverted.
*
@@ -878,7 +878,7 @@
* Instances of <code>AbstractFormatter</code> are used by
* <code>JFormattedTextField</code> to handle the conversion both
* from an Object to a String, and back from a String to an Object.
- * <code>AbstractFormatter</code>s can also enfore editing policies,
+ * <code>AbstractFormatter</code>s can also enforce editing policies,
* or navigation policies, or manipulate the
* <code>JFormattedTextField</code> in any way it sees fit to
* enforce the desired policy.
@@ -1116,7 +1116,7 @@
((JFormattedTextField)target).commitEdit();
} catch (ParseException pe) {
((JFormattedTextField)target).invalidEdit();
- // value not commited, don't notify ActionListeners
+ // value not committed, don't notify ActionListeners
return;
}
}
--- a/jdk/src/share/classes/javax/swing/JFrame.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JFrame.java Fri Nov 08 17:36:14 2013 -0800
@@ -50,9 +50,10 @@
* as a rule, contain
* all the non-menu components displayed by the <code>JFrame</code>.
* This is different from the AWT <code>Frame</code> case.
- * As a conveniance <code>add</code> and its variants, <code>remove</code> and
- * <code>setLayout</code> have been overridden to forward to the
- * <code>contentPane</code> 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:
* <pre>
* frame.add(child);
* </pre>
@@ -505,7 +506,7 @@
* <code>setLayout</code> are forwarded to the <code>contentPane</code>.
*
* @return true if <code>add</code> and <code>setLayout</code>
- * are fowarded; false otherwise
+ * are forwarded; false otherwise
*
* @see #addImpl
* @see #setLayout
@@ -673,7 +674,7 @@
* This method is called by the constructor.
* <p>
* Swing's painting architecture requires an opaque <code>JComponent</code>
- * 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</code>.
*
--- a/jdk/src/share/classes/javax/swing/JInternalFrame.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java Fri Nov 08 17:36:14 2013 -0800
@@ -63,9 +63,10 @@
* <p>
* The <code>JInternalFrame</code> content pane
* is where you add child components.
- * As a conveniance <code>add</code> and its variants, <code>remove</code> and
- * <code>setLayout</code> have been overridden to forward to the
- * <code>contentPane</code> 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:
* <pre>
* internalFrame.add(child);
* </pre>
@@ -445,7 +446,7 @@
* <code>setLayout</code> are forwarded to the <code>contentPane</code>.
*
* @return true if <code>add</code> and <code>setLayout</code>
- * are fowarded; false otherwise
+ * are forwarded; false otherwise
*
* @see #addImpl
* @see #setLayout
--- a/jdk/src/share/classes/javax/swing/JLabel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JLabel.java Fri Nov 08 17:36:14 2013 -0800
@@ -1457,7 +1457,7 @@
* 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() {
--- a/jdk/src/share/classes/javax/swing/JLayeredPane.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java Fri Nov 08 17:36:14 2013 -0800
@@ -168,7 +168,7 @@
/** 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 @@
/**
* 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
--- a/jdk/src/share/classes/javax/swing/JMenu.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JMenu.java Fri Nov 08 17:36:14 2013 -0800
@@ -495,7 +495,7 @@
* In most cases, the delay is not observed for top level menus
* or while dragging. The default for <code>delay</code> 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 <code>delay</code> property
@@ -510,7 +510,7 @@
* 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 <code>d</code>
--- a/jdk/src/share/classes/javax/swing/JPasswordField.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JPasswordField.java Fri Nov 08 17:36:14 2013 -0800
@@ -348,7 +348,7 @@
/**
* 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.
--- a/jdk/src/share/classes/javax/swing/JPopupMenu.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java Fri Nov 08 17:36:14 2013 -0800
@@ -1104,7 +1104,7 @@
/**
* Returns the margin, in pixels, between the popup menu's border and
- * its containees.
+ * its containers.
*
* @return an <code>Insets</code> object containing the margin values.
*/
--- a/jdk/src/share/classes/javax/swing/JRootPane.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JRootPane.java Fri Nov 08 17:36:14 2013 -0800
@@ -161,7 +161,7 @@
* <p>
* The painting architecture of Swing requires an opaque
* <code>JComponent</code>
- * 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 <code>setOpaque(true)</code>. Additionally, if the content pane
@@ -608,7 +608,7 @@
* parented by the root pane.
* <p>
* Swing's painting architecture requires an opaque <code>JComponent</code>
- * 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</code>.
*
@@ -741,7 +741,7 @@
* On the other hand, the <code>glassPane</code>
* is normally not visible, and so this can return true if the
* <code>glassPane</code> isn't visible. Therefore, the
- * return value here depends upon the visiblity of the
+ * return value here depends upon the visibility of the
* <code>glassPane</code>.
*
* @return true if this component's children don't overlap
--- a/jdk/src/share/classes/javax/swing/JSlider.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JSlider.java Fri Nov 08 17:36:14 2013 -0800
@@ -662,7 +662,7 @@
/**
* Returns the "extent" from the <code>BoundedRangeModel</code>.
- * 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
--- a/jdk/src/share/classes/javax/swing/JSpinner.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JSpinner.java Fri Nov 08 17:36:14 2013 -0800
@@ -545,7 +545,7 @@
* 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 @@
* 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).
* <p>Note that the AccessibleRole class is also extensible, so
@@ -1889,7 +1889,7 @@
* 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();
--- a/jdk/src/share/classes/javax/swing/JSplitPane.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JSplitPane.java Fri Nov 08 17:36:14 2013 -0800
@@ -828,7 +828,7 @@
* Returns the last value passed to <code>setDividerLocation</code>.
* The value returned from this method may differ from the actual
* divider location (if <code>setDividerLocation</code> was passed a
- * value bigger than the curent size).
+ * value bigger than the current size).
*
* @return an integer specifying the location of the divider
*/
--- a/jdk/src/share/classes/javax/swing/JTable.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JTable.java Fri Nov 08 17:36:14 2013 -0800
@@ -2991,7 +2991,7 @@
/**
* 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 <code>JTable</code>'s
@@ -3014,7 +3014,7 @@
* The modes are:
* <ul>
* <li> 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
* <code>Viewport</code>. If the <code>JTable</code> is not
* enclosed in a <code>JScrollPane</code> this may
@@ -3104,7 +3104,7 @@
* <P>
* 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.
*
* <H4>Details</H4>
* <P>
--- a/jdk/src/share/classes/javax/swing/JViewport.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JViewport.java Fri Nov 08 17:36:14 2013 -0800
@@ -463,7 +463,7 @@
// 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 @@
* Returns the insets (border) dimensions as (0,0,0,0), since borders
* are not supported on a <code>JViewport</code>.
*
- * @return a <code>Rectange</code> of zero dimension and zero origin
+ * @return a <code>Rectangle</code> of zero dimension and zero origin
* @see #setBorder
*/
public final Insets getInsets() {
--- a/jdk/src/share/classes/javax/swing/JWindow.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/JWindow.java Fri Nov 08 17:36:14 2013 -0800
@@ -43,9 +43,10 @@
* The <code>JWindow</code> component contains a <code>JRootPane</code>
* as its only child. The <code>contentPane</code> should be the parent
* of any children of the <code>JWindow</code>.
- * As a conveniance <code>add</code> and its variants, <code>remove</code> and
- * <code>setLayout</code> have been overridden to forward to the
- * <code>contentPane</code> 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:
* <pre>
* window.add(child);
* </pre>
@@ -286,7 +287,7 @@
* <code>setLayout</code> are forwarded to the <code>contentPane</code>.
*
* @return true if <code>add</code> and <code>setLayout</code>
- * are fowarded; false otherwise
+ * are forwarded; false otherwise
*
* @see #addImpl
* @see #setLayout
--- a/jdk/src/share/classes/javax/swing/LookAndFeel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java Fri Nov 08 17:36:14 2013 -0800
@@ -74,7 +74,7 @@
* 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.
* <p>
* When a {@code LookAndFeel} is installed the {@code UIManager} does
@@ -114,7 +114,7 @@
* <p>
* 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.
* <p>
* {@code ComponentUI} implementations should use the various install methods
@@ -269,7 +269,7 @@
*/
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")) {
--- a/jdk/src/share/classes/javax/swing/ProgressMonitor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/ProgressMonitor.java Fri Nov 08 17:36:14 2013 -0800
@@ -650,7 +650,7 @@
* 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).
* <p>Note that the AccessibleRole class is also extensible, so
@@ -1017,7 +1017,7 @@
* 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();
--- a/jdk/src/share/classes/javax/swing/RepaintManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/RepaintManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -698,7 +698,7 @@
/**
* 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.
*/
--- a/jdk/src/share/classes/javax/swing/RootPaneContainer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/RootPaneContainer.java Fri Nov 08 17:36:14 2013 -0800
@@ -45,18 +45,18 @@
* dropping a component on a RootPaneContainer would be interpreted
* as <code>frame.getContentPane().add(child)</code>.
* <p>
- * For conveniance
- * <code>JFrame</code>, <code>JDialog</code>, <code>JWindow</code>,
- * <code>JApplet</code> and <code>JInternalFrame</code>, by default,
- * forward, by default, all calls to the <code>add</code>,
- * <code>remove</code> and <code>setLayout</code> methods, to the
- * <code>contentPane</code>. 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:
* <pre>
- * rootPaneContainer.add(component);
+ * frame.add(child);
* </pre>
* instead of:
* <pre>
- * rootPaneContainer.getContentPane().add(component);
+ * frame.getContentPane().add(child);
* </pre>
* <p>
* The behavior of the <code>add</code> and
--- a/jdk/src/share/classes/javax/swing/ScrollPaneConstants.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/ScrollPaneConstants.java Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
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
--- a/jdk/src/share/classes/javax/swing/SpinnerDateModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/SpinnerDateModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -67,7 +67,7 @@
* <li><code>Calendar.SECOND</code>
* <li><code>Calendar.MILLISECOND</code>
* </ul>
- * 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.
* <p>
@@ -133,7 +133,7 @@
* upper or lower bound. If <code>value</code> or
* <code>calendarField</code> is <code>null</code>, or if both
* <code>start</code> and <code>end</code> are specified and
- * <code>mininum > maximum</code> then an
+ * <code>minimum > maximum</code> then an
* <code>IllegalArgumentException</code> is thrown.
* Similarly if <code>(minimum <= value <= maximum)</code> is false,
* an IllegalArgumentException is thrown.
@@ -310,7 +310,7 @@
* simply move the specified <code>Calendar</code> field forward or backward
* by one unit with the <code>Calendar.add</code> 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.
*
--- a/jdk/src/share/classes/javax/swing/SpinnerModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/SpinnerModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -33,7 +33,7 @@
* A model for a potentially unbounded sequence of object values. This model
* is similar to <code>ListModel</code> however there are some important differences:
* <ul>
- * <li> The number of sequence elements isn't neccessarily bounded.
+ * <li> The number of sequence elements isn't necessarily bounded.
* <li> 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 @@
* last element of the sequence.
*
* <dt><code>previousValue</code>
- * <dd>The preceeding element or null if <code>value</code> is the
+ * <dd>The preceding element or null if <code>value</code> is the
* first element of the sequence.
* </dl>
* When the the <code>value</code> property changes,
--- a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -102,7 +102,7 @@
* have an upper or lower bound.
* If <code>value</code> or <code>stepSize</code> is <code>null</code>,
* or if both <code>minimum</code> and <code>maximum</code>
- * are specified and <code>mininum > maximum</code> then an
+ * are specified and <code>minimum > maximum</code> then an
* <code>IllegalArgumentException</code> is thrown.
* Similarly if <code>(minimum <= value <= maximum</code>) is false,
* an <code>IllegalArgumentException</code> is thrown.
--- a/jdk/src/share/classes/javax/swing/SpringLayout.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/SpringLayout.java Fri Nov 08 17:36:14 2013 -0800
@@ -286,7 +286,7 @@
* as EAST - WIDTH.
* <p>
* [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.]
* <p>
* <b>Note</b>: In this document,
@@ -1167,7 +1167,7 @@
* 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
--- a/jdk/src/share/classes/javax/swing/SwingUtilities.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/SwingUtilities.java Fri Nov 08 17:36:14 2013 -0800
@@ -1337,7 +1337,7 @@
* <code>java.awt.EventQueue.invokeAndWait()</code>.
*
* @exception InterruptedException if we're interrupted while waiting for
- * the event dispatching thread to finish excecuting
+ * the event dispatching thread to finish executing
* <code>doRun.run()</code>
* @exception InvocationTargetException if an exception is thrown
* while running <code>doRun</code>
--- a/jdk/src/share/classes/javax/swing/ToolTipManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/ToolTipManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* 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 <code>initialDelay</code> milliseconds. After
+ * visible after <code>initialDelay</code> milliseconds. After
* <code>dismissDelay</code> 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
--- a/jdk/src/share/classes/javax/swing/TransferHandler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/TransferHandler.java Fri Nov 08 17:36:14 2013 -0800
@@ -759,7 +759,7 @@
* returns. Should the clipboard be unavailable when attempting to place
* data on it, the <code>IllegalStateException</code> thrown by
* {@link Clipboard#setContents(Transferable, ClipboardOwner)} will
- * be propogated through this method. However,
+ * be propagated through this method. However,
* <code>exportDone</code> will first be called with an action
* of <code>NONE</code> for consistency.
*
--- a/jdk/src/share/classes/javax/swing/UIManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/UIManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -126,7 +126,7 @@
* current look and feel ({@code setLookAndFeel()} is invoked). The
* look and feel defaults can be obtained using the {@code
* getLookAndFeelDefaults()} method.
- * <li>Sytem defaults. The system defaults are provided by Swing.
+ * <li>System defaults. The system defaults are provided by Swing.
* </ol>
* Invoking any of the various {@code get} methods
* results in checking each of the defaults, in order, returning
@@ -152,7 +152,7 @@
* 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 @@
*
* @param name a <code>String</code> specifying the name of
* the look and feel
- * @param className a <code>String</code> specifiying the name of
+ * @param className a <code>String</code> specifying the name of
* the class that implements the look and feel
*/
public LookAndFeelInfo(String name, String className) {
--- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java Fri Nov 08 17:36:14 2013 -0800
@@ -45,7 +45,7 @@
* specified position and justification.
* <p>
* 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:
--- a/jdk/src/share/classes/javax/swing/border/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/border/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/colorchooser/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/colorchooser/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/event/DocumentEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/event/DocumentEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -79,7 +79,7 @@
* 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.
* <p>
* For example, if the an element is removed from it's
--- a/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -158,7 +158,7 @@
/**
* Returns the <code>Element</code> that corresponds to the source of the
* event. This will typically be an <code>Element</code> 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
* <code>Element</code>, or null was specified as the source
* <code>Element</code>, this will return null.
*
--- a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -67,7 +67,7 @@
*/
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;
--- a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -89,7 +89,7 @@
* 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
* <code>addElement()</code>. Then increment the delete-counter. The index
--- a/jdk/src/share/classes/javax/swing/event/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/event/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java Fri Nov 08 17:36:14 2013 -0800
@@ -122,7 +122,7 @@
}
/**
- * 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, <code>C:\</code>, <code>D:\</code>, etc. Unix has one root,
* the <code>"/"</code> directory.
@@ -130,7 +130,7 @@
* The default implementation gets information from the <code>ShellFolder</code> class.
*
* @param f a <code>File</code> object representing a directory
- * @return <code>true</code> if <code>f</code> is a root in the navigatable tree.
+ * @return <code>true</code> if <code>f</code> is a root in the navigable tree.
* @see #isFileSystemRoot
*/
public boolean isRoot(File f) {
@@ -201,7 +201,7 @@
/**
* 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 @@
* parent directory in the filesystem. Folder could for example be the
* "Desktop" folder which is not the same as file.getParentFile().
*
- * @param folder a <code>File</code> object repesenting a directory or special folder
+ * @param folder a <code>File</code> object representing a directory or special folder
* @param file a <code>File</code> object
* @return <code>true</code> if <code>folder</code> is a directory or special folder and contains <code>file</code>.
* @since 1.4
@@ -281,7 +281,7 @@
/**
*
- * @param parent a <code>File</code> object repesenting a directory or special folder
+ * @param parent a <code>File</code> object representing a directory or special folder
* @param fileName a name of a file or folder which exists in <code>parent</code>
* @return a File object. This is normally constructed with <code>new
* File(parent, fileName)</code> except when parent and child are both
@@ -698,7 +698,7 @@
/**
* 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.
*/
--- a/jdk/src/share/classes/javax/swing/filechooser/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/filechooser/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/plaf/ComboBoxUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/ComboBoxUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
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 );
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java Fri Nov 08 17:36:14 2013 -0800
@@ -497,7 +497,7 @@
/**
- * 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 {
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -41,7 +41,7 @@
/**
* Basic UI implementation for JComboBox.
* <p>
- * 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 @@
}
/**
- * 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 @@
}
/**
- * 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 ) {
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -456,7 +456,7 @@
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 @@
}
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 @@
}
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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java Fri Nov 08 17:36:14 2013 -0800
@@ -270,18 +270,27 @@
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 @@
* Instantiate it only within subclasses of <code>Foo</code>.
*/
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 @@
* Instantiate it only within subclasses of <code>Foo</code>.
*/
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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -477,7 +477,7 @@
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 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 @@
} /// 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 @@
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 @@
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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java Fri Nov 08 17:36:14 2013 -0800
@@ -433,7 +433,7 @@
* 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() );
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -760,7 +760,7 @@
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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -322,7 +322,7 @@
* @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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -923,7 +923,7 @@
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;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -335,7 +335,7 @@
/**
* 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 @@
* 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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -1489,7 +1489,7 @@
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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -443,7 +443,7 @@
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 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 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 @@
*/
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 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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -743,7 +743,7 @@
}
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 @@
* Instantiate it only within subclasses of <code>Foo</code>.
*/
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 @@
* Instantiate it only within subclasses of <code>Foo</code>.
*/
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 @@
* Instantiate it only within subclasses of <code>Foo</code>.
*/
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 @@
* Instantiate it only within subclasses of <code>Foo</code>.
*/
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 @@
* 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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -273,7 +273,7 @@
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 @@
/**
- * 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 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 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -3748,7 +3748,7 @@
* 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 @@
* 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 @@
* 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 @@
* 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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -738,7 +738,7 @@
* the current <code>TableCellEditor</code>.
*/
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 @@
* 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 @@
* 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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -1560,6 +1560,10 @@
* 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 @@
* 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);
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -583,7 +583,7 @@
/**
* 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 @@
* This is a convenience method to call <code>setBorderToRollover</code>
* 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 @@
* This is a convenience method to call <code>setBorderToNonRollover</code>
* 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 @@
* This is a convenience method to call <code>setBorderNormal</code>
* 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 @@
}
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 @@
}
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 @@
}
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 @@
* 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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -204,7 +204,7 @@
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");
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -140,7 +140,7 @@
/** 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 @@
}
/**
- * 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 @@
* 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 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 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 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 @@
/**
- * 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 @@
* 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 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 @@
/**
* 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 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.
--- a/jdk/src/share/classes/javax/swing/plaf/basic/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java Fri Nov 08 17:36:14 2013 -0800
@@ -57,7 +57,7 @@
* <code>UIManager.put("swing.boldMetal", Boolean.FALSE);</code>
* </ul>
* The defaults property <code>swing.boldMetal</code>, 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
* <code>MetalLookAndFeel</code>, as well as update the UI
* of any previously created widgets. Otherwise the results are undefined.
@@ -284,7 +284,7 @@
/**
* 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);
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Fri Nov 08 17:36:14 2013 -0800
@@ -1738,7 +1738,7 @@
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
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -682,7 +682,7 @@
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;
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -64,14 +64,14 @@
/**
* A default horizontal thumb <code>Icon</code>. This field might not be
- * used. To change the <code>Icon</code> used by this delgate directly set it
+ * used. To change the <code>Icon</code> used by this delegate directly set it
* using the <code>Slider.horizontalThumbIcon</code> UIManager property.
*/
protected static Icon horizThumbIcon;
/**
* A default vertical thumb <code>Icon</code>. This field might not be
- * used. To change the <code>Icon</code> used by this delgate directly set it
+ * used. To change the <code>Icon</code> used by this delegate directly set it
* using the <code>Slider.verticalThumbIcon</code> UIManager property.
*/
protected static Icon vertThumbIcon;
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -64,7 +64,7 @@
private static List<WeakReference<JComponent>> components = new ArrayList<WeakReference<JComponent>>();
/**
- * 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 @@
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
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java Fri Nov 08 17:36:14 2013 -0800
@@ -64,7 +64,7 @@
* </table>
*
* <p>
- * As it is typically impratical to obtain the <code>TreeUI</code> from
+ * As it is typically impractical to obtain the <code>TreeUI</code> from
* the <code>JTree</code> and cast to an instance of <code>MetalTreeUI</code>
* you enable this property via the client property
* <code>JTree.lineStyle</code>. For example, to switch to
--- a/jdk/src/share/classes/javax/swing/plaf/metal/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html Fri Nov 08 17:36:14 2013 -0800
@@ -14,14 +14,14 @@
<blockquote>
<hr>
+<p>
<i>
-<p>
This document is based on an article
originally published in
<a href="http://java.sun.com/products/jfc/tsc/" target="_top"><em>The Swing
Connection</em></a>.
+</i>
</p>
-</i>
<hr>
</blockquote>
@@ -43,7 +43,6 @@
and requires no modifications to work with auxiliary look and feels.
</p>
-</p>
<p>
This document has the following sections:
@@ -76,14 +75,12 @@
</p>
<p>
-<a name="overview">
+<a name="overview"></a>
<hr width=100% align=LEFT size=2>
-</a>
<b>
<font color="#000080" size="+2">Overview</font>
</b>
-<p></p>
<p>
@@ -146,14 +143,12 @@
the Multiplexing look and feel.
<p>
-<a name="howtouse">
+<a name="howtouse"></a>
<hr width=100% align=LEFT size=2>
-</a>
<b>
<font color="#000080" size="+2">How to Use Auxiliary Look and Feels</font>
</b>
-<p></p>
<p>
It's easy to use auxiliary look and feels with Swing. To instruct
@@ -204,14 +199,12 @@
</p>
<p>
-<a name="howtowrite">
+<a name="howtowrite"></a>
<hr width=100% align=LEFT size=2>
-</a>
<b>
<font color="#000080" size="+2">Tips for Writing an Auxiliary Look and Feel</font>
</b>
-<p></p>
<p>
An auxiliary look and feel is like any other look and feel,
@@ -252,7 +245,6 @@
<font color="#000080" size="+1"><b>Dos and Don'ts</b></font>
</a>
</p>
-<p></p>
<p>
The following paragraphs provide some general recommendations for developing
@@ -264,22 +256,19 @@
to perform all initialization,
and the <code>uninstallUI</code> method
to perform all cleanup.</b></font>
-</font>
</p>
-<ul>
-<p>
+<blockquote>
The <code>installUI</code> and <code>uninstallUI</code>
methods are invoked when a component's look and feel is set.
The <code>installUI</code> method gives the new UI object
a chance to add listeners on the component and its data model.
Similarly, the <code>uninstallUI</code> method
lets the previous UI object remove its listeners.
-</p>
- </ul>
+</blockquote>
<p> <font color="#000080"><b>Don't extend
visual look and feels.</b></font></p>
- <ul>
- <p> We recommended that you <i>don't</i> implement
+<blockquote>
+ We recommended that you <i>don't</i> 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 @@
Instead, we recommend that the UI classes of an auxiliary look
and feel directly extend the abstract UI classes in the <code>javax.swing.plaf</code>
package. By using this strategy, the developer of an auxiliary
- look and feel can avoid competing with the default look and feel.</p>
- </ul>
+ look and feel can avoid competing with the default look and feel.
+</blockquote>
<p> <font color="#000080"><b>Override all UI-specific methods
your UI classes inherit.</b></font>
</p>
- <ul>
- <p> We recommend that each UI class of
+<blockquote>
+ We recommend that each UI class of
an auxiliary look and feel override the methods
defined in the <code>javax.swing.plaf</code>
UI classes it descends from
@@ -309,15 +298,14 @@
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!</p>
- </ul>
+ opaque components appear as blank areas on the screen!
+</blockquote>
<p>
<br>
<a name="uidefaults">
<font color="#000080" size="+1"><b>Extending UIDefaults</b></font>
</a>
- <p></p>
<p>In many cases, you
might want an auxiliary look and feel to be "incomplete." That
@@ -379,7 +367,6 @@
<a name="defaultui">
<b><font color="#000080" size="+1">Examining Other UI Objects</font></b>
</a>
-<p></p>
<p>In
rare instances, a UI object from an auxiliary look and feel
@@ -395,12 +382,10 @@
</p>
<p>
-<a name="implementation">
+<a name="implementation"></a>
<hr width=100% align=LEFT size=2>
-</a>
<font color="#000080" size="+2"><b>How the Multiplexing Look and Feel
Is Implemented</b></font>
-<p></p>
<p>
The Multiplexing look and feel
@@ -437,8 +422,8 @@
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 <code>swing.auxiliarylaf</code>
- property.</li>
-<p>
+ property.<br><br></li>
+
<li> 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 @@
The <code>getPreferredSize</code> method
is also invoked on the UI object for each auxiliary look and feel,
but the return values are ignored.
- </li>
-<p>
+ <br><br></li>
+
<li> 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 @@
<p>
-<a name="custom">
+<a name="custom"></a>
<hr width=100% align=LEFT size=2>
-</a>
<font color="#000080" size="+2"><b>How to Provide a Custom Multiplexing Look
and Feel</b></font>
-<p></p>
- <p><font color="#000080" size="+2"><b></b></font>While
+ <p>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
--- a/jdk/src/share/classes/javax/swing/plaf/multi/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/multi/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java Fri Nov 08 17:36:14 2013 -0800
@@ -187,7 +187,7 @@
protected abstract PaintContext getPaintContext();
/**
- * <p>Configures the given Graphics2D. Often, rendering hints or compositiing rules are
+ * <p>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 @@
/**
* 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 <code>width</code>
* and a height of <code>height</code>. For performance reasons, you may want to read
@@ -313,13 +313,13 @@
* 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 @@
* 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.
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java Fri Nov 08 17:36:14 2013 -0800
@@ -64,7 +64,7 @@
/**
* 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 <code>width</code> and a height of
* <code>height</code>. For performance reasons, you may want to read the
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java Fri Nov 08 17:36:14 2013 -0800
@@ -808,7 +808,7 @@
}
/**
- * 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 @@
}
/**
- * Contains values such as the UIDefaults and painters asssociated with
+ * Contains values such as the UIDefaults and painters associated with
* a state. Whereas <code>State</code> 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
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,7 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
+<title></title>
</head>
<body>
<h1 id="primaryColors">Primary Colors</h1>
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
@@ -39,11 +39,11 @@
<p>Nimbus allows customizing many of its properties, including painters, by
altering the {@link javax.swing.UIDefaults} table. Here's an example:
-<code><pre>
+<pre>
UIManager.put("ProgressBar.tileWidth", myTileWidth);
UIManager.put("ProgressBar[Enabled].backgroundPainter", myBgPainter);
UIManager.put("ProgressBar[Enabled].foregroundPainter", myFgPainter);
-</pre></code>
+</pre>
<p>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 @@
Boolean, specifies whether the overriding settings should be merged with
default ones ({@code true}), or replace them ({@code false}). By default they
are merged:
-<code><pre>
+<pre>
JProgressBar bar = new JProgressBar();
UIDefaults overrides = new UIDefaults();
overrides.put("ProgressBar.cycleTime", 330);
...
bar.putClientProperty("Nimbus.Overrides", overrides);
bar.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
-</pre></code>
+</pre>
<p>Colors in Nimbus are derived from a core set of
<a href="doc-files/properties.html#primaryColors">primary colors</a>. There are also
--- a/jdk/src/share/classes/javax/swing/plaf/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java Fri Nov 08 17:36:14 2013 -0800
@@ -191,20 +191,28 @@
}
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() {
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java Fri Nov 08 17:36:14 2013 -0800
@@ -116,7 +116,7 @@
/**
* 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 <code>selectedUI</code> (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.
--- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html Fri Nov 08 17:36:14 2013 -0800
@@ -47,7 +47,7 @@
JComboBox, JScrollBar and JSplitPane (for the buttons on the divider).
In addition to the <a
href="#buttonProperties">Button properties</a>, ArrowButton supports
-the following propeties: </p>
+the following properties: </p>
<h5>ArrowButton Specific Properties</h5>
<table border="1">
<thead><tr>
@@ -887,7 +887,7 @@
JScrollPane is unique in that it provides a method for setting
the Border around the JViewport with JViewport throwing an
IllegalArgumentException from <code>setBorder</code>. To
- accomodate this a special border is installed on the
+ accommodate this a special border is installed on the
<code>JScrollPane</code> that uses the
insets from the key
<code>ScrollPane.viewportBorderInsets</code>. The
@@ -1190,7 +1190,7 @@
<td>Tree.scrollsHorizontallyAndVertically</td>
<td>Boolean</td>
<td>false </td>
- <td>If false and scrolling needs to happen to accomodate cells
+ <td>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. </td>
</tr>
--- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html Fri Nov 08 17:36:14 2013 -0800
@@ -2,7 +2,7 @@
<html>
<head>
<title>Synth File Format</title>
- <style>
+ <style type="text/css">
div.dtd-fragment {
width: 100%;
border: none;
@@ -24,7 +24,7 @@
Synth's file format (<a href="synth.dtd">dtd</a>)
allows for specifying all the pieces
necessary to create your own look and feel. A synth file is
- loaded by way of the <A HREF="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.io.InputStream, java.lang.Class)">SynthLookAndFeel.load(InputStream, Class)</a> or
+ loaded by way of the <A HREF="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.io.InputStream,%20java.lang.Class)">SynthLookAndFeel.load(InputStream, Class)</a> or
<a href="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.net.URL)">SynthLookAndFeel.load(URL)</a> methods.
The following example uses the <code>load</code> method to configure
a <code>SynthLookAndFeel</code> and sets it as the current look
@@ -110,7 +110,7 @@
style.</dd>
</dl>
<p>
- A <a name="e.style">style</a> element corresponds to a
+ A style element corresponds to a
<code>SynthStyle</code>, with the child elements specifying
properties that apply to all states or state elements which
contain properties specific to a particular state. The following
@@ -216,7 +216,6 @@
contains at least SELECTED and PRESSED, state <code>one</code> will be
chosen, otherwise if the state is SELECTED, but not does not
contain PRESSED, state <code>two</code> will be used.
- <p>
<h3>The font element</h3>
<div class="dtd-fragment">
@@ -462,7 +461,6 @@
for idref properties this will be the unique id of a
previously defined object.</dd>
</dl>
- </dl>
<p>
<a href="#e.defaultsProperty">DefaultsProperty</a> elements are
used to define properties that will be placed in the
@@ -738,7 +736,7 @@
<state value="SELECTED">
<painter idref="stateFallbackPainter"/>
<painter idref="stateButtonBackgroundPainter" method="buttonBackground"/>
- </state>
+ </state>
</style>
</pre>
</div>
--- a/jdk/src/share/classes/javax/swing/plaf/synth/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -27,6 +27,7 @@
-->
+<title></title>
</head>
<body bgcolor="white">
<p>
--- a/jdk/src/share/classes/javax/swing/table/DefaultTableColumnModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/table/DefaultTableColumnModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -315,7 +315,7 @@
* of the view/controller object using this model (typically JTable). The
* view/controller need not display the columns sequentially from left to
* right. For example, columns could be displayed from right to left to
- * accomodate a locale preference or some columns might be hidden at the
+ * accommodate a locale preference or some columns might be hidden at the
* request of the user. Because the model does not know how the columns
* are laid out on screen, the given <code>xPosition</code> should not be
* considered to be a coordinate in 2D graphics space. Instead, it should
--- a/jdk/src/share/classes/javax/swing/table/JTableHeader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/table/JTableHeader.java Fri Nov 08 17:36:14 2013 -0800
@@ -869,7 +869,7 @@
/**
* This class provides an implementation of the Java Accessibility
- * API appropropriate for JTableHeader entries.
+ * API appropriate for JTableHeader entries.
*/
protected class AccessibleJTableHeaderEntry extends AccessibleContext
implements Accessible, AccessibleComponent {
--- a/jdk/src/share/classes/javax/swing/table/TableColumn.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/table/TableColumn.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
/**
* A <code>TableColumn</code> represents all the attributes of a column in a
- * <code>JTable</code>, such as width, resizibility, minimum and maximum width.
+ * <code>JTable</code>, such as width, resizability, minimum and maximum width.
* In addition, the <code>TableColumn</code> provides slots for a renderer and
* an editor that can be used to display and edit the values in this column.
* <p>
--- a/jdk/src/share/classes/javax/swing/table/TableColumnModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/table/TableColumnModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -154,7 +154,7 @@
* of the view/controller object using this model (typically JTable). The
* view/controller need not display the columns sequentially from left to
* right. For example, columns could be displayed from right to left to
- * accomodate a locale preference or some columns might be hidden at the
+ * accommodate a locale preference or some columns might be hidden at the
* request of the user. Because the model does not know how the columns
* are laid out on screen, the given <code>xPosition</code> should not be
* considered to be a coordinate in 2D graphics space. Instead, it should
--- a/jdk/src/share/classes/javax/swing/table/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/table/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,7 +48,7 @@
* all observers of the document have been notified of a previous
* change before beginning another mutation to the document. The
* read lock is acquired and released using the <code>render</code>
- * method. A write lock is aquired by the methods that mutate the
+ * method. A write lock is acquired by the methods that mutate the
* document, and are held for the duration of the method call.
* Notification is done on the thread that produced the mutation,
* and the thread has full read access to the document for the
@@ -391,7 +391,7 @@
* is being executed. The runnable itself may <em>not</em>
* make any mutations.
* <p>
- * This is implemented to aquire a read lock for the duration
+ * This is implemented to acquire a read lock for the duration
* of the runnables execution. There may be multiple runnables
* executing at the same time, and all writers will be blocked
* while there are active rendering runnables. If the runnable
@@ -1373,7 +1373,7 @@
/**
* Releases a write lock previously obtained via <code>writeLock</code>.
- * After decrementing the lock count if there are no oustanding locks
+ * After decrementing the lock count if there are no outstanding locks
* this will allow a new writer, or readers.
*
* @see #writeLock
@@ -1642,7 +1642,7 @@
* @param where The offset into the sequence to make the
* insertion >= 0.
* @param nitems The number of items in the sequence to remove >= 0.
- * @return If the implementation supports a history mechansim,
+ * @return If the implementation supports a history mechanism,
* a reference to an Edit implementation will be returned,
* otherwise null.
* @exception BadLocationException Thrown if the area covered by
--- a/jdk/src/share/classes/javax/swing/text/AbstractWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/AbstractWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -396,7 +396,7 @@
}
/**
- * Sets the String used to reprsent newlines. This is initialized
+ * Sets the String used to represent newlines. This is initialized
* in the constructor from either the Document, or the System property
* line.separator.
*
@@ -698,7 +698,7 @@
}
/**
- * Support method to locate an occurence of a particular character.
+ * Support method to locate an occurrence of a particular character.
*/
private int indexOf(char[] chars, char sChar, int startIndex,
int endIndex) {
--- a/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java Fri Nov 08 17:36:14 2013 -0800
@@ -42,7 +42,7 @@
* or a visible area) can be taken on.
* <p>
* While the child view is being accessed
- * a read lock is aquired on the associated document
+ * a read lock is acquired on the associated document
* so that the model is stable while being accessed.
*
* @author Timothy Prinzing
@@ -77,7 +77,7 @@
}
/**
- * Fetch the minor axis (the axis orthoginal
+ * Fetch the minor axis (the axis orthogonal
* to the tiled axis). This will have a value of
* either X_AXIS or Y_AXIS.
*/
@@ -827,8 +827,12 @@
* 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 pos the position to convert
* @param a the allocated region to render into
* @param direction the direction from the current position that can
* be thought of as the arrow keys typically found on a keyboard;
@@ -842,13 +846,17 @@
* @param biasRet an array contain the bias that was checked
* @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 if <code>direction</code> is invalid
*/
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);
+ }
return Utilities.getNextVisualPositionFrom(
this, pos, b, a, direction, biasRet);
}
@@ -1048,7 +1056,7 @@
/**
* Copy the currently allocated shape into the Rectangle
* used to store the current allocation. This would be
- * a floating point rectangle in a Java2D-specific implmentation.
+ * a floating point rectangle in a Java2D-specific implementation.
*/
protected void setAllocation(Shape a) {
if (a instanceof Rectangle) {
@@ -1216,7 +1224,7 @@
* time updating the child state (intended to
* be the layout thread).
* <p>
- * This aquires a read lock on the associated
+ * This acquires a read lock on the associated
* document for the duration of the update to
* ensure the model is not changed while it is
* operating. The first thing to do would be
--- a/jdk/src/share/classes/javax/swing/text/BoxView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/BoxView.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
* This is a building block that might be useful to represent
* things like a collection of lines, paragraphs,
* lists, columns, pages, etc. The axis along which the children are tiled is
- * considered the major axis. The orthoginal axis is the minor axis.
+ * considered the major axis. The orthogonal axis is the minor axis.
* <p>
* Layout for each axis is handled separately by the methods
* <code>layoutMajorAxis</code> and <code>layoutMinorAxis</code>.
@@ -507,7 +507,7 @@
* Determines the desired alignment for this view along an
* axis. This is implemented to give the total alignment
* needed to position the children with the alignment points
- * lined up along the axis orthoginal to the axis that is
+ * lined up along the axis orthogonal to the axis that is
* being tiled. The axis being tiled will request to be
* centered (i.e. 0.5f).
*
@@ -650,7 +650,7 @@
* @param x the X coordinate >= 0
* @param y the Y coordinate >= 0
* @param alloc the parents inner allocation on entry, which should
- * be changed to the childs allocation on exit
+ * be changed to the child's allocation on exit
* @return the view
*/
protected View getViewAtPoint(int x, int y, Rectangle alloc) {
@@ -816,7 +816,7 @@
/**
* Performs layout for the minor axis of the box (i.e. the
- * axis orthoginal to the axis that it represents). The results
+ * axis orthogonal to the axis that it represents). The results
* of the layout (the offset and span for each children) are
* placed in the given arrays which represent the allocations to
* the children along the minor axis.
@@ -1102,7 +1102,7 @@
}
/**
- * Fetches the span of a particular childs current layout.
+ * Fetches the span of a particular child's current layout.
* @param axis the axis being studied
* @param childIndex the index of the requested child
* @return the span (width or height) of the specified child
--- a/jdk/src/share/classes/javax/swing/text/CompositeView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/CompositeView.java Fri Nov 08 17:36:14 2013 -0800
@@ -435,8 +435,12 @@
* might not allow access to some of the locations in the model.
* This is a convenience method for {@link #getNextNorthSouthVisualPositionFrom}
* and {@link #getNextEastWestVisualPositionFrom}.
+ * 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 pos the position to convert
* @param b a bias value of either <code>Position.Bias.Forward</code>
* or <code>Position.Bias.Backward</code>
* @param a the allocated region to render into
@@ -452,12 +456,16 @@
* @param biasRet an array containing the bias that was checked
* @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 if <code>direction</code> is invalid
*/
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);
+ }
Rectangle alloc = getInsideAllocation(a);
switch (direction) {
--- a/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java Fri Nov 08 17:36:14 2013 -0800
@@ -34,7 +34,7 @@
import javax.swing.text.*;
/**
- * <code>DefaultFormatter</code> formats aribtrary objects. Formatting is done
+ * <code>DefaultFormatter</code> formats arbitrary objects. Formatting is done
* by invoking the <code>toString</code> method. In order to convert the
* value back to a String, your class must provide a constructor that
* takes a String argument. If no single argument constructor that takes a
@@ -137,7 +137,7 @@
* <code>JFormattedTextField</code>, typically when enter is pressed
* or focus leaves the <code>JFormattedTextField</code>.
*
- * @param commit Used to indicate when edits are commited back to the
+ * @param commit Used to indicate when edits are committed back to the
* JTextComponent
*/
public void setCommitsOnValidEdit(boolean commit) {
@@ -148,7 +148,7 @@
* Returns when edits are published back to the
* <code>JFormattedTextField</code>.
*
- * @return true if edits are commited after evey valid edit
+ * @return true if edits are committed after every valid edit
*/
public boolean getCommitsOnValidEdit() {
return commitOnEdit;
@@ -213,7 +213,7 @@
/**
* Returns that class that is used to create new Objects.
*
- * @return Class used to constuct return value from stringToValue
+ * @return Class used to construct return value from stringToValue
*/
public Class<?> getValueClass() {
return valueClass;
@@ -225,7 +225,7 @@
* takes a String argument. If <code>getValueClass</code>
* returns null, the Class of the current value in the
* <code>JFormattedTextField</code> will be used. If this is null, a
- * String will be returned. If the constructor thows an exception, a
+ * String will be returned. If the constructor throws an exception, a
* <code>ParseException</code> will be thrown. If there is no single
* argument String constructor, <code>string</code> will be returned.
*
@@ -500,7 +500,7 @@
/**
- * Finds the next navigatable character.
+ * Finds the next navigable character.
*/
int getNextVisualPositionFrom(JTextComponent text, int pos,
Position.Bias bias, int direction,
--- a/jdk/src/share/classes/javax/swing/text/DefaultHighlighter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/DefaultHighlighter.java Fri Nov 08 17:36:14 2013 -0800
@@ -447,7 +447,7 @@
* 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) {
--- a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java Fri Nov 08 17:36:14 2013 -0800
@@ -2328,7 +2328,7 @@
/**
* Recreates <code>toDuplicate</code>. This is called when an
* element needs to be created as the result of an insertion. This
- * will recurse and create all the children. This is similiar to
+ * will recurse and create all the children. This is similar to
* <code>clone</code>, but deteremines the offsets differently.
*/
Element recreateFracturedElement(Element parent, Element toDuplicate) {
--- a/jdk/src/share/classes/javax/swing/text/Document.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/Document.java Fri Nov 08 17:36:14 2013 -0800
@@ -123,7 +123,7 @@
* rather than a mutation to the <code>Document</code> made through its
* api.
* <p style="text-align:center"><img src="doc-files/Document-notification.gif"
- * alt="The preceeding text describes this graphic.">
+ * alt="The preceding text describes this graphic.">
* <p>
* Referring to the above diagram, suppose that the component shown
* on the left mutates the document object represented by the blue
--- a/jdk/src/share/classes/javax/swing/text/DocumentFilter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/DocumentFilter.java Fri Nov 08 17:36:14 2013 -0800
@@ -131,7 +131,7 @@
*/
public static abstract class FilterBypass {
/**
- * Returns the Document the mutation is occuring on.
+ * Returns the Document the mutation is occurring on.
*
* @return Document that remove/insertString will operate on
*/
--- a/jdk/src/share/classes/javax/swing/text/ElementIterator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/ElementIterator.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,7 +30,7 @@
/**
* <p>
- * ElementIterator, as the name suggests, iteratates over the Element
+ * ElementIterator, as the name suggests, iterates over the Element
* tree. The constructor can be invoked with either Document or an Element
* as an argument. If the constructor is invoked with a Document as an
* argument then the root of the iteration is the return value of
@@ -284,7 +284,7 @@
/**
- * Fetches the previous Element. If howver the current
+ * Fetches the previous Element. If however the current
* element is the last element, or the current element
* is null, then null is returned.
*
--- a/jdk/src/share/classes/javax/swing/text/FlowView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/FlowView.java Fri Nov 08 17:36:14 2013 -0800
@@ -171,7 +171,7 @@
* the layout along the box axis. The FlowStrategy.layout
* method will be called to rebuild the flow rows as
* appropriate. If the height of this view changes
- * (determined by the perferred size along the box axis),
+ * (determined by the preferred size along the box axis),
* a preferenceChanged is called. Following all of that,
* the normal box layout of the superclass is performed.
*
@@ -221,7 +221,7 @@
}
/**
- * Calculate equirements along the minor axis. This
+ * Calculate requirements along the minor axis. This
* is implemented to forward the request to the logical
* view by calling getMinimumSpan, getPreferredSpan, and
* getMaximumSpan on it.
@@ -328,7 +328,7 @@
* entire flow if the layout is invalid on the
* given FlowView. Alternative strategies can
* be implemented by subclassing, and might
- * perform incrementatal repair to the layout
+ * perform incremental repair to the layout
* or alternative breaking behavior.
* @since 1.3
*/
@@ -491,7 +491,7 @@
* This is implemented to fill the row by repeatedly calling
* the createView method until the available span has been
* exhausted, a forced break was encountered, or the createView
- * method returned null. If the remaining span was exhaused,
+ * method returned null. If the remaining span was exhausted,
* the adjustRow method will be called to perform adjustments
* to the row to try and make it fit into the given span.
*
--- a/jdk/src/share/classes/javax/swing/text/GapContent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/GapContent.java Fri Nov 08 17:36:14 2013 -0800
@@ -44,7 +44,7 @@
* to take advantage of common behavior where most changes are
* in the same location. Changes that occur at a gap boundary are
* generally cheap and moving the gap is generally cheaper than
- * moving the array contents directly to accomodate the change.
+ * moving the array contents directly to accommodate the change.
* <p>
* The positions tracking change are also generally cheap to
* maintain. The Position implementations (marks) store the array
--- a/jdk/src/share/classes/javax/swing/text/GapVector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/GapVector.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
* to take advantage of common behavior where most changes occur
* in the same location. Changes that occur at a gap boundary are
* generally cheap and moving the gap is generally cheaper than
- * moving the array contents directly to accomodate the change.
+ * moving the array contents directly to accommodate the change.
*
* @author Timothy Prinzing
* @see GapContent
--- a/jdk/src/share/classes/javax/swing/text/GlyphView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java Fri Nov 08 17:36:14 2013 -0800
@@ -879,8 +879,12 @@
* 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 pos the position to convert
* @param a the allocated region to render into
* @param direction the direction from the current position that can
* be thought of as the arrow keys typically found on a keyboard.
@@ -888,7 +892,8 @@
* 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,
@@ -896,6 +901,9 @@
Position.Bias[] biasRet)
throws BadLocationException {
+ if (pos < -1) {
+ throw new BadLocationException("invalid position", pos);
+ }
return painter.getNextVisualPositionFrom(this, pos, b, a, direction, biasRet);
}
--- a/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java Fri Nov 08 17:36:14 2013 -0800
@@ -569,7 +569,7 @@
}
/**
- * Returns true if the character at offset is navigatable too. This
+ * Returns true if the character at offset is navigable too. This
* is implemented in terms of <code>isLiteral</code>, subclasses
* may wish to provide different behavior.
*/
@@ -862,7 +862,7 @@
}
/**
- * Returns the number of occurences of <code>f</code> before
+ * Returns the number of occurrences of <code>f</code> before
* the location <code>start</code> in the current
* <code>AttributedCharacterIterator</code>.
*/
--- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java Fri Nov 08 17:36:14 2013 -0800
@@ -160,9 +160,9 @@
*
* <table border=1 summary="Stages of keyboard and input method event handling">
* <tr>
- * <th id="stage"><p align="left">Stage</p></th>
- * <th id="ke"><p align="left">KeyEvent</p></th>
- * <th id="ime"><p align="left">InputMethodEvent</p></th></tr>
+ * <th id="stage"><p style="text-align:left">Stage</p></th>
+ * <th id="ke"><p style="text-align:left">KeyEvent</p></th>
+ * <th id="ime"><p style="text-align:left">InputMethodEvent</p></th></tr>
* <tr><td headers="stage">1. </td>
* <td headers="ke">input methods </td>
* <td headers="ime">(generated here)</td></tr>
@@ -214,7 +214,7 @@
* The text document model may be shared by other views which act as observers
* of the model (e.g. a document may be shared by multiple components).
*
- * <p align=center><img src="doc-files/editor.gif" alt="Diagram showing interaction between Controller, Document, events, and ViewFactory"
+ * <p style="text-align:center"><img src="doc-files/editor.gif" alt="Diagram showing interaction between Controller, Document, events, and ViewFactory"
* HEIGHT=358 WIDTH=587></p>
*
* <p>
@@ -426,7 +426,7 @@
Document old = model;
/*
- * aquire a read lock on the old model to prevent notification of
+ * acquire a read lock on the old model to prevent notification of
* mutations while we disconnecting the old model.
*/
try {
@@ -1399,8 +1399,8 @@
* Fetches a portion of the text represented by the
* component. Returns an empty string if length is 0.
*
- * @param offs the offset >= 0
- * @param len the length >= 0
+ * @param offs the offset ≥ 0
+ * @param len the length ≥ 0
* @return the text
* @exception BadLocationException if the offset or length are invalid
*/
@@ -1416,7 +1416,7 @@
* be computed until the component has been sized). The
* component does not have to be visible or painted.
*
- * @param pos the position >= 0
+ * @param pos the position ≥ 0
* @return the coordinates as a rectangle, with (r.x, r.y) as the location
* in the coordinate system, or null if the component does
* not yet have a positive size.
@@ -1437,7 +1437,7 @@
* component does not have to be visible or painted.
*
* @param pt the location in the view to translate
- * @return the offset >= 0 from the start of the document,
+ * @return the offset ≥ 0 from the start of the document,
* or -1 if the component does not yet have a positive
* size.
* @see TextUI#viewToModel
@@ -1493,10 +1493,10 @@
}
/**
- * This is a conveniance method that is only useful for
+ * This is a convenience method that is only useful for
* <code>cut</code>, <code>copy</code> and <code>paste</code>. If
* an <code>Action</code> with the name <code>name</code> does not
- * exist in the <code>ActionMap</code>, this will attemp to install a
+ * exist in the <code>ActionMap</code>, this will attempt to install a
* <code>TransferHandler</code> and then use <code>altAction</code>.
*/
private void invokeAction(String name, Action altAction) {
@@ -1688,7 +1688,7 @@
* text component.
*
* @return the position of the text insertion caret for the
- * text component >= 0
+ * text component ≥ 0
*/
@Transient
public int getCaretPosition() {
@@ -1814,7 +1814,7 @@
* Returns the selected text's start position. Return 0 for an
* empty document, or the value of dot if no selection.
*
- * @return the start position >= 0
+ * @return the start position ≥ 0
*/
@Transient
public int getSelectionStart() {
@@ -1832,7 +1832,7 @@
* This is implemented to forward to the <code>Caret</code>
* implementation which is where the actual selection is maintained.
*
- * @param selectionStart the start position of the text >= 0
+ * @param selectionStart the start position of the text ≥ 0
* @beaninfo
* description: starting location of the selection.
*/
@@ -1847,7 +1847,7 @@
* Returns the selected text's end position. Return 0 if the document
* is empty, or the value of dot if there is no selection.
*
- * @return the end position >= 0
+ * @return the end position ≥ 0
*/
@Transient
public int getSelectionEnd() {
@@ -1865,7 +1865,7 @@
* This is implemented to forward to the <code>Caret</code>
* implementation which is where the actual selection is maintained.
*
- * @param selectionEnd the end position of the text >= 0
+ * @param selectionEnd the end position of the text ≥ 0
* @beaninfo
* description: ending location of the selection.
*/
@@ -2785,7 +2785,7 @@
* if the JTextComponent is contained in a JScrollPane in which
* case the resulting rectangle should be composed with the parent
* coordinates. A good algorithm to use is:
- * <nf>
+ * <pre>
* Accessible a:
* AccessibleText at = a.getAccessibleText();
* AccessibleComponent ac = a.getAccessibleComponent();
@@ -2793,14 +2793,14 @@
* Point p = ac.getLocation();
* r.x += p.x;
* r.y += p.y;
- * </nf>
+ * </pre>
*
* Note: the JTextComponent must have a valid size (e.g. have
* been added to a parent container whose ancestor container
* is a valid top-level window) for this method to be able
* to return a meaningful (non-null) value.
*
- * @param i the index into the String >= 0
+ * @param i the index into the String ≥ 0
* @return the screen coordinates of the character's bounding box
*/
public Rectangle getCharacterBounds(int i) {
@@ -2844,7 +2844,7 @@
/**
* Returns the number of characters (valid indices)
*
- * @return the number of characters >= 0
+ * @return the number of characters ≥ 0
*/
public int getCharCount() {
return model.getLength();
@@ -2895,7 +2895,7 @@
* Return 0 if the text is empty, or the caret position
* if no selection.
*
- * @return the index into the text of the start of the selection >= 0
+ * @return the index into the text of the start of the selection ≥ 0
*/
public int getSelectionStart() {
return JTextComponent.this.getSelectionStart();
@@ -2908,7 +2908,7 @@
* 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 JTextComponent.this.getSelectionEnd();
--- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java Fri Nov 08 17:36:14 2013 -0800
@@ -34,7 +34,7 @@
* <code>NumberFormatter</code> subclasses <code>InternationalFormatter</code>
* adding special behavior for numbers. Among the specializations are
* (these are only used if the <code>NumberFormatter</code> does not display
- * invalid nubers, eg <code>setAllowsInvalid(false)</code>):
+ * invalid numbers, for example, <code>setAllowsInvalid(false)</code>):
* <ul>
* <li>Pressing +/- (- is determined from the
* <code>DecimalFormatSymbols</code> associated with the
@@ -44,7 +44,7 @@
* <li>Pressing +/- (- is determined from the
* <code>DecimalFormatSymbols</code> associated with the
* <code>DecimalFormat</code>) in the exponent field will
- * attemp to change the sign of the exponent to positive/negative.
+ * attempt to change the sign of the exponent to positive/negative.
* </ul>
* <p>
* If you are displaying scientific numbers, you may wish to turn on
@@ -299,9 +299,9 @@
}
/**
- * Subclassed to make the decimal separator navigatable, as well
+ * Subclassed to make the decimal separator navigable, as well
* as making the character between the integer field and the next
- * field navigatable.
+ * field navigable.
*/
boolean isNavigatable(int index) {
if (!super.isNavigatable(index)) {
--- a/jdk/src/share/classes/javax/swing/text/ParagraphView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/ParagraphView.java Fri Nov 08 17:36:14 2013 -0800
@@ -567,7 +567,7 @@
/**
* Renders using the given rendering surface and area on that
- * surface. This is implemented to delgate to the superclass
+ * surface. This is implemented to delegate to the superclass
* after stashing the base coordinate for tab calculations.
*
* @param g the rendering surface to use
@@ -931,7 +931,7 @@
/**
* Perform layout for the minor axis of the box (i.e. the
- * axis orthoginal to the axis that it represents). The results
+ * axis orthogonal to the axis that it represents). The results
* of the layout should be placed in the given arrays which represent
* the allocations to the children along the minor axis.
* <p>
@@ -939,7 +939,7 @@
* by calling BoxView.baselineLayout.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children.
+ * would be used to layout the children.
* @param axis the axis being layed out.
* @param offsets the offsets from the origin of the view for
* each of the child views. This is a return value and is
--- a/jdk/src/share/classes/javax/swing/text/SimpleAttributeSet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/SimpleAttributeSet.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,8 +29,9 @@
import java.util.Collections;
import java.io.IOException;
import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.io.Serializable;
+import java.util.AbstractMap;
+import java.util.LinkedHashMap;
/**
* A straightforward implementation of MutableAttributeSet using a
@@ -56,7 +57,7 @@
*/
public static final AttributeSet EMPTY = new EmptyAttributeSet();
- private transient Hashtable<Object, Object> table = new Hashtable<Object, Object>(3);
+ private transient LinkedHashMap<Object, Object> table = new LinkedHashMap<>(3);
/**
* Creates a new attribute set.
@@ -73,10 +74,6 @@
addAttributes(source);
}
- private SimpleAttributeSet(Hashtable<Object, Object> table) {
- this.table = table;
- }
-
/**
* Checks whether the set of attributes is empty.
*
@@ -132,7 +129,7 @@
* @return the names as an <code>Enumeration</code>
*/
public Enumeration<?> getAttributeNames() {
- return table.keys();
+ return Collections.enumeration(table.keySet());
}
/**
@@ -278,7 +275,7 @@
SimpleAttributeSet attr;
try {
attr = (SimpleAttributeSet) super.clone();
- attr.table = (Hashtable) table.clone();
+ attr.table = (LinkedHashMap) table.clone();
} catch (CloneNotSupportedException cnse) {
attr = null;
}
@@ -341,7 +338,7 @@
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException {
s.defaultReadObject();
- table = new Hashtable<Object, Object>(3);
+ table = new LinkedHashMap<>(3);
StyleContext.readAttributeSet(s, this);
}
--- a/jdk/src/share/classes/javax/swing/text/StyleConstants.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/StyleConstants.java Fri Nov 08 17:36:14 2013 -0800
@@ -39,7 +39,7 @@
* All sizes are specified in points (such as found in postscript), a
* device independent measure.
* </p>
- * <p align=center><img src="doc-files/paragraph.gif"
+ * <p style="text-align:center"><img src="doc-files/paragraph.gif"
* alt="Diagram shows SpaceAbove, FirstLineIndent, LeftIndent, RightIndent,
* and SpaceBelow a paragraph."></p>
* <p>
@@ -65,7 +65,7 @@
public static final Object NameAttribute = new StyleConstants("name");
/**
- * Attribute name used to identifiy the resolving parent
+ * Attribute name used to identify the resolving parent
* set of attributes, if one is defined.
*/
public static final Object ResolveAttribute = new StyleConstants("resolver");
--- a/jdk/src/share/classes/javax/swing/text/StyleContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/StyleContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -438,7 +438,7 @@
}
/**
- * Returns a set no longer needed by the MutableAttributeSet implmentation.
+ * Returns a set no longer needed by the MutableAttributeSet implementation.
* This is useful for operation under 1.1 where there are no weak
* references. This would typically be called by the finalize method
* of the MutableAttributeSet implementation.
@@ -576,7 +576,7 @@
* special care to deal with static attribute keys that
* have been registered wit the
* <code>registerStaticAttributeKey</code> method.
- * Any attribute key not regsitered as a static key
+ * Any attribute key not registered as a static key
* will be serialized directly. All values are expected
* to be serializable.
*
@@ -839,7 +839,7 @@
}
/**
- * Compares this object to the specifed object.
+ * Compares this object to the specified object.
* The result is <code>true</code> if the object is an equivalent
* set of attributes.
* @param obj the object to compare with.
@@ -1040,7 +1040,7 @@
/**
* Sorts the key strings so that they can be very quickly compared
- * in the attribute set searchs.
+ * in the attribute set searches.
*/
class KeyBuilder {
@@ -1209,7 +1209,7 @@
}
/**
- * Compares this object to the specifed object.
+ * Compares this object to the specified object.
* The result is <code>true</code> if and only if the argument is not
* <code>null</code> and is a <code>Font</code> object with the same
* name, style, and point size as this font.
--- a/jdk/src/share/classes/javax/swing/text/TableView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/TableView.java Fri Nov 08 17:36:14 2013 -0800
@@ -308,7 +308,7 @@
/**
* Perform layout for the minor axis of the box (i.e. the
- * axis orthoginal to the axis that it represents). The results
+ * axis orthogonal to the axis that it represents). The results
* of the layout should be placed in the given arrays which represent
* the allocations to the children along the minor axis. This
* is called by the superclass whenever the layout needs to be
@@ -320,7 +320,7 @@
* of the tables rows.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children.
+ * would be used to layout the children.
* @param axis the axis being layed out.
* @param offsets the offsets from the origin of the view for
* each of the child views. This is a return value and is
@@ -657,7 +657,7 @@
* the multi-column span.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children.
+ * would be used to layout the children.
* @param axis the axis being layed out.
* @param offsets the offsets from the origin of the view for
* each of the child views. This is a return value and is
@@ -691,7 +691,7 @@
/**
* Perform layout for the minor axis of the box (i.e. the
- * axis orthoginal to the axis that it represents). The results
+ * axis orthogonal to the axis that it represents). The results
* of the layout should be placed in the given arrays which represent
* the allocations to the children along the minor axis. This
* is called by the superclass whenever the layout needs to be
@@ -701,7 +701,7 @@
* the span for any cell that spans multiple rows.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children.
+ * would be used to layout the children.
* @param axis the axis being layed out.
* @param offsets the offsets from the origin of the view for
* each of the child views. This is a return value and is
--- a/jdk/src/share/classes/javax/swing/text/View.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/View.java Fri Nov 08 17:36:14 2013 -0800
@@ -128,7 +128,7 @@
A view should set any settings needed.
<li>A <code>View</code> is inherently transparent. While a view may render into its
entire allocation, typically a view does not. Rendering is performed by
- tranversing down the tree of <code>View</code> implementations.
+ traversing down the tree of <code>View</code> implementations.
Each <code>View</code> is responsible
for rendering its children. This behavior is depended upon for thread
safety. While view implementations do not necessarily have to be implemented
@@ -324,7 +324,7 @@
* the view has been removed from the hierarchy as
* well. When this method is called to set the parent to
* null, this method does the same for each of its children,
- * propogating the notification that they have been
+ * propagating the notification that they have been
* disconnected from the view tree. If this is
* reimplemented, <code>super.setParent()</code> should
* be called.
@@ -476,8 +476,12 @@
* 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 pos the position to convert
* @param a the allocated region in which to render
* @param direction the direction from the current position that can
* be thought of as the arrow keys typically found on a keyboard.
@@ -490,7 +494,8 @@
* </ul>
* @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 if <code>direction</code>
* doesn't have one of the legal values above
*/
--- a/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java Fri Nov 08 17:36:14 2013 -0800
@@ -380,8 +380,8 @@
public void setSize(float width, float height) {
updateMetrics();
if ((int) width != getWidth()) {
- // invalidate the view itself since the childrens
- // desired widths will be based upon this views width.
+ // invalidate the view itself since the desired widths
+ // of the children will be based upon this views width.
preferenceChanged(null, true, true);
widthChanging = true;
}
--- a/jdk/src/share/classes/javax/swing/text/ZoneView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/ZoneView.java Fri Nov 08 17:36:14 2013 -0800
@@ -60,7 +60,7 @@
* Boxes are easier to estimate the size of than some other shapes.
* </ul>
* <p>
- * The default behavior is controled by two properties, maxZoneSize
+ * The default behavior is controlled by two properties, maxZoneSize
* and maxZonesLoaded. Setting maxZoneSize to Integer.MAX_VALUE would
* have the effect of causing only one zone to be created. This would
* effectively turn the view into an implementation of the decorator
@@ -144,7 +144,7 @@
* Called by a zone when it gets loaded. This happens when
* an attempt is made to display or perform a model/view
* translation on a zone that was in an unloaded state.
- * This is imlemented to check if the maximum number of
+ * This is implemented to check if the maximum number of
* zones was reached and to unload the oldest zone if so.
*
* @param zone the child view that was just loaded.
--- a/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java Fri Nov 08 17:36:14 2013 -0800
@@ -276,7 +276,7 @@
* 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).
* <p>Note that the AccessibleRole class is also extensible, so
@@ -893,7 +893,7 @@
* 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).
* <p>Note that the AccessibleRole class is also extensible, so
@@ -1192,7 +1192,7 @@
* 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() {
return editor.getSelectionEnd();
@@ -1327,7 +1327,7 @@
* 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).
* <p>Note that the AccessibleRole class is also extensible, so
@@ -1628,7 +1628,7 @@
* 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).
* <p>Note that the AccessibleRole class is also extensible, so
--- a/jdk/src/share/classes/javax/swing/text/html/BlockView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/BlockView.java Fri Nov 08 17:36:14 2013 -0800
@@ -106,7 +106,7 @@
/**
* Calculate the requirements of the block along the minor
- * axis (i.e. the axis orthoginal to the axis along with it tiles).
+ * axis (i.e. the axis orthogonal to the axis along with it tiles).
* This is implemented
* to provide the superclass behavior and then adjust it if the
* CSS width or height attribute is specified and applicable to
@@ -218,13 +218,13 @@
/**
* Performs layout for the minor axis of the box (i.e. the
- * axis orthoginal to the axis that it represents). The results
+ * axis orthogonal to the axis that it represents). The results
* of the layout (the offset and span for each children) are
* placed in the given arrays which represent the allocations to
* the children along the minor axis.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the childre.
+ * would be used to layout the children.
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
--- a/jdk/src/share/classes/javax/swing/text/html/CSS.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java Fri Nov 08 17:36:14 2013 -0800
@@ -49,7 +49,7 @@
* CSS attributes to determine how they will render. This also defines
* methods to map between CSS/HTML/StyleConstants. Any shorthand
* properties, such as font, are mapped to the intrinsic properties.
- * <p>The following describes the CSS properties that are suppored by the
+ * <p>The following describes the CSS properties that are supported by the
* rendering engine:
* <ul><li>font-family
* <li>font-style
@@ -3070,7 +3070,7 @@
}
}
if (!valid) {
- // Part is non-parseable or occured more than once.
+ // Part is non-parseable or occurred more than once.
return;
}
}
--- a/jdk/src/share/classes/javax/swing/text/html/CSSParser.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/CSSParser.java Fri Nov 08 17:36:14 2013 -0800
@@ -513,7 +513,7 @@
* hit.
*/
// NOTE: this could be combined with readTill, as they contain somewhat
- // similiar functionality.
+ // similar functionality.
private boolean getIdentifier(char stopChar) throws IOException {
boolean lastWasEscape = false;
boolean done = false;
--- a/jdk/src/share/classes/javax/swing/text/html/FormSubmitEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/FormSubmitEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -29,7 +29,7 @@
/**
* FormSubmitEvent is used to notify interested
- * parties that a form was submited.
+ * parties that a form was submitted.
*
* @since 1.5
* @author Denis Sharypov
--- a/jdk/src/share/classes/javax/swing/text/html/FormView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/FormView.java Fri Nov 08 17:36:14 2013 -0800
@@ -663,7 +663,7 @@
if (type != null && type.equals("submit") &&
next != getElement()) {
- // do nothing - this submit isnt the trigger
+ // do nothing - this submit is not the trigger
} else if (type == null || !type.equals("image")) {
// images only result in data if they triggered
// the submit and they require that the mouse click
--- a/jdk/src/share/classes/javax/swing/text/html/FrameSetView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/FrameSetView.java Fri Nov 08 17:36:14 2013 -0800
@@ -157,7 +157,7 @@
* to the children along the major axis.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children
+ * would be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
@@ -267,7 +267,7 @@
// they share priority, however, unspecified what happens when
// overallocation occurs.)
- // addendum is that we behave similiar to netscape in that specified
+ // addendum is that we behave similar to netscape in that specified
// widths have precedance over percentage widths...
float vTotal = (float)(targetSpan - remainingSpace);
--- a/jdk/src/share/classes/javax/swing/text/html/HTML.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/HTML.java Fri Nov 08 17:36:14 2013 -0800
@@ -303,7 +303,7 @@
}
/**
- * Compares this object to the specifed object.
+ * Compares this object to the specified object.
* The result is <code>true</code> if and only if the argument is not
* <code>null</code> and is an <code>UnknownTag</code> object
* with the same name.
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java Fri Nov 08 17:36:14 2013 -0800
@@ -184,7 +184,6 @@
* of various methods described above.</p>
*
* <table border=1 cellspacing=0>
- * <caption></caption>
* <tr>
* <th>Example</th>
* <th><code>insertAfterStart</code></th>
@@ -262,8 +261,8 @@
* not be compatible with future Swing releases. The current
* serialization support is appropriate for short term storage or RMI
* between applications running the same version of Swing. As of 1.4,
- * support for long term storage of all JavaBeans<sup><font
- * size="-2">TM</font></sup> has been added to the
+ * support for long term storage of all JavaBeans™
+ * has been added to the
* <code>java.beans</code> package. Please see {@link
* java.beans.XMLEncoder}.</p>
*
@@ -1012,7 +1011,7 @@
* If either <code>elem</code> or <code>htmlText</code> parameter
* is <code>null</code>, no changes are made to the document.</p>
*
- * <p>For this to work correcty, the document must have an
+ * <p>For this to work correctly, the document must have an
* <code>HTMLEditorKit.Parser</code> set. This will be the case
* if the document was created from an HTMLEditorKit via the
* <code>createDefaultDocument</code> method.</p>
@@ -1054,7 +1053,7 @@
* a newline present if one is needed. This may result in an additional
* element being inserted. Consider, if you were to replace a character
* element that contained a newline with <img> this would create
- * two elements, one for the image, ane one for the newline.</p>
+ * two elements, one for the image, and one for the newline.</p>
*
* <p>If you try to replace the element at length you will most
* likely end up with two elements, eg
@@ -1090,7 +1089,7 @@
* parameter is <code>null</code>, no changes are made to the
* document.</p>
*
- * <p>For this to work correcty, the document must have an
+ * <p>For this to work correctly, the document must have an
* HTMLEditorKit.Parser set. This will be the case if the document
* was created from an HTMLEditorKit via the
* <code>createDefaultDocument</code> method.</p>
@@ -1167,7 +1166,7 @@
* If either <code>elem</code> or <code>htmlText</code> parameter
* is <code>null</code>, no changes are made to the document.</p>
*
- * <p>For this to work correcty, the document must have an
+ * <p>For this to work correctly, the document must have an
* <code>HTMLEditorKit.Parser</code> set. This will be the case
* if the document was created from an HTMLEditorKit via the
* <code>createDefaultDocument</code> method.</p>
@@ -1237,7 +1236,7 @@
* If either <code>elem</code> or <code>htmlText</code> parameter
* is <code>null</code>, no changes are made to the document.</p>
*
- * <p>For this to work correcty, the document must have an
+ * <p>For this to work correctly, the document must have an
* <code>HTMLEditorKit.Parser</code> set. This will be the case
* if the document was created from an HTMLEditorKit via the
* <code>createDefaultDocument</code> method.</p>
@@ -1301,7 +1300,7 @@
* parameter is <code>null</code>, no changes are made to the
* document.</p>
*
- * <p>For this to work correcty, the document must have an
+ * <p>For this to work correctly, the document must have an
* <code>HTMLEditorKit.Parser</code> set. This will be the case
* if the document was created from an HTMLEditorKit via the
* <code>createDefaultDocument</code> method.</p>
@@ -1359,7 +1358,7 @@
* parameter is <code>null</code>, no changes are made to the
* document.</p>
*
- * <p>For this to work correcty, the document must have an
+ * <p>For this to work correctly, the document must have an
* <code>HTMLEditorKit.Parser</code> set. This will be the case
* if the document was created from an HTMLEditorKit via the
* <code>createDefaultDocument</code> method.</p>
@@ -3345,7 +3344,7 @@
String type = (String)
attr.getAttribute(HTML.Attribute.TYPE);
/*
- * if type is not defined teh default is
+ * if type is not defined the default is
* assumed to be text.
*/
if (type == null) {
@@ -3735,7 +3734,7 @@
int size = parseBuffer.size();
if (insertTagDepthDelta < 0) {
// When inserting via an insertTag, the depths (of the tree
- // being read in, and existing hiearchy) may not match up.
+ // being read in, and existing hierarchy) may not match up.
// This attemps to clean it up.
int removeCounter = insertTagDepthDelta;
while (removeCounter < 0 && size >= 0 &&
@@ -3974,7 +3973,7 @@
private boolean receivedEndHTML;
/** Number of times <code>flushBuffer</code> has been invoked. */
private int flushCount;
- /** If true, behavior is similiar to insertTag, but instead of
+ /** If true, behavior is similar to insertTag, but instead of
* waiting for insertTag will wait for first Element without
* an 'implied' attribute and begin inserting then. */
private boolean insertAfterImplied;
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java Fri Nov 08 17:36:14 2013 -0800
@@ -69,7 +69,7 @@
* exactly as defined in the HTML document.
* <p>
* The modeling of HTML is provided by the class <code>HTMLDocument</code>.
- * Its documention describes the details of how the HTML is modeled.
+ * Its documentation describes the details of how the HTML is modeled.
* The editing support leverages heavily off of the text package.
* <p>
* <dt>
@@ -80,7 +80,7 @@
* features.
* <ol>
* <li>
- * The parser is replacable. The default parser is the Hot Java
+ * The parser is replaceable. The default parser is the Hot Java
* parser which is DTD based. A different DTD can be used, or an
* entirely different parser can be used. To change the parser,
* reimplement the getParser method. The default parser is
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLFrameHyperlinkEvent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLFrameHyperlinkEvent.java Fri Nov 08 17:36:14 2013 -0800
@@ -92,7 +92,7 @@
* @param source the object responsible for the event
* @param type the event type
* @param targetURL the affected URL
- * @param desc a desription
+ * @param desc a description
* @param sourceElement the element that corresponds to the source
* of the event
* @param targetFrame the Frame to display the document in
@@ -109,7 +109,7 @@
* @param source the object responsible for the event
* @param type the event type
* @param targetURL the affected URL
- * @param desc a desription
+ * @param desc a description
* @param sourceElement the element that corresponds to the source
* of the event
* @param inputEvent InputEvent that triggered the hyperlink event
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -750,7 +750,7 @@
/**
* Searches the attribute set and for each tag
- * that is stored in the tag vector. If the tag isnt found,
+ * that is stored in the tag vector. If the tag is not found,
* then the tag is removed from the vector and a corresponding
* end tag is written out.
*
--- a/jdk/src/share/classes/javax/swing/text/html/OptionListModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/OptionListModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -502,7 +502,7 @@
* leadIndex and newLeadIndex is the new one.
* <p>
* 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 new one.
+ * selecting values in the old range and deselecting values in the new one.
* <p>
* Generate a single event for this change and notify all listeners.
* For the purposes of generating minimal bounds in this event, do the
--- a/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java Fri Nov 08 17:36:14 2013 -0800
@@ -211,7 +211,7 @@
/**
* Renders using the given rendering surface and area on that
- * surface. This is implemented to delgate to the superclass
+ * surface. This is implemented to delegate to the superclass
* after stashing the base coordinate for tab calculations.
*
* @param g the rendering surface to use
--- a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java Fri Nov 08 17:36:14 2013 -0800
@@ -105,7 +105,7 @@
* background. But if the html file also contains the CSS rule
* <code>body { background: blue }</code> it becomes less clear as to
* what color the background of the body should be. The current
- * implemention gives visual attributes defined in the element the
+ * implementation gives visual attributes defined in the element the
* highest precedence, that is they are always checked before any styles.
* Therefore, in the previous example the background would have a
* red color as the body element defines the background color to be red.
@@ -938,7 +938,7 @@
/**
* Sets the base font size from the passed in String. The string
* can either identify a specific font size, with legal values between
- * 1 and 7, or identifiy a relative font size such as +1 or -2.
+ * 1 and 7, or identify a relative font size such as +1 or -2.
*/
public void setBaseFontSize(String size) {
css.setBaseFontSize(size);
@@ -1035,7 +1035,7 @@
}
//
- // The following gaggle of methods is used in maintaing the rules from
+ // The following gaggle of methods is used in maintaining the rules from
// the sheet.
//
@@ -2959,13 +2959,13 @@
return true;
}
if (thisDotIndex != -1) {
- // Reciever references a class, just check element name.
+ // Receiver references a class, just check element name.
return (((thisDotIndex - thisCurrent) == (sLast - sCurrent)) &&
selector.regionMatches(sCurrent, name, thisCurrent,
thisDotIndex - thisCurrent));
}
if (thisPoundIndex != -1) {
- // Reciever references an id, just check element name.
+ // Receiver references an id, just check element name.
return (((thisPoundIndex - thisCurrent) ==(sLast - sCurrent))&&
selector.regionMatches(sCurrent, name, thisCurrent,
thisPoundIndex - thisCurrent));
@@ -2977,7 +2977,7 @@
}
/**
- * Similiar to String.indexOf, but allows an upper bound
+ * Similar to String.indexOf, but allows an upper bound
* (this is slower in that it will still check string starting at
* start.
*/
--- a/jdk/src/share/classes/javax/swing/text/html/TableView.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/TableView.java Fri Nov 08 17:36:14 2013 -0800
@@ -620,7 +620,7 @@
/**
* Perform layout for the minor axis of the box (i.e. the
- * axis orthoginal to the axis that it represents). The results
+ * axis orthogonal to the axis that it represents). The results
* of the layout should be placed in the given arrays which represent
* the allocations to the children along the minor axis. This
* is called by the superclass whenever the layout needs to be
@@ -632,7 +632,7 @@
* of the tables rows.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children
+ * would be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views. This is a return value and is
@@ -675,7 +675,7 @@
* with border spacing and border collapsing capabilities.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children
+ * would be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
@@ -1169,7 +1169,7 @@
}
/**
- * Fixup preferences to accomodate a multi-row table cell
+ * Fixup preferences to accommodate a multi-row table cell
* if not already covered by existing preferences. This is
* a no-op if not all of the rows needed (to do this check/fixup)
* have arrived yet.
@@ -1523,7 +1523,7 @@
* the multi-column span.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children
+ * would be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
@@ -1564,7 +1564,7 @@
/**
* Perform layout for the minor axis of the box (i.e. the
- * axis orthoginal to the axis that it represents). The results
+ * axis orthogonal to the axis that it represents). The results
* of the layout should be placed in the given arrays which represent
* the allocations to the children along the minor axis. This
* is called by the superclass whenever the layout needs to be
@@ -1574,7 +1574,7 @@
* the span for any cell that spans multiple rows.
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children
+ * would be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
@@ -1716,7 +1716,7 @@
* (i.e. position according to the html valign attribute).
*
* @param targetSpan the total span given to the view, which
- * whould be used to layout the children
+ * would be used to layout the children
* @param axis the axis being layed out
* @param offsets the offsets from the origin of the view for
* each of the child views; this is a return value and is
--- a/jdk/src/share/classes/javax/swing/text/html/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -34,7 +34,7 @@
* A representation of a content model. A content model is
* basically a restricted BNF expression. It is restricted in
* the sense that it must be deterministic. This means that you
- * don't have to represent it as a finite state automata.<p>
+ * don't have to represent it as a finite state automaton.<p>
* See Annex H on page 556 of the SGML handbook for more information.
*
* @author Arthur van Hoff
--- a/jdk/src/share/classes/javax/swing/text/html/parser/DocumentParser.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/DocumentParser.java Fri Nov 08 17:36:14 2013 -0800
@@ -69,7 +69,7 @@
* a String value of 'neat' and the String key 'foo' with a String value of
* 'bar'.
* <p>The position argument will indicate the start of the tag, comment
- * or text. Similiar to arrays, the first character in the stream has a
+ * or text. Similar to arrays, the first character in the stream has a
* position of 0. For tags that are
* implied the position will indicate
* the location of the next encountered tag. In the first example,
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Element.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Element.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,7 @@
/**
* An element as described in a DTD using the ELEMENT construct.
- * This is essentiall the description of a tag. It describes the
+ * This is essential the description of a tag. It describes the
* type, content model, attributes, attribute types etc. It is used
* to correctly parse a document by the Parser.
*
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java Fri Nov 08 17:36:14 2013 -0800
@@ -547,7 +547,7 @@
// The use of all error recovery strategies are contingent
// on the value of the strict property.
//
- // These are commonly occuring errors. if insertTag is true,
+ // These are commonly occurring errors. if insertTag is true,
// then we want to adopt an error recovery strategy that
// involves attempting to insert an additional tag to
// legalize the context. The two errors addressed here
@@ -606,7 +606,7 @@
// They try to find a legal context by checking if the current
// tag is valid in an enclosing context. If so
// close out the tags by outputing end tags and then
- // insert the curent tag. If the tags that are
+ // insert the current tag. If the tags that are
// being closed out do not have an optional end tag
// specification in the DTD then an html error is
// reported.
@@ -1761,7 +1761,7 @@
// find the corresponding start tag
- // A commonly occuring error appears to be the insertion
+ // A commonly occurring error appears to be the insertion
// of extra end tags in a table. The intent here is ignore
// such extra end tags.
//
@@ -1769,7 +1769,7 @@
String stackElem = stack.elem.getName();
if (stackElem.equals("table")) {
- // If it isnt a valid end tag ignore it and return
+ // If it is not a valid end tag ignore it and return
//
if (!elem.getName().equals(stackElem)) {
error("tag.ignore", elem.getName());
--- a/jdk/src/share/classes/javax/swing/text/html/parser/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/text/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/text/rtf/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/text/rtf/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java Fri Nov 08 17:36:14 2013 -0800
@@ -68,7 +68,7 @@
/**
* Sets the renderer that is responsible for drawing nodes in the tree
- * and which is threfore responsible for calculating the dimensions of
+ * and which is therefore responsible for calculating the dimensions of
* individual nodes.
*
* @param nd a <code>NodeDimensions</code> object
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java Fri Nov 08 17:36:14 2013 -0800
@@ -45,7 +45,7 @@
* If you do not supply a <code>TreeCellEditor</code>,
* a <code>TextField</code> will be used. Editing is started
* on a triple mouse click, or after a click, pause, click and
- * a delay of 1200 miliseconds.
+ * a delay of 1200 milliseconds.
*<p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
@@ -173,7 +173,7 @@
* Sets the font to edit with. <code>null</code> indicates
* the renderers font should be used. This will NOT
* override any font you have set in the editor
- * the receiver was instantied with. If <code>null</code>
+ * the receiver was instantiated with. If <code>null</code>
* for an editor was passed in a default editor will be
* created that will pick up this font.
*
@@ -216,7 +216,7 @@
isSelected, expanded,leaf, row);
- // this is kept for backwards compatability but isn't really needed
+ // this is kept for backwards compatibility but isn't really needed
// with the current BasicTreeUI implementation.
TreePath newPath = tree.getPathForRow(row);
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java Fri Nov 08 17:36:14 2013 -0800
@@ -62,8 +62,8 @@
* {@code DefaultTreeCellRenderer} property and defaults table key:
* <table border="1" cellpadding="1" cellspacing="0" summary="">
* <tr valign="top" align="left">
- * <th bgcolor="#CCCCFF" align="left">Property:
- * <th bgcolor="#CCCCFF" align="left">Key:
+ * <th style="background-color:#CCCCFF" align="left">Property:
+ * <th style="background-color:#CCCCFF" align="left">Key:
* <tr><td>"leafIcon"<td>"Tree.leafIcon"
* <tr><td>"closedIcon"<td>"Tree.closedIcon"
* <tr><td>"openIcon"<td>"Tree.openIcon"
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -357,7 +357,7 @@
/**
* Invoke this method if you've totally changed the children of
- * node and its childrens children... This will post a
+ * node and its children's children... This will post a
* treeStructureChanged event.
*/
public void nodeStructureChanged(TreeNode node) {
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -1123,7 +1123,7 @@
/**
* This method is obsolete and its implementation is now a noop. It's
* still called by setSelectionPaths and addSelectionPaths, but only
- * for backwards compatability.
+ * for backwards compatibility.
*/
protected void insureUniqueness() {
}
--- a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java Fri Nov 08 17:36:14 2013 -0800
@@ -936,7 +936,7 @@
}
/**
- * Recreates the receivers path, and all its childrens paths.
+ * Recreates the receivers path, and all its children's paths.
*/
protected void resetChildrenPaths(TreePath parentPath) {
removeMapping(this);
@@ -1079,7 +1079,7 @@
}
/**
- * Resets the receivers childrens rows. Starting with the child
+ * Resets the receivers children's rows. Starting with the child
* at <code>childIndex</code> (and <code>modelIndex</code>) to
* <code>newRow</code>. This uses <code>setRowAndChildren</code>
* to recursively descend children, and uses
@@ -1346,7 +1346,7 @@
return true;
}
else {
- // May have been in last childs bounds.
+ // May have been in last child's bounds.
int lastChildEndRow = 1 + child.row -
(child.childIndex - lastChild.childIndex);
@@ -1474,7 +1474,7 @@
/**
* An enumerator to iterate through visible nodes.
*/
- // This is very similiar to
+ // This is very similar to
// VariableHeightTreeState.VisibleTreeStateNodeEnumeration
private class VisibleFHTreeStateNodeEnumeration
implements Enumeration<TreePath>
--- a/jdk/src/share/classes/javax/swing/tree/TreeModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/TreeModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,7 +30,7 @@
* The model used by <code>JTree</code>.
* <p>
* <code>JTree</code> and its related classes make extensive use of
- * <code>TreePath</code>s for indentifying nodes in the <code>TreeModel</code>.
+ * <code>TreePath</code>s for identifying nodes in the <code>TreeModel</code>.
* If a <code>TreeModel</code> returns the same object, as compared by
* <code>equals</code>, at two different indices under the same parent
* than the resulting <code>TreePath</code> objects will be considered equal
--- a/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -47,7 +47,7 @@
*
* A TreeSelectionModel can be configured to allow only one
* path (<code>SINGLE_TREE_SELECTION</code>) a number of
- * continguous paths (<code>CONTIGUOUS_TREE_SELECTION</code>) or a number of
+ * contiguous paths (<code>CONTIGUOUS_TREE_SELECTION</code>) or a number of
* discontiguous paths (<code>DISCONTIGUOUS_TREE_SELECTION</code>).
* A <code>RowMapper</code> is used to determine if TreePaths are
* contiguous.
--- a/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java Fri Nov 08 17:36:14 2013 -0800
@@ -1315,7 +1315,7 @@
//
/**
- * Recreates the receivers path, and all its childrens paths.
+ * Recreates the receivers path, and all its children's paths.
*/
protected void resetChildrenPaths(TreePath parentPath) {
removeMapping(this);
--- a/jdk/src/share/classes/javax/swing/tree/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/tree/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/swing/undo/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/swing/undo/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
or visit www.oracle.com if you need additional information or have any
questions.
-->
-
+<title></title>
</head>
<body bgcolor="white">
--- a/jdk/src/share/classes/javax/xml/crypto/KeySelector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/xml/crypto/KeySelector.java Fri Nov 08 17:36:14 2013 -0800
@@ -34,7 +34,7 @@
/**
* A selector that finds and returns a key using the data contained in a
* {@link KeyInfo} object. An example of an implementation of
- * this class is one that searchs a {@link java.security.KeyStore} for
+ * this class is one that searches a {@link java.security.KeyStore} for
* trusted keys that match information contained in a <code>KeyInfo</code>.
*
* <p>Whether or not the returned key is trusted and the mechanisms
--- a/jdk/src/share/classes/javax/xml/crypto/MarshalException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/xml/crypto/MarshalException.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
/**
- * Indicates an exceptional condition that occured during the XML
+ * Indicates an exceptional condition that occurred during the XML
* marshalling or unmarshalling process.
*
* <p>A <code>MarshalException</code> can contain a cause: another
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/TransformException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/TransformException.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,7 +31,7 @@
import java.io.PrintWriter;
/**
- * Indicates an exceptional condition that occured while executing a
+ * Indicates an exceptional condition that occurred while executing a
* transform algorithm.
*
* <p>A <code>TransformException</code> can contain a cause: another
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignatureException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignatureException.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,7 +31,7 @@
import java.io.PrintWriter;
/**
- * Indicates an exceptional condition that occured during the XML
+ * Indicates an exceptional condition that occurred during the XML
* signature generation or validation process.
*
* <p>An <code>XMLSignatureException</code> can contain a cause: another
--- a/jdk/src/share/classes/jdi-overview.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/jdi-overview.html Fri Nov 08 17:36:14 2013 -0800
@@ -6,7 +6,7 @@
<body>
The Java<sup><font size="-2">TM</font></sup>
Debug Interface (JDI) is a high level Java
-API providing information useful for debuggers and similiar
+API providing information useful for debuggers and similar
systems needing access to the running state of a (usually remote)
virtual machine.
<p>
--- a/jdk/src/share/classes/jdk/internal/org/objectweb/asm/Frame.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/jdk/internal/org/objectweb/asm/Frame.java Fri Nov 08 17:36:14 2013 -0800
@@ -537,7 +537,7 @@
/**
* The types that are initialized in the basic block. A constructor
* invocation on an UNINITIALIZED or UNINITIALIZED_THIS type must replace
- * <i>every occurence</i> of this type in the local variables and in the
+ * <i>every occurrence</i> of this type in the local variables and in the
* operand stack. This cannot be done during the first phase of the
* algorithm since, during this phase, the local variables and the operand
* stack are not completely computed. It is therefore necessary to store the
--- a/jdk/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Analyzer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Analyzer.java Fri Nov 08 17:36:14 2013 -0800
@@ -404,7 +404,7 @@
* instruction of the method. The size of the returned array is
* equal to the number of instructions (and labels) of the method. A
* given frame is <tt>null</tt> if the corresponding instruction
- * cannot be reached, or if an error occured during the analysis of
+ * cannot be reached, or if an error occurred during the analysis of
* the method.
*/
public Frame<V>[] getFrames() {
--- a/jdk/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Interpreter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Interpreter.java Fri Nov 08 17:36:14 2013 -0800
@@ -111,7 +111,7 @@
* the bytecode instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
- * if an error occured during the interpretation.
+ * if an error occurred during the interpretation.
*/
public abstract V newOperation(AbstractInsnNode insn)
throws AnalyzerException;
@@ -130,7 +130,7 @@
* @return the result of the interpretation of the given instruction. The
* returned value must be <tt>equal</tt> to the given value.
* @throws AnalyzerException
- * if an error occured during the interpretation.
+ * if an error occurred during the interpretation.
*/
public abstract V copyOperation(AbstractInsnNode insn, V value)
throws AnalyzerException;
@@ -151,7 +151,7 @@
* the argument of the instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
- * if an error occured during the interpretation.
+ * if an error occurred during the interpretation.
*/
public abstract V unaryOperation(AbstractInsnNode insn, V value)
throws AnalyzerException;
@@ -175,7 +175,7 @@
* the second argument of the instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
- * if an error occured during the interpretation.
+ * if an error occurred during the interpretation.
*/
public abstract V binaryOperation(AbstractInsnNode insn, V value1, V value2)
throws AnalyzerException;
@@ -196,7 +196,7 @@
* the third argument of the instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
- * if an error occured during the interpretation.
+ * if an error occurred during the interpretation.
*/
public abstract V ternaryOperation(AbstractInsnNode insn, V value1,
V value2, V value3) throws AnalyzerException;
@@ -214,7 +214,7 @@
* the arguments of the instruction to be interpreted.
* @return the result of the interpretation of the given instruction.
* @throws AnalyzerException
- * if an error occured during the interpretation.
+ * if an error occurred during the interpretation.
*/
public abstract V naryOperation(AbstractInsnNode insn,
List<? extends V> values) throws AnalyzerException;
@@ -232,7 +232,7 @@
* @param expected
* the expected return type of the analyzed method.
* @throws AnalyzerException
- * if an error occured during the interpretation.
+ * if an error occurred during the interpretation.
*/
public abstract void returnOperation(AbstractInsnNode insn, V value,
V expected) throws AnalyzerException;
--- a/jdk/src/share/classes/jdk/internal/org/xml/sax/EntityResolver.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/jdk/internal/org/xml/sax/EntityResolver.java Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
*
* <p>Many SAX applications will not need to implement this interface,
* but it will be especially useful for applications that build
- * XML documents from databases or other specialised input sources,
+ * XML documents from databases or other specialized input sources,
* or for applications that use URI types other than URLs.</p>
*
* <p>The following resolver would provide the application
--- a/jdk/src/share/classes/jdk/internal/util/xml/XMLStreamException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/jdk/internal/util/xml/XMLStreamException.java Fri Nov 08 17:36:14 2013 -0800
@@ -50,7 +50,7 @@
}
/**
- * Construct an exception with the assocated message.
+ * Construct an exception with the associated message.
*
* @param msg the message to report
*/
@@ -59,7 +59,7 @@
}
/**
- * Construct an exception with the assocated exception
+ * Construct an exception with the associated exception
*
* @param th a nested exception
*/
@@ -69,7 +69,7 @@
}
/**
- * Construct an exception with the assocated message and exception
+ * Construct an exception with the associated message and exception
*
* @param th a nested exception
* @param msg the message to report
--- a/jdk/src/share/classes/jdk/internal/util/xml/impl/Parser.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/jdk/internal/util/xml/impl/Parser.java Fri Nov 08 17:36:14 2013 -0800
@@ -1052,7 +1052,7 @@
case 'X':
case ':':
bkch();
- // Get the attribut from the list or add a new one.
+ // Get the attribute from the list or add a new one.
attqn = qname(mIsNSAware);
att = find(elm.list, attqn);
if (att == null) {
@@ -2960,7 +2960,7 @@
* Parses the xml text declaration.
*
* This method gets encoding from the xml text declaration [#4.3.1] if any.
- * The method assumes the buffer (mChars) is big enough to accomodate whole
+ * The method assumes the buffer (mChars) is big enough to accommodate whole
* xml text declaration.
*
* @param reader is entity reader.
--- a/jdk/src/share/classes/org/ietf/jgss/GSSContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -1094,7 +1094,7 @@
* side and it has to be done prior to the first call to
* <code>initSecContext</code>.<p>
*
- * The actual lifetime of the context will depend on the capabilites of
+ * The actual lifetime of the context will depend on the capabilities of
* the underlying mechanism and the application should call the {@link
* #getLifetime() getLifetime} method to determine this.<p>
*
--- a/jdk/src/share/classes/org/ietf/jgss/GSSCredential.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSCredential.java Fri Nov 08 17:36:14 2013 -0800
@@ -203,7 +203,7 @@
* expire. A return value of 0 indicates that the credential element is
* already expired.
*
- * @param mech the Oid of the mechanism whose intiator credential element
+ * @param mech the Oid of the mechanism whose initiator credential element
* should be queried.
*
* @throws GSSException containing the following
--- a/jdk/src/share/classes/org/ietf/jgss/GSSException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSException.java Fri Nov 08 17:36:14 2013 -0800
@@ -291,7 +291,7 @@
* this exception to be thrown. Major error codes are
* defined at the mechanism independent GSS-API level in this
* class. Mechanism specific error codes that might provide more
- * information aer set as the minor error code.
+ * information are set as the minor error code.
*
* @return int the GSS-API level major error code causing this exception
* @see #getMajorString
--- a/jdk/src/share/classes/org/ietf/jgss/GSSManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -214,7 +214,7 @@
* the namespace type parameter indicates NT_EXPORT_NAME or when the
* GSS-API implementation is not multi-mechanism. It is
* not recommended to use this method with a NT_EXPORT_NAME type because
- * representing a previously exported name consisting of abitrary bytes
+ * representing a previously exported name consisting of arbitrary bytes
* as a String might cause problems with character encoding schemes. In
* such cases it is recommended that the bytes be passed in directly to
* the overloaded form of this method {@link #createName(byte[],
--- a/jdk/src/share/classes/org/ietf/jgss/GSSName.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSName.java Fri Nov 08 17:36:14 2013 -0800
@@ -45,7 +45,7 @@
* single-mechanism environments where the underlying mechanism supports
* multiple namespaces). Different name formats and their definitions are
* identified with {@link Oid Oid's} and some standard types
- * are defind in this interface. The format of the names can be derived
+ * are defined in this interface. The format of the names can be derived
* based on the unique <code>Oid</code> of its name type.<p>
*
* Included below are code examples utilizing the <code>GSSName</code> interface.
--- a/jdk/src/share/classes/org/ietf/jgss/package.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/org/ietf/jgss/package.html Fri Nov 08 17:36:14 2013 -0800
@@ -86,9 +86,9 @@
This model does require that a {@link
javax.security.auth.login JAAS login} be performed in order to
- authenticate and populate a Subject that the JGSS mechnanism can later
+ authenticate and populate a Subject that the JGSS mechanism can later
utilize. However, applications have the ability to relax this
- restiction by means of a system property:
+ restriction by means of a system property:
<code>javax.security.auth.useSubjectCredsOnly</code>. By default
this system property will be assumed to be <code>true</code> (even when
it is unset) indicating that providers must only use the credentials
--- a/jdk/src/share/classes/sun/applet/AppletSecurity.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java Fri Nov 08 17:36:14 2013 -0800
@@ -140,7 +140,7 @@
* fix bug # 6433620 the logic here is : try to find URLClassLoader from
* class context, check its AccessControlContext to see if
* AppletClassLoader is in stack when it's created. for this kind of
- * URLClassLoader, return the AppContext assocated with the
+ * URLClassLoader, return the AppContext associated with the
* AppletClassLoader.
*/
for (int i = 0; i < context.length; i++) {
@@ -304,7 +304,7 @@
*
* @since JDK1.1
* @exception SecurityException if the caller does not have
- * permission to accesss the AWT event queue.
+ * permission to access the AWT event queue.
*/
public void checkAwtEventQueueAccess() {
AppContext appContext = AppContext.getAppContext();
--- a/jdk/src/share/classes/sun/awt/AWTAccessor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,6 +31,7 @@
import java.awt.KeyboardFocusManager;
import java.awt.DefaultKeyboardFocusManager;
import java.awt.event.InputEvent;
+import java.awt.event.InvocationEvent;
import java.awt.event.KeyEvent;
import java.awt.geom.Point2D;
import java.awt.peer.ComponentPeer;
@@ -721,6 +722,13 @@
}
/*
+ * An accessor object for the InvocationEvent class
+ */
+ public interface InvocationEventAccessor {
+ void dispose(InvocationEvent event);
+ }
+
+ /*
* Accessor instances are initialized in the static initializers of
* corresponding AWT classes by using setters defined below.
*/
@@ -748,6 +756,7 @@
private static DefaultKeyboardFocusManagerAccessor defaultKeyboardFocusManagerAccessor;
private static SequencedEventAccessor sequencedEventAccessor;
private static ToolkitAccessor toolkitAccessor;
+ private static InvocationEventAccessor invocationEventAccessor;
/*
* Set an accessor object for the java.awt.Component class.
@@ -1159,4 +1168,18 @@
return toolkitAccessor;
}
+
+ /*
+ * Get the accessor object for the java.awt.event.InvocationEvent class.
+ */
+ public static void setInvocationEventAccessor(InvocationEventAccessor invocationEventAccessor) {
+ AWTAccessor.invocationEventAccessor = invocationEventAccessor;
+ }
+
+ /*
+ * Set the accessor object for the java.awt.event.InvocationEvent class.
+ */
+ public static InvocationEventAccessor getInvocationEventAccessor() {
+ return invocationEventAccessor;
+ }
}
--- a/jdk/src/share/classes/sun/awt/AppContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/awt/AppContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -167,6 +167,9 @@
*/
private static volatile AppContext mainAppContext = null;
+ private static class GetAppContextLock {};
+ private final static Object getAppContextLock = new GetAppContextLock();
+
/*
* The hash map associated with this AppContext. A private delegate
* is used instead of subclassing HashMap so as to avoid all of
@@ -309,14 +312,16 @@
// if no contexts have been created yet. This covers standalone apps
// and excludes applets because by the time applet starts
// a number of contexts have already been created by the plugin.
- if (numAppContexts.get() == 0) {
- if (System.getProperty("javaplugin.version") == null &&
- System.getProperty("javawebstart.version") == null) {
- initMainAppContext();
- } else if (System.getProperty("javafx.version") != null &&
- threadGroup.getParent() != null) {
- // Swing inside JavaFX case
- SunToolkit.createNewAppContext();
+ synchronized (getAppContextLock) {
+ if (numAppContexts.get() == 0) {
+ if (System.getProperty("javaplugin.version") == null &&
+ System.getProperty("javawebstart.version") == null) {
+ initMainAppContext();
+ } else if (System.getProperty("javafx.version") != null &&
+ threadGroup.getParent() != null) {
+ // Swing inside JavaFX case
+ SunToolkit.createNewAppContext();
+ }
}
}
--- a/jdk/src/share/classes/sun/awt/FontConfiguration.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java Fri Nov 08 17:36:14 2013 -0800
@@ -1278,7 +1278,7 @@
//////////////////////////////////////////////////////////////////////
/* The binary font configuration file begins with a short[] "head", which
* contains the offsets to the starts of the individual data table which
- * immediately follow. Teh current implemention includes the tables shown
+ * immediately follow. The current implementation includes the tables shown
* below.
*
* (00) table_scriptIDs :stringIDs of all defined CharacterSubsetNames
@@ -2119,7 +2119,7 @@
private void parseProperty(String key, String value) {
if (key.startsWith("filename.")) {
//the only special case is "MingLiu_HKSCS" which has "_" in its
- //facename, we dont want to replace the "_" with " "
+ //facename, we don't want to replace the "_" with " "
key = key.substring(9);
if (!"MingLiU_HKSCS".equals(key)) {
key = key.replace('_', ' ');
@@ -2224,7 +2224,7 @@
proportionals.put(getID(componentFontNameIDs, key),
getID(componentFontNameIDs, value));
} else {
- //"name.style.script(.motif)", we dont care anything else
+ //"name.style.script(.motif)", we don't care anything else
int dot1, dot2;
boolean isMotif = false;
--- a/jdk/src/share/classes/sun/awt/GlobalCursorManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/awt/GlobalCursorManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -157,7 +157,7 @@
*
* (2) If 'useCache' is true, the native code is free to use a cached
* value to determine the most specific, visible, enabled heavyweight
- * because this update is occuring in response to a mouse move. If
+ * because this update is occurring in response to a mouse move. If
* 'useCache' is false, the native code must perform a new search given
* the current mouse coordinates.
*
--- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1674,6 +1674,15 @@
theObject = translateStream(bais, flavor, format, localeTransferable);
}
+ } else if (flavor.isRepresentationClassRemote()) {
+ try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = new ObjectInputStream(bais))
+ {
+ theObject = RMI.getMarshalledObject(ois.readObject());
+ } catch (Exception e) {
+ throw new IOException(e.getMessage());
+ }
+
// Target data is Serializable
} else if (flavor.isRepresentationClassSerializable()) {
@@ -1731,6 +1740,14 @@
}
theObject = files;
+ // Target data is a String. Strip terminating NUL bytes. Decode bytes
+ // into characters. Search-and-replace EOLN.
+ } else if (String.class.equals(flavor.getRepresentationClass()) &&
+ isFlavorCharsetTextType(flavor) && isTextFormat(format)) {
+
+ return translateBytesToString(inputStreamToByteArray(str),
+ format, localeTransferable);
+
// Special hack to maintain backwards-compatibility with the brokenness
// of StringSelection. Return a StringReader instead of an InputStream.
// Recur to obtain String and encapsulate.
--- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -271,14 +271,11 @@
throw new InvalidDnDOperationException(e.getMessage());
}
} else if (ret instanceof InputStream) {
- InputStream inputStream = (InputStream)ret;
try {
return DataTransferer.getInstance().
- translateStream(inputStream, df, format, this);
+ translateStream((InputStream)ret, df, format, this);
} catch (IOException e) {
throw new InvalidDnDOperationException(e.getMessage());
- } finally {
- inputStream.close();
}
} else {
throw new IOException("no native data was transfered");
--- a/jdk/src/share/classes/sun/awt/shell/ShellFolderManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/awt/shell/ShellFolderManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,7 +48,7 @@
* "fileChooserDefaultFolder":
* Returns a <code>File</code> - the default shellfolder for a new filechooser
* "roots":
- * Returns a <code>File[]</code> - containing the root(s) of the displayable hieararchy
+ * Returns a <code>File[]</code> - containing the root(s) of the displayable hierarchy
* "fileChooserComboBoxFolders":
* Returns a <code>File[]</code> - an array of shellfolders representing the list to
* show by default in the file chooser's combobox
@@ -73,7 +73,7 @@
return homeDir;
}
} else if (key.equals("roots")) {
- // The root(s) of the displayable hieararchy
+ // The root(s) of the displayable hierarchy
return File.listRoots();
} else if (key.equals("fileChooserComboBoxFolders")) {
// Return an array of ShellFolders representing the list to
--- a/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java Fri Nov 08 17:36:14 2013 -0800
@@ -290,7 +290,7 @@
* and Infinity values. Ignoring current path segment in case
* of invalid endpoints's data. Equivalent to the SEG_LINETO
* if endpoint coordinates are valid but there are invalid data
- * amoung other coordinates
+ * among other coordinates
*/
if (point[2] < UPPER_BND && point[2] > LOWER_BND &&
point[3] < UPPER_BND && point[3] > LOWER_BND)
@@ -319,7 +319,7 @@
* and Infinity values. Ignoring current path segment in case
* of invalid endpoints's data. Equivalent to the SEG_LINETO
* if endpoint coordinates are valid but there are invalid data
- * amoung other coordinates
+ * among other coordinates
*/
if (point[4] < UPPER_BND && point[4] > LOWER_BND &&
point[5] < UPPER_BND && point[5] > LOWER_BND)
@@ -545,7 +545,7 @@
* NaN and Infinity values. Ignoring current path segment
* in case of invalid endpoints's data. Equivalent to the
* SEG_LINETO if endpoint coordinates are valid but there
- * are invalid data amoung other coordinates
+ * are invalid data among other coordinates
*/
if (point[2] < UPPER_BND && point[2] > LOWER_BND &&
point[3] < UPPER_BND && point[3] > LOWER_BND)
@@ -574,7 +574,7 @@
* NaN and Infinity values. Ignoring current path segment
* in case of invalid endpoints's data. Equivalent to the
* SEG_LINETO if endpoint coordinates are valid but there
- * are invalid data amoung other coordinates
+ * are invalid data among other coordinates
*/
if (point[4] < UPPER_BND && point[4] > LOWER_BND &&
--- a/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java Fri Nov 08 17:36:14 2013 -0800
@@ -569,7 +569,7 @@
* The output maps this to character positions, and therefore caret positions, via the following assumptions:
* - zero-advance glyphs do not contribute to the advance of their character (i.e. position is ignored), conversely
* if a glyph is to contribute to the advance of its character it must have a non-zero (float) advance
-* - no carets can appear between a zero width character and its preceeding character, where 'preceeding' is
+* - no carets can appear between a zero width character and its preceding character, where 'preceding' is
* defined logically.
* - no carets can appear within a split character
* - no carets can appear within a local reordering (i.e. Indic reordering, or non-adjacent split characters)
--- a/jdk/src/share/classes/sun/font/FileFontStrike.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/FileFontStrike.java Fri Nov 08 17:36:14 2013 -0800
@@ -189,7 +189,7 @@
/* Always segment for fonts with > 256 glyphs, but also for smaller
* fonts with non-typical sizes and transforms.
- * Segmenting for all non-typical pt sizes helps to minimise memory
+ * Segmenting for all non-typical pt sizes helps to minimize memory
* usage when very many distinct strikes are created.
* The size range of 0->5 and 37->INF for segmenting is arbitrary
* but the intention is that typical GUI integer point sizes (6->36)
--- a/jdk/src/share/classes/sun/font/FontManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/FontManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -92,7 +92,7 @@
/**
* If usingPerAppContextComposites is true, we are in "applet"
- * (eg browser) enviroment and at least one context has selected
+ * (eg browser) environment and at least one context has selected
* an alternate composite font behaviour.
*/
public boolean usingPerAppContextComposites();
--- a/jdk/src/share/classes/sun/font/FontRunIterator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/FontRunIterator.java Fri Nov 08 17:36:14 2013 -0800
@@ -90,10 +90,10 @@
* problems: we optimize latin-1 and cjk text assuming a fixed
* width for each character. since latin-1 digits and punctuation
* are common, following this algorithm they will change to match
- * the fonts used for the preceeding text, and potentially change metrics.
+ * the fonts used for the preceding text, and potentially change metrics.
*
* this also seems to have the potential for changing arbitrary runs of text, e.g.
- * any number of digits and spaces can change depending on the preceeding (or following!)
+ * any number of digits and spaces can change depending on the preceding (or following!)
* non-COMMON character's font assignment. this is not good.
*
* since the goal is to enable layout to be performed using as few physical fonts as
--- a/jdk/src/share/classes/sun/font/LayoutPathImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/LayoutPathImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -144,7 +144,7 @@
/**
* Reset the builder for a new path. Datalen is a hint of how many
* points will be in the path, and the working buffer will be sized
- * to accomodate at least this number of points. If datalen is zero,
+ * to accommodate at least this number of points. If datalen is zero,
* the working buffer is freed (it will be allocated on first use).
*/
public void reset(int datalen) {
--- a/jdk/src/share/classes/sun/font/ScriptRun.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/ScriptRun.java Fri Nov 08 17:36:14 2013 -0800
@@ -39,7 +39,7 @@
* the same script, as defined in the <code>Script</code> class.
* It implements a simple iterator over an array of characters.
* The iterator will assign <code>COMMON</code> and <code>INHERITED</code>
- * characters to the same script as the preceeding characters. If the
+ * characters to the same script as the preceding characters. If the
* COMMON and INHERITED characters are first, they will be assigned to
* the same script as the following characters.
*
--- a/jdk/src/share/classes/sun/font/StandardTextSource.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/StandardTextSource.java Fri Nov 08 17:36:14 2013 -0800
@@ -97,7 +97,7 @@
throw new IllegalArgumentException("bad frc: null");
}
- this.chars = chars;
+ this.chars = chars.clone();
this.start = start;
this.len = len;
this.cstart = cstart;
@@ -148,7 +148,7 @@
// TextSource API
public char[] getChars() {
- return chars;
+ return chars.clone();
}
public int getStart() {
--- a/jdk/src/share/classes/sun/font/StrikeCache.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/StrikeCache.java Fri Nov 08 17:36:14 2013 -0800
@@ -166,7 +166,7 @@
* cache strikes. The default is "soft" which hints to keep
* the strikes around. This property allows the client to
* override this to "weak" which hint to the GC to free
- * memory more agressively.
+ * memory more aggressively.
*/
String refType =
System.getProperty("sun.java2d.font.reftype", "soft");
--- a/jdk/src/share/classes/sun/font/SunFontManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/SunFontManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -2814,7 +2814,7 @@
* these methods will be called very rarely.
*
* If _usingPerAppContextComposites is true, we are in "applet"
- * (eg browser) enviroment and at least one context has selected
+ * (eg browser) environment and at least one context has selected
* an alternate composite font behaviour.
* If _usingAlternateComposites is true, we are not in an "applet"
* environment and the (single) application has selected
--- a/jdk/src/share/classes/sun/font/TextLabelFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/TextLabelFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,6 @@
import java.awt.Font;
import java.awt.font.FontRenderContext;
-import java.awt.font.LineMetrics;
import java.text.Bidi;
/**
@@ -70,7 +69,7 @@
Bidi bidi,
int flags) {
this.frc = frc;
- this.text = text;
+ this.text = text.clone();
this.bidi = bidi;
this.flags = flags;
this.lineBidi = bidi;
@@ -82,30 +81,10 @@
return frc;
}
- public char[] getText() {
- return text;
- }
-
- public Bidi getParagraphBidi() {
- return bidi;
- }
-
public Bidi getLineBidi() {
return lineBidi;
}
- public int getLayoutFlags() {
- return flags;
- }
-
- public int getLineStart() {
- return lineStart;
- }
-
- public int getLineLimit() {
- return lineLimit;
- }
-
/**
* Set a line context for the factory. Shaping only occurs on this line.
* Characters are ordered as they would appear on this line.
--- a/jdk/src/share/classes/sun/font/TrueTypeFont.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/TrueTypeFont.java Fri Nov 08 17:36:14 2013 -0800
@@ -630,7 +630,7 @@
* only one of these ranges then we need to distinguish based on
* country. So far this only seems to matter for zh.
* REMIND: Unicode locales such as Hindi do not have a code page so
- * this whole mechansim needs to be revised to map languages to
+ * this whole mechanism needs to be revised to map languages to
* the Unicode ranges either when this fails, or as an additional
* validating test. Basing it on Unicode ranges should get us away
* from needing to map to this small and incomplete set of Windows
--- a/jdk/src/share/classes/sun/font/Type1Font.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/font/Type1Font.java Fri Nov 08 17:36:14 2013 -0800
@@ -368,7 +368,7 @@
String fontType = null;
try {
//Parse font looking for explicit FullName, FamilyName and FontName
- // (acording to Type1 spec they are optional)
+ // (according to Type1 spec they are optional)
while ((fullName == null || familyName == null || psName == null || fontType == null) && !eof) {
int tokenType = nextTokenType(bb);
if (tokenType == PSNAMETOKEN) {
--- a/jdk/src/share/classes/sun/java2d/SurfaceDataProxy.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/SurfaceDataProxy.java Fri Nov 08 17:36:14 2013 -0800
@@ -368,7 +368,7 @@
* be useful given the operational parameters.
* This method checks any preexisting cached copy for being "up to date"
* and tries to update it if it is stale or non-existant and the
- * appropriate number of accesses have occured since it last was stale.
+ * appropriate number of accesses have occurred since it last was stale.
* <p>
* An outline of the process is as follows:
* <ol>
--- a/jdk/src/share/classes/sun/java2d/loops/ProcessPath.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/loops/ProcessPath.java Fri Nov 08 17:36:14 2013 -0800
@@ -744,7 +744,7 @@
/* Checking that we are not running out of the endpoint and bounding
* violating coordinate. The check is pretty simple because the
- * curve passed to the DrawCubic already splitted into the
+ * curve passed to the DrawCubic already split into the
* monotonic in X and Y pieces
*/
@@ -1105,7 +1105,7 @@
/* Checking that we are not running out of the endpoint and
* bounding violating coordinate. The check is pretty simple
- * because the curve passed to the DrawCubic already splitted
+ * because the curve passed to the DrawCubic already split
* into the monotonic in X and Y pieces
*/
--- a/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java Fri Nov 08 17:36:14 2013 -0800
@@ -720,7 +720,7 @@
}
/**
- * This general Blit implemenation converts any source surface to an
+ * This general Blit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->OpenGLSurface/Texture loop to get the intermediate
* (premultiplied) surface down to OpenGL.
--- a/jdk/src/share/classes/sun/java2d/pipe/BufferedMaskFill.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/pipe/BufferedMaskFill.java Fri Nov 08 17:36:14 2013 -0800
@@ -120,7 +120,7 @@
}
}
} else {
- // queue is too small to accomodate entire mask; perform
+ // queue is too small to accommodate entire mask; perform
// the operation directly on the queue flushing thread
rq.flushAndInvokeNow(new Runnable() {
public void run() {
--- a/jdk/src/share/classes/sun/java2d/pipe/BufferedRenderPipe.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/pipe/BufferedRenderPipe.java Fri Nov 08 17:36:14 2013 -0800
@@ -224,7 +224,7 @@
buf.put(xPoints, 0, nPoints);
buf.put(yPoints, 0, nPoints);
} else {
- // queue is too small to accomodate all points; perform the
+ // queue is too small to accommodate all points; perform the
// operation directly on the queue flushing thread
rq.flushAndInvokeNow(new Runnable() {
public void run() {
--- a/jdk/src/share/classes/sun/java2d/pipe/BufferedTextPipe.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/pipe/BufferedTextPipe.java Fri Nov 08 17:36:14 2013 -0800
@@ -137,7 +137,7 @@
buf.put(positions, 0, 2*totalGlyphs);
}
} else {
- // queue is too small to accomodate glyphs; perform
+ // queue is too small to accommodate glyphs; perform
// the operation directly on the queue flushing thread
rq.flushAndInvokeNow(new Runnable() {
public void run() {
--- a/jdk/src/share/classes/sun/java2d/pipe/DrawImage.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/pipe/DrawImage.java Fri Nov 08 17:36:14 2013 -0800
@@ -128,7 +128,7 @@
/*
* This method is only called in those circumstances where the
- * operation has a non-null secondary transform specfied. Its
+ * operation has a non-null secondary transform specified. Its
* role is to check for various optimizations based on the types
* of both the secondary and SG2D transforms and to do some
* quick calculations to avoid having to combine the transforms
--- a/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java Fri Nov 08 17:36:14 2013 -0800
@@ -344,7 +344,7 @@
/**
* Returns the minimum pen width that the antialiasing rasterizer
- * can represent without dropouts occuring.
+ * can represent without dropouts occurring.
* @since 1.7
*/
public abstract float getMinimumAAPenSize();
--- a/jdk/src/share/classes/sun/java2d/pipe/hw/AccelDeviceEventNotifier.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/pipe/hw/AccelDeviceEventNotifier.java Fri Nov 08 17:36:14 2013 -0800
@@ -81,7 +81,7 @@
}
/**
- * Called to indicate that a device event had occured.
+ * Called to indicate that a device event had occurred.
* If a singleton exists, the listeners (those associated with
* the device) will be notified.
*
--- a/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java Fri Nov 08 17:36:14 2013 -0800
@@ -632,7 +632,7 @@
/**
* Returns the minimum pen width that the antialiasing rasterizer
- * can represent without dropouts occuring.
+ * can represent without dropouts occurring.
* @since 1.7
*/
public float getMinimumAAPenSize() {
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfDataBufferImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfDataBufferImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -120,7 +120,7 @@
}
} catch (MonitorException e) {
/*
- * just ignore this here and let the reciever of the
+ * just ignore this here and let the receiver of the
* byte[] detect and handle the problem.
*/
}
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/FileMonitoredVm.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/FileMonitoredVm.java Fri Nov 08 17:36:14 2013 -0800
@@ -34,7 +34,7 @@
/**
* Concrete implementation of the AbstractMonitoredVm class for the
- * <em>file:</em> protcol for the HotSpot PerfData monitoring implementation.
+ * <em>file:</em> protocol for the HotSpot PerfData monitoring implementation.
* <p>
* This class provides the ability to attach to the instrumentation buffer
* (saved or live) of a target Java Virtual Machine by providing a
--- a/jdk/src/share/classes/sun/management/counter/perf/InstrumentationException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/management/counter/perf/InstrumentationException.java Fri Nov 08 17:36:14 2013 -0800
@@ -28,14 +28,14 @@
public class InstrumentationException extends RuntimeException {
/**
* Constructs a <tt>InstrumentationException</tt> with no
- * detail mesage.
+ * detail message.
*/
public InstrumentationException() {
}
/**
* Constructs a <tt>InstrumentationException</tt> with a specified
- * detail mesage.
+ * detail message.
*
* @param message the detail message
*/
--- a/jdk/src/share/classes/sun/management/counter/perf/PerfDataType.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/management/counter/perf/PerfDataType.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,7 @@
* performance data.
*
* <p> The enumeration values for this typesafe enumeration must be
- * kept in sychronization with the PerfDataType enum in the
+ * kept in synchronization with the PerfDataType enum in the
* globalsDefinitions.hpp file in the HotSpot source base.</p>
*
* @author Brian Doherty
--- a/jdk/src/share/classes/sun/misc/CRC16.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/misc/CRC16.java Fri Nov 08 17:36:14 2013 -0800
@@ -28,7 +28,7 @@
/**
* The CRC-16 class calculates a 16 bit cyclic redundancy check of a set
* of bytes. This error detecting code is used to determine if bit rot
- * has occured in a byte stream.
+ * has occurred in a byte stream.
*/
public class CRC16 {
--- a/jdk/src/share/classes/sun/misc/CharacterDecoder.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/misc/CharacterDecoder.java Fri Nov 08 17:36:14 2013 -0800
@@ -145,7 +145,7 @@
* Decode the text from the InputStream and write the decoded
* octets to the OutputStream. This method runs until the stream
* is exhausted.
- * @exception CEFormatException An error has occured while decoding
+ * @exception CEFormatException An error has occurred while decoding
* @exception CEStreamExhausted The input stream is unexpectedly out of data
*/
public void decodeBuffer(InputStream aStream, OutputStream bStream) throws IOException {
@@ -181,7 +181,7 @@
/**
* Alternate decode interface that takes a String containing the encoded
* buffer and returns a byte array containing the data.
- * @exception CEFormatException An error has occured while decoding
+ * @exception CEFormatException An error has occurred while decoding
*/
public byte decodeBuffer(String inputString)[] throws IOException {
byte inputBuffer[] = new byte[inputString.length()];
--- a/jdk/src/share/classes/sun/misc/PerformanceLogger.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/misc/PerformanceLogger.java Fri Nov 08 17:36:14 2013 -0800
@@ -37,7 +37,7 @@
* This class is intended to be a central place for the jdk to
* log timing events of interest. There is pre-defined event
* of startTime, as well as a general
- * mechanism of setting aribtrary times in an array.
+ * mechanism of setting arbitrary times in an array.
* All unreserved times in the array can be used by callers
* in application-defined situations. The caller is responsible
* for setting and getting all times and for doing whatever
--- a/jdk/src/share/classes/sun/net/NetworkClient.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/NetworkClient.java Fri Nov 08 17:36:14 2013 -0800
@@ -244,7 +244,7 @@
* Sets the read timeout.
*
* Note: Public URLConnection (and protocol specific implementations)
- * protect against negative timeout values being set. This implemenation,
+ * protect against negative timeout values being set. This implementation,
* and protocol specific implementations, use -1 to represent the default
* read timeout.
*
--- a/jdk/src/share/classes/sun/net/TelnetOutputStream.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/TelnetOutputStream.java Fri Nov 08 17:36:14 2013 -0800
@@ -81,7 +81,7 @@
}
/**
- * set the stickyCRLF flag. Tells wether the terminal considers CRLF as a single
+ * set the stickyCRLF flag. Tells whether the terminal considers CRLF as a single
* char.
*
* @param on the <code>boolean</code> to set the flag to.
--- a/jdk/src/share/classes/sun/net/ftp/FtpClient.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/ftp/FtpClient.java Fri Nov 08 17:36:14 2013 -0800
@@ -267,7 +267,7 @@
* @param user The user name
* @param password The password for that user
* @return this FtpClient
- * @throws IOException if an error occured during the transmission
+ * @throws IOException if an error occurred during the transmission
* @throws FtpProtocolException if the login was refused by the server
*/
public abstract FtpClient login(String user, char[] password) throws FtpProtocolException, IOException;
@@ -378,7 +378,7 @@
*
* @param name the name of the remote file
* @return the {@link java.io.InputStream} from the data connection
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was refused by the server
* @see #setRestartOffset(long)
*/
@@ -398,7 +398,7 @@
* @param name the name of the remote file to write.
* @return the {@link java.io.OutputStream} from the data connection or
* {@code null} if the command was unsuccessful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public OutputStream putFileStream(String name) throws FtpProtocolException, IOException {
@@ -427,7 +427,7 @@
* @param unique {@code true} if the remote files should be unique,
* in which case the STOU command will be used.
* @return the {@link java.io.OutputStream} from the data connection.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract OutputStream putFileStream(String name, boolean unique) throws FtpProtocolException, IOException;
@@ -456,7 +456,7 @@
* @param local the {@code InputStream} that points to the data to
* transfer.
* @return this FtpClient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public FtpClient putFile(String name, InputStream local) throws FtpProtocolException, IOException {
@@ -481,7 +481,7 @@
* @param unique {@code true} if the remote file should be unique
* (i.e. not already existing), {@code false} otherwise.
* @return this FtpClient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
* @see #getLastFileName()
*/
@@ -500,7 +500,7 @@
* @param local The {@code InputStream} providing access to the data
* to be appended.
* @return this FtpClient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient appendFile(String name, InputStream local) throws FtpProtocolException, IOException;
@@ -511,7 +511,7 @@
* @param from the name of the file being renamed
* @param to the new name for the file
* @return this FtpClient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient rename(String from, String to) throws FtpProtocolException, IOException;
@@ -522,7 +522,7 @@
* @param name a {@code String} containing the name of the file
* to delete.
* @return this FtpClient
- * @throws IOException if an error occured during the exchange
+ * @throws IOException if an error occurred during the exchange
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient deleteFile(String name) throws FtpProtocolException, IOException;
@@ -533,7 +533,7 @@
* @param name a {@code String} containing the name of the directory
* to create.
* @return this FtpClient
- * @throws IOException if an error occured during the exchange
+ * @throws IOException if an error occurred during the exchange
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient makeDirectory(String name) throws FtpProtocolException, IOException;
@@ -545,7 +545,7 @@
* to remove.
*
* @return this FtpClient
- * @throws IOException if an error occured during the exchange.
+ * @throws IOException if an error occurred during the exchange.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient removeDirectory(String name) throws FtpProtocolException, IOException;
@@ -555,7 +555,7 @@
* status or as a <I>keep alive</I> mechanism.
*
* @return this FtpClient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient noop() throws FtpProtocolException, IOException;
@@ -572,7 +572,7 @@
* @param name an optional {@code String} containing the pathname
* the STAT command should apply to.
* @return the response from the server
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract String getStatus(String name) throws FtpProtocolException, IOException;
@@ -602,7 +602,7 @@
* after an abort.</p>
*
* @return this FtpClient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient abort() throws FtpProtocolException, IOException;
@@ -637,7 +637,7 @@
* </pre>
* <p>Since {@link #close()} will call completePending() if necessary.</p>
* @return this FtpClient
- * @throws IOException if an error occured during the transfer
+ * @throws IOException if an error occurred during the transfer
* @throws FtpProtocolException if the command didn't complete successfully
*/
public abstract FtpClient completePending() throws FtpProtocolException, IOException;
@@ -786,7 +786,7 @@
* for the current working directoty.
* @return a {@code Iterator} of files or {@code null} if the
* command failed.
- * @throws IOException if an error occured during the transmission
+ * @throws IOException if an error occurred during the transmission
* @see #setDirParser(FtpDirParser)
* @see #changeDirectory(String)
* @throws FtpProtocolException if the command was rejected by the server
@@ -862,7 +862,7 @@
* but before calling {@link #login(java.lang.String, char[]) }.</p>
*
* @return this FtpCLient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
* @see #endSecureSession()
*/
@@ -874,7 +874,7 @@
* back to a non encrypted transmission.
*
* @return this FtpClient
- * @throws IOException if an error occured during transmission.
+ * @throws IOException if an error occurred during transmission.
* @throws FtpProtocolException if the command was rejected by the server
* @see #startSecureSession()
*/
@@ -886,7 +886,7 @@
*
* @param size The number of bytes to allocate.
* @return this FtpClient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient allocate(long size) throws FtpProtocolException, IOException;
@@ -899,7 +899,7 @@
* @param struct a {@code String} containing the name of the
* structure to mount.
* @return this FtpClient
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient structureMount(String struct) throws FtpProtocolException, IOException;
@@ -911,7 +911,7 @@
*
* @return a {@code String} describing the OS, or {@code null}
* if the operation was not successful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract String getSystem() throws FtpProtocolException, IOException;
@@ -924,7 +924,7 @@
* {@code null} for the general help
* @return a {@code String} containing the text sent back by the
* server, or {@code null} if the command failed.
- * @throws IOException if an error occured during transmission
+ * @throws IOException if an error occurred during transmission
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract String getHelp(String cmd) throws FtpProtocolException, IOException;
@@ -936,7 +936,7 @@
*
* @param cmd the command to be sent.
* @return this FtpClient
- * @throws IOException if an error occured during transmission
+ * @throws IOException if an error occurred during transmission
* @throws FtpProtocolException if the command was rejected by the server
*/
public abstract FtpClient siteCmd(String cmd) throws FtpProtocolException, IOException;
--- a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java Fri Nov 08 17:36:14 2013 -0800
@@ -491,7 +491,7 @@
* Read the reply from the FTP server.
*
* @return <code>true</code> if the command was successful
- * @throws IOException if an error occured
+ * @throws IOException if an error occurred
*/
private boolean readReply() throws IOException {
lastReplyCode = FtpReplyCode.find(readServerResponse());
@@ -537,7 +537,7 @@
*
* @param cmd String containing the command
*
- * @throws FtpProtocolException if an error occured
+ * @throws FtpProtocolException if an error occurred
*/
private void issueCommandCheck(String cmd) throws sun.net.ftp.FtpProtocolException, IOException {
if (!issueCommand(cmd)) {
@@ -738,7 +738,7 @@
// Some FTP servers (like the one on Solaris) are bugged, they
// will accept the EPRT command but then, the subsequent command
// (e.g. RETR) will fail, so we have to check BOTH results (the
- // EPRT cmd then the actual command) to decide wether we should
+ // EPRT cmd then the actual command) to decide whether we should
// fall back on the older PORT command.
portCmd = "EPRT |" + ((myAddress instanceof Inet6Address) ? "2" : "1") + "|" +
myAddress.getHostAddress() + "|" + portSocket.getLocalPort() + "|";
@@ -1037,7 +1037,7 @@
* @param user The user name
* @param password The password for that user
* @return <code>true</code> if the login was successful.
- * @throws IOException if an error occured during the transmission
+ * @throws IOException if an error occurred during the transmission
*/
public sun.net.ftp.FtpClient login(String user, char[] password) throws sun.net.ftp.FtpProtocolException, IOException {
if (!isConnected()) {
@@ -1262,7 +1262,7 @@
* @param name the name of the remote file
* @return the {@link java.io.InputStream} from the data connection, or
* <code>null</code> if the command was unsuccessful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
*/
public InputStream getFileStream(String name) throws sun.net.ftp.FtpProtocolException, IOException {
Socket s;
@@ -1311,7 +1311,7 @@
* in which case the STOU command will be used.
* @return the {@link java.io.OutputStream} from the data connection or
* <code>null</code> if the command was unsuccessful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
*/
public OutputStream putFileStream(String name, boolean unique)
throws sun.net.ftp.FtpProtocolException, IOException
@@ -1340,7 +1340,7 @@
* @param unique <code>true</code> if the remote file should be unique
* (i.e. not already existing), <code>false</code> otherwise.
* @return <code>true</code> if the transfer was successful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @see #getLastFileName()
*/
public sun.net.ftp.FtpClient putFile(String name, InputStream local, boolean unique) throws sun.net.ftp.FtpProtocolException, IOException {
@@ -1371,7 +1371,7 @@
* @param local The <code>InputStream</code> providing access to the data
* to be appended.
* @return <code>true</code> if the transfer was successful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
*/
public sun.net.ftp.FtpClient appendFile(String name, InputStream local) throws sun.net.ftp.FtpProtocolException, IOException {
int mtu = 1500;
@@ -1407,7 +1407,7 @@
* @param name a <code>String</code> containing the name of the file
* to delete.
* @return <code>true</code> if the command was successful
- * @throws IOException if an error occured during the exchange
+ * @throws IOException if an error occurred during the exchange
*/
public sun.net.ftp.FtpClient deleteFile(String name) throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("DELE " + name);
@@ -1420,7 +1420,7 @@
* @param name a <code>String</code> containing the name of the directory
* to create.
* @return <code>true</code> if the operation was successful.
- * @throws IOException if an error occured during the exchange
+ * @throws IOException if an error occurred during the exchange
*/
public sun.net.ftp.FtpClient makeDirectory(String name) throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("MKD " + name);
@@ -1434,7 +1434,7 @@
* to remove.
*
* @return <code>true</code> if the operation was successful.
- * @throws IOException if an error occured during the exchange.
+ * @throws IOException if an error occurred during the exchange.
*/
public sun.net.ftp.FtpClient removeDirectory(String name) throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("RMD " + name);
@@ -1465,7 +1465,7 @@
* the STAT command should apply to.
* @return the response from the server or <code>null</code> if the
* command failed.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
*/
public String getStatus(String name) throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck((name == null ? "STAT" : "STAT " + name));
@@ -1548,7 +1548,7 @@
* It tells the server to stop the previous command or transfer.
*
* @return <code>true</code> if the command was successful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
*/
public sun.net.ftp.FtpClient abort() throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("ABOR");
@@ -1871,7 +1871,7 @@
* for the current working directoty.
* @return a <code>Iterator</code> of files or <code>null</code> if the
* command failed.
- * @throws IOException if an error occured during the transmission
+ * @throws IOException if an error occurred during the transmission
* @see #setDirParser(FtpDirParser)
* @see #changeDirectory(String)
*/
@@ -2038,7 +2038,7 @@
* {@link #reInit()} command or a {@link #endSecureSession()} command is issued.
*
* @return <code>true</code> if the operation was successful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
* @see #endSecureSession()
*/
public sun.net.ftp.FtpClient startSecureSession() throws sun.net.ftp.FtpProtocolException, IOException {
@@ -2086,7 +2086,7 @@
* back to a non crypted transmission.
*
* @return <code>true</code> if the operation was successful.
- * @throws IOException if an error occured during transmission.
+ * @throws IOException if an error occurred during transmission.
* @see #startSecureSession()
*/
public sun.net.ftp.FtpClient endSecureSession() throws sun.net.ftp.FtpProtocolException, IOException {
@@ -2117,7 +2117,7 @@
*
* @param size The number of bytes to allocate.
* @return <code>true</code> if the operation was successful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
*/
public sun.net.ftp.FtpClient allocate(long size) throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("ALLO " + size);
@@ -2132,7 +2132,7 @@
* @param struct a <code>String</code> containing the name of the
* structure to mount.
* @return <code>true</code> if the operation was successful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
*/
public sun.net.ftp.FtpClient structureMount(String struct) throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("SMNT " + struct);
@@ -2146,7 +2146,7 @@
*
* @return a <code>String</code> describing the OS, or <code>null</code>
* if the operation was not successful.
- * @throws IOException if an error occured during the transmission.
+ * @throws IOException if an error occurred during the transmission.
*/
public String getSystem() throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("SYST");
@@ -2166,7 +2166,7 @@
* <code>null</code> for the general help
* @return a <code>String</code> containing the text sent back by the
* server, or <code>null</code> if the command failed.
- * @throws IOException if an error occured during transmission
+ * @throws IOException if an error occurred during transmission
*/
public String getHelp(String cmd) throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("HELP " + cmd);
@@ -2209,7 +2209,7 @@
*
* @param cmd the command to be sent.
* @return <code>true</code> if the command was successful.
- * @throws IOException if an error occured during transmission
+ * @throws IOException if an error occurred during transmission
*/
public sun.net.ftp.FtpClient siteCmd(String cmd) throws sun.net.ftp.FtpProtocolException, IOException {
issueCommandCheck("SITE " + cmd);
--- a/jdk/src/share/classes/sun/net/httpserver/Request.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/httpserver/Request.java Fri Nov 08 17:36:14 2013 -0800
@@ -222,7 +222,7 @@
ByteBuffer chanbuf;
byte[] one;
private boolean closed = false, eof = false;
- ByteBuffer markBuf; /* reads may be satisifed from this buffer */
+ ByteBuffer markBuf; /* reads may be satisfied from this buffer */
boolean marked;
boolean reset;
int readlimit;
--- a/jdk/src/share/classes/sun/net/idn/StringPrep.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/idn/StringPrep.java Fri Nov 08 17:36:14 2013 -0800
@@ -153,7 +153,7 @@
}
}
- // CharTrie implmentation for reading the trie data
+ // CharTrie implementation for reading the trie data
private StringPrepTrieImpl sprepTrieImpl;
// Indexes read from the data file
private int[] indexes;
--- a/jdk/src/share/classes/sun/net/smtp/SmtpProtocolException.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/smtp/SmtpProtocolException.java Fri Nov 08 17:36:14 2013 -0800
@@ -28,7 +28,7 @@
import java.io.IOException;
/**
- * This exeception is thrown when unexpected results are returned during
+ * This exception is thrown when unexpected results are returned during
* an SMTP session.
*/
public class SmtpProtocolException extends IOException {
--- a/jdk/src/share/classes/sun/net/www/http/ChunkedInputStream.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/www/http/ChunkedInputStream.java Fri Nov 08 17:36:14 2013 -0800
@@ -755,7 +755,7 @@
* stream. If the last chunk (and optional trailers) can be read without
* blocking then the stream is considered hurried.
* <p>
- * Note that if an error has occured or we can't get to last chunk
+ * Note that if an error has occurred or we can't get to last chunk
* without blocking then this stream can't be hurried and should be
* closed.
*/
--- a/jdk/src/share/classes/sun/net/www/http/HttpClient.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/www/http/HttpClient.java Fri Nov 08 17:36:14 2013 -0800
@@ -247,7 +247,7 @@
}
/* This class has no public constructor for HTTP. This method is used to
- * get an HttpClient to the specifed URL. If there's currently an
+ * get an HttpClient to the specified URL. If there's currently an
* active HttpClient to that server/port, you'll get that one.
*/
public static HttpClient New(URL url)
--- a/jdk/src/share/classes/sun/net/www/http/PosterOutputStream.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/www/http/PosterOutputStream.java Fri Nov 08 17:36:14 2013 -0800
@@ -81,7 +81,7 @@
/**
* Resets the <code>count</code> field of this output
* stream to zero, so that all currently accumulated output in the
- * ouput stream is discarded. The output stream can be used again,
+ * output stream is discarded. The output stream can be used again,
* reusing the already allocated buffer space. If the output stream
* has been closed, then this method has no effect.
*
--- a/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheValue.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheValue.java Fri Nov 08 17:36:14 2013 -0800
@@ -29,7 +29,7 @@
import java.net.PasswordAuthentication;
/**
- * AuthCacheValue: interface to minimise exposure to authentication cache
+ * AuthCacheValue: interface to minimize exposure to authentication cache
* for external users (ie. plugin)
*
* @author Michael McMahon
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Fri Nov 08 17:36:14 2013 -0800
@@ -2268,7 +2268,7 @@
* Gets the authentication for an HTTP server, and applies it to
* the connection.
* @param authHdr the AuthenticationHeader which tells what auth scheme is
- * prefered.
+ * preferred.
*/
@SuppressWarnings("fallthrough")
private AuthenticationInfo getServerAuthentication (AuthenticationHeader authhdr) {
--- a/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Fri Nov 08 17:36:14 2013 -0800
@@ -128,7 +128,7 @@
"gb2312-1980",
"euc-cn",
"euccn",
- "x-EUC-CN", // 1.4 compatability
+ "x-EUC-CN", // 1.4 compatibility
"EUC_CN" //JDK historical
});
--- a/jdk/src/share/classes/sun/print/PSPathGraphics.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/print/PSPathGraphics.java Fri Nov 08 17:36:14 2013 -0800
@@ -258,7 +258,7 @@
*
* @param img The image to be drawn.
* This method does nothing if <code>img</code> is null.
- * @param xform Used to tranform the image before drawing.
+ * @param xform Used to transform the image before drawing.
* This can be null.
* @param bgcolor This color is drawn where the image has transparent
* pixels. If this parameter is null then the
--- a/jdk/src/share/classes/sun/print/PSPrinterJob.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java Fri Nov 08 17:36:14 2013 -0800
@@ -1644,7 +1644,7 @@
/*
* Currently CharToByteConverter.getCharacterEncoding() return values are
* not fixed yet. These are used as the part of the key of
- * psfont.propeties. When those name are fixed this routine can
+ * psfont.properties. When those name are fixed this routine can
* be erased.
*/
private String makeCharsetName(String name, char[] chs) {
--- a/jdk/src/share/classes/sun/print/PathGraphics.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/print/PathGraphics.java Fri Nov 08 17:36:14 2013 -0800
@@ -1340,7 +1340,7 @@
*
* @param img The image to be drawn.
* This method does nothing if <code>img</code> is null.
- * @param xform Used to tranform the image before drawing.
+ * @param xform Used to transform the image before drawing.
* This can be null.
* @param bgcolor This color is drawn where the image has transparent
* pixels. If this parameter is null then the
--- a/jdk/src/share/classes/sun/print/PrintJob2D.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/print/PrintJob2D.java Fri Nov 08 17:36:14 2013 -0800
@@ -812,7 +812,7 @@
currentGraphics.translate(pageFormat.getImageableX(),
pageFormat.getImageableY());
- /* Scale to accomodate AWT's notion of printer resolution */
+ /* Scale to accommodate AWT's notion of printer resolution */
double awtScale = 72.0/getPageResolutionInternal();
currentGraphics.scale(awtScale, awtScale);
--- a/jdk/src/share/classes/sun/print/RasterPrinterJob.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/print/RasterPrinterJob.java Fri Nov 08 17:36:14 2013 -0800
@@ -118,6 +118,16 @@
protected static final int STREAM = 2;
/**
+ * Pageable MAX pages
+ */
+ protected static final int MAX_UNKNOWN_PAGES = 9999;
+
+ protected static final int PD_ALLPAGES = 0x00000000;
+ protected static final int PD_SELECTION = 0x00000001;
+ protected static final int PD_PAGENUMS = 0x00000002;
+ protected static final int PD_NOSELECTION = 0x00000004;
+
+ /**
* Maximum amount of memory in bytes to use for the
* buffered image "band". 4Mb is a compromise between
* limiting the number of bands on hi-res printers and
@@ -195,7 +205,7 @@
/* Instance Variables */
/**
- * Used to minimise GC & reallocation of band when printing
+ * Used to minimize GC & reallocation of band when printing
*/
private int cachedBandWidth = 0;
private int cachedBandHeight = 0;
@@ -800,6 +810,14 @@
}
}
+ protected PageFormat getPageFormatFromAttributes() {
+ if (attributes == null) {
+ return null;
+ }
+ return attributeToPageFormat(getPrintService(), this.attributes);
+ }
+
+
/**
* Presents the user a dialog for changing properties of the
* print job interactively.
@@ -1359,34 +1377,7 @@
setAttributes(attributes);
// throw exception for invalid destination
if (destinationAttr != null) {
- // destinationAttr is null for Destination(new URI(""))
- // because isAttributeValueSupported returns false in setAttributes
-
- // Destination(new URI(" ")) throws URISyntaxException
- File f = new File(destinationAttr);
- try {
- // check if this is a new file and if filename chars are valid
- if (f.createNewFile()) {
- f.delete();
- }
- } catch (IOException ioe) {
- throw new PrinterException("Cannot write to file:"+
- destinationAttr);
- } catch (SecurityException se) {
- //There is already file read/write access so at this point
- // only delete access is denied. Just ignore it because in
- // most cases the file created in createNewFile gets overwritten
- // anyway.
- }
-
- File pFile = f.getParentFile();
- if ((f.exists() &&
- (!f.isFile() || !f.canWrite())) ||
- ((pFile != null) &&
- (!pFile.exists() || (pFile.exists() && !pFile.canWrite())))) {
- throw new PrinterException("Cannot write to file:"+
- destinationAttr);
- }
+ validateDestination(destinationAttr);
}
} else {
spoolToService(psvc, attributes);
@@ -1509,6 +1500,40 @@
}
}
+ protected void validateDestination(String dest) throws PrinterException {
+ if (dest == null) {
+ return;
+ }
+ // dest is null for Destination(new URI(""))
+ // because isAttributeValueSupported returns false in setAttributes
+
+ // Destination(new URI(" ")) throws URISyntaxException
+ File f = new File(dest);
+ try {
+ // check if this is a new file and if filename chars are valid
+ if (f.createNewFile()) {
+ f.delete();
+ }
+ } catch (IOException ioe) {
+ throw new PrinterException("Cannot write to file:"+
+ dest);
+ } catch (SecurityException se) {
+ //There is already file read/write access so at this point
+ // only delete access is denied. Just ignore it because in
+ // most cases the file created in createNewFile gets overwritten
+ // anyway.
+ }
+
+ File pFile = f.getParentFile();
+ if ((f.exists() &&
+ (!f.isFile() || !f.canWrite())) ||
+ ((pFile != null) &&
+ (!pFile.exists() || (pFile.exists() && !pFile.canWrite())))) {
+ throw new PrinterException("Cannot write to file:"+
+ dest);
+ }
+ }
+
/**
* updates a Paper object to reflect the current printer's selected
* paper size and imageable area for that paper size.
@@ -1755,6 +1780,78 @@
return mCollate;
}
+ protected final int getSelectAttrib() {
+ if (attributes != null) {
+ SunPageSelection pages =
+ (SunPageSelection)attributes.get(SunPageSelection.class);
+ if (pages == SunPageSelection.RANGE) {
+ return PD_PAGENUMS;
+ } else if (pages == SunPageSelection.SELECTION) {
+ return PD_SELECTION;
+ } else if (pages == SunPageSelection.ALL) {
+ return PD_ALLPAGES;
+ }
+ }
+ return PD_NOSELECTION;
+ }
+
+ //returns 1-based index for "From" page
+ protected final int getFromPageAttrib() {
+ if (attributes != null) {
+ PageRanges pageRangesAttr =
+ (PageRanges)attributes.get(PageRanges.class);
+ if (pageRangesAttr != null) {
+ int[][] range = pageRangesAttr.getMembers();
+ return range[0][0];
+ }
+ }
+ return getMinPageAttrib();
+ }
+
+ //returns 1-based index for "To" page
+ protected final int getToPageAttrib() {
+ if (attributes != null) {
+ PageRanges pageRangesAttr =
+ (PageRanges)attributes.get(PageRanges.class);
+ if (pageRangesAttr != null) {
+ int[][] range = pageRangesAttr.getMembers();
+ return range[range.length-1][1];
+ }
+ }
+ return getMaxPageAttrib();
+ }
+
+ protected final int getMinPageAttrib() {
+ if (attributes != null) {
+ SunMinMaxPage s =
+ (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
+ if (s != null) {
+ return s.getMin();
+ }
+ }
+ return 1;
+ }
+
+ protected final int getMaxPageAttrib() {
+ if (attributes != null) {
+ SunMinMaxPage s =
+ (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
+ if (s != null) {
+ return s.getMax();
+ }
+ }
+
+ Pageable pageable = getPageable();
+ if (pageable != null) {
+ int numPages = pageable.getNumberOfPages();
+ if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
+ numPages = MAX_UNKNOWN_PAGES;
+ }
+ return ((numPages == 0) ? 1 : numPages);
+ }
+
+ return Integer.MAX_VALUE;
+ }
/**
* Called by the print() method at the start of
* a print job.
--- a/jdk/src/share/classes/sun/rmi/rmic/RemoteClass.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/rmic/RemoteClass.java Fri Nov 08 17:36:14 2013 -0800
@@ -621,7 +621,7 @@
/**
* Sort array of class declarations alphabetically by their mangled
- * fully-qualfied class name. This is used to feed a method's exceptions
+ * fully-qualified class name. This is used to feed a method's exceptions
* in a canonical order into the digest stream for the interface hash
* computation.
*/
--- a/jdk/src/share/classes/sun/rmi/rmic/Util.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/rmic/Util.java Fri Nov 08 17:36:14 2013 -0800
@@ -52,7 +52,7 @@
* class.
* @param theClass The fully qualified name of the class.
* @param rootDir The directory to use as the root of the
- * package heirarchy. May be null, in which case the current
+ * package hierarchy. May be null, in which case the current
* working directory is used as the root.
*/
public static File getOutputDirectoryFor(Identifier theClass,
--- a/jdk/src/share/classes/sun/rmi/rmic/newrmic/jrmp/StubSkeletonWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/rmic/newrmic/jrmp/StubSkeletonWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -53,7 +53,7 @@
/** rmic environment for this object */
private final BatchEnvironment env;
- /** the remote implemention class to generate code for */
+ /** the remote implementation class to generate code for */
private final RemoteClass remoteClass;
/** version of the JRMP stub protocol to generate code for */
--- a/jdk/src/share/classes/sun/rmi/runtime/Log.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/runtime/Log.java Fri Nov 08 17:36:14 2013 -0800
@@ -379,7 +379,7 @@
private LogStreamLog(LogStream stream, Level level) {
if ((stream != null) && (level != null)) {
- /* if the stream or level is null, dont log any
+ /* if the stream or level is null, don't log any
* messages
*/
levelValue = level.intValue();
--- a/jdk/src/share/classes/sun/rmi/server/Activation.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/server/Activation.java Fri Nov 08 17:36:14 2013 -0800
@@ -684,7 +684,7 @@
* Now exit... A System.exit should only be done if
* the RMI activation system daemon was started up
* by the main method below (in which should always
- * be the case since the Activation contructor is private).
+ * be the case since the Activation constructor is private).
*/
System.err.println(getTextResource("rmid.daemon.shutdown"));
System.exit(0);
@@ -784,7 +784,7 @@
/**
* Container for group information: group's descriptor, group's
* instantiator, flag to indicate pending group creation, and
- * table of the group's actived objects.
+ * table of the objects that are activated in the group.
*
* WARNING: GroupEntry objects should not be written into log file
* updates. GroupEntrys are inner classes of Activation and they
--- a/jdk/src/share/classes/sun/rmi/transport/ObjectTable.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/transport/ObjectTable.java Fri Nov 08 17:36:14 2013 -0800
@@ -223,7 +223,7 @@
/**
* Process client VM signalling reference for given ObjID: forward to
- * correspoding Target entry. If ObjID is not found in table,
+ * corresponding Target entry. If ObjID is not found in table,
* no action is taken.
*/
static void referenced(ObjID id, long sequenceNum, VMID vmid) {
@@ -239,7 +239,7 @@
/**
* Process client VM dropping reference for given ObjID: forward to
- * correspoding Target entry. If ObjID is not found in table,
+ * corresponding Target entry. If ObjID is not found in table,
* no action is taken.
*/
static void unreferenced(ObjID id, long sequenceNum, VMID vmid,
--- a/jdk/src/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java Fri Nov 08 17:36:14 2013 -0800
@@ -367,7 +367,7 @@
/**
* Send packet of requested data on connection to remote endpoint.
* @param info connection information structure
- * @param buf array containg bytes to send
+ * @param buf array containing bytes to send
* @param off offset of first array index of packet
* @param len number of bytes in packet to send
*/
--- a/jdk/src/share/classes/sun/rmi/transport/tcp/MultiplexOutputStream.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/MultiplexOutputStream.java Fri Nov 08 17:36:14 2013 -0800
@@ -27,7 +27,7 @@
import java.io.*;
/**
- * MultiplexOutputStream manages sending data over a conection managed
+ * MultiplexOutputStream manages sending data over a connection managed
* by a ConnectionMultiplexer object. Data written is buffered until the
* internal buffer is full or the flush() method is called, at which
* point it attempts to push a packet of bytes through to the remote
@@ -171,7 +171,7 @@
}
/**
- * Take note of more bytes requested by conection at remote endpoint.
+ * Take note of more bytes requested by connection at remote endpoint.
* @param num number of additional bytes requested
*/
void request(int num)
--- a/jdk/src/share/classes/sun/rmi/transport/tcp/TCPChannel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/TCPChannel.java Fri Nov 08 17:36:14 2013 -0800
@@ -515,7 +515,7 @@
}
/**
- * Give transport next accepted conection, when available.
+ * Give transport next accepted connection, when available.
*/
public void run() {
Connection conn;
--- a/jdk/src/share/classes/sun/security/jca/GetInstance.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/jca/GetInstance.java Fri Nov 08 17:36:14 2013 -0800
@@ -165,7 +165,7 @@
} catch (NoSuchAlgorithmException e) {
failure = e;
}
- // if we cannot get the service from the prefered provider,
+ // if we cannot get the service from the preferred provider,
// fail over to the next
for (Service s : list.getServices(type, algorithm)) {
if (s == firstService) {
--- a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Context.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Context.java Fri Nov 08 17:36:14 2013 -0800
@@ -867,7 +867,7 @@
}
/**
- * Queries the context for largest data size to accomodate
+ * Queries the context for largest data size to accommodate
* the specified protection and be <= maxTokSize.
*
* @param qop the quality of protection that the context will be
--- a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5NameElement.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5NameElement.java Fri Nov 08 17:36:14 2013 -0800
@@ -253,7 +253,7 @@
/**
* Returns the principal name in the form user@REALM or
- * host/service@REALM but with the following contraints that are
+ * host/service@REALM but with the following constraints that are
* imposed by RFC 1964:
* <pre>
* (1) all occurrences of the characters `@`, `/`, and `\` within
@@ -265,7 +265,7 @@
* represented, respectively, with `\0`, `\b`, `\t`, or `\n`.
*
* (3) the `\` quoting character shall not be emitted within an
- * exported name except to accomodate cases (1) and (2).
+ * exported name except to accommodate cases (1) and (2).
* </pre>
*/
public byte[] export() throws GSSException {
--- a/jdk/src/share/classes/sun/security/jgss/krb5/MessageToken.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/MessageToken.java Fri Nov 08 17:36:14 2013 -0800
@@ -596,7 +596,7 @@
* Constructs a MessageTokenHeader for the specified token type with
* appropriate checksum and encryption algorithms fields.
*
- * @param tokenId the token id for this mesage token
+ * @param tokenId the token id for this message token
* @param conf true if confidentiality will be resuested with this
* message token, false otherwise.
* @param qop the value of the quality of protection that will be
--- a/jdk/src/share/classes/sun/security/jgss/spi/GSSContextSpi.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/jgss/spi/GSSContextSpi.java Fri Nov 08 17:36:14 2013 -0800
@@ -232,7 +232,7 @@
throws GSSException;
/**
- * Queries the context for largest data size to accomodate
+ * Queries the context for largest data size to accommodate
* the specified protection and for the token to remain less then
* maxTokSize.
*
@@ -313,7 +313,7 @@
MessageProp msgProp) throws GSSException;
/**
- * For apps that want simplicity and dont care about buffer copies.
+ * For apps that want simplicity and don't care about buffer copies.
*/
public byte[] unwrap(byte inBuf[], int offset, int len,
MessageProp msgProp) throws GSSException;
--- a/jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java Fri Nov 08 17:36:14 2013 -0800
@@ -541,7 +541,7 @@
if (mech_wanted == null) {
valid = false;
}
- // save the desired mechansim
+ // save the desired mechanism
internal_mech = mech_wanted;
// get the token for mechanism
@@ -741,7 +741,7 @@
return null;
}
- // check if mechansim supports integrity
+ // check if mechanism supports integrity
if (!mechContext.getIntegState()) {
if (DEBUG) {
System.out.println("SpNegoContext: no MIC token included" +
@@ -783,7 +783,7 @@
return true;
}
- // check if mechansim supports integrity
+ // check if mechanism supports integrity
if (!mechContext.getIntegState()) {
if (DEBUG) {
System.out.println("SpNegoContext: no MIC token validation" +
--- a/jdk/src/share/classes/sun/security/krb5/Config.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java Fri Nov 08 17:36:14 2013 -0800
@@ -63,7 +63,7 @@
private static Config singleton = null;
/*
- * Hashtable used to store configuration infomation.
+ * Hashtable used to store configuration information.
*/
private Hashtable<String,Object> stanzaTable = new Hashtable<>();
--- a/jdk/src/share/classes/sun/security/krb5/KdcComm.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/krb5/KdcComm.java Fri Nov 08 17:36:14 2013 -0800
@@ -426,7 +426,7 @@
}
/**
- * Returns krb5.conf setting of {@code key} for a specfic realm,
+ * Returns krb5.conf setting of {@code key} for a specific realm,
* which can be:
* 1. defined in the sub-stanza for the given realm inside [realms], or
* 2. defined in [libdefaults], or
--- a/jdk/src/share/classes/sun/security/krb5/Realm.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/krb5/Realm.java Fri Nov 08 17:36:14 2013 -0800
@@ -400,7 +400,7 @@
}
/**
- * Creates a realm name using components from the given postion.
+ * Creates a realm name using components from the given position.
* For example, subStringFrom({"A", "B", "C"}, 1) is "B.C".
*/
private static String subStringFrom(String[] components, int from) {
--- a/jdk/src/share/classes/sun/security/krb5/internal/CredentialsUtil.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/krb5/internal/CredentialsUtil.java Fri Nov 08 17:36:14 2013 -0800
@@ -281,7 +281,7 @@
}
else {
/*
- * The new tgt's realm is not in the heirarchy of realms.
+ * The new tgt's realm is not in the hierarchy of realms.
* It's probably not safe to get a tgt from
* a tgs that is outside the known list of realms.
* Give up now.
--- a/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java Fri Nov 08 17:36:14 2013 -0800
@@ -513,7 +513,7 @@
}
});
if (p == null) {
- // exception occured in execing the command
+ // exception occurred during executing the command
return null;
}
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/DesCbcEType.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/DesCbcEType.java Fri Nov 08 17:36:14 2013 -0800
@@ -94,7 +94,7 @@
byte[] new_data;
byte pad;
/*Data padding: using Kerberos 5 GSS-API mechanism (1.2.2.3), Jun 1996.
- *Before encryption, plaintext data is padded to the next higest multiple of blocksize.
+ *Before encryption, plain text data is padded to the next highest multiple of blocksize.
*by appending between 1 and 8 bytes, the value of each such byte being the total number
*of pad bytes. For example, if new_size = 10, blockSize is 8, we should pad 2 bytes,
*and the value of each byte is 2.
--- a/jdk/src/share/classes/sun/security/pkcs11/P11DHKeyFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11DHKeyFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
/**
- * DH KeyFactory implemenation.
+ * DH KeyFactory implementation.
*
* @author Andreas Sterbenz
* @since 1.5
--- a/jdk/src/share/classes/sun/security/pkcs11/P11DSAKeyFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11DSAKeyFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
/**
- * DSA KeyFactory implemenation.
+ * DSA KeyFactory implementation.
*
* @author Andreas Sterbenz
* @since 1.5
--- a/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
import sun.security.util.ECUtil;
/**
- * EC KeyFactory implemenation.
+ * EC KeyFactory implementation.
*
* @author Andreas Sterbenz
* @since 1.6
--- a/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,7 @@
import sun.security.rsa.RSAKeyFactory;
/**
- * RSA KeyFactory implemenation.
+ * RSA KeyFactory implementation.
*
* @author Andreas Sterbenz
* @since 1.5
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11.java Fri Nov 08 17:36:14 2013 -0800
@@ -1503,7 +1503,7 @@
* (PKCS#11 param: CK_FLAGS flags)
* @param pReserved reserved. Should be null
* (PKCS#11 param: CK_VOID_PTR pReserved)
- * @return the slot ID where the event occured
+ * @return the slot ID where the event occurred
* (PKCS#11 param: CK_SLOT_ID_PTR pSlot)
* @exception PKCS11Exception If function returns other value than CKR_OK.
* @preconditions (pRserved == null)
--- a/jdk/src/share/classes/sun/security/provider/DSA.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/provider/DSA.java Fri Nov 08 17:36:14 2013 -0800
@@ -529,7 +529,7 @@
* i.e. FIPS186.
*
* @param seed the seed for generating k. This seed should be
- * secure. This is what is refered to as the KSEED in the DSA
+ * secure. This is what is referred to as the KSEED in the DSA
* specification.
*
* @param g the g parameter from the DSA key pair.
--- a/jdk/src/share/classes/sun/security/provider/certpath/AdjacencyList.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/provider/certpath/AdjacencyList.java Fri Nov 08 17:36:14 2013 -0800
@@ -64,7 +64,7 @@
* The iterator method returns objects of type <code>BuildStep</code>, not
* objects of type <code>Vertex</code>.
* A <code>BuildStep</code> contains a <code>Vertex</code> and a result code,
- * accessable via getResult method. There are five result values.
+ * accessible via getResult method. There are five result values.
* <code>POSSIBLE</code> denotes that the current step represents a
* <code>Certificate</code> that the builder is considering at this point in
* the build. <code>FOLLOW</code> denotes a <code>Certificate</code> (one of
--- a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java Fri Nov 08 17:36:14 2013 -0800
@@ -675,7 +675,7 @@
* check for looping - abort a loop if
* ((we encounter the same certificate twice) AND
* ((policyMappingInhibited = true) OR (no policy mapping
- * extensions can be found between the occurences of the same
+ * extensions can be found between the occurrences of the same
* certificate)))
*/
if (certPathList != null) {
--- a/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java Fri Nov 08 17:36:14 2013 -0800
@@ -364,10 +364,10 @@
* check for looping - abort a loop if
* ((we encounter the same certificate twice) AND
* ((policyMappingInhibited = true) OR (no policy mapping
- * extensions can be found between the occurences of the same
+ * extensions can be found between the occurrences of the same
* certificate)))
* in order to facilitate the check to see if there are
- * any policy mapping extensions found between the occurences
+ * any policy mapping extensions found between the occurrences
* of the same certificate, we reverse the certpathlist first
*/
if ((certPathList != null) && (!certPathList.isEmpty())) {
--- a/jdk/src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java Fri Nov 08 17:36:14 2013 -0800
@@ -117,7 +117,7 @@
// generate the keypair. See JCA doc
public KeyPair generateKeyPair() {
- // accomodate odd key sizes in case anybody wants to use them
+ // accommodate odd key sizes in case anybody wants to use them
int lp = (keySize + 1) >> 1;
int lq = keySize - lp;
if (random == null) {
--- a/jdk/src/share/classes/sun/security/ssl/HandshakeOutStream.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/HandshakeOutStream.java Fri Nov 08 17:36:14 2013 -0800
@@ -139,8 +139,8 @@
/*
* Tell the OutputRecord that a finished message was
* contained either in this record or the one immeiately
- * preceeding it. We need to reliably pass back notifications
- * that a finish message occured.
+ * preceding it. We need to reliably pass back notifications
+ * that a finish message occurred.
*/
void setFinishedMsg() {
assert(socket == null);
--- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java Fri Nov 08 17:36:14 2013 -0800
@@ -902,7 +902,7 @@
}
/*
- * Process the messsage. We require
+ * Process the message. We require
* that processMessage() consumes the entire message. In
* lieu of explicit error checks (how?!) we assume that the
* data will look like garbage on encoding/processing errors,
--- a/jdk/src/share/classes/sun/security/ssl/RSASignature.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/RSASignature.java Fri Nov 08 17:36:14 2013 -0800
@@ -39,7 +39,7 @@
* negative interaction with the JCA mechanisms for hardware providers.
*
* The class should be instantiated via the getInstance() method in this class,
- * which returns the implementation from the prefered provider. The internal
+ * which returns the implementation from the preferred provider. The internal
* implementation allows the hashes to be explicitly set, which is required
* for RSA client authentication. It can be obtained via the
* getInternalInstance() method.
--- a/jdk/src/share/classes/sun/security/ssl/Record.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/Record.java Fri Nov 08 17:36:14 2013 -0800
@@ -102,7 +102,7 @@
* this is the amount OpenSSL is using.
*/
static final int maxLargeRecordSize =
- maxRecordSize // Max size with a conforming implemenation
+ maxRecordSize // Max size with a conforming implementation
+ maxDataSize; // extra 2^14 bytes for large data packets.
--- a/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -243,7 +243,7 @@
abstract SSLParameters getDefaultClientSSLParams();
abstract SSLParameters getSupportedSSLParams();
- // Get suported ProtoclList.
+ // Get supported ProtocolList.
ProtocolList getSuportedProtocolList() {
if (supportedProtocolList == null) {
supportedProtocolList =
@@ -253,7 +253,7 @@
return supportedProtocolList;
}
- // Get default ProtoclList.
+ // Get default ProtocolList.
ProtocolList getDefaultProtocolList(boolean roleIsServer) {
if (roleIsServer) {
if (defaultServerProtocolList == null) {
@@ -272,7 +272,7 @@
}
}
- // Get suported CipherSuiteList.
+ // Get supported CipherSuiteList.
CipherSuiteList getSupportedCipherSuiteList() {
// The maintenance of cipher suites needs to be synchronized.
synchronized (this) {
--- a/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -762,7 +762,7 @@
/**
* Unwraps a buffer. Does a variety of checks before grabbing
- * the unwrapLock, which blocks multiple unwraps from occuring.
+ * the unwrapLock, which blocks multiple unwraps from occurring.
*/
@Override
public SSLEngineResult unwrap(ByteBuffer netData, ByteBuffer [] appData,
@@ -1143,7 +1143,7 @@
/**
* Wraps a buffer. Does a variety of checks before grabbing
- * the wrapLock, which blocks multiple wraps from occuring.
+ * the wrapLock, which blocks multiple wraps from occurring.
*/
@Override
public SSLEngineResult wrap(ByteBuffer [] appData,
--- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -1727,7 +1727,7 @@
while (((state = getConnectionState()) != cs_CLOSED) &&
(state != cs_ERROR) && (state != cs_APP_CLOSED)) {
- // create the InputRecord if it isn't intialized.
+ // create the InputRecord if it isn't initialized.
if (inrec == null) {
inrec = new InputRecord();
}
--- a/jdk/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java Fri Nov 08 17:36:14 2013 -0800
@@ -282,7 +282,7 @@
} else if ((keySize > 0) && (keySize < 512)) {
maxDigestLength = HashAlgorithm.SHA1.length;
} // Otherwise, cannot determine the key size, prefer the most
- // perferable hash algorithm.
+ // preferable hash algorithm.
}
for (SignatureAndHashAlgorithm algorithm : algorithms) {
--- a/jdk/src/share/classes/sun/security/ssl/SunJSSE.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/SunJSSE.java Fri Nov 08 17:36:14 2013 -0800
@@ -112,7 +112,7 @@
registerAlgorithms(false);
}
- // prefered constructor to enable FIPS mode at runtime
+ // preferred constructor to enable FIPS mode at runtime
protected SunJSSE(java.security.Provider cryptoProvider){
this(checkNull(cryptoProvider), cryptoProvider.getName());
}
--- a/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
/**
- * An implemention of X509KeyManager backed by a KeyStore.
+ * An implementation of X509KeyManager backed by a KeyStore.
*
* The backing KeyStore is inspected when this object is constructed.
* All key entries containing a PrivateKey and a non-empty chain of
--- a/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,7 +48,7 @@
* CallbackHandler) or to have keys within one KeyStore protected by
* different keys.
* . it can use multiple KeyStores at the same time.
- * . it is explicitly designed to accomodate KeyStores that change over
+ * . it is explicitly designed to accommodate KeyStores that change over
* the lifetime of the process.
* . it makes an effort to choose the key that matches best, i.e. one that
* is not expired and has the appropriate certificate extensions.
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java Fri Nov 08 17:36:14 2013 -0800
@@ -682,7 +682,7 @@
// The label finally contains 2 parts separated by '|':
// The legend displayed before the entry names, and
- // the cert info (if -certs specfied).
+ // the cert info (if -certs specified).
if (!output.containsKey(label)) {
output.put(label, new ArrayList<String>());
--- a/jdk/src/share/classes/sun/security/util/HostnameChecker.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/util/HostnameChecker.java Fri Nov 08 17:36:14 2013 -0800
@@ -212,7 +212,7 @@
/**
* Return the subject of a certificate as X500Name, by reparsing if
* necessary. X500Name should only be used if access to name components
- * is required, in other cases X500Principal is to be prefered.
+ * is required, in other cases X500Principal is to be preferred.
*
* This method is currently used from within JSSE, do not remove.
*/
--- a/jdk/src/share/classes/sun/security/x509/AlgIdDSA.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/security/x509/AlgIdDSA.java Fri Nov 08 17:36:14 2013 -0800
@@ -113,9 +113,9 @@
* define the algorithm parameters. Those integers are encoded
* as big-endian byte arrays.
*
- * @param p the DSS/DSA paramter "P"
- * @param q the DSS/DSA paramter "Q"
- * @param g the DSS/DSA paramter "G"
+ * @param p the DSS/DSA parameter "P"
+ * @param q the DSS/DSA parameter "Q"
+ * @param g the DSS/DSA parameter "G"
*/
public AlgIdDSA (byte p [], byte q [], byte g [])
throws IOException
@@ -130,9 +130,9 @@
* If all three are null, then the parameters portion of the algorithm id
* is set to null. See note in header regarding use.
*
- * @param p the DSS/DSA paramter "P"
- * @param q the DSS/DSA paramter "Q"
- * @param g the DSS/DSA paramter "G"
+ * @param p the DSS/DSA parameter "P"
+ * @param q the DSS/DSA parameter "Q"
+ * @param g the DSS/DSA parameter "G"
*/
public AlgIdDSA (BigInteger p, BigInteger q, BigInteger g)
{
--- a/jdk/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java Fri Nov 08 17:36:14 2013 -0800
@@ -276,7 +276,7 @@
/**
* Returns a SynthGraphicsUtils.
*
- * @param context SynthContext indentifying requestor
+ * @param context SynthContext identifying requestor
* @return SynthGraphicsUtils
*/
public SynthGraphicsUtils getGraphicsUtils(SynthContext context) {
@@ -300,7 +300,7 @@
* 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 to Where to place Insets
* @return Insets.
*/
@@ -332,7 +332,7 @@
/**
* Returns the Painter for the passed in Component. This may return null.
*
- * @param ss SynthContext indentifying requestor
+ * @param ss SynthContext identifying requestor
* @return Painter for the border
*/
public SynthPainter getPainter(SynthContext ss) {
@@ -353,7 +353,7 @@
* to. A Style should NOT assume the opacity will remain this value, the
* developer may reset it or override it.
*
- * @param ss SynthContext indentifying requestor
+ * @param ss SynthContext identifying requestor
* @return opaque Whether or not the JComponent is opaque.
*/
public boolean isOpaque(SynthContext ss) {
@@ -382,7 +382,7 @@
/**
* Getter for a region specific style property.
*
- * @param state SynthContext indentifying requestor
+ * @param state SynthContext identifying requestor
* @param key Property being requested.
* @return Value of the named property
*/
@@ -435,7 +435,7 @@
* Returns the default value for a particular property. This is only
* invoked if this style doesn't define a property for <code>key</code>.
*
- * @param state SynthContext indentifying requestor
+ * @param state SynthContext identifying requestor
* @param key Property being requested.
* @return Value of the named property
*/
--- a/jdk/src/share/classes/sun/swing/plaf/synth/Paint9Painter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/Paint9Painter.java Fri Nov 08 17:36:14 2013 -0800
@@ -83,7 +83,7 @@
public static final int PAINT_ALL = 512;
/**
- * Conveniance method for testing the validity of an image.
+ * Convenience method for testing the validity of an image.
*
* @param image Image to check.
* @return true if <code>image</code> is non-null and has a positive
--- a/jdk/src/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java Fri Nov 08 17:36:14 2013 -0800
@@ -179,7 +179,7 @@
// private data members ----------------------------------------------------
/**
- * Replacable object
+ * Replaceable object
*/
private Replaceable replaceable;
/**
--- a/jdk/src/share/classes/sun/text/resources/th/CollationData_th.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/text/resources/th/CollationData_th.java Fri Nov 08 17:36:14 2013 -0800
@@ -144,11 +144,11 @@
// Below are thai puntuation marks and Tonal(Accent) marks. According to CLDR 1.9 and
// ISO/IEC 14651, Annex C, C.2.1 Thai ordering principles, 0E2F to 0E5B are punctuaion marks that need to be ignored
// in the first three leveles. 0E4E to 0E4B are tonal marks to be compared in secondary level.
- // In real implmentation, set puncutation marks in tertiary as there is no fourth level in Java.
+ // In real implementation, set punctuation marks in tertiary as there is no fourth level in Java.
// Set all these special marks after \u0301, the accute accent.
+ "& \u0301 " // acute accent
- //puncutation marks
+ //punctuation marks
+ ", \u0E2F " // PAIYANNOI (ellipsis, abbreviation)
+ ", \u0E46 " // MAIYAMOK
+ ", \u0E4F " // FONGMAN
--- a/jdk/src/share/classes/sun/tools/jar/Main.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/jar/Main.java Fri Nov 08 17:36:14 2013 -0800
@@ -1219,7 +1219,7 @@
}
/**
- * Print an error mesage; like something is broken
+ * Print an error message; like something is broken
*/
protected void error(String s) {
err.println(s);
--- a/jdk/src/share/classes/sun/tools/jconsole/BorderedComponent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/jconsole/BorderedComponent.java Fri Nov 08 17:36:14 2013 -0800
@@ -266,7 +266,7 @@
* default position.
* <p>
* If the border property value is not
- * specified in the constuctor or by invoking the appropriate
+ * specified in the constructor or by invoking the appropriate
* set method, the property value will be defined by the current
* look and feel, using the following property name in the
* Defaults Table:
--- a/jdk/src/share/classes/sun/tools/jconsole/inspector/XTextField.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/jconsole/inspector/XTextField.java Fri Nov 08 17:36:14 2013 -0800
@@ -182,19 +182,19 @@
public void changedUpdate(DocumentEvent e) {
// the user typed something, so remove references
- // to the obejct that was dropped.
+ // to the object that was dropped.
clearObject();
}
public void removeUpdate(DocumentEvent e) {
// the user typed something, so remove references
- // to the obejct that was dropped.
+ // to the object that was dropped.
clearObject();
}
public void insertUpdate(DocumentEvent e) {
// the user typed something, so remove references
- // to the obejct that was dropped.
+ // to the object that was dropped.
clearObject();
}
--- a/jdk/src/share/classes/sun/tools/jinfo/JInfo.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/jinfo/JInfo.java Fri Nov 08 17:36:14 2013 -0800
@@ -35,7 +35,7 @@
/*
* This class is the main class for the JInfo utility. It parses its arguments
- * and decides if the command should be satisifed using the VM attach mechanism
+ * and decides if the command should be satisfied using the VM attach mechanism
* or an SA tool. At this time the only option that uses the VM attach
* mechanism is the -flag option to set or print a command line option of a
* running application. All other options are mapped to SA tools.
--- a/jdk/src/share/classes/sun/tools/jmap/JMap.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/jmap/JMap.java Fri Nov 08 17:36:14 2013 -0800
@@ -36,7 +36,7 @@
/*
* This class is the main class for the JMap utility. It parses its arguments
- * and decides if the command should be satisifed using the VM attach mechanism
+ * and decides if the command should be satisfied using the VM attach mechanism
* or an SA tool. At this time the only option that uses the VM attach mechanism
* is the -dump option to get a heap dump of a running application. All other
* options are mapped to SA tools.
--- a/jdk/src/share/classes/sun/tools/jstat/ColumnFormat.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/jstat/ColumnFormat.java Fri Nov 08 17:36:14 2013 -0800
@@ -57,7 +57,7 @@
// should allow null data statments
if (expression == null) {
- // current policy is that a data statment must be specified
+ // current policy is that a data statement must be specified
throw new ParserException("Missing data statement in column " + number);
}
if (header == null) {
--- a/jdk/src/share/classes/sun/tools/jstat/resources/jstat_options Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/jstat/resources/jstat_options Fri Nov 08 17:36:14 2013 -0800
@@ -314,7 +314,7 @@
format "0.0"
}
column {
- header "^OGCMN^" /* Old Generation Capacity - Minumum */
+ header "^OGCMN^" /* Old Generation Capacity - Minimum */
data sun.gc.generation.1.minCapacity
scale K
align right
@@ -776,7 +776,7 @@
option gcoldcapacity {
column {
- header "^OGCMN^" /* Old Generation Capacity - Minumum */
+ header "^OGCMN^" /* Old Generation Capacity - Minimum */
data sun.gc.generation.1.minCapacity
scale K
align right
--- a/jdk/src/share/classes/sun/tools/tree/ExprExpression.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/tree/ExprExpression.java Fri Nov 08 17:36:14 2013 -0800
@@ -29,7 +29,7 @@
import java.util.Hashtable;
/**
- * Parenthesised expressions.
+ * Parenthesized expressions.
*
* WARNING: The contents of this source file are not part of any
* supported API. Code that depends on them does so at its own risk:
--- a/jdk/src/share/classes/sun/tools/tree/FieldExpression.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java Fri Nov 08 17:36:14 2013 -0800
@@ -154,7 +154,7 @@
return t;
}
- // These were ommitted earlier in calls to 'toType', but I can't
+ // These were omitted earlier in calls to 'toType', but I can't
// see any reason for that. I think it was an oversight. See
// 'checkCommon' and 'checkInnerClass'.
innerClass.noteUsedBy(ctxClass, where, env);
@@ -1121,7 +1121,7 @@
// either.
//
// However, NullPointerException can't happen and initialization must
- // already have occured if you are dotting into 'this'. So
+ // already have occurred if you are dotting into 'this'. So
// allow fields of 'this' to be eliminated as a special case.
Expression e = inlineValue(env, ctx);
if (e instanceof FieldExpression) {
--- a/jdk/src/share/classes/sun/util/locale/provider/RuleBasedBreakIterator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/util/locale/provider/RuleBasedBreakIterator.java Fri Nov 08 17:36:14 2013 -0800
@@ -822,7 +822,7 @@
}
/**
- * Returns true if the specfied position is a boundary position. As a side
+ * Returns true if the specified position is a boundary position. As a side
* effect, leaves the iterator pointing to the first boundary position at
* or after "offset".
* @param offset the offset to check.
--- a/jdk/src/share/classes/sun/util/logging/PlatformLogger.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java Fri Nov 08 17:36:14 2013 -0800
@@ -135,7 +135,7 @@
static Level valueOf(int level) {
switch (level) {
- // ordering per the highest occurences in the jdk source
+ // ordering per the highest occurrences in the jdk source
// finest, fine, finer, info first
case PlatformLogger.FINEST : return Level.FINEST;
case PlatformLogger.FINE : return Level.FINE;
--- a/jdk/src/share/demo/jfc/Font2DTest/FontPanel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/demo/jfc/Font2DTest/FontPanel.java Fri Nov 08 17:36:14 2013 -0800
@@ -524,7 +524,7 @@
* graphics anti-aliasing hint if the text anti-aliasing hint
* was set. The dubious element here is that people simply
* using this program may think this is built-in behaviour
- * but its not - at least not when the app explictly draws
+ * but its not - at least not when the app explicitly draws
* outline text.
* This becomes more dubious in cases such as "GASP" where the
* size at which text is AA'ed is not something you can easily
--- a/jdk/src/share/demo/jfc/TableExample/TableExample4.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/demo/jfc/TableExample/TableExample4.java Fri Nov 08 17:36:14 2013 -0800
@@ -54,7 +54,7 @@
/**
* Another JTable example, showing how column attributes can be refined
* even when columns have been created automatically. Here we create some
- * specialised renderers and editors as well as changing widths and colors
+ * specialized renderers and editors as well as changing widths and colors
* for some of the columns in the SwingSet demo table.
*
* @author Philip Milne
--- a/jdk/src/share/demo/jvmti/hprof/debug_malloc.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/demo/jvmti/hprof/debug_malloc.c Fri Nov 08 17:36:14 2013 -0800
@@ -250,7 +250,7 @@
static char *debug_check;
static void *clobbered_ptr;
-/* Minumum macro */
+/* Minimum macro */
#define minimum(a,b) ((a)<(b)?(a):(b))
/* Message routine */
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Fri Nov 08 17:36:14 2013 -0800
@@ -1023,7 +1023,7 @@
}
// Reads zip file central directory. Returns the file position of first
- // CEN header, otherwise returns -1 if an error occured. If zip->msg != NULL
+ // CEN header, otherwise returns -1 if an error occurred. If zip->msg != NULL
// then the error was a zip format error and zip->msg has the error text.
// Always pass in -1 for knownTotal; it's used for a recursive call.
private byte[] initCEN() throws IOException {
@@ -1740,7 +1740,7 @@
static class IndexNode {
byte[] name;
int hashcode; // node is hashable/hashed by its name
- int pos = -1; // postion in cen table, -1 menas the
+ int pos = -1; // position in cen table, -1 menas the
// entry does not exists in zip file
IndexNode(byte[] name, int pos) {
name(name);
--- a/jdk/src/share/javavm/export/jvm.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/javavm/export/jvm.h Fri Nov 08 17:36:14 2013 -0800
@@ -856,7 +856,7 @@
JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index);
/*
- * Returns the name of the field refered to at a given constant pool
+ * Returns the name of the field referred to at a given constant pool
* index.
*
* The result is in UTF format and remains valid until JVM_ReleaseUTF
@@ -869,7 +869,7 @@
JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index);
/*
- * Returns the name of the method refered to at a given constant pool
+ * Returns the name of the method referred to at a given constant pool
* index.
*
* The result is in UTF format and remains valid until JVM_ReleaseUTF
@@ -882,7 +882,7 @@
JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index);
/*
- * Returns the signature of the method refered to at a given constant pool
+ * Returns the signature of the method referred to at a given constant pool
* index.
*
* The result is in UTF format and remains valid until JVM_ReleaseUTF
@@ -895,7 +895,7 @@
JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index);
/*
- * Returns the signature of the field refered to at a given constant pool
+ * Returns the signature of the field referred to at a given constant pool
* index.
*
* The result is in UTF format and remains valid until JVM_ReleaseUTF
@@ -908,7 +908,7 @@
JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index);
/*
- * Returns the class name refered to at a given constant pool index.
+ * Returns the class name referred to at a given constant pool index.
*
* The result is in UTF format and remains valid until JVM_ReleaseUTF
* is called.
@@ -920,7 +920,7 @@
JVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index);
/*
- * Returns the class name refered to at a given constant pool index.
+ * Returns the class name referred to at a given constant pool index.
*
* The constant pool entry must refer to a CONSTANT_Fieldref.
*
@@ -934,7 +934,7 @@
JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index);
/*
- * Returns the class name refered to at a given constant pool index.
+ * Returns the class name referred to at a given constant pool index.
*
* The constant pool entry must refer to CONSTANT_Methodref or
* CONSTANT_InterfaceMethodref.
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -467,7 +467,7 @@
zs.avail_in -= TRAILER_LEN;
} else {
// Bug: 5023768,we read past the TRAILER_LEN to see if there is
- // any extraneous data, as we dont support concatenated .gz
+ // any extraneous data, as we don't support concatenated .gz
// files just yet.
int extra = (int) read_gzin_fn(u, inbuf, 1, inbuflen);
zs.avail_in += extra - TRAILER_LEN;
--- a/jdk/src/share/native/com/sun/media/sound/PlatformMidi.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/com/sun/media/sound/PlatformMidi.h Fri Nov 08 17:36:14 2013 -0800
@@ -222,7 +222,7 @@
/*
* Return the current time stamp in microseconds.
- * If not supported, or problem occured, returns -1
+ * If not supported, or problem occurred, returns -1
*/
INT64 MIDI_IN_GetTimeStamp(MidiDeviceHandle* handle);
@@ -311,7 +311,7 @@
/*
* Return the current time stamp in microseconds (the time since the device
* was opened).
- * If not supported, or problem occured, returns -1
+ * If not supported, or problem occurred, returns -1
*/
INT64 MIDI_OUT_GetTimeStamp(MidiDeviceHandle* handle);
--- a/jdk/src/share/native/common/jni_util.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/common/jni_util.h Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
* particularly aware of the fact that these functions are convenience
* functions, and as such are often compound operations, each one of
* which may throw an exception. Therefore, the functions this file
- * will often return silently if an exception has occured, and callers
+ * will often return silently if an exception has occurred, and callers
* must check for exception themselves.
*/
@@ -186,7 +186,7 @@
* pass to it.
*
* The method will return an initialized instance if successful.
- * It will return NULL if an error has occured (for example if
+ * It will return NULL if an error has occurred (for example if
* it ran out of memory) and the appropriate Java exception will
* have been thrown.
*/
--- a/jdk/src/share/native/java/lang/fdlibm/src/k_rem_pio2.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/java/lang/fdlibm/src/k_rem_pio2.c Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
* z = (z-x[i])*2**24
*
*
- * y[] ouput result in an array of double precision numbers.
+ * y[] output result in an array of double precision numbers.
* The dimension of y[] is:
* 24-bit precision 1
* 53-bit precision 2
--- a/jdk/src/share/native/java/util/zip/zip_util.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/java/util/zip/zip_util.c Fri Nov 08 17:36:14 2013 -0800
@@ -536,7 +536,7 @@
/*
* Reads zip file central directory. Returns the file position of first
- * CEN header, otherwise returns -1 if an error occured. If zip->msg != NULL
+ * CEN header, otherwise returns -1 if an error occurred. If zip->msg != NULL
* then the error was a zip format error and zip->msg has the error text.
* Always pass in -1 for knownTotal; it's used for a recursive call.
*/
--- a/jdk/src/share/native/sun/awt/image/cvutils/img_dcm.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/image/cvutils/img_dcm.h Fri Nov 08 17:36:14 2013 -0800
@@ -28,7 +28,7 @@
* the macros used by the generic scaleloop function.
*
* This implementation can decode the pixel information associated
- * with any Java DirectColorModel object. This implemenation will
+ * with any Java DirectColorModel object. This implementation will
* scale the decoded color components to 8-bit quantities if needed.
* Another file is provided to optimize DCM parsing when the masks
* are guaranteed to be at least 8-bits wide. This implementation
--- a/jdk/src/share/native/sun/awt/image/cvutils/img_replscale.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/image/cvutils/img_replscale.h Fri Nov 08 17:36:14 2013 -0800
@@ -35,7 +35,7 @@
* more than one output pixel. Conversely, when scaling smaller than
* the original image size, the input pixels will be omitted as needed
* to pare them down to the required number of samples for the output
- * image. If there is no scaling occuring in one or both directions
+ * image. If there is no scaling occurring in one or both directions
* the macros attempt to short-circuit most of the more complicated
* calculations in an attempt to impose little cost for using this
* implementation in the general case. The calculations also do not
--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Fri Nov 08 17:36:14 2013 -0800
@@ -983,7 +983,7 @@
* buffer filling be done at the top application level, using this
* function. Due to the way that backtracking works, this procedure
* saves all of the data that was left in the buffer when suspension
- * occured and read new data only at the end.
+ * occurred and read new data only at the end.
*/
GLOBAL(void)
--- a/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c Fri Nov 08 17:36:14 2013 -0800
@@ -310,7 +310,7 @@
* Note that with I/O suspension turned on, the JPEG library requires
* that all buffer filling be done at the top application level. Due
* to the way that backtracking works, this procedure should save all
- * of the data that was left in the buffer when suspension occured and
+ * of the data that was left in the buffer when suspension occurred and
* only read new data at the end.
*/
--- a/jdk/src/share/native/sun/awt/libpng/CHANGES Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/libpng/CHANGES Fri Nov 08 17:36:14 2013 -0800
@@ -2126,7 +2126,7 @@
png_decompress_chunk(), and remove "chunkdata" from parameter list.
Put a call to png_check_chunk_name() in png_read_chunk_header().
Revised png_check_chunk_name() to reject a name with a lowercase 3rd byte.
- Removed two calls to png_check_chunk_name() occuring later in the process.
+ Removed two calls to png_check_chunk_name() occurring later in the process.
Define PNG_NO_ERROR_NUMBERS by default in pngconf.h
Version 1.4.0beta25 [July 30, 2008]
--- a/jdk/src/share/native/sun/awt/libpng/png.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/libpng/png.h Fri Nov 08 17:36:14 2013 -0800
@@ -1351,7 +1351,7 @@
*
* When the default gamma of PNG files doesn't match the output gamma.
* If you have PNG files with no gamma information png_set_alpha_mode allows
- * you to provide a default gamma, but it also sets the ouput gamma to the
+ * you to provide a default gamma, but it also sets the output gamma to the
* matching value. If you know your PNG files have a gamma that doesn't
* match the output you can take advantage of the fact that
* png_set_alpha_mode always sets the output gamma but only sets the PNG
--- a/jdk/src/share/native/sun/awt/libpng/pngconf.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/libpng/pngconf.h Fri Nov 08 17:36:14 2013 -0800
@@ -633,7 +633,7 @@
# else
/* This is an attempt to detect an old Windows system where (int) is
* actually 16 bits, in that case png_malloc must have an argument with a
- * bigger size to accomodate the requirements of the library.
+ * bigger size to accommodate the requirements of the library.
*/
# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
(!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
--- a/jdk/src/share/native/sun/awt/libpng/pngpriv.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/libpng/pngpriv.h Fri Nov 08 17:36:14 2013 -0800
@@ -1195,7 +1195,7 @@
png_warning_parameters p, png_const_charp message);
/* 'message' follows the X/Open approach of using @1, @2 to insert
* parameters previously supplied using the above functions. Errors in
- * specifying the paramters will simple result in garbage substitutions.
+ * specifying the parameters will simple result in garbage substitutions.
*/
#endif
--- a/jdk/src/share/native/sun/awt/libpng/pngrutil.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/awt/libpng/pngrutil.c Fri Nov 08 17:36:14 2013 -0800
@@ -126,7 +126,7 @@
png_uint_16 (PNGAPI
png_get_uint_16)(png_const_bytep buf)
{
- /* ANSI-C requires an int value to accomodate at least 16 bits so this
+ /* ANSI-C requires an int value to accommodate at least 16 bits so this
* works and allows the compiler not to worry about possible narrowing
* on 32 bit systems. (Pre-ANSI systems did not make integers smaller
* than 16 bits either.)
--- a/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h Fri Nov 08 17:36:14 2013 -0800
@@ -209,7 +209,7 @@
* This method converts the Arabic Presentation Forms in the temp glyph array
* into actual glyph indices using ArabicOpenTypeLayoutEngine::mapCharsToGlyps.
*
- * Input paramters:
+ * Input parameters:
* @param tempGlyphs - the input presentation forms
* @param tempCharIndices - the input character index array
* @param tempGlyphCount - the number of Presentation Froms
--- a/jdk/src/share/native/sun/font/layout/IndicReordering.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/font/layout/IndicReordering.h Fri Nov 08 17:36:14 2013 -0800
@@ -42,7 +42,7 @@
U_NAMESPACE_BEGIN
-// Characters that get refered to by name...
+// Characters that get referred to by name...
#define C_SIGN_ZWNJ 0x200C
#define C_SIGN_ZWJ 0x200D
--- a/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
U_NAMESPACE_BEGIN
-// Characters that get refered to by name...
+// Characters that get referred to by name...
enum
{
C_SIGN_ZWNJ = 0x200C,
--- a/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h Fri Nov 08 17:36:14 2013 -0800
@@ -59,7 +59,7 @@
* 3) Glyph post processing - in cases where the font doesn't directly contain a GSUB table,
* the previous two steps may have generated "fake" glyph indices to use with a "canned" GSUB
* table. This step turns those glyph indices into actual font-specific glyph indices, and may
- * perform any other adjustments requried by the previous steps.
+ * perform any other adjustments required by the previous steps.
*
* OpenTypeLayoutEngine will also use the font's GPOS table to apply position adjustments
* such as kerning and accent positioning.
@@ -349,7 +349,7 @@
* index and character index arrays, assuming that no "fake" glyph indices
* were needed to do GSUB processing.
*
- * Input paramters:
+ * Input parameters:
* @param tempGlyphs - the input "fake" glyph index array
* @param tempCharIndices - the input "fake" character index array
* @param tempGlyphCount - the number of "fake" glyph indices
--- a/jdk/src/share/native/sun/font/layout/TibetanReordering.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/font/layout/TibetanReordering.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -47,7 +47,7 @@
U_NAMESPACE_BEGIN
-// Characters that get refered to by name...
+// Characters that get referred to by name...
enum
{
C_DOTTED_CIRCLE = 0x25CC,
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c Fri Nov 08 17:36:14 2013 -0800
@@ -31,6 +31,7 @@
#include "Trace.h"
#include "Disposer.h"
#include "lcms2.h"
+#include "jlong.h"
#define ALIGNLONG(x) (((x)+3) & ~(3)) // Aligns to DWORD boundary
@@ -98,13 +99,6 @@
cmsHPROFILE pf;
} lcmsProfile_t, *lcmsProfile_p;
-typedef union storeID_s { /* store SProfile stuff in a Java Long */
- lcmsProfile_p lcmsPf;
- cmsHTRANSFORM xf;
- jobject jobj;
- jlong j;
-} storeID_t, *storeID_p;
-
typedef union {
cmsTagSignature cms;
jint j;
@@ -148,23 +142,21 @@
}
void LCMS_freeProfile(JNIEnv *env, jlong ptr) {
- storeID_t sProfile;
- sProfile.j = ptr;
+ lcmsProfile_p p = (lcmsProfile_p)jlong_to_ptr(ptr);
- if (sProfile.lcmsPf != NULL) {
- if (sProfile.lcmsPf->pf != NULL) {
- cmsCloseProfile(sProfile.lcmsPf->pf);
+ if (p != NULL) {
+ if (p->pf != NULL) {
+ cmsCloseProfile(p->pf);
}
- free(sProfile.lcmsPf);
+ free(p);
}
}
void LCMS_freeTransform(JNIEnv *env, jlong ID)
{
- storeID_t sTrans;
- sTrans.j = ID;
+ cmsHTRANSFORM sTrans = jlong_to_ptr(ID);
/* Passed ID is always valid native ref so there is no check for zero */
- cmsDeleteTransform(sTrans.xf);
+ cmsDeleteTransform(sTrans);
}
/*
@@ -179,12 +171,16 @@
{
cmsHPROFILE _iccArray[DF_ICC_BUF_SIZE];
cmsHPROFILE *iccArray = &_iccArray[0];
- storeID_t sTrans;
+ cmsHTRANSFORM sTrans = NULL;
int i, j, size;
jlong* ids;
size = (*env)->GetArrayLength (env, profileIDs);
ids = (*env)->GetLongArrayElements(env, profileIDs, 0);
+ if (ids == NULL) {
+ // An exception should have already been thrown.
+ return 0L;
+ }
#ifdef _LITTLE_ENDIAN
/* Reversing data packed into int for LE archs */
@@ -209,11 +205,10 @@
j = 0;
for (i = 0; i < size; i++) {
- cmsHPROFILE icc;
cmsColorSpaceSignature cs;
+ lcmsProfile_p profilePtr = (lcmsProfile_p)jlong_to_ptr(ids[i]);
+ cmsHPROFILE icc = profilePtr->pf;
- sTrans.j = ids[i];
- icc = sTrans.lcmsPf->pf;
iccArray[j++] = icc;
/* Middle non-abstract profiles should be doubled before passing to
@@ -228,26 +223,26 @@
}
}
- sTrans.xf = cmsCreateMultiprofileTransform(iccArray, j,
+ sTrans = cmsCreateMultiprofileTransform(iccArray, j,
inFormatter, outFormatter, renderType, 0);
(*env)->ReleaseLongArrayElements(env, profileIDs, ids, 0);
- if (sTrans.xf == NULL) {
+ if (sTrans == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR, "LCMS_createNativeTransform: "
- "sTrans.xf == NULL");
+ "sTrans == NULL");
if ((*env)->ExceptionOccurred(env) == NULL) {
JNU_ThrowByName(env, "java/awt/color/CMMException",
"Cannot get color transform");
}
} else {
- Disposer_AddRecord(env, disposerRef, LCMS_freeTransform, sTrans.j);
+ Disposer_AddRecord(env, disposerRef, LCMS_freeTransform, ptr_to_jlong(sTrans));
}
if (iccArray != &_iccArray[0]) {
free(iccArray);
}
- return sTrans.j;
+ return ptr_to_jlong(sTrans);
}
@@ -261,7 +256,7 @@
{
jbyte* dataArray;
jint dataSize;
- storeID_t sProf;
+ lcmsProfile_p sProf = NULL;
cmsHPROFILE pf;
if (JNU_IsNull(env, data)) {
@@ -269,16 +264,14 @@
return 0L;
}
- sProf.j = 0L;
-
dataArray = (*env)->GetByteArrayElements (env, data, 0);
- dataSize = (*env)->GetArrayLength (env, data);
-
if (dataArray == NULL) {
- JNU_ThrowIllegalArgumentException(env, "Invalid profile data");
+ // An exception should have already been thrown.
return 0L;
}
+ dataSize = (*env)->GetArrayLength (env, data);
+
pf = cmsOpenProfileFromMem((const void *)dataArray,
(cmsUInt32Number) dataSize);
@@ -303,17 +296,17 @@
if (pf != NULL) {
// create profile holder
- sProf.lcmsPf = (lcmsProfile_p)malloc(sizeof(lcmsProfile_t));
- if (sProf.lcmsPf != NULL) {
+ sProf = (lcmsProfile_p)malloc(sizeof(lcmsProfile_t));
+ if (sProf != NULL) {
// register the disposer record
- sProf.lcmsPf->pf = pf;
- Disposer_AddRecord(env, disposerRef, LCMS_freeProfile, sProf.j);
+ sProf->pf = pf;
+ Disposer_AddRecord(env, disposerRef, LCMS_freeProfile, ptr_to_jlong(sProf));
} else {
cmsCloseProfile(pf);
}
}
- return sProf.j;
+ return ptr_to_jlong(sProf);
}
/*
@@ -324,11 +317,10 @@
JNIEXPORT jint JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileSizeNative
(JNIEnv *env, jobject obj, jlong id)
{
- storeID_t sProf;
+ lcmsProfile_p sProf = (lcmsProfile_p)jlong_to_ptr(id);
cmsUInt32Number pfSize = 0;
- sProf.j = id;
- if (cmsSaveProfileToMem(sProf.lcmsPf->pf, NULL, &pfSize) && ((jint)pfSize > 0)) {
+ if (cmsSaveProfileToMem(sProf->pf, NULL, &pfSize) && ((jint)pfSize > 0)) {
return (jint)pfSize;
} else {
JNU_ThrowByName(env, "java/awt/color/CMMException",
@@ -345,16 +337,14 @@
JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileDataNative
(JNIEnv *env, jobject obj, jlong id, jbyteArray data)
{
- storeID_t sProf;
+ lcmsProfile_p sProf = (lcmsProfile_p)jlong_to_ptr(id);
jint size;
jbyte* dataArray;
cmsUInt32Number pfSize = 0;
cmsBool status;
- sProf.j = id;
-
// determine actual profile size
- if (!cmsSaveProfileToMem(sProf.lcmsPf->pf, NULL, &pfSize)) {
+ if (!cmsSaveProfileToMem(sProf->pf, NULL, &pfSize)) {
JNU_ThrowByName(env, "java/awt/color/CMMException",
"Can not access specified profile.");
return;
@@ -369,8 +359,12 @@
}
dataArray = (*env)->GetByteArrayElements (env, data, 0);
+ if (dataArray == NULL) {
+ // An exception should have already been thrown.
+ return;
+ }
- status = cmsSaveProfileToMem(sProf.lcmsPf->pf, dataArray, &pfSize);
+ status = cmsSaveProfileToMem(sProf->pf, dataArray, &pfSize);
(*env)->ReleaseByteArrayElements (env, data, dataArray, 0);
@@ -395,7 +389,7 @@
JNIEXPORT jbyteArray JNICALL Java_sun_java2d_cmm_lcms_LCMS_getTagNative
(JNIEnv *env, jobject obj, jlong id, jint tagSig)
{
- storeID_t sProf;
+ lcmsProfile_p sProf = (lcmsProfile_p)jlong_to_ptr(id);
TagSignature_t sig;
cmsInt32Number tagSize;
@@ -404,7 +398,6 @@
jint bufSize;
- sProf.j = id;
sig.j = tagSig;
if (tagSig == SigHead) {
@@ -415,20 +408,18 @@
data = (*env)->NewByteArray(env, bufSize);
if (data == NULL) {
- JNU_ThrowByName(env, "java/awt/color/CMMException",
- "Unable to allocate buffer");
+ // An exception should have already been thrown.
return NULL;
}
dataArray = (*env)->GetByteArrayElements (env, data, 0);
if (dataArray == NULL) {
- JNU_ThrowByName(env, "java/awt/color/CMMException",
- "Unable to get buffer");
- return NULL;
+ // An exception should have already been thrown.
+ return NULL;
}
- status = _getHeaderInfo(sProf.lcmsPf->pf, dataArray, bufSize);
+ status = _getHeaderInfo(sProf->pf, dataArray, bufSize);
(*env)->ReleaseByteArrayElements (env, data, dataArray, 0);
@@ -441,8 +432,8 @@
return data;
}
- if (cmsIsTag(sProf.lcmsPf->pf, sig.cms)) {
- tagSize = cmsReadRawTag(sProf.lcmsPf->pf, sig.cms, NULL, 0);
+ if (cmsIsTag(sProf->pf, sig.cms)) {
+ tagSize = cmsReadRawTag(sProf->pf, sig.cms, NULL, 0);
} else {
JNU_ThrowByName(env, "java/awt/color/CMMException",
"ICC profile tag not found");
@@ -452,20 +443,18 @@
// allocate java array
data = (*env)->NewByteArray(env, tagSize);
if (data == NULL) {
- JNU_ThrowByName(env, "java/awt/color/CMMException",
- "Unable to allocate buffer");
+ // An exception should have already been thrown.
return NULL;
}
dataArray = (*env)->GetByteArrayElements (env, data, 0);
if (dataArray == NULL) {
- JNU_ThrowByName(env, "java/awt/color/CMMException",
- "Unable to get buffer");
+ // An exception should have already been thrown.
return NULL;
}
- bufSize = cmsReadRawTag(sProf.lcmsPf->pf, sig.cms, dataArray, tagSize);
+ bufSize = cmsReadRawTag(sProf->pf, sig.cms, dataArray, tagSize);
(*env)->ReleaseByteArrayElements (env, data, dataArray, 0);
@@ -485,7 +474,7 @@
JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_setTagDataNative
(JNIEnv *env, jobject obj, jlong id, jint tagSig, jbyteArray data)
{
- storeID_t sProf;
+ lcmsProfile_p sProf = (lcmsProfile_p)jlong_to_ptr(id);
cmsHPROFILE pfReplace = NULL;
TagSignature_t sig;
@@ -493,7 +482,6 @@
jbyte* dataArray;
int tagSize;
- sProf.j = id;
sig.j = tagSig;
if (JNU_IsNull(env, data)) {
@@ -506,19 +494,19 @@
dataArray = (*env)->GetByteArrayElements(env, data, 0);
if (dataArray == NULL) {
- JNU_ThrowIllegalArgumentException(env, "Can not write tag data.");
+ // An exception should have already been thrown.
return;
}
if (tagSig == SigHead) {
- status = _setHeaderInfo(sProf.lcmsPf->pf, dataArray, tagSize);
+ status = _setHeaderInfo(sProf->pf, dataArray, tagSize);
} else {
/*
* New strategy for generic tags: create a place holder,
* dump all existing tags there, dump externally supplied
* tag, and return the new profile to the java.
*/
- pfReplace = _writeCookedTag(sProf.lcmsPf->pf, sig.cms, dataArray, tagSize);
+ pfReplace = _writeCookedTag(sProf->pf, sig.cms, dataArray, tagSize);
status = (pfReplace != NULL);
}
@@ -527,8 +515,8 @@
if (!status) {
JNU_ThrowIllegalArgumentException(env, "Can not write tag data.");
} else if (pfReplace != NULL) {
- cmsCloseProfile(sProf.lcmsPf->pf);
- sProf.lcmsPf->pf = pfReplace;
+ cmsCloseProfile(sProf->pf);
+ sProf->pf = pfReplace;
}
}
@@ -582,7 +570,7 @@
JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_colorConvert
(JNIEnv *env, jclass obj, jobject trans, jobject src, jobject dst)
{
- storeID_t sTrans;
+ cmsHTRANSFORM sTrans = NULL;
int srcDType, dstDType;
int srcOffset, srcNextRowOffset, dstOffset, dstNextRowOffset;
int width, height, i;
@@ -603,9 +591,9 @@
srcAtOnce = (*env)->GetBooleanField(env, src, IL_imageAtOnce_fID);
dstAtOnce = (*env)->GetBooleanField(env, dst, IL_imageAtOnce_fID);
- sTrans.j = (*env)->GetLongField (env, trans, Trans_ID_fID);
+ sTrans = jlong_to_ptr((*env)->GetLongField (env, trans, Trans_ID_fID));
- if (sTrans.xf == NULL) {
+ if (sTrans == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR, "LCMS_colorConvert: transform == NULL");
JNU_ThrowByName(env, "java/awt/color/CMMException",
"Cannot get color transform");
@@ -617,8 +605,7 @@
if (inputBuffer == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR, "");
- JNU_ThrowByName(env, "java/awt/color/CMMException",
- "Cannot get input data");
+ // An exception should have already been thrown.
return;
}
@@ -626,8 +613,7 @@
if (outputBuffer == NULL) {
releaseILData(env, inputBuffer, srcDType, srcData);
- JNU_ThrowByName(env, "java/awt/color/CMMException",
- "Cannot get output data");
+ // An exception should have already been thrown.
return;
}
@@ -635,10 +621,10 @@
outputRow = (char*)outputBuffer + dstOffset;
if (srcAtOnce && dstAtOnce) {
- cmsDoTransform(sTrans.xf, inputRow, outputRow, width * height);
+ cmsDoTransform(sTrans, inputRow, outputRow, width * height);
} else {
for (i = 0; i < height; i++) {
- cmsDoTransform(sTrans.xf, inputRow, outputRow, width);
+ cmsDoTransform(sTrans, inputRow, outputRow, width);
inputRow += srcNextRowOffset;
outputRow += dstNextRowOffset;
}
@@ -656,14 +642,22 @@
JNIEXPORT jobject JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileID
(JNIEnv *env, jclass cls, jobject pf)
{
+ jclass clsLcmsProfile;
+ jobject cmmProfile;
jfieldID fid = (*env)->GetFieldID (env,
(*env)->GetObjectClass(env, pf),
"cmmProfile", "Lsun/java2d/cmm/Profile;");
+ if (fid == NULL) {
+ return NULL;
+ }
- jclass clsLcmsProfile = (*env)->FindClass(env,
+ clsLcmsProfile = (*env)->FindClass(env,
"sun/java2d/cmm/lcms/LCMSProfile");
+ if (clsLcmsProfile == NULL) {
+ return NULL;
+ }
- jobject cmmProfile = (*env)->GetObjectField (env, pf, fid);
+ cmmProfile = (*env)->GetObjectField (env, pf, fid);
if (JNU_IsNull(env, cmmProfile)) {
return NULL;
@@ -687,18 +681,51 @@
* unloading
*/
Trans_renderType_fID = (*env)->GetFieldID (env, Trans, "renderType", "I");
+ if (Trans_renderType_fID == NULL) {
+ return;
+ }
Trans_ID_fID = (*env)->GetFieldID (env, Trans, "ID", "J");
+ if (Trans_ID_fID == NULL) {
+ return;
+ }
IL_isIntPacked_fID = (*env)->GetFieldID (env, IL, "isIntPacked", "Z");
+ if (IL_isIntPacked_fID == NULL) {
+ return;
+ }
IL_dataType_fID = (*env)->GetFieldID (env, IL, "dataType", "I");
+ if (IL_dataType_fID == NULL) {
+ return;
+ }
IL_pixelType_fID = (*env)->GetFieldID (env, IL, "pixelType", "I");
+ if (IL_pixelType_fID == NULL) {
+ return;
+ }
IL_dataArray_fID = (*env)->GetFieldID(env, IL, "dataArray",
"Ljava/lang/Object;");
+ if (IL_dataArray_fID == NULL) {
+ return;
+ }
IL_width_fID = (*env)->GetFieldID (env, IL, "width", "I");
+ if (IL_width_fID == NULL) {
+ return;
+ }
IL_height_fID = (*env)->GetFieldID (env, IL, "height", "I");
+ if (IL_height_fID == NULL) {
+ return;
+ }
IL_offset_fID = (*env)->GetFieldID (env, IL, "offset", "I");
+ if (IL_offset_fID == NULL) {
+ return;
+ }
IL_imageAtOnce_fID = (*env)->GetFieldID (env, IL, "imageAtOnce", "Z");
+ if (IL_imageAtOnce_fID == NULL) {
+ return;
+ }
IL_nextRowOffset_fID = (*env)->GetFieldID (env, IL, "nextRowOffset", "I");
+ if (IL_nextRowOffset_fID == NULL) {
+ return;
+ }
}
static cmsBool _getHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize)
@@ -709,7 +736,7 @@
if (!cmsSaveProfileToMem(pf, NULL, &pfSize) ||
pfSize < sizeof(cmsICCHeader) ||
- bufferSize < sizeof(cmsICCHeader))
+ bufferSize < (jint)sizeof(cmsICCHeader))
{
return FALSE;
}
@@ -730,9 +757,9 @@
static cmsBool _setHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize)
{
- cmsICCHeader pfHeader = { 0 };
+ cmsICCHeader pfHeader;
- if (pBuffer == NULL || bufferSize < sizeof(cmsICCHeader)) {
+ if (pBuffer == NULL || bufferSize < (jint)sizeof(cmsICCHeader)) {
return FALSE;
}
@@ -765,13 +792,14 @@
cmsInt32Number i;
cmsHPROFILE pfSanity = NULL;
- cmsICCHeader hdr = { 0 };
+ cmsICCHeader hdr;
cmsHPROFILE p = cmsCreateProfilePlaceholder(NULL);
if (NULL == p) {
return NULL;
}
+ memset(&hdr, 0, sizeof(cmsICCHeader));
// Populate the placeholder's header according to target profile
hdr.flags = cmsGetHeaderFlags(pfTarget);
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c Fri Nov 08 17:36:14 2013 -0800
@@ -350,7 +350,7 @@
return nReaded;
}
-// Postion file pointer in the file
+// Position file pointer in the file
static
cmsBool FileSeek(cmsIOHANDLER* iohandler, cmsUInt32Number offset)
{
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c Fri Nov 08 17:36:14 2013 -0800
@@ -1266,7 +1266,7 @@
static
void BlessLUT(cmsPipeline* lut)
{
- // We can set the input/ouput channels only if we have elements.
+ // We can set the input/output channels only if we have elements.
if (lut ->Elements != NULL) {
cmsStage *First, *Last;
--- a/jdk/src/share/native/sun/java2d/loops/ProcessPath.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/java2d/loops/ProcessPath.c Fri Nov 08 17:36:14 2013 -0800
@@ -641,7 +641,7 @@
/* Checking that we are not running out of the endpoint and bounding
* violating coordinate. The check is pretty simple because the curve
- * passed to the DrawMonotonicQuad already splitted into the monotonic
+ * passed to the DrawMonotonicQuad already split into the monotonic
* in X and Y pieces
*/
@@ -1129,7 +1129,7 @@
/* Checking that we are not running out of the endpoint and
* bounding violating coordinate. The check is pretty simple
* because the curve passed to the DrawMonotonicCubic already
- * splitted into the monotonic in X and Y pieces
+ * split into the monotonic in X and Y pieces
*/
/* Bounding x2 by xe */
--- a/jdk/src/share/native/sun/java2d/opengl/OGLBlitLoops.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/java2d/opengl/OGLBlitLoops.c Fri Nov 08 17:36:14 2013 -0800
@@ -661,7 +661,12 @@
(sy2-sy1) != (jint)(dy2-dy1) ||
oglc->extraAlpha != 1.0f;
break;
-
+#ifdef MACOSX
+ case OGLC_VENDOR_ATI:
+ // see 8024461
+ viaTexture = JNI_TRUE;
+ break;
+#endif
default:
// just use the glDrawPixels() codepath
viaTexture = JNI_FALSE;
--- a/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c Fri Nov 08 17:36:14 2013 -0800
@@ -772,7 +772,7 @@
} else if (remainingWidth < ginfo->width) {
// in some cases, the x-advance may be slightly smaller
// than the actual width of the glyph; if so, adjust our
- // estimate so that we can accomodate the entire glyph
+ // estimate so that we can accommodate the entire glyph
remainingWidth = ginfo->width;
}
} else {
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c Fri Nov 08 17:36:14 2013 -0800
@@ -539,7 +539,7 @@
#ifndef NO_CALLBACKS
/*
- * The function handling notify callbacks. It casts the pApplication paramter
+ * The function handling notify callbacks. It casts the pApplication parameter
* back to a NotifyEncapsulation structure and retrieves the Notify object and
* the application data from it.
*
--- a/jdk/src/share/sample/jmx/jmx-scandir/index.html Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/sample/jmx/jmx-scandir/index.html Fri Nov 08 17:36:14 2013 -0800
@@ -1579,7 +1579,7 @@
<ul>
<p>The <a
href="dist/javadoc/com/sun/jmx/examples/scandir/ScanDirClient.html"
-title="The ScanDirClient class is a very short example of secure programatic client"
+title="The ScanDirClient class is a very short example of secure programmatic client"
>ScanDirClient</a> is an example class that shows how a
programmatic client can connect to a secured <i>scandir</i> application.
This class contains a <code>main</code> method which creates and
@@ -2025,7 +2025,7 @@
</p>
<p>The <a
href="dist/javadoc/com/sun/jmx/examples/scandir/ScanDirClient.html"
-title="The ScanDirClient class is a very short example of secure programatic client"
+title="The ScanDirClient class is a very short example of secure programmatic client"
>ScanDirClient</a> is an example class that shows how a
programmatic client can connect to a secured <i>scandir</i> application.
This class contains a <code>main</code> method which creates and
--- a/jdk/src/share/sample/nio/chatserver/ClientReader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/sample/nio/chatserver/ClientReader.java Fri Nov 08 17:36:14 2013 -0800
@@ -58,7 +58,7 @@
}
/**
- * Runs a cycle of doing a beforeRead action and then enqueing a new
+ * Runs a cycle of doing a beforeRead action and then inquiring a new
* read on the client. Handles closed channels and errors while reading.
* If the client is still connected a new round of actions are called.
*/
--- a/jdk/src/share/sample/scripting/scriptpad/src/resources/gui.js Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/share/sample/scripting/scriptpad/src/resources/gui.js Fri Nov 08 17:36:14 2013 -0800
@@ -124,7 +124,7 @@
*
* @param title of the dialog box [optional]
* @param color default color [optional]
- * @return choosen color or default color
+ * @return chosen color or default color
*/
function colorDialog(title, color) {
var result;
--- a/jdk/src/solaris/classes/java/net/DefaultInterface.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/java/net/DefaultInterface.java Fri Nov 08 17:36:14 2013 -0800
@@ -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).
*
* Platforms that do not require a default interface may return null
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java Fri Nov 08 17:36:14 2013 -0800
@@ -187,7 +187,7 @@
************************************************/
/**
- * Returns parent menu window (not the X-heirarchy parent window)
+ * Returns parent menu window (not the X-hierarchy parent window)
*/
protected abstract XBaseMenuWindow getParentMenuWindow();
--- a/jdk/src/solaris/classes/sun/awt/X11/XButtonPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XButtonPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -79,10 +79,17 @@
return true;
}
- public void setLabel(java.lang.String label) {
- this.label = label;
- repaint();
+ @Override
+ public void setLabel(String label) {
+ if (label == null) {
+ label = "";
+ }
+ if (!label.equals(this.label)) {
+ this.label = label;
+ repaint();
+ }
}
+
public void setBackground(Color c) {
updateMotifColors(c);
super.setBackground(c);
@@ -257,10 +264,6 @@
drawMotif3DRect(g, x, y, w-1, h-1, pressed);
}
- public void setFont(Font f) {
- super.setFont(f);
- target.repaint();
- }
protected void paintFocus(Graphics g, int x, int y, int w, int h){
g.setColor(focusColor);
g.drawRect(x,y,w,h);
--- a/jdk/src/solaris/classes/sun/awt/X11/XCanvasPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCanvasPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -103,15 +103,4 @@
protected boolean doEraseBackground() {
return !eraseBackgroundDisabled;
}
- public void setBackground(Color c) {
- boolean doRepaint = false;
- if( getPeerBackground() == null ||
- !getPeerBackground().equals( c ) ) {
- doRepaint = true;
- }
- super.setBackground(c);
- if( doRepaint ) {
- target.repaint();
- }
- }
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XCheckboxPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCheckboxPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,6 +31,7 @@
import java.awt.image.BufferedImage;
import javax.swing.plaf.basic.BasicGraphicsUtils;
import java.awt.geom.AffineTransform;
+import java.util.Objects;
import sun.util.logging.PlatformLogger;
@@ -135,14 +136,16 @@
public void keyReleased(KeyEvent e) {}
- public void setLabel(java.lang.String label) {
- if ( label == null ) {
- this.label = "";
- } else {
+ @Override
+ public void setLabel(String label) {
+ if (label == null) {
+ label = "";
+ }
+ if (!label.equals(this.label)) {
this.label = label;
+ layout();
+ repaint();
}
- layout();
- repaint();
}
void handleJavaMouseEvent(MouseEvent e) {
@@ -377,10 +380,6 @@
g.drawImage(buffer, x, y, null);
}
}
- public void setFont(Font f) {
- super.setFont(f);
- target.repaint();
- }
public void paintRadioButton(Graphics g, int x, int y, int w, int h) {
@@ -424,16 +423,21 @@
g.drawRect(x,y,w,h);
}
+ @Override
public void setState(boolean state) {
if (selected != state) {
selected = state;
repaint();
}
}
- public void setCheckboxGroup(CheckboxGroup g) {
- // If changed from grouped/ungrouped, need to repaint()
- checkBoxGroup = g;
- repaint();
+
+ @Override
+ public void setCheckboxGroup(final CheckboxGroup g) {
+ if (!Objects.equals(g, checkBoxGroup)) {
+ // If changed from grouped/ungrouped, need to repaint()
+ checkBoxGroup = g;
+ repaint();
+ }
}
// NOTE: This method is called by privileged threads.
--- a/jdk/src/solaris/classes/sun/awt/X11/XChoicePeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XChoicePeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -87,7 +87,7 @@
private boolean firstPress = false; // mouse was pressed on
// furled Choice so we
// not need to furl the
- // Choice when MOUSE_RELEASED occured
+ // Choice when MOUSE_RELEASED occurred
// 6425067. Mouse was pressed on furled choice and dropdown list appeared over Choice itself
// and then there were no mouse movements until MOUSE_RELEASE.
@@ -814,12 +814,12 @@
x = screen.width - width;
}
+ if (y + height > screen.height) {
+ y = global.y - height;
+ }
if (y < 0) {
y = 0;
}
- else if (y + height > screen.height) {
- y = screen.height - height;
- }
return new Rectangle(x, y, width, height);
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -61,6 +61,7 @@
import java.lang.reflect.*;
import java.security.*;
import java.util.Collection;
+import java.util.Objects;
import java.util.Set;
import sun.util.logging.PlatformLogger;
import sun.awt.*;
@@ -635,22 +636,30 @@
g.drawLine(x+width, y+height, x+width, y+1); // right
}
+ @Override
public void setBackground(Color c) {
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Set background to " + c);
}
synchronized (getStateLock()) {
+ if (Objects.equals(background, c)) {
+ return;
+ }
background = c;
}
super.setBackground(c);
repaint();
}
+ @Override
public void setForeground(Color c) {
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Set foreground to " + c);
}
synchronized (getStateLock()) {
+ if (Objects.equals(foreground, c)) {
+ return;
+ }
foreground = c;
}
repaint();
@@ -674,18 +683,21 @@
return sun.font.FontDesignMetrics.getMetrics(font);
}
+ @Override
public void setFont(Font f) {
+ if (f == null) {
+ f = XWindow.getDefaultFont();
+ }
synchronized (getStateLock()) {
- if (f == null) {
- f = XWindow.getDefaultFont();
+ if (f.equals(font)) {
+ return;
}
font = f;
}
- // as it stands currently we dont need to do layout or repaint since
+ // as it stands currently we don't need to do layout since
// layout is done in the Component upon setFont.
//layout();
- // target.repaint();
- //repaint()?
+ repaint();
}
public Font getFont() {
--- a/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,7 @@
}
- public void handleExposeEvent(Component target, int x, int y, int w, int h) {
+ public void postPaintEvent(Component target, int x, int y, int w, int h) {
// TODO: ?
// get rid of 'istanceof' by subclassing:
// XContentWindow -> XFrameContentWindow
@@ -160,13 +160,13 @@
iconifiedExposeEvents.add(new SavedExposeEvent(target, x, y, w, h));
} else {
// Normal case: [it is not a frame or] the frame is not iconified.
- super.handleExposeEvent(target, x, y, w, h);
+ super.postPaintEvent(target, x, y, w, h);
}
}
void purgeIconifiedExposeEvents() {
for (SavedExposeEvent evt : iconifiedExposeEvents) {
- super.handleExposeEvent(evt.target, evt.x, evt.y, evt.w, evt.h);
+ super.postPaintEvent(evt.target, evt.x, evt.y, evt.w, evt.h);
}
iconifiedExposeEvents.clear();
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java Fri Nov 08 17:36:14 2013 -0800
@@ -70,7 +70,7 @@
public abstract String getProtocolName();
/**
- * Initalizes a drag operation with the specified supported drop actions,
+ * Initializes a drag operation with the specified supported drop actions,
* contents and data formats.
*
* @param actions a bitwise mask of <code>DnDConstants</code> that represent
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java Fri Nov 08 17:36:14 2013 -0800
@@ -61,7 +61,7 @@
/**
* Returns the XID of the topmost window with WM_STATE set in the ancestor
- * heirarchy of the specified window or 0 if none found.
+ * hierarchy of the specified window or 0 if none found.
*/
private long getToplevelWindow(long window) {
XBaseWindow candWindow = XToolkit.windowToXWindow(window);
--- a/jdk/src/solaris/classes/sun/awt/X11/XLabelPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XLabelPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -132,20 +132,22 @@
}
}
- public void setText(String text) {
- label = text;
+ @Override
+ public void setText(String label) {
if (label == null) {
label = "";
}
- repaint();
- }
- public void setFont(Font f) {
- super.setFont(f);
- repaint();
+ if (!label.equals(this.label)) {
+ this.label = label;
+ repaint();
+ }
}
- public void setAlignment(int align) {
- alignment = align;
- repaint();
+ @Override
+ public void setAlignment(final int alignment) {
+ if (this.alignment != alignment) {
+ this.alignment = alignment;
+ repaint();
+ }
}
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,8 +31,8 @@
import java.awt.*;
import java.awt.event.*;
import java.awt.peer.*;
+import java.util.Objects;
import java.util.Vector;
-import java.awt.geom.*;
import java.awt.image.*;
import sun.util.logging.PlatformLogger;
@@ -409,7 +409,7 @@
if (g != null) {
try {
painter.paint(g, firstItem, lastItem, options, source, distance);
- target.paint(g);
+ postPaintEvent(target, 0, 0, getWidth(), getHeight());
} finally {
g.dispose();
}
@@ -1682,11 +1682,13 @@
* The bug is due to incorrent caching of the list item size
* So we should recalculate font metrics on setFont
*/
- public void setFont(Font f){
- super.setFont(f);
- initFontMetrics();
- layout();
- repaint();
+ public void setFont(Font f) {
+ if (!Objects.equals(getFont(), f)) {
+ super.setFont(f);
+ initFontMetrics();
+ layout();
+ repaint();
+ }
}
/**
--- a/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -60,7 +60,7 @@
*/
/**
- * Rectange occupied by menu item in container's
+ * Rectangle occupied by menu item in container's
* coordinates. Filled by map(...) function from
* XBaseMenuWindow.map()
*/
--- a/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java Fri Nov 08 17:36:14 2013 -0800
@@ -564,7 +564,7 @@
* This method enforces the same constraints as in java.awt.Scrollbar:
* <UL>
* <LI> The maximum must be greater than the minimum </LI>
- * <LI> The value must be greater than or equal to the minumum
+ * <LI> The value must be greater than or equal to the minimum
* and less than or equal to the maximum minus the
* visible amount </LI>
* <LI> The visible amount must be greater than 1 and less than or equal
@@ -855,7 +855,7 @@
}
// There was one final adjustment here in the Motif function, which was
- // noted to be for backward-compatiblity. It has been left out for now.
+ // noted to be for backward-compatibility. It has been left out for now.
return retVal;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Fri Nov 08 17:36:14 2013 -0800
@@ -560,7 +560,7 @@
awtLock();
try {
if (loop == SECONDARY_LOOP) {
- // In the secondary loop we may have already aquired awt_lock
+ // In the secondary loop we may have already acquired awt_lock
// several times, so waitForEvents() might be unable to release
// the awt_lock and this causes lock up.
// For now, we just avoid waitForEvents in the secondary loop.
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,6 @@
import java.lang.ref.WeakReference;
-import java.lang.reflect.Field;
import java.lang.reflect.Method;
import sun.util.logging.PlatformLogger;
@@ -251,7 +250,7 @@
if (target != null && (c = target.getBackground()) != null) {
// We need a version of setBackground that does not call repaint !!
// and one that does not get overridden. The problem is that in postInit
- // we call setBackground and we dont have all the stuff initialized to
+ // we call setBackground and we don't have all the stuff initialized to
// do a full paint for most peers. So we cannot call setBackground in postInit.
// instead we need to call xSetBackground.
xSetBackground(c);
@@ -437,7 +436,7 @@
// We need a version of setBackground that does not call repaint !!
// and one that does not get overridden. The problem is that in postInit
- // we call setBackground and we dont have all the stuff initialized to
+ // we call setBackground and we don't have all the stuff initialized to
// do a full paint for most peers. So we cannot call setBackground in postInit.
final public void xSetBackground(Color c) {
XToolkit.awtLock();
@@ -491,33 +490,31 @@
public boolean isEmbedded() {
return embedded;
}
- public void repaint(int x,int y, int width, int height) {
+
+ public final void repaint(int x, int y, int width, int height) {
if (!isVisible() || getWidth() == 0 || getHeight() == 0) {
return;
}
Graphics g = getGraphics();
if (g != null) {
try {
- g.setClip(x,y,width,height);
- paint(g);
+ g.setClip(x, y, width, height);
+ if (SunToolkit.isDispatchThreadForAppContext(getTarget())) {
+ paint(g); // The native and target will be painted in place.
+ } else {
+ paintPeer(g);
+ postPaintEvent(target, x, y, width, height);
+ }
} finally {
g.dispose();
}
}
}
+
void repaint() {
- if (!isVisible() || getWidth() == 0 || getHeight() == 0) {
- return;
- }
- final Graphics g = getGraphics();
- if (g != null) {
- try {
- paint(g);
- } finally {
- g.dispose();
- }
- }
+ repaint(0, 0, getWidth(), getHeight());
}
+
public void paint(final Graphics g) {
// paint peer
paintPeer(g);
@@ -558,11 +555,11 @@
&& compAccessor.getWidth(target) != 0
&& compAccessor.getHeight(target) != 0)
{
- handleExposeEvent(target, x, y, w, h);
+ postPaintEvent(target, x, y, w, h);
}
}
- public void handleExposeEvent(Component target, int x, int y, int w, int h) {
+ public void postPaintEvent(Component target, int x, int y, int w, int h) {
PaintEvent event = PaintEventDispatcher.getPaintEventDispatcher().
createPaintEvent(target, x, y, w, h);
if (event != null) {
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java Fri Nov 08 17:36:14 2013 -0800
@@ -95,7 +95,7 @@
}
/*
- * Note this method is currently here for backward compatability
+ * Note this method is currently here for backward compatibility
* as this was the method used in jdk 1.2 beta4 to create the
* X11GraphicsConfig objects. Java3D code had called this method
* explicitly so without this, if a user tries to use JDK1.2 fcs
--- a/jdk/src/solaris/classes/sun/font/FontConfigManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/font/FontConfigManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -108,10 +108,6 @@
public FontConfigManager() {
}
- public static String[] getFontConfigNames() {
- return fontConfigNames;
- }
-
/* Called from code that needs to know what are the AA settings
* that apps using FC would pick up for the default desktop font.
* Note apps can change the default desktop font. etc, so this
@@ -182,7 +178,6 @@
t0 = System.nanoTime();
}
- String[] fontConfigNames = FontConfigManager.getFontConfigNames();
FcCompFont[] fontArr = new FcCompFont[fontConfigNames.length];
for (int i = 0; i< fontArr.length; i++) {
--- a/jdk/src/solaris/classes/sun/font/XMap.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/font/XMap.java Fri Nov 08 17:36:14 2013 -0800
@@ -204,7 +204,7 @@
try {
int cbLen = 0;
int bbLen = 0;
- // Since we dont support surrogates in any X11 encoding, skip
+ // Since we don't support surrogates in any X11 encoding, skip
// the surrogate area, otherwise the sequence of "Oxdbff0xdc00"
// will accidently cause the surrogate-aware nio charset to treat
// them as a legal pair and then undesirablly skip 2 "chars"
--- a/jdk/src/solaris/classes/sun/java2d/jules/JulesAATileGenerator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/jules/JulesAATileGenerator.java Fri Nov 08 17:36:14 2013 -0800
@@ -212,9 +212,9 @@
/*
* Optimization for large fills. Foutunatly cairo does generate an y-sorted
- * list of trapezoids. This makes it quite simple to check wether a tile is
- * fully covered by traps by: - Checking wether the tile is fully covered by
- * traps vertically (trap 2 starts where trap 1 ended) - Checking wether all
+ * list of trapezoids. This makes it quite simple to check whether a tile is
+ * fully covered by traps by: - Checking whether the tile is fully covered by
+ * traps vertically (trap 2 starts where trap 1 ended) - Checking whether all
* traps cover the tile horizontally This also works, when a single tile
* coveres the whole tile.
*/
@@ -231,7 +231,7 @@
int tileEndX = tileStartX + TILE_SIZE_FP;
int tileEndY = tileStartY + TILE_SIZE_FP;
- // Check wether first tile covers the beginning of the tile vertically
+ // Check whether first tile covers the beginning of the tile vertically
int firstTop = traps.getTop(trapList.getInt(0));
int firstBottom = traps.getBottom(trapList.getInt(0));
if (firstTop > tileStartY || firstBottom < tileStartY) {
--- a/jdk/src/solaris/classes/sun/java2d/xr/MaskTileManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/MaskTileManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -76,8 +76,9 @@
public void fillMask(XRSurfaceData dst) {
boolean maskRequired = xrMgr.maskRequired();
+ boolean maskEvaluated = XRUtils.isMaskEvaluated(xrMgr.compRule);
- if (maskRequired) {
+ if (maskRequired && maskEvaluated) {
mainTile.calculateDirtyAreas();
DirtyRegion dirtyArea = mainTile.getDirtyArea().cloneRegion();
mainTile.translate(-dirtyArea.x, -dirtyArea.y);
@@ -106,7 +107,15 @@
}
}
} else {
- xrMgr.XRRenderRectangles(dst, mainTile.getRects());
+ /*
+ * If a mask would be required to store geometry (maskRequired)
+ * composition has to be done rectangle-by-rectagle.
+ */
+ if(xrMgr.isSolidPaintActive()) {
+ xrMgr.XRRenderRectangles(dst, mainTile.getRects());
+ } else {
+ xrMgr.XRCompositeRectangles(dst, mainTile.getRects());
+ }
}
mainTile.reset();
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRBackend.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRBackend.java Fri Nov 08 17:36:14 2013 -0800
@@ -100,14 +100,13 @@
int xSrc, int ySrc, int xDst, int yDst,
int glyphset, GrowableEltArray elts);
- public int createRadialGradient(Point2D inner, Point2D outer,
+ public int createRadialGradient(float centerX, float centerY,
float innerRadius, float outerRadius,
float[] fractions, int[] pixels,
- int repeat, AffineTransform transform);
+ int repeat);
public int createLinearGradient(Point2D p1, Point2D p2, float[] fractions,
- int[] pixels, int repeat,
- AffineTransform transform);
+ int[] pixels, int repeat);
public void setGCMode(long gc, boolean copy);
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRBackendNative.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRBackendNative.java Fri Nov 08 17:36:14 2013 -0800
@@ -105,17 +105,14 @@
XRCreateLinearGradientPaintNative(float[] fractionsArray,
short[] pixelsArray,
int x1, int y1, int x2, int y2,
- int numStops, int repeat,
- int m00, int m01, int m02,
- int m10, int m11, int m12);
+ int numStops, int repeat);
private native static int
XRCreateRadialGradientPaintNative(float[] fractionsArray,
short[] pixelsArray, int numStops,
+ int centerX, int centerY,
int innerRadius, int outerRadius,
- int repeat,
- int m00, int m01, int m02,
- int m10, int m11, int m12);
+ int repeat);
public native void setFilter(int picture, int filter);
@@ -175,40 +172,29 @@
}
public int createLinearGradient(Point2D p1, Point2D p2, float[] fractions,
- int[] pixels, int repeat, AffineTransform trx) {
+ int[] pixels, int repeat) {
short[] colorValues = getRenderColors(pixels);
int gradient =
XRCreateLinearGradientPaintNative(fractions, colorValues,
XDoubleToFixed(p1.getX()), XDoubleToFixed(p1.getY()),
XDoubleToFixed(p2.getX()), XDoubleToFixed(p2.getY()),
- fractions.length, repeat,
- XDoubleToFixed(trx.getScaleX()),
- XDoubleToFixed(trx.getShearX()),
- XDoubleToFixed(trx.getTranslateX()),
- XDoubleToFixed(trx.getShearY()),
- XDoubleToFixed(trx.getScaleY()),
- XDoubleToFixed(trx.getTranslateY()));
+ fractions.length, repeat);
return gradient;
}
- public int createRadialGradient(Point2D inner, Point2D outer,
+ public int createRadialGradient(float centerX, float centerY,
float innerRadius, float outerRadius,
- float[] fractions, int[] pixels, int repeat,
- AffineTransform trx) {
+ float[] fractions, int[] pixels, int repeat) {
short[] colorValues = getRenderColors(pixels);
return XRCreateRadialGradientPaintNative
(fractions, colorValues, fractions.length,
+ XDoubleToFixed(centerX),
+ XDoubleToFixed(centerY),
XDoubleToFixed(innerRadius),
XDoubleToFixed(outerRadius),
- repeat,
- XDoubleToFixed(trx.getScaleX()),
- XDoubleToFixed(trx.getShearX()),
- XDoubleToFixed(trx.getTranslateX()),
- XDoubleToFixed(trx.getShearY()),
- XDoubleToFixed(trx.getScaleY()),
- XDoubleToFixed(trx.getTranslateY()));
+ repeat);
}
public void setGCClipRectangles(long gc, Region clip) {
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRColor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRColor.java Fri Nov 08 17:36:14 2013 -0800
@@ -54,6 +54,7 @@
}
public XRColor(Color color) {
+ setColorValues(color);
}
public void setColorValues(Color color) {
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRCompositeManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRCompositeManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,7 +48,12 @@
private static boolean enableGradCache = true;
private static XRCompositeManager instance;
- XRSurfaceData src;
+ private final static int SOLID = 0;
+ private final static int TEXTURE = 1;
+ private final static int GRADIENT = 2;
+
+ int srcType;
+ XRSolidSrcPict solidSrc32;
XRSurfaceData texture;
XRSurfaceData gradient;
int alphaMask = XRUtils.None;
@@ -84,7 +89,6 @@
private XRCompositeManager(XRSurfaceData surface) {
con = new XRBackendNative();
- // con = XRBackendJava.getInstance();
String gradProp =
AccessController.doPrivileged(new PrivilegedAction<String>() {
@@ -109,14 +113,7 @@
public void initResources(XRSurfaceData surface) {
int parentXid = surface.getXid();
- int solidPixmap = con.createPixmap(parentXid, 32, 1, 1);
- int solidSrcPictXID = con.createPicture(solidPixmap,
- XRUtils.PictStandardARGB32);
- con.setPictureRepeat(solidSrcPictXID, XRUtils.RepeatNormal);
- con.renderRectangle(solidSrcPictXID, XRUtils.PictOpSrc,
- XRColor.FULL_ALPHA, 0, 0, 1, 1);
- solidSrcPict = new XRSurfaceData.XRInternalSurfaceData(con,
- solidSrcPictXID, null);
+ solidSrc32 = new XRSolidSrcPict(con, parentXid);
setForeground(0);
int extraAlphaMask = con.createPixmap(parentXid, 8, 1, 1);
@@ -135,9 +132,7 @@
}
public void setForeground(int pixel) {
- solidColor.setColorValues(pixel, false);
- con.renderRectangle(solidSrcPict.picture, XRUtils.PictOpSrc,
- solidColor, 0, 0, 1, 1);
+ solidColor.setColorValues(pixel, true);
}
public void setGradientPaint(XRSurfaceData gradient) {
@@ -145,16 +140,16 @@
con.freePicture(this.gradient.picture);
}
this.gradient = gradient;
- src = gradient;
+ srcType = GRADIENT;
}
public void setTexturePaint(XRSurfaceData texture) {
this.texture = texture;
- src = texture;
+ this.srcType = TEXTURE;
}
public void XRResetPaint() {
- src = solidSrcPict;
+ srcType = SOLID;
}
public void validateCompositeState(Composite comp, AffineTransform xform,
@@ -175,7 +170,7 @@
validatedComp = comp;
}
- if (sg2d != null && validatedPixel != sg2d.pixel) {
+ if (sg2d != null && (validatedPixel != sg2d.pixel || updatePaint)) {
validatedPixel = sg2d.pixel;
setForeground(validatedPixel);
}
@@ -191,14 +186,14 @@
validatedPaint = paint;
}
- if (src != solidSrcPict) {
+ if (srcType != SOLID) {
AffineTransform at = (AffineTransform) xform.clone();
try {
at.invert();
} catch (NoninvertibleTransformException e) {
at.setToIdentity();
}
- src.validateAsSource(at, -1, -1);
+ getCurrentSource().validateAsSource(at, -1, XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
}
}
@@ -234,13 +229,13 @@
public boolean maskRequired() {
return (!xorEnabled)
- && ((src != solidSrcPict)
- || (src == solidSrcPict && solidColor.alpha != 0xffff) || (extraAlpha != 1.0f));
+ && ((srcType != SOLID)
+ || (srcType == SOLID && (solidColor.alpha != 0xffff) || (extraAlpha != 1.0f)));
}
public void XRComposite(int src, int mask, int dst, int srcX, int srcY,
int maskX, int maskY, int dstX, int dstY, int width, int height) {
- int cachedSrc = (src == XRUtils.None) ? this.src.picture : src;
+ int cachedSrc = (src == XRUtils.None) ? getCurrentSource().picture : src;
int cachedX = srcX;
int cachedY = srcY;
@@ -276,7 +271,7 @@
renderReferenceY = (int) Math.floor(XRUtils
.XFixedToDouble(renderReferenceY));
- con.renderCompositeTrapezoids(compRule, src.picture,
+ con.renderCompositeTrapezoids(compRule, getCurrentSource().picture,
XRUtils.PictStandardA8, dst, renderReferenceX,
renderReferenceY, trapList);
}
@@ -294,15 +289,46 @@
}
}
+ public void XRCompositeRectangles(XRSurfaceData dst, GrowableRectArray rects) {
+ int srcPict = getCurrentSource().picture;
+
+ for(int i=0; i < rects.getSize(); i++) {
+ int x = rects.getX(i);
+ int y = rects.getY(i);
+ int width = rects.getWidth(i);
+ int height = rects.getHeight(i);
+
+ con.renderComposite(compRule, srcPict, XRUtils.None, dst.picture, x, y, 0, 0, x, y, width, height);
+ }
+ }
+
+ protected XRSurfaceData getCurrentSource() {
+ switch(srcType) {
+ case SOLID:
+ return solidSrc32.prepareSrcPict(validatedPixel);
+ case TEXTURE:
+ return texture;
+ case GRADIENT:
+ return gradient;
+ }
+
+ return null;
+ }
+
public void compositeBlit(XRSurfaceData src, XRSurfaceData dst, int sx,
int sy, int dx, int dy, int w, int h) {
con.renderComposite(compRule, src.picture, alphaMask, dst.picture, sx,
sy, 0, 0, dx, dy, w, h);
}
- public void compositeText(XRSurfaceData dst, int sx, int sy,
- int glyphSet, int maskFormat, GrowableEltArray elts) {
- con.XRenderCompositeText(compRule, src.picture, dst.picture,
+ public void compositeText(XRSurfaceData dst, int sx, int sy, int glyphSet,
+ int maskFormat, GrowableEltArray elts) {
+ /*
+ * Try to emulate the SRC blend mode with SRC_OVER.
+ * We bail out during pipe validation for cases where this is not possible.
+ */
+ byte textCompRule = (compRule != XRUtils.PictOpSrc) ? compRule : XRUtils.PictOpOver;
+ con.XRenderCompositeText(textCompRule, getCurrentSource().picture, dst.picture,
maskFormat, sx, sy, 0, 0, glyphSet, elts);
}
@@ -315,7 +341,11 @@
}
public boolean isTexturePaintActive() {
- return src == texture;
+ return srcType == TEXTURE;
+ }
+
+ public boolean isSolidPaintActive() {
+ return srcType == SOLID;
}
public XRColor getAlphaColor() {
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,6 +38,7 @@
*/
public class XRDrawImage extends DrawImage {
+
@Override
protected void renderImageXform(SunGraphics2D sg, Image img,
AffineTransform tx, int interpType, int sx1, int sy1, int sx2,
@@ -45,20 +46,24 @@
SurfaceData dstData = sg.surfaceData;
SurfaceData srcData = dstData.getSourceSurfaceData(img,
SunGraphics2D.TRANSFORM_GENERIC, sg.imageComp, bgColor);
+ int compRule = ((AlphaComposite) sg.composite).getRule();
+ float extraAlpha = ((AlphaComposite) sg.composite).getAlpha();
if (srcData != null && !isBgOperation(srcData, bgColor)
- && interpType <= AffineTransformOp.TYPE_BILINEAR) {
+ && interpType <= AffineTransformOp.TYPE_BILINEAR
+ && (XRUtils.isMaskEvaluated(XRUtils.j2dAlphaCompToXR(compRule))
+ || (XRUtils.isTransformQuadrantRotated(tx)) && extraAlpha == 1.0f))
+ {
SurfaceType srcType = srcData.getSurfaceType();
SurfaceType dstType = dstData.getSurfaceType();
TransformBlit blit = TransformBlit.getFromCache(srcType,
sg.imageComp, dstType);
-
if (blit != null) {
blit.Transform(srcData, dstData, sg.composite,
sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2
- sx1, sy2 - sy1);
- return;
+ return;
}
}
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java Fri Nov 08 17:36:14 2013 -0800
@@ -84,7 +84,7 @@
int maskPict = maskBuffer.getMaskBuffer().
uploadMask(width, height, maskscan, maskoff, mask);
- maskBuffer.XRComposite(x11sd.getPicture(), maskPict, x11sd.picture,
+ maskBuffer.XRComposite(x11sd.getPicture(), maskPict, x11dst.getPicture(),
srcx, srcy, 0, 0, dstx, dsty, width, height);
maskBuffer.getMaskBuffer().clearUploadMask(maskPict, width, height);
} finally {
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java Fri Nov 08 17:36:14 2013 -0800
@@ -178,9 +178,6 @@
super(srcType, CompositeType.AnyAlpha, dstType);
}
- /*
- * TODO: This breaks scales with non-integer coordinates!?!?!
- */
public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1,
double dx2, double dy2) {
try {
@@ -199,19 +196,14 @@
sy1 *= yScale;
sy2 *= yScale;
+ dx1 = Math.ceil(dx1 - 0.5);
+ dy1 = Math.ceil(dy1 - 0.5);
+ dx2 = Math.ceil(dx2 - 0.5);
+ dy2 = Math.ceil(dy2 - 0.5);
+
AffineTransform xForm = AffineTransform.getScaleInstance(1 / xScale, 1 / yScale);
- x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST); /*
- * TODO:
- * padded
- * blit
- * required
- * :
- * -
- * /
- * ?
- * ?
- */
+ x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST);
x11sdDst.maskBuffer.compositeBlit(x11sdSrc, x11sdDst, (int) sx1, (int) sy1, (int) dx1, (int) dy1, (int) (dx2 - dx1), (int) (dy2 - dy1));
} finally {
SunToolkit.awtUnlock();
@@ -234,43 +226,55 @@
}
/*
- * Calculates the composite-rectangle required for transformed blits. This
- * method is functionally equal to: Shape shp =
- * xform.createTransformedShape(rect); Rectangle bounds = shp.getBounds();
- * but performs significantly better.
- * Returns true if the destination shape is parallel to x/y axis
+ * Calculates the composition-rectangle required for transformed blits.
+ * For composite operations where the composition-rectangle defines
+ * the modified destination area, coordinates are rounded.
+ * Otherwise the composition window rectangle is sized large enough
+ * to not clip away any pixels.
*/
- protected boolean adjustCompositeBounds(AffineTransform tr, int dstx, int dsty, int width, int height) {
+ protected void adjustCompositeBounds(boolean isQuadrantRotated, AffineTransform tr,
+ int dstx, int dsty, int width, int height) {
srcCoords[0] = dstx;
srcCoords[1] = dsty;
srcCoords[2] = dstx + width;
- srcCoords[3] = dsty;
- srcCoords[4] = dstx + width;
- srcCoords[5] = dsty + height;
- srcCoords[6] = dstx;
- srcCoords[7] = dsty + height;
+ srcCoords[3] = dsty + height;
- tr.transform(srcCoords, 0, dstCoords, 0, 4);
+ double minX, minY, maxX, maxY;
+ if (isQuadrantRotated) {
+ tr.transform(srcCoords, 0, dstCoords, 0, 2);
+
+ minX = Math.min(dstCoords[0], dstCoords[2]);
+ minY = Math.min(dstCoords[1], dstCoords[3]);
+ maxX = Math.max(dstCoords[0], dstCoords[2]);
+ maxY = Math.max(dstCoords[1], dstCoords[3]);
- double minX = Math.min(dstCoords[0], Math.min(dstCoords[2], Math.min(dstCoords[4], dstCoords[6])));
- double minY = Math.min(dstCoords[1], Math.min(dstCoords[3], Math.min(dstCoords[5], dstCoords[7])));
- double maxX = Math.max(dstCoords[0], Math.max(dstCoords[2], Math.max(dstCoords[4], dstCoords[6])));
- double maxY = Math.max(dstCoords[1], Math.max(dstCoords[3], Math.max(dstCoords[5], dstCoords[7])));
+ minX = Math.ceil(minX - 0.5);
+ minY = Math.ceil(minY - 0.5);
+ maxX = Math.ceil(maxX - 0.5);
+ maxY = Math.ceil(maxY - 0.5);
+ } else {
+ srcCoords[4] = dstx;
+ srcCoords[5] = dsty + height;
+ srcCoords[6] = dstx + width;
+ srcCoords[7] = dsty;
- minX = Math.round(minX);
- minY = Math.round(minY);
- maxX = Math.round(maxX);
- maxY = Math.round(maxY);
+ tr.transform(srcCoords, 0, dstCoords, 0, 4);
+
+ minX = Math.min(dstCoords[0], Math.min(dstCoords[2], Math.min(dstCoords[4], dstCoords[6])));
+ minY = Math.min(dstCoords[1], Math.min(dstCoords[3], Math.min(dstCoords[5], dstCoords[7])));
+ maxX = Math.max(dstCoords[0], Math.max(dstCoords[2], Math.max(dstCoords[4], dstCoords[6])));
+ maxY = Math.max(dstCoords[1], Math.max(dstCoords[3], Math.max(dstCoords[5], dstCoords[7])));
+
+ minX = Math.floor(minX);
+ minY = Math.floor(minY);
+ maxX = Math.ceil(maxX);
+ maxY = Math.ceil(maxY);
+ }
compositeBounds.x = (int) minX;
compositeBounds.y = (int) minY;
compositeBounds.width = (int) (maxX - minX);
compositeBounds.height = (int) (maxY - minY);
-
- boolean is0or180 = (dstCoords[1] == dstCoords[3]) && (dstCoords[2] == dstCoords[4]);
- boolean is90or270 = (dstCoords[0] == dstCoords[2]) && (dstCoords[3] == dstCoords[5]);
-
- return is0or180 || is90or270;
}
public void Transform(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform xform,
@@ -280,9 +284,13 @@
XRSurfaceData x11sdDst = (XRSurfaceData) dst;
XRSurfaceData x11sdSrc = (XRSurfaceData) src;
+ XRCompositeManager xrMgr = XRCompositeManager.getInstance(x11sdSrc);
+ float extraAlpha = ((AlphaComposite) comp).getAlpha();
int filter = XRUtils.ATransOpToXRQuality(hint);
- boolean isAxisAligned = adjustCompositeBounds(xform, dstx, dsty, width, height);
+ boolean isQuadrantRotated = XRUtils.isTransformQuadrantRotated(xform);
+
+ adjustCompositeBounds(isQuadrantRotated, xform, dstx, dsty, width, height);
x11sdDst.validateAsDestination(null, clip);
x11sdDst.maskBuffer.validateCompositeState(comp, null, null, null);
@@ -298,21 +306,26 @@
trx.setToIdentity();
}
- boolean omitMask = (filter == XRUtils.FAST)
- || (isAxisAligned && ((AlphaComposite) comp).getAlpha() == 1.0f);
-
- if (!omitMask) {
+ if (filter != XRUtils.FAST && (!isQuadrantRotated || extraAlpha != 1.0f)) {
XRMaskImage mask = x11sdSrc.maskBuffer.getMaskImage();
+ // For quadrant-transformed blits geometry is not stored inside the mask
+ // therefore we can use a repeating 1x1 mask for applying extra alpha.
+ int maskPicture = isQuadrantRotated ? xrMgr.getExtraAlphaMask()
+ : mask.prepareBlitMask(x11sdDst, maskTX, width, height);
+
x11sdSrc.validateAsSource(trx, XRUtils.RepeatPad, filter);
- int maskPicture = mask.prepareBlitMask(x11sdDst, maskTX, width, height);
- x11sdDst.maskBuffer.con.renderComposite(XRCompositeManager.getInstance(x11sdSrc).getCompRule(), x11sdSrc.picture, maskPicture, x11sdDst.picture,
- 0, 0, 0, 0, compositeBounds.x, compositeBounds.y, compositeBounds.width, compositeBounds.height);
+ x11sdDst.maskBuffer.con.renderComposite(xrMgr.getCompRule(), x11sdSrc.picture,
+ maskPicture, x11sdDst.picture, 0, 0, 0, 0, compositeBounds.x, compositeBounds.y,
+ compositeBounds.width, compositeBounds.height);
} else {
int repeat = filter == XRUtils.FAST ? XRUtils.RepeatNone : XRUtils.RepeatPad;
x11sdSrc.validateAsSource(trx, repeat, filter);
- x11sdDst.maskBuffer.compositeBlit(x11sdSrc, x11sdDst, 0, 0, compositeBounds.x, compositeBounds.y, compositeBounds.width, compositeBounds.height);
+
+ // compositeBlit takes care of extra alpha
+ x11sdDst.maskBuffer.compositeBlit(x11sdSrc, x11sdDst, 0, 0, compositeBounds.x,
+ compositeBounds.y, compositeBounds.width, compositeBounds.height);
}
} finally {
SunToolkit.awtUnlock();
@@ -329,9 +342,7 @@
}
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) {
- /*
- * If the blit is write-only (putimge), no need for a temporary VI.
- */
+ // If the blit is write-only (putimge), no need for a temporary VI.
if (CompositeType.SrcOverNoEa.equals(comp) && (src.getTransparency() == Transparency.OPAQUE)) {
Blit opaqueSwToSurfaceBlit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dst.getSurfaceType());
opaqueSwToSurfaceBlit.Blit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRPaints.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRPaints.java Fri Nov 08 17:36:14 2013 -0800
@@ -29,10 +29,9 @@
import java.awt.MultipleGradientPaint.*;
import java.awt.geom.*;
import java.awt.image.*;
-
import sun.java2d.*;
import sun.java2d.loops.*;
-import sun.java2d.pipe.*;
+import sun.java2d.xr.XRSurfaceData.XRInternalSurfaceData;
abstract class XRPaints {
static XRCompositeManager xrCompMan;
@@ -108,27 +107,16 @@
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
GradientPaint paint = (GradientPaint) pt;
- int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() }, false);
-
- float fractions[] = new float[2];
- fractions[0] = 0;
- fractions[1] = 1;
+ int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
+ float fractions[] = {0, 1};
+ int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() });
Point2D pt1 = paint.getPoint1();
Point2D pt2 = paint.getPoint2();
- AffineTransform at = (AffineTransform) sg2d.transform.clone();
- try {
- at.invert();
- } catch (NoninvertibleTransformException ex) {
- at.setToIdentity();
- }
-
- int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
-
XRBackend con = xrCompMan.getBackend();
- int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat, at);
- xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient, at));
+ int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
+ xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient));
}
}
@@ -142,26 +130,22 @@
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
- return true;
+ return ((LinearGradientPaint) sg2d.getPaint()).getColorSpace() == ColorSpaceType.SRGB;
}
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
LinearGradientPaint paint = (LinearGradientPaint) pt;
- boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
Color[] colors = paint.getColors();
Point2D pt1 = paint.getStartPoint();
Point2D pt2 = paint.getEndPoint();
+ int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
+ float[] fractions = paint.getFractions();
+ int[] pixels = convertToIntArgbPixels(colors);
AffineTransform at = paint.getTransform();
- at.preConcatenate(sg2d.transform);
-
- int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
- float[] fractions = paint.getFractions();
- int[] pixels = convertToIntArgbPixels(colors, linear);
-
try {
at.invert();
} catch (NoninvertibleTransformException ex) {
@@ -169,8 +153,10 @@
}
XRBackend con = xrCompMan.getBackend();
- int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat, at);
- xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient, at));
+ int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
+ XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
+ x11sd.setStaticSrcTx(at);
+ xrCompMan.setGradientPaint(x11sd);
}
}
@@ -179,136 +165,101 @@
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
RadialGradientPaint grad = (RadialGradientPaint) sg2d.paint;
- return grad.getFocusPoint().equals(grad.getCenterPoint());
+ return grad.getFocusPoint().equals(grad.getCenterPoint())
+ && grad.getColorSpace() == ColorSpaceType.SRGB;
}
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
RadialGradientPaint paint = (RadialGradientPaint) pt;
- boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
Color[] colors = paint.getColors();
Point2D center = paint.getCenterPoint();
- Point2D focus = paint.getFocusPoint();
int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
float[] fractions = paint.getFractions();
- int[] pixels = convertToIntArgbPixels(colors, linear);
+ int[] pixels = convertToIntArgbPixels(colors);
float radius = paint.getRadius();
- // save original (untransformed) center and focus points
- double cx = center.getX();
- double cy = center.getY();
- double fx = focus.getX();
- double fy = focus.getY();
+ float cx = (float) center.getX();
+ float cy = (float) center.getY();
AffineTransform at = paint.getTransform();
- at.preConcatenate(sg2d.transform);
- focus = at.transform(focus, focus);
-
- // transform unit circle to gradient coords; we start with the
- // unit circle (center=(0,0), focus on positive x-axis, radius=1)
- // and then transform into gradient space
- at.translate(cx, cy);
- at.rotate(fx - cx, fy - cy);
- // at.scale(radius, radius);
-
- // invert to get mapping from device coords to unit circle
try {
at.invert();
- } catch (Exception e) {
- at.setToScale(0.0, 0.0);
+ } catch (NoninvertibleTransformException ex) {
+ ex.printStackTrace();
}
- focus = at.transform(focus, focus);
-
- // clamp the focus point so that it does not rest on, or outside
- // of, the circumference of the gradient circle
- fx = Math.min(focus.getX(), 0.99);
XRBackend con = xrCompMan.getBackend();
- int gradient = con.createRadialGradient(new Point2D.Float(0, 0), new Point2D.Float(0, 0), 0, radius, fractions, pixels, repeat, at);
- xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient, at));
+ int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
+ XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
+ x11sd.setStaticSrcTx(at);
+ xrCompMan.setGradientPaint(x11sd);
}
}
private static class XRTexture extends XRPaints {
+ private XRSurfaceData getAccSrcSurface(XRSurfaceData dstData, BufferedImage bi) {
+ // REMIND: this is a hack that attempts to cache the system
+ // memory image from the TexturePaint instance into an
+ // XRender pixmap...
+ SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
+ if (!(srcData instanceof XRSurfaceData)) {
+ srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
+ if (!(srcData instanceof XRSurfaceData)) {
+ throw new InternalError("Surface not cachable");
+ }
+ }
+
+ return (XRSurfaceData) srcData;
+ }
+
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
TexturePaint paint = (TexturePaint) sg2d.paint;
BufferedImage bi = paint.getImage();
XRSurfaceData dstData = (XRSurfaceData) sg2d.getDestSurface();
- SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
- if (!(srcData instanceof XRSurfaceData)) {
- // REMIND: this is a hack that attempts to cache the system
- // memory image from the TexturePaint instance into an
- // OpenGL texture...
- srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
- if (!(srcData instanceof XRSurfaceData)) {
- return false;
- }
- }
-
- return true;
+ return getAccSrcSurface(dstData, bi) != null;
}
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
TexturePaint paint = (TexturePaint) pt;
-
BufferedImage bi = paint.getImage();
- SurfaceData dstData = sg2d.surfaceData;
- SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
+ Rectangle2D anchor = paint.getAnchorRect();
- // REMIND: this hack tries to ensure that we have a cached texture
- if (!(srcData instanceof XRSurfaceData)) {
- srcData = dstData.getSourceSurfaceData(paint.getImage(), SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
- if (!(srcData instanceof XRSurfaceData)) {
- throw new InternalError("Surface not cachable");
- }
- }
+ XRSurfaceData dstData = (XRSurfaceData) sg2d.surfaceData;
+ XRSurfaceData srcData = (XRSurfaceData) getAccSrcSurface(dstData, bi);
- XRSurfaceData x11SrcData = (XRSurfaceData) srcData;
-
- AffineTransform at = (AffineTransform) sg2d.transform.clone();
- Rectangle2D anchor = paint.getAnchorRect();
+ AffineTransform at = new AffineTransform();
at.translate(anchor.getX(), anchor.getY());
at.scale(anchor.getWidth() / ((double) bi.getWidth()), anchor.getHeight() / ((double) bi.getHeight()));
try {
at.invert();
} catch (NoninvertibleTransformException ex) {
- at.setToIdentity(); /* TODO: Right thing to do in this case? */
+ at.setToIdentity();
}
+ srcData.setStaticSrcTx(at);
- x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
- xrCompMan.setTexturePaint(((XRSurfaceData) srcData));
+ srcData.validateAsSource(at, XRUtils.RepeatNormal, XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
+ xrCompMan.setTexturePaint(srcData);
}
}
- public int[] convertToIntArgbPixels(Color[] colors, boolean linear) {
+ public int[] convertToIntArgbPixels(Color[] colors) {
int[] pixels = new int[colors.length];
for (int i = 0; i < colors.length; i++) {
- pixels[i] = colorToIntArgbPixel(colors[i], linear);
+ pixels[i] = colorToIntArgbPixel(colors[i]);
}
return pixels;
}
- public int colorToIntArgbPixel(Color c, boolean linear) {
+ public int colorToIntArgbPixel(Color c) {
int rgb = c.getRGB();
-
- int a = rgb >>> 24;
- int r = (rgb >> 16) & 0xff;
- int g = (rgb >> 8) & 0xff;
- int b = (rgb) & 0xff;
- if (linear) {
- r = BufferedPaints.convertSRGBtoLinearRGB(r);
- g = BufferedPaints.convertSRGBtoLinearRGB(g);
- b = BufferedPaints.convertSRGBtoLinearRGB(b);
- }
-
- a *= xrCompMan.getExtraAlpha();
-
- return ((a << 24) | (r << 16) | (g << 8) | (b));
+ int a = (int) Math.round(xrCompMan.getExtraAlpha() * (rgb >>> 24));
+ return ((a << 24) | (rgb & 0x00FFFFFF));
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSolidSrcPict.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.java2d.xr;
+
+public class XRSolidSrcPict {
+ XRBackend con;
+
+ XRSurfaceData srcPict;
+ XRColor xrCol;
+ int curPixVal = -1;
+
+ public XRSolidSrcPict(XRBackend con, int parentXid) {
+ this.con = con;
+
+ xrCol = new XRColor();
+ int solidPixmap = con.createPixmap(parentXid, 32, 1, 1);
+ int solidSrcPictXID = con.createPicture(solidPixmap, XRUtils.PictStandardARGB32);
+ con.setPictureRepeat(solidSrcPictXID, XRUtils.RepeatNormal);
+ con.renderRectangle(solidSrcPictXID, XRUtils.PictOpSrc, XRColor.FULL_ALPHA, 0, 0, 1, 1);
+ srcPict = new XRSurfaceData.XRInternalSurfaceData(con, solidSrcPictXID);
+ }
+
+ public XRSurfaceData prepareSrcPict(int pixelVal) {
+ if(pixelVal != curPixVal) {
+ xrCol.setColorValues(pixelVal, false);
+ con.renderRectangle(srcPict.picture, XRUtils.PictOpSrc, xrCol, 0, 0, 1, 1);
+ this.curPixVal = pixelVal;
+ }
+
+ return srcPict;
+ }
+
+}
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java Fri Nov 08 17:36:14 2013 -0800
@@ -109,6 +109,7 @@
return XRSurfaceDataProxy.createProxy(srcData, graphicsConfig);
}
+ @Override
public void validatePipe(SunGraphics2D sg2d) {
TextPipe textpipe;
boolean validated = false;
@@ -117,14 +118,8 @@
* The textpipe for now can't handle TexturePaint when extra-alpha is
* specified nore XOR mode
*/
- if (sg2d.compositeState < SunGraphics2D.COMP_XOR &&
- (sg2d.paintState < SunGraphics2D.PAINT_TEXTURE ||
- sg2d.composite == null ||
- !(sg2d.composite instanceof AlphaComposite) ||
- ((AlphaComposite) sg2d.composite).getAlpha() == 1.0f))
+ if ((textpipe = getTextPipe(sg2d)) == null)
{
- textpipe = xrtextpipe;
- } else {
super.validatePipe(sg2d);
textpipe = sg2d.textpipe;
validated = true;
@@ -184,13 +179,38 @@
sg2d.imagepipe = xrDrawImage;
}
+ protected TextPipe getTextPipe(SunGraphics2D sg2d) {
+ boolean supportedPaint = sg2d.compositeState <= SunGraphics2D.COMP_ALPHA
+ && (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR || sg2d.composite == null);
+
+ boolean supportedCompOp = false;
+ if (sg2d.composite instanceof AlphaComposite) {
+ int compRule = ((AlphaComposite) sg2d.composite).getRule();
+ supportedCompOp = XRUtils.isMaskEvaluated(XRUtils.j2dAlphaCompToXR(compRule))
+ || (compRule == AlphaComposite.SRC
+ && sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR);
+ }
+
+ return (supportedPaint && supportedCompOp) ? xrtextpipe : null;
+ }
+
protected MaskFill getMaskFill(SunGraphics2D sg2d) {
- if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR &&
- !XRPaints.isValid(sg2d))
- {
- return null;
+ AlphaComposite aComp = null;
+ if(sg2d.composite != null
+ && sg2d.composite instanceof AlphaComposite) {
+ aComp = (AlphaComposite) sg2d.composite;
}
- return super.getMaskFill(sg2d);
+
+ boolean supportedPaint = sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR
+ || XRPaints.isValid(sg2d);
+
+ boolean supportedCompOp = false;
+ if(aComp != null) {
+ int rule = aComp.getRule();
+ supportedCompOp = XRUtils.isMaskEvaluated(XRUtils.j2dAlphaCompToXR(rule));
+ }
+
+ return (supportedPaint && supportedCompOp) ? super.getMaskFill(sg2d) : null;
}
public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
@@ -395,6 +415,7 @@
boolean transformInUse = false;
AffineTransform validatedSourceTransform = new AffineTransform();
+ AffineTransform staticSrcTx = null;
int validatedRepeat = XRUtils.RepeatNone;
int validatedFilter = XRUtils.FAST;
@@ -423,13 +444,24 @@
}
} else if (!transformInUse ||
(transformInUse && !sxForm.equals(validatedSourceTransform))) {
+
validatedSourceTransform.setTransform(sxForm.getScaleX(),
sxForm.getShearY(),
sxForm.getShearX(),
sxForm.getScaleY(),
sxForm.getTranslateX(),
sxForm.getTranslateY());
- renderQueue.setPictureTransform(picture, validatedSourceTransform);
+
+ AffineTransform srcTransform = validatedSourceTransform;
+ if(staticSrcTx != null) {
+ // Apply static transform set when used as texture or gradient.
+ // Create a copy to not modify validatedSourceTransform as
+ // this would confuse the validation logic.
+ srcTransform = new AffineTransform(validatedSourceTransform);
+ srcTransform.preConcatenate(staticSrcTx);
+ }
+
+ renderQueue.setPictureTransform(picture, srcTransform);
transformInUse = true;
}
@@ -547,15 +579,10 @@
}
public static class XRInternalSurfaceData extends XRSurfaceData {
- public XRInternalSurfaceData(XRBackend renderQueue, int pictXid,
- AffineTransform transform) {
+ public XRInternalSurfaceData(XRBackend renderQueue, int pictXid) {
super(renderQueue);
this.picture = pictXid;
- this.validatedSourceTransform = transform;
-
- if (validatedSourceTransform != null) {
- transformInUse = true;
- }
+ this.transformInUse = false;
}
public boolean canSourceSendExposures(int x, int y, int w, int h) {
@@ -677,4 +704,8 @@
public XRGraphicsConfig getGraphicsConfig() {
return graphicsConfig;
}
+
+ public void setStaticSrcTx(AffineTransform staticSrcTx) {
+ this.staticSrcTx = staticSrcTx;
+ }
}
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java Fri Nov 08 17:36:14 2013 -0800
@@ -27,6 +27,7 @@
import java.awt.*;
import java.awt.MultipleGradientPaint.*;
+import java.awt.geom.AffineTransform;
import java.awt.image.*;
import sun.java2d.loops.*;
import static java.awt.AlphaComposite.*;
@@ -258,4 +259,21 @@
public static int clampToUShort(int x) {
return (x > 65535 ? 65535 : (x < 0) ? 0 : x);
}
+
+ public static boolean isTransformQuadrantRotated(AffineTransform tr) {
+ return ((tr.getType() & (AffineTransform.TYPE_GENERAL_ROTATION |
+ AffineTransform.TYPE_GENERAL_TRANSFORM)) == 0);
+ }
+
+ public static boolean isMaskEvaluated(byte xrCompRule) {
+ switch (xrCompRule) {
+ case PictOpOver:
+ case PictOpOverReverse:
+ case PictOpAtop:
+ case PictOpXor:
+ return true;
+ }
+
+ return false;
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/misc/GThreadHelper.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.misc;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * This class is used to prevent multiple calling of g_thread_init ()
+ * and gdk_thread_init ().
+ *
+ * Since version 2.24 of GLib, calling g_thread_init () multiple times is
+ * allowed, but it will crash for older versions. There are two ways to
+ * find out if g_thread_init () has been called:
+ * g_thread_get_initialized (), but it was introduced in 2.20
+ * g_thread_supported (), but it is a macro and cannot be loaded with dlsym.
+ *
+ * usage:
+ * <pre>
+ * lock();
+ * try {
+ * if (!getAndSetInitializationNeededFlag()) {
+ * //call to g_thread_init();
+ * //call to gdk_thread_init();
+ * }
+ * } finally {
+ * unlock();
+ * }
+ * </pre>
+ */
+public final class GThreadHelper {
+
+ private static final ReentrantLock LOCK = new ReentrantLock();
+ private static boolean isGThreadInitialized = false;
+
+ /**
+ * Acquires the lock.
+ */
+ public static void lock() {
+ LOCK.lock();
+ }
+
+ /**
+ * Releases the lock.
+ */
+ public static void unlock() {
+ LOCK.unlock();
+ }
+
+ /**
+ * Gets current value of initialization flag and sets it to {@code true}.
+ * MUST be called under the lock.
+ *
+ * A return value of {@code false} indicates that the calling code
+ * should call the g_thread_init() and gdk_thread_init() functions
+ * before releasing the lock.
+ *
+ * @return {@code true} if initialization has been completed.
+ */
+ public static boolean getAndSetInitializationNeededFlag() {
+ boolean ret = isGThreadInitialized;
+ isGThreadInitialized = true;
+ return ret;
+ }
+}
--- a/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java Fri Nov 08 17:36:14 2013 -0800
@@ -668,7 +668,7 @@
}
}
- // an error occured
+ // an error occurred
if (ex != null) {
releaseChildren(key);
throw ex;
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java Fri Nov 08 17:36:14 2013 -0800
@@ -493,8 +493,8 @@
// first pass:
// 1. compute length of names
- // 2. mark all occurences of "." to ignore
- // 3. and look for any occurences of ".."
+ // 2. mark all occurrences of "." to ignore
+ // 3. and look for any occurrences of ".."
for (int i=0; i<count; i++) {
int begin = offsets[i];
int len;
@@ -517,7 +517,7 @@
}
}
- // multiple passes to eliminate all occurences of name/..
+ // multiple passes to eliminate all occurrences of name/..
if (hasDotDot) {
int prevRemaining;
do {
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java Fri Nov 08 17:36:14 2013 -0800
@@ -56,7 +56,7 @@
if (uri.getQuery() != null)
throw new IllegalArgumentException("URI has a query component");
- // compatability with java.io.File
+ // compatibility with java.io.File
if (!uri.toString().startsWith("file:///"))
return new File(uri).toPath();
--- a/jdk/src/solaris/classes/sun/print/CUPSPrinter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/print/CUPSPrinter.java Fri Nov 08 17:36:14 2013 -0800
@@ -237,8 +237,9 @@
/**
* Get CUPS default printer using IPP.
+ * Returns 2 values - index 0 is printer name, index 1 is the uri.
*/
- public static String getDefaultPrinter() {
+ static String[] getDefaultPrinter() {
try {
URL url = new URL("http", getServer(), getPort(), "");
final HttpURLConnection urlConnection =
@@ -264,8 +265,8 @@
AttributeClass.ATTRIBUTES_CHARSET,
AttributeClass.ATTRIBUTES_NATURAL_LANGUAGE,
new AttributeClass("requested-attributes",
- AttributeClass.TAG_KEYWORD,
- "printer-name")
+ AttributeClass.TAG_URI,
+ "printer-uri")
};
if (IPPPrintService.writeIPPRequest(os,
@@ -273,6 +274,7 @@
attCl)) {
HashMap defaultMap = null;
+ String[] printerInfo = new String[2];
InputStream is = urlConnection.getInputStream();
HashMap[] responseMap = IPPPrintService.readIPPResponse(
is);
@@ -293,21 +295,30 @@
* special behaviour for this built in.
*/
if (UnixPrintServiceLookup.isMac()) {
- return UnixPrintServiceLookup.
+ printerInfo[0] = UnixPrintServiceLookup.
getDefaultPrinterNameSysV();
+ printerInfo[1] = null;
+ return (String[])printerInfo.clone();
} else {
return null;
}
}
+
AttributeClass attribClass = (AttributeClass)
defaultMap.get("printer-name");
if (attribClass != null) {
- String nameStr = attribClass.getStringValue();
+ printerInfo[0] = attribClass.getStringValue();
+ attribClass = (AttributeClass)defaultMap.get("device-uri");
+ if (attribClass != null) {
+ printerInfo[1] = attribClass.getStringValue();
+ } else {
+ printerInfo[1] = null;
+ }
os.close();
urlConnection.disconnect();
- return nameStr;
+ return (String [])printerInfo.clone();
}
}
os.close();
@@ -322,7 +333,7 @@
/**
* Get list of all CUPS printers using IPP.
*/
- public static String[] getAllPrinters() {
+ static String[] getAllPrinters() {
try {
URL url = new URL("http", getServer(), getPort(), "");
--- a/jdk/src/solaris/classes/sun/print/IPPPrintService.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/print/IPPPrintService.java Fri Nov 08 17:36:14 2013 -0800
@@ -366,6 +366,7 @@
" IPPPrintService, myURL="+
myURL+" Exception= "+
e);
+ throw new IllegalArgumentException("invalid url");
}
isCupsPrinter = isCups;
@@ -1145,6 +1146,8 @@
// REMIND: check attribute values
return (T)PDLOverrideSupported.NOT_ATTEMPTED;
}
+ } else if (category == PrinterURI.class) {
+ return (T)(new PrinterURI(myURI));
} else {
return null;
}
--- a/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,6 +48,7 @@
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.PrintServiceAttributeSet;
import javax.print.attribute.standard.PrinterName;
+import javax.print.attribute.standard.PrinterURI;
import java.io.File;
import java.io.FileReader;
import java.net.URL;
@@ -61,7 +62,7 @@
implements BackgroundServiceLookup, Runnable {
/* Remind: the current implementation is static, as its assumed
- * its preferable to minimise creation of PrintService instances.
+ * its preferable to minimize creation of PrintService instances.
* Later we should add logic to add/remove services on the fly which
* will take a hit of needing to regather the list of services.
*/
@@ -203,6 +204,33 @@
}
}
+ private int addPrintServiceToList(ArrayList printerList, PrintService ps) {
+ int index = printerList.indexOf(ps);
+ // Check if PrintService with same name is already in the list.
+ if (CUPSPrinter.isCupsRunning() && index != -1) {
+ // Bug in Linux: Duplicate entry of a remote printer
+ // and treats it as local printer but it is returning wrong
+ // information when queried using IPP. Workaround is to remove it.
+ // Even CUPS ignores these entries as shown in lpstat or using
+ // their web configuration.
+ PrinterURI uri = (PrinterURI)ps.getAttribute(PrinterURI.class);
+ if (uri.getURI().getHost().equals("localhost")) {
+ IPPPrintService.debug_println(debugPrefix+"duplicate PrintService, ignoring the new local printer: "+ps);
+ return index; // Do not add this.
+ }
+ PrintService oldPS = (PrintService)(printerList.get(index));
+ uri = (PrinterURI)oldPS.getAttribute(PrinterURI.class);
+ if (uri.getURI().getHost().equals("localhost")) {
+ IPPPrintService.debug_println(debugPrefix+"duplicate PrintService, removing existing local printer: "+oldPS);
+ printerList.remove(oldPS);
+ } else {
+ return index;
+ }
+ }
+ printerList.add(ps);
+ return (printerList.size() - 1);
+ }
+
// refreshes "printServices"
public synchronized void refreshServices() {
@@ -246,8 +274,7 @@
}
if ((defaultPrintService != null)
&& printers[p].equals(getPrinterDestName(defaultPrintService))) {
- printerList.add(defaultPrintService);
- defaultIndex = printerList.size() - 1;
+ defaultIndex = addPrintServiceToList(printerList, defaultPrintService);
} else {
if (printServices == null) {
IPPPrintService.debug_println(debugPrefix+
@@ -255,9 +282,10 @@
if (CUPSPrinter.isCupsRunning()) {
try {
- printerList.add(new IPPPrintService(printers[p],
- printerURIs[p],
- true));
+ addPrintServiceToList(printerList,
+ new IPPPrintService(printers[p],
+ printerURIs[p],
+ true));
} catch (Exception e) {
IPPPrintService.debug_println(debugPrefix+
" getAllPrinters Exception "+
@@ -282,10 +310,10 @@
if (j == printServices.length) { // not found?
if (CUPSPrinter.isCupsRunning()) {
try {
- printerList.add(new IPPPrintService(
- printers[p],
- printerURIs[p],
- true));
+ addPrintServiceToList(printerList,
+ new IPPPrintService(printers[p],
+ printerURIs[p],
+ true));
} catch (Exception e) {
IPPPrintService.debug_println(debugPrefix+
" getAllPrinters Exception "+
@@ -312,9 +340,7 @@
//if defaultService is not found in printerList
if (defaultIndex == -1 && defaultPrintService != null) {
- //add default to the list
- printerList.add(defaultPrintService);
- defaultIndex = printerList.size() - 1;
+ defaultIndex = addPrintServiceToList(printerList, defaultPrintService);
}
printServices = (PrintService[])printerList.toArray(
@@ -563,11 +589,14 @@
// clear defaultPrintService
defaultPrintService = null;
+ String psuri = null;
IPPPrintService.debug_println("isRunning ? "+
(CUPSPrinter.isCupsRunning()));
if (CUPSPrinter.isCupsRunning()) {
- defaultPrinter = CUPSPrinter.getDefaultPrinter();
+ String[] printerInfo = CUPSPrinter.getDefaultPrinter();
+ defaultPrinter = printerInfo[0];
+ psuri = printerInfo[1];
} else {
if (isMac() || isSysV()) {
defaultPrinter = getDefaultPrinterNameSysV();
@@ -590,12 +619,17 @@
if (defaultPrintService == null) {
if (CUPSPrinter.isCupsRunning()) {
try {
- PrintService defaultPS =
- new IPPPrintService(defaultPrinter,
+ PrintService defaultPS;
+ if (psuri != null) {
+ defaultPS = new IPPPrintService(defaultPrinter,
+ psuri, true);
+ } else {
+ defaultPS = new IPPPrintService(defaultPrinter,
new URL("http://"+
CUPSPrinter.getServer()+":"+
CUPSPrinter.getPort()+"/"+
defaultPrinter));
+ }
defaultPrintService = defaultPS;
} catch (Exception e) {
}
--- a/jdk/src/solaris/demo/jni/Poller/Poller.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/demo/jni/Poller/Poller.c Fri Nov 08 17:36:14 2013 -0800
@@ -73,7 +73,7 @@
* 6> Could add simpler code for pre-Solaris 7 releases which will
* perform slightly better on those OSs. But again there
* are only modest gains to be had from these new code paths,
- * so they've been ommitted here.
+ * so they've been omitted here.
*
* Compile "cc -G -o <dest_dir>/libpoller.so -I ${JAVA_HOME}/include " \
* -I ${JAVA_HOME}/include/solaris Poller.c" and place the <dest_dir>
--- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_Ports.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_Ports.c Fri Nov 08 17:36:14 2013 -0800
@@ -401,7 +401,7 @@
numControls = 0;
elem = portMixer->elems[portIndex];
if (snd_mixer_selem_has_playback_volume(elem) || snd_mixer_selem_has_capture_volume(elem)) {
- /* Since we've splitted/duplicated elements with both playback and capture on the recovery
+ /* Since we've split/duplicated elements with both playback and capture on the recovery
of elements, we now can assume that we handle only to deal with either playback or
capture. */
isPlayback = isPlaybackFunction(portMixer->types[portIndex]);
--- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_Ports.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_Ports.c Fri Nov 08 17:36:14 2013 -0800
@@ -401,7 +401,7 @@
numControls = 0;
elem = portMixer->elems[portIndex];
if (snd_mixer_selem_has_playback_volume(elem) || snd_mixer_selem_has_capture_volume(elem)) {
- /* Since we've splitted/duplicated elements with both playback and capture on the recovery
+ /* Since we've split/duplicated elements with both playback and capture on the recovery
of elements, we now can assume that we handle only to deal with either playback or
capture. */
isPlayback = isPlaybackFunction(portMixer->types[portIndex]);
--- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_SolarisOS_PCM.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_SolarisOS_PCM.c Fri Nov 08 17:36:14 2013 -0800
@@ -371,7 +371,7 @@
}
AUDIO_INITINFO(&audioInfo);
if (underrun) {
- /* if an underrun occured, reset */
+ /* if an underrun occurred, reset */
ERROR1("DAUDIO_Write/Read: Underrun/overflow: adjusting positionOffset by %d:\n",
(devBytes - info->transferedBytes));
ERROR1(" devBytes from %d to 0, ", devBytes);
--- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_SolarisOS_Utils.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_SolarisOS_Utils.h Fri Nov 08 17:36:14 2013 -0800
@@ -87,7 +87,7 @@
/*
* fills adDesc from the audio device given in path
- * returns 0 if an error occured
+ * returns 0 if an error occurred
* if getNames is 0, only path and pathctl are filled
*/
int getAudioDeviceDescription(char* path, AudioDeviceDescription* adDesc, int getNames);
--- a/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c Fri Nov 08 17:36:14 2013 -0800
@@ -67,7 +67,7 @@
Java_sun_awt_UNIXToolkit_load_1gtk(JNIEnv *env, jclass klass)
{
#ifndef HEADLESS
- return (jboolean)gtk2_load();
+ return (jboolean)gtk2_load(env);
#else
return JNI_FALSE;
#endif /* !HEADLESS */
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c Fri Nov 08 17:36:14 2013 -0800
@@ -81,7 +81,7 @@
static void *gtk2_libhandle = NULL;
static void *gthread_libhandle = NULL;
-static gboolean flag_g_thread_get_initialized = FALSE;
+
static jmp_buf j;
/* Widgets */
@@ -502,7 +502,7 @@
fp_gtk_g_slist_length = dl_symbol("g_slist_length");
}
-gboolean gtk2_load()
+gboolean gtk2_load(JNIEnv *env)
{
gboolean result;
int i;
@@ -533,6 +533,7 @@
}
/* GLib */
+ fp_glib_check_version = dl_symbol("glib_check_version");
fp_g_free = dl_symbol("g_free");
fp_g_object_unref = dl_symbol("g_object_unref");
@@ -708,6 +709,9 @@
/**
* GLib thread system
*/
+ if (fp_glib_check_version(2, 20, 0) == NULL) {
+ fp_g_thread_get_initialized = dl_symbol_gthread("g_thread_get_initialized");
+ }
fp_g_thread_init = dl_symbol_gthread("g_thread_init");
fp_gdk_threads_init = dl_symbol("gdk_threads_init");
fp_gdk_threads_enter = dl_symbol("gdk_threads_enter");
@@ -810,16 +814,33 @@
io_handler = XSetIOErrorHandler(NULL);
if (fp_gtk_check_version(2, 2, 0) == NULL) {
+ jclass clazz = (*env)->FindClass(env, "sun/misc/GThreadHelper");
+ jmethodID mid_getAndSetInitializationNeededFlag =
+ (*env)->GetStaticMethodID(env, clazz, "getAndSetInitializationNeededFlag", "()Z");
+ jmethodID mid_lock = (*env)->GetStaticMethodID(env, clazz, "lock", "()V");
+ jmethodID mid_unlock = (*env)->GetStaticMethodID(env, clazz, "unlock", "()V");
+
// Init the thread system to use GLib in a thread-safe mode
- if (!flag_g_thread_get_initialized) {
- flag_g_thread_get_initialized = TRUE;
+ (*env)->CallStaticVoidMethod(env, clazz, mid_lock);
- fp_g_thread_init(NULL);
+ // Calling g_thread_init() multiple times leads to crash on GLib < 2.24
+ // We can use g_thread_get_initialized () but it is available only for
+ // GLib >= 2.20. We rely on GThreadHelper for GLib < 2.20.
+ gboolean is_g_thread_get_initialized = FALSE;
+ if (fp_glib_check_version(2, 20, 0) == NULL) {
+ is_g_thread_get_initialized = fp_g_thread_get_initialized();
+ }
+
+ if (!(*env)->CallStaticBooleanMethod(env, clazz, mid_getAndSetInitializationNeededFlag)) {
+ if (!is_g_thread_get_initialized) {
+ fp_g_thread_init(NULL);
+ }
//According the GTK documentation, gdk_threads_init() should be
//called before gtk_init() or gtk_init_check()
fp_gdk_threads_init();
}
+ (*env)->CallStaticVoidMethod(env, clazz, mid_unlock);
}
result = (*fp_gtk_init_check)(NULL, NULL);
@@ -1231,7 +1252,7 @@
if (init_result = (NULL == gtk2_widgets[_GTK_CONTAINER_TYPE]))
{
/* There is no constructor for a container type. I've
- * choosen GtkFixed container since it has a default
+ * chosen GtkFixed container since it has a default
* constructor.
*/
gtk2_widgets[_GTK_CONTAINER_TYPE] =
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.h Fri Nov 08 17:36:14 2013 -0800
@@ -643,6 +643,14 @@
*/
const char *getStrFor(JNIEnv *env, jstring value);
+/**
+ * Returns :
+ * NULL if the GLib library is compatible with the given version, or a string
+ * describing the version mismatch.
+ */
+gchar* (*fp_glib_check_version)(guint required_major, guint required_minor,
+ guint required_micro);
+
/*
* Check whether the gtk2 library is available and meets the minimum
* version requirement. If the library is already loaded this method has no
@@ -663,7 +671,7 @@
* effect and returns success.
* Returns FALSE on failure and TRUE on success.
*/
-gboolean gtk2_load();
+gboolean gtk2_load(JNIEnv *env);
/*
* Loads fp_gtk_show_uri function pointer. This initialization is
@@ -801,6 +809,12 @@
guint (*fp_gtk_main_level)(void);
+/**
+ * This function is available for GLIB > 2.20, so it MUST be
+ * called within (fp_glib_check_version(2, 20, 0) == NULL) check.
+ */
+gboolean (*fp_g_thread_get_initialized)(void);
+
void (*fp_g_thread_init)(GThreadFunctions *vtable);
void (*fp_gdk_threads_init)(void);
void (*fp_gdk_threads_enter)(void);
--- a/jdk/src/solaris/native/sun/awt/multiVis.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/sun/awt/multiVis.c Fri Nov 08 17:36:14 2013 -0800
@@ -1115,7 +1115,7 @@
* to by pImageVisuals. */
XVisualInfo ***pImageVisuals; /* The device's image visuals. */
{
- XVisualInfo getVisInfo; /* Paramters of XGetVisualInfo */
+ XVisualInfo getVisInfo; /* Parameters of XGetVisualInfo */
int32_t mask;
XVisualInfo *pVis, **pIVis; /* Faster, local copies */
OverlayInfo *pOVis;
--- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c Fri Nov 08 17:36:14 2013 -0800
@@ -523,12 +523,10 @@
Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative
(JNIEnv *env, jclass xsd, jfloatArray fractionsArray,
jshortArray pixelsArray, jint x1, jint y1, jint x2, jint y2,
- jint numStops, jint repeat,
- jint m00, jint m01, jint m02, jint m10, jint m11, jint m12) {
+ jint numStops, jint repeat) {
jint i;
jshort* pixels;
jfloat* fractions;
- XTransform tr;
XRenderPictureAttributes pict_attr;
Picture gradient = 0;
XRenderColor *colors;
@@ -594,8 +592,6 @@
(*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, fractions, JNI_ABORT);
if (gradient != 0) {
- BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
- XRenderSetPictureTransform (awt_display, gradient, &tr);
pict_attr.repeat = repeat;
XRenderChangePicture (awt_display, gradient, CPRepeat, &pict_attr);
}
@@ -608,12 +604,11 @@
Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative
(JNIEnv *env, jclass xsd, jfloatArray fractionsArray,
jshortArray pixelsArray, jint numStops,
- jint innerRadius, jint outerRadius, jint repeat,
- jint m00, jint m01, jint m02, jint m10, jint m11, jint m12) {
+ jint centerX, jint centerY,
+ jint innerRadius, jint outerRadius, jint repeat) {
jint i;
jshort* pixels;
jfloat* fractions;
- XTransform tr;
XRenderPictureAttributes pict_attr;
Picture gradient = 0;
XRenderColor *colors;
@@ -637,11 +632,11 @@
return -1; //TODO release pixels first
}
- grad.inner.x = 0;
- grad.inner.y = 0;
+ grad.inner.x = centerX;
+ grad.inner.y = centerY;
grad.inner.radius = innerRadius;
- grad.outer.x = 0;
- grad.outer.y = 0;
+ grad.outer.x = centerX;
+ grad.outer.y = centerY;
grad.outer.radius = outerRadius;
/*TODO optimized & malloc check*/
@@ -682,8 +677,6 @@
if (gradient != 0) {
- BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
- XRenderSetPictureTransform (awt_display, gradient, &tr);
pict_attr.repeat = repeat;
XRenderChangePicture (awt_display, gradient, CPRepeat, &pict_attr);
}
--- a/jdk/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h Fri Nov 08 17:36:14 2013 -0800
@@ -317,8 +317,8 @@
#endif
/*
- * Enhanced messaging has been added to accomodate newer devices which have
- * more advanced capabilites, such as dedicated secure co-processors which
+ * Enhanced messaging has been added to accommodate newer devices which have
+ * more advanced capabilities, such as dedicated secure co-processors which
* can stream and encrypt data over USB. In order to used enhanced messaging
* you must define PCSCLITE_ENHANCED_MESSAGING in the framework(library),
* the daemon, and your application
@@ -332,7 +332,7 @@
/*
* The message and buffer sizes must be multiples of 16.
* The max message size must be at least large enough
- * to accomodate the transmit_struct
+ * to accommodate the transmit_struct
*/
#define PCSCLITE_MAX_MESSAGE_SIZE (1<<17) /* enhanced (128K) msg len */
#define MAX_BUFFER_SIZE (1<<15) /* enhanced (32K) Tx/Rx Buffer */
--- a/jdk/src/solaris/native/sun/xawt/awt_Desktop.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/solaris/native/sun/xawt/awt_Desktop.c Fri Nov 08 17:36:14 2013 -0800
@@ -42,7 +42,7 @@
return JNI_TRUE;
}
- if (gtk2_load() && gtk2_show_uri_load()) {
+ if (gtk2_load(env) && gtk2_show_uri_load()) {
gtk_has_been_loaded = TRUE;
return JNI_TRUE;
} else if (gnome_load()) {
--- a/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryAttachingConnector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryAttachingConnector.java Fri Nov 08 17:36:14 2013 -0800
@@ -50,7 +50,7 @@
transport = new Transport() {
public String name() {
- return "dt_shmem"; // for compatability reasons
+ return "dt_shmem"; // for compatibility reasons
}
};
}
--- a/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryListeningConnector.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryListeningConnector.java Fri Nov 08 17:36:14 2013 -0800
@@ -49,7 +49,7 @@
transport = new Transport() {
public String name() {
- return "dt_shmem"; // compatability
+ return "dt_shmem"; // compatibility
}
};
}
--- a/jdk/src/windows/classes/java/net/DefaultInterface.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/java/net/DefaultInterface.java Fri Nov 08 17:36:14 2013 -0800
@@ -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).
*
* Platforms that do not require a default interface may return null
--- a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -1108,4 +1108,8 @@
}
private native void setZOrder(long above);
+
+ public boolean isLightweightFramePeer() {
+ return false;
+ }
}
--- a/jdk/src/windows/classes/sun/awt/windows/WLightweightFramePeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/awt/windows/WLightweightFramePeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -90,4 +90,8 @@
public void updateCursorImmediately() {
SwingAccessor.getJLightweightFrameAccessor().updateCursor((JLightweightFrame)getLwTarget());
}
+
+ public boolean isLightweightFramePeer() {
+ return true;
+ }
}
--- a/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java Fri Nov 08 17:36:14 2013 -0800
@@ -870,7 +870,7 @@
* drawn using GDI to the printer context.
*
* @param img The image to be drawn.
- * @param xform Used to tranform the image before drawing.
+ * @param xform Used to transform the image before drawing.
* This can be null.
* @param bgcolor This color is drawn where the image has transparent
* pixels. If this parameter is null then the
--- a/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java Fri Nov 08 17:36:14 2013 -0800
@@ -183,10 +183,6 @@
/**
* Values must match those defined in wingdi.h & commdlg.h
*/
- private static final int PD_ALLPAGES = 0x00000000;
- private static final int PD_SELECTION = 0x00000001;
- private static final int PD_PAGENUMS = 0x00000002;
- private static final int PD_NOSELECTION = 0x00000004;
private static final int PD_COLLATE = 0x00000010;
private static final int PD_PRINTTOFILE = 0x00000020;
private static final int DM_ORIENTATION = 0x00000001;
@@ -1639,63 +1635,7 @@
}
}
- //returns 1-based index for "From" page
- private final int getFromPageAttrib() {
- if (attributes != null) {
- PageRanges pageRangesAttr =
- (PageRanges)attributes.get(PageRanges.class);
- if (pageRangesAttr != null) {
- int[][] range = pageRangesAttr.getMembers();
- return range[0][0];
- }
- }
- return getMinPageAttrib();
- }
- //returns 1-based index for "To" page
- private final int getToPageAttrib() {
- if (attributes != null) {
- PageRanges pageRangesAttr =
- (PageRanges)attributes.get(PageRanges.class);
- if (pageRangesAttr != null) {
- int[][] range = pageRangesAttr.getMembers();
- return range[range.length-1][1];
- }
- }
- return getMaxPageAttrib();
- }
-
- private final int getMinPageAttrib() {
- if (attributes != null) {
- SunMinMaxPage s =
- (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
- if (s != null) {
- return s.getMin();
- }
- }
- return 1;
- }
-
- private final int getMaxPageAttrib() {
- if (attributes != null) {
- SunMinMaxPage s =
- (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
- if (s != null) {
- return s.getMax();
- }
- }
-
- Pageable pageable = getPageable();
- if (pageable != null) {
- int numPages = pageable.getNumberOfPages();
- if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
- numPages = MAX_UNKNOWN_PAGES;
- }
- return ((numPages == 0) ? 1 : numPages);
- }
-
- return Integer.MAX_VALUE;
- }
private final boolean getDestAttrib() {
return (mDestination != null);
@@ -1847,20 +1787,7 @@
return mAttMediaTray;
}
- private final int getSelectAttrib() {
- if (attributes != null) {
- SunPageSelection pages =
- (SunPageSelection)attributes.get(SunPageSelection.class);
- if (pages == SunPageSelection.RANGE) {
- return PD_PAGENUMS;
- } else if (pages == SunPageSelection.SELECTION) {
- return PD_SELECTION;
- } else if (pages == SunPageSelection.ALL) {
- return PD_ALLPAGES;
- }
- }
- return PD_NOSELECTION;
- }
+
private final boolean getPrintToFileEnabled() {
SecurityManager security = System.getSecurityManager();
--- a/jdk/src/windows/classes/sun/awt/windows/WRobotPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/awt/windows/WRobotPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -56,9 +56,9 @@
public native void keyRelease( int keycode );
public int getRGBPixel(int x, int y) {
- return getRGBPixelImpl(x, y);
+ // See 7002846: that's ineffective, but works correctly with non-opaque windows
+ return getRGBPixels(new Rectangle(x, y, 1, 1))[0];
}
- public native int getRGBPixelImpl(int x, int y);
public int [] getRGBPixels(Rectangle bounds) {
int pixelArray[] = new int[bounds.width*bounds.height];
--- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java Fri Nov 08 17:36:14 2013 -0800
@@ -252,6 +252,13 @@
updateWindow(true);
}
}
+
+ // See https://javafx-jira.kenai.com/browse/RT-32570
+ WComponentPeer owner = getNativeParent();
+ if (owner != null && owner.isLightweightFramePeer()) {
+ Rectangle b = getBounds();
+ handleExpose(0, 0, b.width, b.height);
+ }
}
// Synchronize the insets members (here & in helper) with actual window
--- a/jdk/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java Fri Nov 08 17:36:14 2013 -0800
@@ -709,7 +709,7 @@
}
/**
- * This general Blit implemenation converts any source surface to an
+ * This general Blit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->D3DSurface/Texture loop to get the intermediate
* (premultiplied) surface down to D3D.
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -219,7 +219,7 @@
// Number of helper threads, that did not finish yet.
private int threadsToFinish;
- // IOException which occured during the last run.
+ // IOException which occurred during the last run.
IOException exception = null;
// Called before polling.
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java Fri Nov 08 17:36:14 2013 -0800
@@ -429,7 +429,7 @@
boolean[] ignore = new boolean[count]; // true => ignore name
int remaining = count; // number of names remaining
- // multiple passes to eliminate all occurences of "." and "name/.."
+ // multiple passes to eliminate all occurrences of "." and "name/.."
int prevRemaining;
do {
prevRemaining = remaining;
--- a/jdk/src/windows/classes/sun/security/krb5/internal/tools/Klist.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Klist.java Fri Nov 08 17:36:14 2013 -0800
@@ -58,7 +58,7 @@
* The main program that can be invoked at command line.
* <br>Usage: klist
* [[-c] [-f] [-e] [-a [-n]]] [-k [-t] [-K]] [name]
- * -c specifes that credential cache is to be listed
+ * -c specifies that credential cache is to be listed
* -k specifies that key tab is to be listed
* name name of the credentials cache or keytab
* <br>available options for credential caches:
--- a/jdk/src/windows/native/java/io/canonicalize_md.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/java/io/canonicalize_md.c Fri Nov 08 17:36:14 2013 -0800
@@ -161,7 +161,7 @@
{
char *p = start;
while (*p) {
- if ((p = strchr(p, '.')) == NULL) // find next occurence of '.'
+ if ((p = strchr(p, '.')) == NULL) // find next occurrence of '.'
return 0; // no more dots
p++; // next char
while ((*p) == '.') // go to the end of dots
@@ -184,7 +184,7 @@
p = p + 4;
while (*p) {
- if ((p = wcschr(p, L'.')) == NULL) // find next occurence of '.'
+ if ((p = wcschr(p, L'.')) == NULL) // find next occurrence of '.'
return 0; // no more dots
p++; // next char
while ((*p) == L'.') // go to the end of dots
--- a/jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c Fri Nov 08 17:36:14 2013 -0800
@@ -172,7 +172,7 @@
}
/*
- * Socket is writable or error occured. On some Windows editions
+ * Socket is writable or error occurred. On some Windows editions
* the socket will appear writable when the connect fails so we
* check for error rather than writable.
*/
--- a/jdk/src/windows/native/java/net/icmp.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/java/net/icmp.h Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
short ip_len; /* total length */
unsigned short ip_id; /* identification */
short ip_off; /* fragment offset field */
-#define IP_DF 0x4000 /* dont fragment flag */
+#define IP_DF 0x4000 /* don't fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
unsigned char ip_ttl; /* time to live */
unsigned char ip_p; /* protocol */
--- a/jdk/src/windows/native/sun/font/fontpath.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/font/fontpath.c Fri Nov 08 17:36:14 2013 -0800
@@ -371,7 +371,7 @@
* However if a program "installed" a font in the registry the key may
* not include that. We could also try to "pass" fonts which have no "(..)"
* at the end. But that turns out to pass a few .FON files that MS supply.
- * If there's no parenthesised type string, we could next try to infer
+ * If there's no parenthesized type string, we could next try to infer
* the file type from the file name extension. Since the MS entries that
* have no type string are very few, and have odd names like "MS-DOS CP 437"
* and would never return a Java Font anyway its currently OK to put these
--- a/jdk/src/windows/native/sun/java2d/d3d/D3DBadHardware.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DBadHardware.h Fri Nov 08 17:36:14 2013 -0800
@@ -53,26 +53,73 @@
// Intel HD
// Clarkdale (Desktop) GMA HD Lines
- { 0x8086, 0x0042, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x0042, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0042, D_VERSION(6,14,10,5394), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0042, D_VERSION(8,15,10,2993), OS_VISTA | OS_WINDOWS7 },
// Arrandale (Mobile) GMA HD Lines
- { 0x8086, 0x0046, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x0046, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- // Sandy Bridge GMA HD Lines
- { 0x8086, 0x0102, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x0102, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x0106, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x0106, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x0112, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x0112, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x0116, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x0116, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x0122, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x0122, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x0126, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x0126, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x010A, D_VERSION(6,14,10,5337), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x010A, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0046, D_VERSION(6,14,10,5394), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0046, D_VERSION(8,15,10,2993), OS_VISTA | OS_WINDOWS7 },
+
+ // Sandy Bridge HD Graphics 3000/2000
+ { 0x8086, 0x0102, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0102, D_VERSION(9,17,10,3223), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0106, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0106, D_VERSION(9,17,10,3223), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0112, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0112, D_VERSION(9,17,10,3223), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0116, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0116, D_VERSION(9,17,10,3223), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0122, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0122, D_VERSION(9,17,10,3223), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0126, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0126, D_VERSION(9,17,10,3223), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x010A, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x010A, D_VERSION(9,17,10,3223), OS_VISTA | OS_WINDOWS7 },
+
+ // Ivy Bridge
+ { 0x8086, 0x0162, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0162, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0166, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0166, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x016A, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x016A, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0152, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0152, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0156, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0156, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x015A, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x015A, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+
+ // Haswell
+ { 0x8086, 0x0402, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0402, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0406, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0406, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0412, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0412, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0416, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0416, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x041E, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x041E, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x040A, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x040A, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x041A, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x041A, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0A06, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0A06, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0A16, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0A16, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0A26, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0A26, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0A2E, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0A2E, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0A1E, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0A1E, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0A0E, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0A0E, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0D26, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0D26, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x0D22, D_VERSION(6,14,10,5437), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x0D22, D_VERSION(9,18,10,3257), OS_VISTA | OS_WINDOWS7 },
// Reason: workaround for 6620073, 6612195
// Intel 740
@@ -123,33 +170,33 @@
{ 0x8086, 0x2A13, NO_VERSION, OS_ALL },
// Eaglelake (Desktop) GMA 4500 Lines
- { 0x8086, 0x2E42, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E42, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x2E43, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E43, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x2E92, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E92, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x2E93, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E93, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x2E12, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E12, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x2E13, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E13, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E42, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E42, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E43, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E43, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E92, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E92, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E93, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E93, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E12, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E12, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E13, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E13, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
// Eaglelake (Desktop) GMA X4500 Lines
- { 0x8086, 0x2E32, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E32, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x2E33, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E33, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x2E22, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E22, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E32, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E32, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E33, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E33, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E22, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E22, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
// Eaglelake (Desktop) GMA X4500HD Lines
- { 0x8086, 0x2E23, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2E23, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2E23, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2E23, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
// Cantiga (Mobile) GMA 4500MHD Lines
- { 0x8086, 0x2A42, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2A42, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
- { 0x8086, 0x2A43, D_VERSION(6,14,10,5303), OS_WINXP | OS_WINXP_64 },
- { 0x8086, 0x2A43, D_VERSION(8,15,10,2302), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2A42, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2A42, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
+ { 0x8086, 0x2A43, D_VERSION(6,14,10,5420), OS_WINXP | OS_WINXP_64 },
+ { 0x8086, 0x2A43, D_VERSION(8,15,10,2869), OS_VISTA | OS_WINDOWS7 },
// ATI Mobility Radeon X1600, X1400, X1450, X1300, X1350
// Reason: workaround for 6613066, 6687166
--- a/jdk/src/windows/native/sun/java2d/d3d/D3DTextRenderer.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DTextRenderer.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -444,7 +444,7 @@
} else if (remainingWidth < ginfo->width) {
// in some cases, the x-advance may be slightly smaller
// than the actual width of the glyph; if so, adjust our
- // estimate so that we can accomodate the entire glyph
+ // estimate so that we can accommodate the entire glyph
remainingWidth = ginfo->width;
}
} else {
--- a/jdk/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -161,7 +161,7 @@
// yet created the byteGrayPalette, create it now and copy
// it into our temporary bmi structure.
// REMIND: byteGrayPalette is a leak since we do not have
- // a mechansim to free it up. This should be fine, since it
+ // a mechanism to free it up. This should be fine, since it
// is only 256 bytes for any process and only gets malloc'd
// when using ByteGray surfaces. Eventually, we should use
// the new Disposer mechanism to delete this native memory.
--- a/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -68,7 +68,7 @@
// Fix for 4298688 - draw(Line) and Polygon omit last pixel
// We will need to add a point if we need to close it off or
- // if we need to fix the endpoint to accomodate the Windows
+ // if we need to fix the endpoint to accommodate the Windows
// habit of never drawing the last pixel of a Polyline. Note
// that if the polyline is already closed then neither fix
// is needed because the last pixel is also the first pixel
--- a/jdk/src/windows/native/sun/nio/ch/SocketChannelImpl.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/nio/ch/SocketChannelImpl.c Fri Nov 08 17:36:14 2013 -0800
@@ -97,7 +97,7 @@
}
/*
- * Socket is writable or error occured. On some Windows editions
+ * Socket is writable or error occurred. On some Windows editions
* the socket will appear writable when the connect fails so we
* check for error rather than writable.
*/
--- a/jdk/src/windows/native/sun/security/krb5/NativeCreds.c Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/security/krb5/NativeCreds.c Fri Nov 08 17:36:14 2013 -0800
@@ -725,7 +725,7 @@
return GetLastError();
//
- // Concatenate the target prefix with the previous reponse's
+ // Concatenate the target prefix with the previous response's
// target domain.
//
--- a/jdk/src/windows/native/sun/windows/ThemeReader.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/ThemeReader.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -35,7 +35,7 @@
//
// These type definitions have been imported from UxTheme.h
// They have been imported instead of including them, because
-// currently we dont require Platform SDK for building J2SE and
+// currently we don't require Platform SDK for building J2SE and
// VC6 includes do not have UxTheme.h. When we move to VC7
// we should remove these imports and just include
//
--- a/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -359,7 +359,7 @@
/**
* Creates a 32 bit ARGB bitmap. Returns the bitmap handle. The *bitmapBits
- * contains the pointer to the bitmap data or NULL if an error occured.
+ * contains the pointer to the bitmap data or NULL if an error occurred.
*/
HBITMAP BitmapUtil::CreateARGBBitmap(int width, int height, void ** bitmapBitsPtr)
{
--- a/jdk/src/windows/native/sun/windows/awt_Choice.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_Choice.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -243,7 +243,7 @@
RECT rcWindow;
::GetWindowRect(GetHWnd(), &rcWindow);
- // resize the drop down to accomodate added/removed items
+ // resize the drop down to accommodate added/removed items
int totalHeight = GetTotalHeight();
::SetWindowPos(GetHWnd(), NULL,
0, 0, rcWindow.right - rcWindow.left, totalHeight,
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -281,7 +281,7 @@
void AwtComponent::Dispose()
{
// NOTE: in case the component/toplevel was focused, Java should
- // have already taken care of proper transfering it or clearing.
+ // have already taken care of proper transferring it or clearing.
if (m_hdwp != NULL) {
// end any deferred window positioning, regardless
@@ -2164,7 +2164,7 @@
// Fix 4530093: Don't Validate if can't actually paint
if (m_peerObject == NULL || !m_callbacksEnabled) {
- // Fix 4745222: If we dont ValidateRgn, windows will keep sending
+ // Fix 4745222: If we don't ValidateRgn, windows will keep sending
// WM_PAINT messages until we do. This causes java to go into
// a tight loop that increases CPU to 100% and starves main
// thread which needs to complete initialization, but cant.
--- a/jdk/src/windows/native/sun/windows/awt_Dialog.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_Dialog.h Fri Nov 08 17:36:14 2013 -0800
@@ -127,7 +127,7 @@
// dialog to front
static LRESULT CALLBACK MouseHookProc(int code,
WPARAM wParam, LPARAM lParam);
- // WM_MOUSE hook procedure used in modality, similiar to
+ // WM_MOUSE hook procedure used in modality, similar to
// MouseHookProc but installed on non-toolkit threads, for
// example on browser's thread when running in Java Plugin
static LRESULT CALLBACK MouseHookProc_NonTT(int code,
--- a/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -1524,7 +1524,7 @@
FILETIME now; ::CoFileTimeNow(&now); m_statstg.atime = now;
- return STG_E_CANTSAVE; // dont support writing
+ return STG_E_CANTSAVE; // don't support writing
CATCH_BAD_ALLOC_RET(E_OUTOFMEMORY);
}
--- a/jdk/src/windows/native/sun/windows/awt_Font.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_Font.h Fri Nov 08 17:36:14 2013 -0800
@@ -242,7 +242,7 @@
*/
private:
- /* The array of assocated font handles */
+ /* The array of associated font handles */
HFONT* m_hFont;
/* The number of handles. */
int m_hFontNum;
--- a/jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -277,7 +277,7 @@
have to merge. Or if the current composing string size is 0, we don't have to merge either.
So in clusion, the three conditions not not merge are:
- 1. no commited string
+ 1. no committed string
2. m_pResultTextInfor points to NULL
3. the current string size is 0;
--- a/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -948,7 +948,7 @@
// This may happen in other cases too, but was observed for the above.
// To get a DC compatible with this devmode we should really call
// CreateDC() again to get a DC for the devmode we are using.
- // The changes for that are a lot more risk, so to minimise that
+ // The changes for that are a lot more risk, so to minimize that
// risk, assume its not LANDSCAPE unless width > height, even if the
// devmode says its LANDSCAPE.
// if the values were obtained from a rotated device, swap.
--- a/jdk/src/windows/native/sun/windows/awt_Robot.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_Robot.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -192,15 +192,6 @@
return value;
}
-jint AwtRobot::GetRGBPixel( jint x, jint y)
-{
- HDC hdc = ::CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
- COLORREF ref = ::GetPixel( hdc, x, y );
- ::DeleteDC(hdc);
- jint value = WinToJavaPixel(GetRValue(ref), GetGValue(ref), GetBValue(ref));
- return value;
-}
-
void AwtRobot::GetRGBPixels(jint x, jint y, jint width, jint height, jintArray pixelArray)
{
DASSERT(width > 0 && height > 0);
@@ -403,15 +394,6 @@
CATCH_BAD_ALLOC;
}
-JNIEXPORT jint JNICALL Java_sun_awt_windows_WRobotPeer_getRGBPixelImpl(
- JNIEnv * env, jobject self, jint x, jint y)
-{
- TRY;
-
- return AwtRobot::GetRobot(self)->GetRGBPixel(x, y);
-
- CATCH_BAD_ALLOC_RET(0);
-}
JNIEXPORT void JNICALL Java_sun_awt_windows_WRobotPeer_getRGBPixels(
JNIEnv *env, jobject self, jint x, jint y, jint width, jint height, jintArray pixelArray)
{
--- a/jdk/src/windows/native/sun/windows/awt_Robot.h Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_Robot.h Fri Nov 08 17:36:14 2013 -0800
@@ -44,7 +44,6 @@
void MouseWheel(jint wheelAmt);
jint getNumberOfButtons();
- jint GetRGBPixel( jint x, jint y);
void GetRGBPixels(jint x, jint y, jint width, jint height, jintArray pixelArray);
void KeyPress( jint key );
--- a/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -348,7 +348,7 @@
}
/*
- * If this Paste is occuring because of a synthetic Java event (e.g.,
+ * If this Paste is occurring because of a synthetic Java event (e.g.,
* a synthesized <CTRL>-V KeyEvent), then verify that the TextComponent
* has permission to access the Clipboard before pasting. If permission
* is denied, we should throw a SecurityException, but currently do not
--- a/jdk/src/windows/native/sun/windows/awt_Window.cpp Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp Fri Nov 08 17:36:14 2013 -0800
@@ -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
@@ -1878,11 +1878,28 @@
AwtWindow::sm_resizing = TRUE;
mr = WmSysCommand(wParam, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
if (mr != mrConsume) {
+ // Perform size-move loop here
AwtWindow::DefWindowProc(message, wParam, lParam);
}
AwtWindow::sm_resizing = FALSE;
if (!AwtToolkit::GetInstance().IsDynamicLayoutActive()) {
WindowResized();
+ } else {
+ /*
+ * 8016356: check whether window snapping occurred after
+ * resizing, i.e. GetWindowRect() returns the real
+ * (snapped) window rectangle, e.g. (179, 0)-(483, 1040),
+ * but GetWindowPlacement() returns the rectangle of
+ * normal window position, e.g. (179, 189)-(483, 445) and
+ * they are different. If so, send ComponentResized event.
+ */
+ WINDOWPLACEMENT wp;
+ ::GetWindowPlacement(GetHWnd(), &wp);
+ RECT rc;
+ ::GetWindowRect(GetHWnd(), &rc);
+ if (!::EqualRect(&rc, &wp.rcNormalPosition)) {
+ WindowResized();
+ }
}
mr = mrConsume;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/java/swing/plaf/windows/8016551/bug8016551.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,90 @@
+/*
+ * 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 8016551
+ * @summary JMenuItem in WindowsLookAndFeel can't paint default icons
+ * @author Leonid Romanov
+ * @run main bug8016551
+ */
+
+import javax.swing.*;
+import java.awt.Graphics;
+import java.awt.Toolkit;
+import sun.awt.SunToolkit;
+
+public class bug8016551 {
+ private static volatile RuntimeException exception = null;
+
+ public static void main(String[] args) throws Exception {
+ try {
+ UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+ } catch (Exception e) {
+ // We intentionally allow the test to run with other l&f
+ }
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ Icon icon = UIManager.getIcon("InternalFrame.closeIcon");
+ if (icon == null) {
+ return;
+ }
+
+ JMenuItem item = new TestMenuItem(icon);
+ JFrame f = new JFrame();
+ f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ f.getContentPane().add(item);
+ f.pack();
+ f.setVisible(true);
+ } catch (ClassCastException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+
+ SunToolkit tk = (SunToolkit)Toolkit.getDefaultToolkit();
+ tk.realSync();
+
+ if (exception != null) {
+ throw exception;
+ }
+ }
+
+ static class TestMenuItem extends JMenuItem {
+ TestMenuItem(Icon icon) {
+ super(icon);
+ }
+
+ @Override
+ public void paint(Graphics g) {
+ try {
+ super.paint(g);
+ } catch (RuntimeException e) {
+ exception = e;
+ }
+ }
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Frame/MaximizedByPlatform/MaximizedByPlatform.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,105 @@
+/*
+ * 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 8026143
+ * @summary [macosx] Maximized state could be inconsistent between peer and frame
+ * @author Petr Pchelko
+ * @run main MaximizedByPlatform
+ */
+
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+
+import java.awt.*;
+
+public class MaximizedByPlatform {
+ private static Frame frame;
+ private static Rectangle availableScreenBounds;
+
+ public static void main(String[] args) {
+ if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+ // Test only for macosx. Pass
+ return;
+ }
+
+ availableScreenBounds = getAvailableScreenBounds();
+
+ // Test 1. The maximized state is set in setBounds
+ try {
+ frame = new Frame();
+ frame.setBounds(100, 100, 100, 100);
+ frame.setVisible(true);
+
+ ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+
+ frame.setBounds(availableScreenBounds.x, availableScreenBounds.y,
+ availableScreenBounds.width, availableScreenBounds.height);
+
+ ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+
+ if (frame.getExtendedState() != Frame.MAXIMIZED_BOTH) {
+ throw new RuntimeException("Maximized state was not set for frame in setBounds");
+ }
+ } finally {
+ frame.dispose();
+ }
+
+
+ // Test 2. The maximized state is set in setVisible
+ try {
+ frame = new Frame();
+ frame.setBounds(availableScreenBounds.x, availableScreenBounds.y,
+ availableScreenBounds.width + 100, availableScreenBounds.height);
+ frame.setVisible(true);
+
+ ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+
+ if (frame.getExtendedState() != Frame.MAXIMIZED_BOTH) {
+ throw new RuntimeException("Maximized state was not set for frame in setVisible");
+ }
+ } finally {
+ frame.dispose();
+ }
+ }
+
+ private static Rectangle getAvailableScreenBounds() {
+ final Toolkit toolkit = Toolkit.getDefaultToolkit();
+ final GraphicsEnvironment graphicsEnvironment =
+ GraphicsEnvironment.getLocalGraphicsEnvironment();
+ final GraphicsDevice graphicsDevice =
+ graphicsEnvironment.getDefaultScreenDevice();
+
+ final Dimension screenSize = toolkit.getScreenSize();
+ final Insets screenInsets = toolkit.getScreenInsets(
+ graphicsDevice.getDefaultConfiguration());
+
+ final Rectangle availableScreenBounds = new Rectangle(screenSize);
+
+ availableScreenBounds.x += screenInsets.left;
+ availableScreenBounds.y += screenInsets.top;
+ availableScreenBounds.width -= (screenInsets.left + screenInsets.right);
+ availableScreenBounds.height -= (screenInsets.top + screenInsets.bottom);
+ return availableScreenBounds;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/FullScreen/8013581/bug8013581.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,108 @@
+/*
+ * 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 8013581
+ * @summary [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
+ * @author leonid.romanov@oracle.com
+ * @run main bug8013581
+ */
+
+import sun.awt.*;
+import java.awt.*;
+import java.awt.event.*;
+
+public class bug8013581 {
+ private static Frame frame;
+ private static volatile int listenerCallCounter = 0;
+
+ public static void main(String[] args) throws Exception {
+ final GraphicsEnvironment ge = GraphicsEnvironment
+ .getLocalGraphicsEnvironment();
+ final GraphicsDevice[] devices = ge.getScreenDevices();
+
+ final SunToolkit toolkit = (SunToolkit)Toolkit.getDefaultToolkit();
+ final Robot robot = new Robot();
+ robot.setAutoDelay(50);
+
+ createAndShowGUI();
+ toolkit.realSync();
+
+ Exception error = null;
+ for (final GraphicsDevice device : devices) {
+ if (!device.isFullScreenSupported()) {
+ continue;
+ }
+
+ device.setFullScreenWindow(frame);
+ sleep();
+
+ robot.keyPress(KeyEvent.VK_A);
+ robot.keyRelease(KeyEvent.VK_A);
+ toolkit.realSync();
+
+ device.setFullScreenWindow(null);
+ sleep();
+
+ if (listenerCallCounter != 2) {
+ error = new Exception("Test failed: KeyListener called " + listenerCallCounter + " times instead of 2!");
+ break;
+ }
+
+ listenerCallCounter = 0;
+ }
+
+ frame.dispose();
+
+ if (error != null) {
+ throw error;
+ }
+ }
+
+ private static void createAndShowGUI() {
+ frame = new Frame("Test");
+ frame.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ listenerCallCounter++;
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ listenerCallCounter++;
+ }
+ });
+
+ frame.setUndecorated(true);
+ frame.setVisible(true);
+ }
+
+ private static void sleep() {
+ ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException ignored) {
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/GradientPaint/GradientTransformTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.MultipleGradientPaint.*;
+import java.awt.geom.*;
+import java.awt.image.*;
+
+/**
+ * @test
+ * @bug 8023483
+ * @summary tests if the transform-parameter is applied correctly when creating
+ * a gradient.
+ * @author ceisserer
+ */
+public class GradientTransformTest extends Frame {
+ BufferedImage srcImg;
+ Image dstImg;
+
+ public GradientTransformTest() {
+ srcImg = createSrcImage();
+ dstImg = getGraphicsConfiguration().createCompatibleVolatileImage(20,
+ 20);
+ }
+
+ protected void renderToVI(BufferedImage src, Image dst) {
+ Graphics2D g = (Graphics2D) dst.getGraphics();
+
+ g.setColor(Color.WHITE);
+ g.fillRect(0, 0, dst.getWidth(null), dst.getHeight(null));
+
+ AffineTransform at = new AffineTransform();
+ at.translate(-100, 0);
+
+ g.setPaint(new LinearGradientPaint(new Point2D.Float(100, 0),
+ new Point2D.Float(120, 0), new float[] { 0.0f, 0.75f, 1.0f },
+ new Color[] { Color.red, Color.green, Color.blue },
+ CycleMethod.NO_CYCLE, ColorSpaceType.SRGB, at));
+
+ g.fillRect(-10, -10, 30, 30);
+ }
+
+ public void paint(Graphics g1) {
+ Graphics2D g = (Graphics2D) g1;
+ renderToVI(createSrcImage(), dstImg);
+ g.drawImage(dstImg, 20, 20, null);
+ }
+
+ public void showFrame() {
+ setSize(500, 500);
+ setVisible(true);
+ }
+
+ public void test() {
+ renderToVI(createSrcImage(), dstImg);
+
+ BufferedImage validationImg = new BufferedImage(20, 20,
+ BufferedImage.TYPE_INT_RGB);
+ Graphics2D valG = (Graphics2D) validationImg.getGraphics();
+ valG.drawImage(dstImg, 0, 0, null);
+
+ // Loop over all pixel, and count the different pixel values
+ // encountered.
+ boolean gradientTranslated = false;
+ for (int x = 0; x < validationImg.getWidth() && !gradientTranslated; x++) {
+ for (int y = 0; y < validationImg.getHeight()
+ && !gradientTranslated; y++) {
+ int rgb = validationImg.getRGB(x, y);
+ if (rgb != -65279) {
+ gradientTranslated = true;
+ }
+ }
+ }
+
+ if (gradientTranslated) {
+ System.out.println("Passed!");
+ } else {
+ throw new RuntimeException("Test FAILED!");
+ }
+ }
+
+ protected BufferedImage createSrcImage() {
+ BufferedImage bi = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
+ Graphics2D g = (Graphics2D) bi.getGraphics();
+ g.setColor(Color.YELLOW);
+ g.fillRect(0, 0, 10, 10);
+ g.setColor(Color.black);
+ g.drawLine(0, 0, 10, 10);
+ return bi;
+ }
+
+ public static void main(String[] args) throws Exception {
+ boolean show = (args.length > 0 && "-show".equals(args[0]));
+ final GradientTransformTest t = new GradientTransformTest();
+
+ if (show) {
+ EventQueue.invokeAndWait(new Runnable() {
+ public void run() {
+ t.showFrame();
+ }
+ });
+ } else {
+ t.test();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/GradientPaint/LinearColorSpaceGradientTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.MultipleGradientPaint.*;
+import java.awt.geom.*;
+import java.awt.image.*;
+
+/**
+ * @test
+ * @bug 8023483
+ * @summary tests wether the colorspace-parameter is applied correctly when
+ * creating a gradient.
+ * @author ceisserer
+ */
+public class LinearColorSpaceGradientTest extends Frame {
+ BufferedImage srcImg;
+ Image dstImg;
+
+ public LinearColorSpaceGradientTest() {
+ srcImg = createSrcImage();
+ dstImg = getGraphicsConfiguration().createCompatibleVolatileImage(20,
+ 20);
+ }
+
+ protected void renderToVI(BufferedImage src, Image dst) {
+ Graphics2D g = (Graphics2D) dst.getGraphics();
+
+ g.setColor(Color.WHITE);
+ g.fillRect(0, 0, dst.getWidth(null), dst.getHeight(null));
+
+ AffineTransform at = new AffineTransform();
+ g.setPaint(new LinearGradientPaint(new Point2D.Float(0, 0),
+ new Point2D.Float(20, 0), new float[] { 0.0f, 1.0f },
+ new Color[] { Color.green, Color.blue }, CycleMethod.NO_CYCLE,
+ ColorSpaceType.LINEAR_RGB, at));
+
+ g.fillRect(-10, -10, 30, 30);
+ }
+
+ public void paint(Graphics g1) {
+ Graphics2D g = (Graphics2D) g1;
+ renderToVI(createSrcImage(), dstImg);
+ g.drawImage(dstImg, 20, 20, null);
+ }
+
+ public void showFrame() {
+ setSize(500, 500);
+ setVisible(true);
+ }
+
+ public void test() {
+ renderToVI(createSrcImage(), dstImg);
+
+ BufferedImage validationImg = new BufferedImage(20, 20,
+ BufferedImage.TYPE_INT_RGB);
+ Graphics2D valG = (Graphics2D) validationImg.getGraphics();
+ valG.drawImage(dstImg, 0, 0, null);
+
+ int b = validationImg.getRGB(10, 10) & 0x000000FF;
+
+ if (b > 150) {
+ System.out.println("Passed!");
+ } else {
+ throw new RuntimeException("Test FAILED!");
+ }
+ }
+
+ protected BufferedImage createSrcImage() {
+ BufferedImage bi = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
+ Graphics2D g = (Graphics2D) bi.getGraphics();
+ g.setColor(Color.YELLOW);
+ g.fillRect(0, 0, 10, 10);
+ g.setColor(Color.black);
+ g.drawLine(0, 0, 10, 10);
+ return bi;
+ }
+
+ public static void main(String[] args) throws Exception {
+ boolean show = (args.length > 0 && "-show".equals(args[0]));
+
+ final LinearColorSpaceGradientTest t = new LinearColorSpaceGradientTest();
+ if (show) {
+ EventQueue.invokeAndWait(new Runnable() {
+ public void run() {
+ t.showFrame();
+ }
+ });
+ } else {
+ t.test();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/InputMethods/DiacriticsTest/DiacriticsTest.html Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,45 @@
+<!--
+Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+<html>
+<head>
+<title> DiacriticsTest </title>
+</head>
+<body>
+<applet code="DiacriticsTest.class" width=350 height=200></applet>
+
+Test run requires the following keyboard layouts to be installed:
+Linux OS: English (US, alternative international)
+Windows OS: Hungarian
+
+To test JDK-8000423 fix (Linux only!):
+please switch to US alternative international layout and try to type diacritics
+(using the following combinations: `+e; `+u; etc.)
+
+To test JDK-7197619 fix (Windows only!):
+please switch to Hungarian keyboard layout and try to type diacritics
+(Ctrl+Alt+2 e; Ctrl+Alt+2 E)
+
+If you can do that then the test is passed; otherwise failed.
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/InputMethods/DiacriticsTest/DiacriticsTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,63 @@
+/*
+ * 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 8000423 7197619 8025649
+ @summary Check if diacritical signs could be typed for TextArea and TextField
+ @run applet/manual=yesno DiacriticsTest.html
+*/
+
+
+import java.applet.Applet;
+import java.awt.*;
+import javax.swing.JPanel;
+
+
+public class DiacriticsTest extends Applet {
+
+ public void init() {
+ this.setLayout(new BorderLayout());
+ }
+
+ public void start() {
+
+ setSize(350, 200);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(new GridLayout(2, 1));
+
+ TextArea txtArea = new TextArea();
+ panel.add(txtArea);
+
+ TextField txtField = new TextField();
+ panel.add(txtField);
+
+ add(panel, BorderLayout.CENTER);
+
+ validate();
+ setVisible(true);
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.html Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,43 @@
+<html>
+<!--
+ 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 6299858
+ @summary PIT. Focused border not shown on List if selected item is removed, XToolkit
+ @author Dmitry.Cherepanov@SUN.COM area=awt.list
+ @run applet FirstItemRemoveTest.html
+ -->
+<head>
+<title> </title>
+</head>
+<body>
+
+<h1>FirstItemRemoveTest<br>Bug ID: 6299858 </h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="FirstItemRemoveTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,119 @@
+/*
+ * 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 6299858 7124338
+ @summary PIT. Focused border not shown on List if selected item is removed, XToolkit
+ @author Dmitry.Cherepanov@SUN.COM area=awt.list
+ @run applet FirstItemRemoveTest.html
+*/
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.*;
+
+public class FirstItemRemoveTest extends Applet
+{
+ List list = new List(4, false);
+ Panel panel = new Panel();
+
+ public void init()
+ {
+ list.add("000");
+ list.add("111");
+ list.add("222");
+ list.add("333");
+ list.add("444");
+ list.add("555");
+
+ panel.setLayout(new FlowLayout ());
+ panel.add(list);
+
+ this.add(panel);
+ this.setLayout (new FlowLayout ());
+ }//End init()
+
+ public void start ()
+ {
+ setSize (200,200);
+ setVisible(true);
+ validate();
+
+ test();
+ }// start()
+
+ private void test(){
+
+ if (sun.awt.OSInfo.getOSType() == sun.awt.OSInfo.OSType.MACOSX) {
+ System.err.println("Skipped. This test is not for OS X.");
+ return;
+ }
+
+ Robot r;
+ try {
+ r = new Robot();
+ } catch(AWTException e) {
+ throw new RuntimeException(e.getMessage());
+ }
+
+ // Removing first item in order to reproduce incorrect behaviour
+ r.delay(1000);
+ list.remove(0);
+ r.delay(1000);
+
+ // Request focus to list
+ Point loc = this.getLocationOnScreen();
+ r.delay(1000);
+
+ r.mouseMove(loc.x+10, loc.y+10);
+ r.delay(10);
+ r.mousePress(InputEvent.BUTTON1_MASK);
+ r.delay(10);
+ r.mouseRelease(InputEvent.BUTTON1_MASK);
+ r.delay(1000);
+
+ list.requestFocusInWindow();
+ r.delay(1000);
+ r.waitForIdle();
+ if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() != list){
+ throw new RuntimeException("Test failed - list isn't focus owner.");
+ }
+
+ // The focus index should be set to first item after removing
+ // So if we press VK_SPACE then the selected item will be equals 0.
+ r.delay(100);
+ r.keyPress(KeyEvent.VK_SPACE);
+ r.delay(10);
+ r.keyRelease(KeyEvent.VK_SPACE);
+ r.delay(1000);
+ r.waitForIdle();
+
+ int selectedIndex = list.getSelectedIndex();
+ if (selectedIndex != 0){
+ throw new RuntimeException("Test failed. list.getSelectedIndex() = "+selectedIndex);
+ }
+
+ }
+
+}// class AutomaticAppletTest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Paint/ButtonRepaint.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.*;
+import java.awt.peer.ButtonPeer;
+
+/**
+ * @test
+ * @bug 7090424
+ * @author Sergey Bylokhov
+ */
+public final class ButtonRepaint extends Button {
+
+ public static void main(final String[] args) {
+ for (int i = 0; i < 10; ++i) {
+ final Frame frame = new Frame();
+ frame.setSize(300, 300);
+ frame.setLocationRelativeTo(null);
+ ButtonRepaint button = new ButtonRepaint();
+ frame.add(button);
+ frame.setVisible(true);
+ sleep();
+ button.test();
+ frame.dispose();
+ }
+ }
+
+ private static void sleep() {
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException ignored) {
+ }
+ }
+
+ @Override
+ public void paint(final Graphics g) {
+ super.paint(g);
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ test();
+ }
+
+ void test() {
+ setLabel("");
+ setLabel(null);
+ setLabel(getLabel());
+ ((ButtonPeer) getPeer()).setLabel("");
+ ((ButtonPeer) getPeer()).setLabel(null);
+ ((ButtonPeer) getPeer()).setLabel(getLabel());
+
+ setFont(null);
+ setFont(getFont());
+ getPeer().setFont(getFont());
+
+ setBackground(null);
+ setBackground(getBackground());
+ getPeer().setBackground(getBackground());
+
+ setForeground(null);
+ setForeground(getForeground());
+ getPeer().setForeground(getForeground());
+
+ setEnabled(isEnabled());
+ getPeer().setEnabled(isEnabled());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Paint/CheckboxRepaint.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.peer.CheckboxPeer;
+
+/**
+ * @test
+ * @bug 7090424
+ * @author Sergey Bylokhov
+ */
+public final class CheckboxRepaint extends Checkbox {
+
+ public static void main(final String[] args) {
+ for (int i = 0; i < 10; ++i) {
+ final Frame frame = new Frame();
+ frame.setSize(300, 300);
+ frame.setLocationRelativeTo(null);
+ CheckboxRepaint checkbox = new CheckboxRepaint();
+ frame.add(checkbox);
+ frame.setVisible(true);
+ sleep();
+ checkbox.test();
+ frame.dispose();
+ }
+ }
+
+ private static void sleep() {
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException ignored) {
+ }
+ }
+
+ @Override
+ public void paint(final Graphics g) {
+ super.paint(g);
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ test();
+ }
+
+ void test() {
+ setState(getState());
+ ((CheckboxPeer) getPeer()).setState(getState());
+
+ setCheckboxGroup(getCheckboxGroup());
+ ((CheckboxPeer) getPeer()).setCheckboxGroup(getCheckboxGroup());
+
+ setLabel("");
+ setLabel(null);
+ setLabel(getLabel());
+ ((CheckboxPeer) getPeer()).setLabel("");
+ ((CheckboxPeer) getPeer()).setLabel(null);
+ ((CheckboxPeer) getPeer()).setLabel(getLabel());
+
+ setFont(null);
+ setFont(getFont());
+ getPeer().setFont(getFont());
+
+ setBackground(null);
+ setBackground(getBackground());
+ getPeer().setBackground(getBackground());
+
+ setForeground(null);
+ setForeground(getForeground());
+ getPeer().setForeground(getForeground());
+
+ setEnabled(isEnabled());
+ getPeer().setEnabled(isEnabled());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Paint/ExposeOnEDT.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import sun.awt.SunToolkit;
+
+import java.awt.*;
+
+/**
+ * @test
+ * @bug 7090424
+ * @author Sergey Bylokhov
+ * @run main ExposeOnEDT
+ */
+public final class ExposeOnEDT {
+
+ private static final Button buttonStub = new Button() {
+ @Override
+ public void paint(final Graphics g) {
+ buttonPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Canvas canvasStub = new Canvas() {
+ @Override
+ public void paint(final Graphics g) {
+ canvasPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Checkbox checkboxStub = new Checkbox() {
+ @Override
+ public void paint(final Graphics g) {
+ checkboxPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Choice choiceStub = new Choice() {
+ @Override
+ public void paint(final Graphics g) {
+ choicePainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Component lwComponentStub = new Component() {
+ @Override
+ public void paint(final Graphics g) {
+ lwPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Container containerStub = new Container() {
+ @Override
+ public void paint(final Graphics g) {
+ containerPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Frame frame = new Frame() {
+ @Override
+ public void paint(final Graphics g) {
+ super.paint(g);
+ framePainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Label labelStub = new Label() {
+ @Override
+ public void paint(final Graphics g) {
+ labelPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final List listStub = new List() {
+ @Override
+ public void paint(final Graphics g) {
+ listPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Panel panelStub = new Panel() {
+ @Override
+ public void paint(final Graphics g) {
+ panelPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final Scrollbar scrollbarStub = new Scrollbar() {
+ @Override
+ public void paint(final Graphics g) {
+ scrollbarPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final ScrollPane scrollPaneStub = new ScrollPane() {
+ @Override
+ public void paint(final Graphics g) {
+ scrollPanePainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final TextArea textAreaStub = new TextArea() {
+ @Override
+ public void paint(final Graphics g) {
+ textAreaPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static final TextField textFieldStub = new TextField() {
+ @Override
+ public void paint(final Graphics g) {
+ textFieldPainted = true;
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ }
+ };
+ private static volatile boolean lwPainted;
+ private static volatile boolean buttonPainted;
+ private static volatile boolean canvasPainted;
+ private static volatile boolean checkboxPainted;
+ private static volatile boolean choicePainted;
+ private static volatile boolean containerPainted;
+ private static volatile boolean framePainted;
+ private static volatile boolean labelPainted;
+ private static volatile boolean listPainted;
+ private static volatile boolean panelPainted;
+ private static volatile boolean scrollbarPainted;
+ private static volatile boolean scrollPanePainted;
+ private static volatile boolean textAreaPainted;
+ private static volatile boolean textFieldPainted;
+
+ public static void main(final String[] args) throws Exception {
+ //Frame initialisation
+ frame.setLayout(new GridLayout());
+ frame.setSize(new Dimension(200, 200));
+ frame.setLocationRelativeTo(null);
+ frame.setVisible(true);
+ sleep();
+
+ frame.add(buttonStub);
+ frame.add(canvasStub);
+ frame.add(checkboxStub);
+ frame.add(choiceStub);
+ frame.add(lwComponentStub);
+ frame.add(containerStub);
+ frame.add(labelStub);
+ frame.add(listStub);
+ frame.add(panelStub);
+ frame.add(scrollbarStub);
+ frame.add(scrollPaneStub);
+ frame.add(textAreaStub);
+ frame.add(textFieldStub);
+ frame.validate();
+ sleep();
+
+ // Force expose event from the native system.
+ initPaintedFlags();
+ frame.setSize(300, 300);
+ frame.validate();
+ sleep();
+
+ //Check results.
+ validation();
+
+ cleanup();
+ }
+
+ private static void initPaintedFlags() {
+ lwPainted = false;
+ buttonPainted = false;
+ canvasPainted = false;
+ checkboxPainted = false;
+ choicePainted = false;
+ containerPainted = false;
+ framePainted = false;
+ labelPainted = false;
+ listPainted = false;
+ panelPainted = false;
+ scrollbarPainted = false;
+ scrollPanePainted = false;
+ textAreaPainted = false;
+ textFieldPainted = false;
+ }
+
+ private static void validation() {
+ if (!buttonPainted) {
+ fail("Paint is not called a Button ");
+ }
+ if (!canvasPainted) {
+ fail("Paint is not called a Canvas ");
+ }
+ if (!checkboxPainted) {
+ fail("Paint is not called a Checkbox ");
+ }
+ if (!choicePainted) {
+ fail("Paint is not called a Choice ");
+ }
+ if (!lwPainted) {
+ fail("Paint is not called on a lightweight");
+ }
+ if (!containerPainted) {
+ fail("Paint is not called on a Container");
+ }
+ if (!labelPainted) {
+ fail("Paint is not called on a Label");
+ }
+ if (!listPainted) {
+ fail("Paint is not called on a List");
+ }
+ if (!panelPainted) {
+ fail("Paint is not called on a Panel");
+ }
+ if (!scrollbarPainted) {
+ fail("Paint is not called on a Scrollbar");
+ }
+ if (!scrollPanePainted) {
+ fail("Paint is not called on a ScrollPane");
+ }
+ if (!textAreaPainted) {
+ fail("Paint is not called on a TextArea");
+ }
+ if (!textFieldPainted) {
+ fail("Paint is not called on a TextField");
+ }
+ if (!framePainted) {
+ fail("Paint is not called on a Frame when paintAll()");
+ }
+ }
+
+ private static void sleep() {
+ ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+ try {
+ Thread.sleep(1000L);
+ } catch (InterruptedException ignored) {
+ }
+ }
+
+ private static void fail(final String message) {
+ cleanup();
+ throw new RuntimeException(message);
+ }
+
+ private static void cleanup() {
+ frame.dispose();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Paint/LabelRepaint.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Label;
+import java.awt.peer.LabelPeer;
+
+/**
+ * @test
+ * @bug 7090424
+ * @author Sergey Bylokhov
+ */
+public final class LabelRepaint extends Label {
+
+ public static void main(final String[] args) {
+ for (int i = 0; i < 10; ++i) {
+ final Frame frame = new Frame();
+ frame.setSize(300, 300);
+ frame.setLocationRelativeTo(null);
+ LabelRepaint label = new LabelRepaint();
+ frame.add(label);
+ frame.setVisible(true);
+ sleep();
+ label.test();
+ frame.dispose();
+ }
+ }
+
+ private static void sleep() {
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException ignored) {
+ }
+ }
+
+ @Override
+ public void paint(final Graphics g) {
+ super.paint(g);
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ test();
+ }
+
+ void test() {
+ setAlignment(getAlignment());
+ ((LabelPeer) getPeer()).setAlignment(getAlignment());
+
+ setText("");
+ setText(null);
+ setText(getText());
+ ((LabelPeer) getPeer()).setText("");
+ ((LabelPeer) getPeer()).setText(null);
+ ((LabelPeer) getPeer()).setText(getText());
+
+ setFont(null);
+ setFont(getFont());
+ getPeer().setFont(getFont());
+
+ setBackground(null);
+ setBackground(getBackground());
+ getPeer().setBackground(getBackground());
+
+ setForeground(null);
+ setForeground(getForeground());
+ getPeer().setForeground(getForeground());
+
+ setEnabled(isEnabled());
+ getPeer().setEnabled(isEnabled());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Paint/ListRepaint.java Fri Nov 08 17:36:14 2013 -0800
@@ -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.
+ */
+
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.List;
+import java.awt.peer.ListPeer;
+
+/**
+ * @test
+ * @bug 7090424
+ * @author Sergey Bylokhov
+ */
+public final class ListRepaint extends List {
+
+ public static void main(final String[] args) {
+ for (int i = 0; i < 10; ++i) {
+ final Frame frame = new Frame();
+ frame.setSize(300, 300);
+ frame.setLocationRelativeTo(null);
+ ListRepaint list = new ListRepaint();
+ list.add("1");
+ list.add("2");
+ list.add("3");
+ list.add("4");
+ list.select(0);
+ frame.add(list);
+ frame.setVisible(true);
+ sleep();
+ list.test();
+ frame.dispose();
+ }
+ }
+
+ private static void sleep() {
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException ignored) {
+ }
+ }
+
+ @Override
+ public void paint(final Graphics g) {
+ super.paint(g);
+ if (!EventQueue.isDispatchThread()) {
+ throw new RuntimeException("Wrong thread");
+ }
+ test();
+ }
+
+ void test() {
+ select(0);
+ ((ListPeer) getPeer()).select(getSelectedIndex());
+
+ setFont(null);
+ setFont(getFont());
+ getPeer().setFont(getFont());
+
+ setBackground(null);
+ setBackground(getBackground());
+ getPeer().setBackground(getBackground());
+
+ setForeground(null);
+ setForeground(getForeground());
+ getPeer().setForeground(getForeground());
+
+ setEnabled(isEnabled());
+ getPeer().setEnabled(isEnabled());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Paint/bug8024864.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,84 @@
+/*
+ * 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 8024864
+ * @summary [macosx] Problems with rendering of controls
+ * @author Petr Pchelko
+ * @library ../regtesthelpers
+ * @build Util
+ * @run main bug8024864
+ */
+
+import javax.swing.*;
+import java.awt.*;
+
+import test.java.awt.regtesthelpers.Util;
+
+public class bug8024864
+{
+ private static final int REPEATS = 30;
+
+ private static volatile JFrame frame;
+
+ private static void showTestUI() {
+ frame = new JFrame();
+ frame.setBackground(Color.green);
+ JPanel p = new JPanel();
+ p.setBackground(Color.red);
+ JLabel l = new JLabel("Test!");
+ p.add(l);
+ frame.add(p);
+ frame.pack();
+ frame.setLocation(100,100);
+ frame.setVisible(true);
+ }
+
+ public static void main(String[] args) throws Exception
+ {
+ Robot r = new Robot();
+ for (int i = 0; i < REPEATS; i++) {
+ try {
+ SwingUtilities.invokeAndWait(bug8024864::showTestUI);
+ //Thread.sleep(100);
+ Util.waitTillShown(frame);
+ Util.waitForIdle(r);
+
+ Dimension frameSize = frame.getSize();
+ Point loc = new Point(frameSize.width - 5, frameSize.height - 5);
+ SwingUtilities.convertPointToScreen(loc, frame);
+ Color c = r.getPixelColor(loc.x, loc.y);
+
+ if (c.getGreen() > 200) {
+ throw new RuntimeException("TEST FAILED. Unexpected pixel color " + c);
+ }
+
+ } finally {
+ if (frame != null) {
+ frame.dispose();
+ }
+ Util.waitForIdle(r);
+ }
+ }
+ }
+}
--- a/jdk/test/java/awt/PrintJob/SaveDialogTitleTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/test/java/awt/PrintJob/SaveDialogTitleTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 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
@@ -23,8 +23,8 @@
/*
* @test
- * @bug 4851363
- * @summary Tests the save to file dialog has a title
+ * @bug 4851363 8025988 8025990
+ * @summary Tests the save to file dialog has a title.
* @run main/manual=yesno/othervm SaveDialogTitleTest
*/
@@ -37,12 +37,21 @@
System.out.print("Once the dialog appears, press OK and the ");
System.out.print("Save to File dialog should appear and it ");
System.out.println("must have a window title else the test fails.");
+ System.out.println("To test 8025988: Range should be selected with pages 3 to 8.");
+ System.out.println("To test 8025990: Paper should be Legal and in Landscape.");
Toolkit tk = Toolkit.getDefaultToolkit();
JobAttributes jobAttributes = new JobAttributes();
jobAttributes.setDestination(JobAttributes.DestinationType.FILE);
+ jobAttributes.setDefaultSelection(JobAttributes.DefaultSelectionType.RANGE);
+ jobAttributes.setPageRanges(new int[][]{new int[]{3,8}});
+ PageAttributes page = new PageAttributes();
+ page.setMedia(PageAttributes.MediaType.LEGAL);
+ page.setOrientationRequested(PageAttributes.
+ OrientationRequestedType.LANDSCAPE);
+
PrintJob printJob =
tk.getPrintJob(new Frame(), "Save Title Test",
- jobAttributes, null);
+ jobAttributes, page);
if (printJob != null) { // in case user cancels.
printJob.end();
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Window/8027025/Test8027025.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8027025
+ * @summary [macosx] getLocationOnScreen returns 0 if parent invisible
+ * @author Petr Pchelko
+ * @run main Test8027025
+ */
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class Test8027025 {
+
+ private static Frame frame;
+ private static Window window;
+
+ public static void main(String[] args) throws Exception {
+ try {
+ SwingUtilities.invokeAndWait(() -> {
+ frame = new Frame("Dummy Frame");
+ window = new Window(frame);
+ window.setSize(200, 200);
+ window.setLocationRelativeTo(frame);
+ window.setVisible(true);
+ });
+
+ ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+
+ AtomicReference<Point> point = new AtomicReference<>();
+ SwingUtilities.invokeAndWait(() -> point.set(window.getLocationOnScreen()));
+
+ if (point.get().getX() == 0 || point.get().getY() == 0) {
+ throw new RuntimeException("Test failed. The location was not set");
+ }
+ } finally {
+ if (frame != null) {
+ frame.dispose();
+ }
+ if (window != null) {
+ window.dispose();
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Window/OwnedWindowsSerialization/OwnedWindowsSerialization.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/* @test
+ * @bug 8027152
+ * @summary Checks that ownedWindowList is serialized and deserialized properly and alwaysOnTop works after deserialization
+ * @author Petr Pchelko
+ * @run main OwnedWindowsSerialization
+ */
+public class OwnedWindowsSerialization {
+
+ private static final String TOP_FRAME_LABEL = "Top Frame";
+ private static final String DIALOG_LABEL = "Dialog";
+ private static final String SUBDIALOG_LABEL = "Subdialog";
+
+ private static volatile Frame topFrame;
+ private static volatile Dialog dialog;
+ private static volatile Dialog subDialog;
+
+ public static void main(String[] args) throws Exception {
+ SwingUtilities.invokeAndWait(() -> {
+ topFrame = new Frame(TOP_FRAME_LABEL);
+ topFrame.setAlwaysOnTop(true);
+ dialog = new Dialog(topFrame, DIALOG_LABEL);
+ subDialog = new Dialog(dialog, SUBDIALOG_LABEL);
+ });
+
+ ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+
+ if (!topFrame.isAlwaysOnTop() || !dialog.isAlwaysOnTop() || !subDialog.isAlwaysOnTop()) {
+ throw new RuntimeException("TEST FAILED: AlwaysOnTop was not set properly");
+ }
+
+ //Serialize
+ byte[] serializedObject;
+ try (ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream outputStream = new ObjectOutputStream(bytes)) {
+ outputStream.writeObject(topFrame);
+ outputStream.flush();
+ serializedObject = bytes.toByteArray();
+ }
+
+ if (serializedObject == null) {
+ throw new RuntimeException("FAILED: Serialized byte array in null");
+ }
+
+ //Deserialize
+ Frame deserializedFrame;
+ try (ObjectInputStream inputStream = new ObjectInputStream(new ByteArrayInputStream(serializedObject))) {
+ deserializedFrame = (Frame) inputStream.readObject();
+ }
+
+ //Check the state of the deserialized objects
+ if (!TOP_FRAME_LABEL.equals(deserializedFrame.getTitle())) {
+ throw new RuntimeException("FAILED: Top frame deserialized incorrectly");
+ }
+
+ if (!deserializedFrame.isAlwaysOnTop()) {
+ throw new RuntimeException("FAILED: Top frame alwaysOnTop not set after deserialization");
+ }
+
+ Window[] topOwnedWindows = topFrame.getOwnedWindows();
+ if (topOwnedWindows.length != 1 || !DIALOG_LABEL.equals(((Dialog) topOwnedWindows[0]).getTitle())) {
+ throw new RuntimeException("FAILED: Dialog deserialized incorrectly");
+ }
+
+ if (!topOwnedWindows[0].isAlwaysOnTop()) {
+ throw new RuntimeException("FAILED: Dialog alwaysOnTop not set after deserialization");
+ }
+
+ Window dialog = topOwnedWindows[0];
+ Window[] dialogOwnedWindows = dialog.getOwnedWindows();
+ if (dialogOwnedWindows.length != 1 || !SUBDIALOG_LABEL.equals(((Dialog) dialogOwnedWindows[0]).getTitle())) {
+ throw new RuntimeException("FAILED: Subdialog deserialized incorrectly");
+ }
+
+ if (!dialogOwnedWindows[0].isAlwaysOnTop()) {
+ throw new RuntimeException("FAILED: Subdialog alwaysOnTop not set after deserialization");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Window/WindowGCInFullScreen/WindowGCInFullScreen.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Color;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.SwingUtilities;
+
+/**
+ * @test
+ * @bug 8019591
+ * @author Sergey Bylokhov
+ */
+public class WindowGCInFullScreen {
+
+ public static void main(final String[] args)
+ throws InvocationTargetException, InterruptedException {
+ SwingUtilities.invokeAndWait(() -> {
+ final GraphicsDevice[] devices =
+ GraphicsEnvironment.getLocalGraphicsEnvironment()
+ .getScreenDevices();
+ final Frame frame = new Frame();
+ frame.setBackground(Color.GREEN);
+ frame.setUndecorated(true);
+ frame.setSize(100, 100);
+ frame.setLocationRelativeTo(null);
+ frame.setVisible(true);
+ sleep();
+ for (final GraphicsDevice gd : devices) {
+ try {
+ gd.setFullScreenWindow(frame);
+ if (gd.getFullScreenWindow() != frame) {
+ throw new RuntimeException("Wrong window");
+ }
+ if (frame.getGraphicsConfiguration().getDevice() != gd) {
+ throw new RuntimeException("Wrong new GraphicsDevice");
+ }
+ } finally {
+ // cleaning up
+ gd.setFullScreenWindow(null);
+ }
+ }
+ frame.dispose();
+ });
+ }
+
+ private static void sleep() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ignored) {
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/KeyEvent/8020209/bug8020209.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8020209
+ * @summary [macosx] Mac OS X key event confusion for "COMMAND PLUS"
+ * @author leonid.romanov@oracle.com
+ * @run main bug8020209
+ */
+
+import sun.awt.*;
+import java.awt.*;
+import java.awt.event.*;
+
+public class bug8020209 {
+ static volatile int listenerCallCounter = 0;
+
+ static AWTKeyStroke keyStrokes[] = {
+ AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_DECIMAL, InputEvent.META_MASK),
+ AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_EQUALS, InputEvent.META_MASK),
+ AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_ESCAPE, InputEvent.CTRL_MASK),
+ };
+
+ public static void main(String[] args) throws Exception {
+ if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {
+ System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
+ return;
+ }
+
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+
+ SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ Robot robot = new Robot();
+ robot.setAutoDelay(50);
+
+ createAndShowGUI();
+ toolkit.realSync();
+
+ for (int i = 0; i < keyStrokes.length; ++i) {
+ AWTKeyStroke ks = keyStrokes[i];
+
+ int modKeyCode = getModKeyCode(ks.getModifiers());
+ robot.keyPress(modKeyCode);
+
+ robot.keyPress(ks.getKeyCode());
+ robot.keyRelease(ks.getKeyCode());
+
+ robot.keyRelease(modKeyCode);
+
+ toolkit.realSync();
+
+ if (listenerCallCounter != 4) {
+ throw new Exception("Test failed: KeyListener for '" + ks.toString() +
+ "' called " + listenerCallCounter + " times instead of 4!");
+ }
+
+ listenerCallCounter = 0;
+ }
+
+ }
+
+ private static void createAndShowGUI() {
+ Frame frame = new Frame("Test");
+ frame.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ listenerCallCounter++;
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ listenerCallCounter++;
+ }
+ });
+
+ frame.pack();
+ frame.setVisible(true);
+ }
+
+ private static int getModKeyCode(int mod) {
+ if ((mod & (InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK)) != 0) {
+ return KeyEvent.VK_SHIFT;
+ }
+
+ if ((mod & (InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK)) != 0) {
+ return KeyEvent.VK_CONTROL;
+ }
+
+ if ((mod & (InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK)) != 0) {
+ return KeyEvent.VK_ALT;
+ }
+
+ if ((mod & (InputEvent.META_DOWN_MASK | InputEvent.META_MASK)) != 0) {
+ return KeyEvent.VK_META;
+ }
+
+ return 0;
+ }
+}
--- a/jdk/test/java/awt/print/PrinterJob/PrintLatinCJKTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/test/java/awt/print/PrinterJob/PrintLatinCJKTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 800535
+ * @bug 800535 8022536
* @summary JDK7 Printing: CJK and Latin Text in string overlap
* @run main/manual=yesno PrintLatinCJKTest
*/
@@ -49,6 +49,8 @@
private PageFormat pf;
static String info =
+ "To test 8022536, if a remote printer is the system default,"+
+ "it should show in the dialog as the selected printer.\n"+
"You need a printer for this test. If you have none, let "+
"the test pass. If there is a printer, press Print, send "+
"the output to the printer, and examine it. It should have "+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/print/PrinterJob/PrintToDir.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,144 @@
+/*
+ * 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 4973278 8015586
+ @run main PrintToDir
+ @summary Must throw exception when printing to an invalid filename - a dir.
+*/
+import java.io.*;
+import java.net.*;
+import java.awt.*;
+import java.awt.geom.*;
+import java.awt.print.*;
+import javax.print.PrintService;
+import javax.print.attribute.*;
+import javax.print.attribute.standard.*;
+import java.util.PropertyPermission;
+
+public class PrintToDir extends Frame implements Printable {
+
+ boolean firstTime = true;
+ double sx, sy;
+ Shape clip, firstClip;
+
+ TextField tf = new TextField();
+ Label tfLabel = new Label ("File Name");
+ Panel p = new Panel (new GridLayout(2,2));
+ Button b = new Button("Print");
+
+ PrintToDir() {
+ add("South", p);
+ p.add(tfLabel);
+ p.add(tf);
+ p.add(b);
+ setSize(300, 300);
+ setVisible(true);
+ }
+
+ public int print(Graphics g, PageFormat pf, int pageIndex) {
+ Graphics2D g2 = (Graphics2D)g;
+ if (pageIndex>=1) {
+ return Printable.NO_SUCH_PAGE;
+ }
+ g2.drawString("hello world", 100, 100);
+ return Printable.PAGE_EXISTS;
+ }
+
+ void doPrintJob(String fileStr) {
+ PageAttributes pa = new PageAttributes();
+ JobAttributes ja = new JobAttributes();
+ ja.setDialog(JobAttributes.DialogType.NONE);
+ ja.setDestination(JobAttributes.DestinationType.FILE);
+ ja.setFileName(fileStr);
+ try {
+ PrintJob pjob = Toolkit.getDefaultToolkit().getPrintJob(this,
+ "PrintDialog Testing", ja, pa);
+ if (pjob != null) {
+ System.out.println("Printjob successfully created: " + pjob);
+ Graphics g = pjob.getGraphics();
+ this.printAll(g);
+ g.dispose();
+ pjob.end();
+ }
+ System.out.println("Printing completed");
+ } catch (IllegalArgumentException e) {
+ System.out.println("PrintJob passed.");
+ return;
+ }
+ throw new RuntimeException("PrintJob::IllegalArgumentException expected but not thrown. \nTEST FAILED");
+ }
+
+ public static void doPrinterJob(String fileStr, OrientationRequested o) {
+ PrinterJob pj = PrinterJob.getPrinterJob();
+ PrintService ps = pj.getPrintService();
+ if (ps == null) {
+ System.out.println("No print service found.");
+ return;
+ }
+ pj.setPrintable(new PrintToDir());
+ PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
+ aset.add(o);
+ File f = new File(fileStr);
+ // f.deleteOnExit();
+ URI dest = f.toURI();
+ Destination d = new Destination(dest);
+ if (ps.isAttributeValueSupported(d, null, null)) {
+ aset.add(d);
+ try {
+ pj.print(aset);
+ } catch (PrinterException e) {
+ System.out.println("PrinterJob passed.");
+ return;
+ }
+ throw new RuntimeException("PrinterJob:PrinterException expected but not thrown. \nTEST FAILED");
+ } else {
+ System.out.println("Destination attribute is not a supported value. PrinterJob passed.");
+ }
+ }
+
+
+ public static void main(String arg[]) {
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ System.out.println("Security manager detected");
+ try {
+ security.checkPermission(new FilePermission("<<ALL FILES>>", "read,write"));
+ security.checkPermission(new PropertyPermission("user.dir", "read"));
+ } catch (SecurityException se) {
+ System.out.println("Security requirement not obtained. TEST PASSED");
+ return;
+ }
+ }
+ String[] testStr = {".", ""};
+ for (int i=0; i<testStr.length; i++) {
+ System.out.println("Testing file name = \""+testStr[i]+"\"");
+ doPrinterJob(testStr[i], OrientationRequested.PORTRAIT);
+ PrintToDir ptd = new PrintToDir();
+ ptd.doPrintJob(testStr[i]);
+ ptd.dispose();
+ }
+ System.out.println("TEST PASSED");
+ }
+
+}
--- a/jdk/test/java/beans/Introspector/TestTypeResolver.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/test/java/beans/Introspector/TestTypeResolver.java Fri Nov 08 17:36:14 2013 -0800
@@ -115,6 +115,8 @@
// by private implementations of the various Type interfaces
if (expect.equals(t) && t.equals(expect))
System.out.println(", as expected");
+ else if ((expect.equals(t) || t.equals(expect)) && expect.toString().equals(t.toString()))
+ System.out.println(", as workaround of the 8023301 bug");
else {
System.out.println(" BUT SHOULD BE " + expect);
failedCases.add(c);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/XMLEncoder/Test8027066.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8027066
+ * @summary Tests that the same array can be encoded twice
+ * @author Anton Nashatyrev
+ */
+public class Test8027066 extends AbstractTest<String[][]> {
+ public static void main(String[] args) {
+ new Test8027066().test(true);
+ }
+
+ @Override
+ protected String[][] getObject() {
+ String[] strings = {"first", "second"};
+ String[][] arrays = {strings, strings};
+ return arrays;
+ }
+}
--- a/jdk/test/java/lang/Thread/ThreadStateTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/test/java/lang/Thread/ThreadStateTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -31,7 +31,7 @@
*
* @author Mandy Chung
* @build ThreadStateTest ThreadStateController
- * @run main ThreadStateTest
+ * @run main/othervm -Xmixed ThreadStateTest
*/
public class ThreadStateTest {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/print/TextFlavorTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ @test
+ @bug 6334074 8022536
+ @summary test supported text flavors reported properly
+ @run main TextFlavorTest
+*/
+
+import javax.print.*;
+import javax.print.attribute.standard.*;
+import javax.print.attribute.*;
+import java.io.*;
+
+public class TextFlavorTest {
+
+ public static void main(String[] args) throws Exception {
+
+ PrintService service[] =
+ PrintServiceLookup.lookupPrintServices(null, null);
+
+ if (service.length == 0) {
+ System.out.println("No print service found.");
+ return;
+ }
+
+ for (int y = 0; y < service.length; y ++) {
+ DocFlavor flavors[] = service[y].getSupportedDocFlavors();
+ if (flavors == null) continue;
+ for (int x = 0; x < flavors.length; x ++) {
+ if (!service[y].isDocFlavorSupported(flavors[x])) {
+ String msg = "DocFlavor " + flavors[x] +
+ " is not supported by service "+ service[y];
+ throw new RuntimeException(msg);
+ }
+ }
+ }
+ System.out.println("Test passed.");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/FileReader/ReadersExceptions.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.UnsupportedAudioFileException;
+
+/**
+ * @test
+ * @bug 7058662 7058666 7058672
+ * @author Sergey Bylokhov
+ */
+public final class ReadersExceptions {
+
+ // empty channels
+ static byte[] wrongAIFFCh =
+ {0x46, 0x4f, 0x52, 0x4d, // AiffFileFormat.AIFF_MAGIC
+ 0, 0, 0, 0, // length
+ 0, 0, 0, 0, // iffType
+ 0x43, 0x4f, 0x4d, 0x4d, // chunkName
+ 0, 0, 0, 100, // chunkLen
+ 0, 0, // channels
+ 0, 0, 0, 0, //
+ 0, 10 // sampleSize
+ , 0, 0, 0, 0};
+ // empty sampleSize
+ static byte[] wrongAIFFSSL =
+ {0x46, 0x4f, 0x52, 0x4d, //AiffFileFormat.AIFF_MAGIC
+ 0, 0, 0, 0, // length
+ 0, 0, 0, 0, // iffType
+ 0x43, 0x4f, 0x4d, 0x4d, // chunkName
+ 0, 0, 0, 100, // chunkLen
+ 0, 10, // channels
+ 0, 0, 0, 0, //
+ 0, 0 // sampleSize
+ , 0, 0, 0, 0};
+ // big sampleSize
+ static byte[] wrongAIFFSSH =
+ {0x46, 0x4f, 0x52, 0x4d, //AiffFileFormat.AIFF_MAGIC
+ 0, 0, 0, 0, // length
+ 0, 0, 0, 0, // iffType
+ 0x43, 0x4f, 0x4d, 0x4d, // chunkName
+ 0, 0, 0, 100, // chunkLen
+ 0, 10, // channels
+ 0, 0, 0, 0, //
+ 0, 33 // sampleSize
+ , 0, 0, 0, 0};
+ // empty channels
+ static byte[] wrongAUCh =
+ {0x2e, 0x73, 0x6e, 0x64,//AiffFileFormat.AU_SUN_MAGIC
+ 0, 0, 0, 0, // headerSize
+ 0, 0, 0, 0, // dataSize
+ 0, 0, 0, 1, // encoding_local AuFileFormat.AU_ULAW_8
+ 0, 0, 0, 0, // sampleRate
+ 0, 0, 0, 0 // channels
+ };
+ // empty channels
+ static byte[] wrongWAVCh =
+ {0x52, 0x49, 0x46, 0x46, // WaveFileFormat.RIFF_MAGIC
+ 1, 1, 1, 1, // fileLength
+ 0x57, 0x41, 0x56, 0x45, // waveMagic
+ 0x66, 0x6d, 0x74, 0x20, // FMT_MAGIC
+ 3, 0, 0, 0, // length
+ 1, 0, // wav_type WAVE_FORMAT_PCM
+ 0, 0, // channels
+ 0, 0, 0, 0, // sampleRate
+ 0, 0, 0, 0, // avgBytesPerSec
+ 0, 0, // blockAlign
+ 1, 0, // sampleSizeInBits
+ 0x64, 0x61, 0x74, 0x61, // WaveFileFormat.DATA_MAGIC
+ 0, 0, 0, 0, // dataLength
+ };
+ // empty sampleSizeInBits
+ static byte[] wrongWAVSSB =
+ {0x52, 0x49, 0x46, 0x46, // WaveFileFormat.RIFF_MAGIC
+ 1, 1, 1, 1, // fileLength
+ 0x57, 0x41, 0x56, 0x45, // waveMagic
+ 0x66, 0x6d, 0x74, 0x20, // FMT_MAGIC
+ 3, 0, 0, 0, // length
+ 1, 0, // wav_type WAVE_FORMAT_PCM
+ 1, 0, // channels
+ 0, 0, 0, 0, // sampleRate
+ 0, 0, 0, 0, // avgBytesPerSec
+ 0, 0, // blockAlign
+ 0, 0, // sampleSizeInBits
+ 0x64, 0x61, 0x74, 0x61, // WaveFileFormat.DATA_MAGIC
+ 0, 0, 0, 0, // dataLength
+ };
+
+ public static void main(final String[] args) throws IOException {
+ test(wrongAIFFCh);
+ test(wrongAIFFSSL);
+ test(wrongAIFFSSH);
+ test(wrongAUCh);
+ test(wrongWAVCh);
+ test(wrongWAVSSB);
+ }
+
+ private static void test(final byte[] buffer) throws IOException {
+ final InputStream is = new ByteArrayInputStream(buffer);
+ try {
+ AudioSystem.getAudioFileFormat(is);
+ } catch (UnsupportedAudioFileException ignored) {
+ // Expected.
+ return;
+ }
+ throw new RuntimeException("Test Failed");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JInternalFrame/8020708/bug8020708.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.util.Locale;
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 8020708
+ * @author Alexander Scherbatiy
+ * @summary NLS: mnemonics missing in SwingSet2/JInternalFrame demo
+ * @library ../../regtesthelpers
+ * @build Util
+ * @run main bug8020708
+ */
+public class bug8020708 {
+
+ private static final Locale[] SUPPORTED_LOCALES = {
+ Locale.ENGLISH,
+ new Locale("de"),
+ new Locale("es"),
+ new Locale("fr"),
+ new Locale("it"),
+ new Locale("ja"),
+ new Locale("ko"),
+ new Locale("pt", "BR"),
+ new Locale("sv"),
+ new Locale("zh", "CN"),
+ new Locale("zh", "TW")
+ };
+ private static final String[] LOOK_AND_FEELS = {
+ "Nimbus",
+ "Windows",
+ "Motif"
+ };
+ private static JInternalFrame internalFrame;
+ private static JFrame frame;
+
+ public static void main(String[] args) throws Exception {
+ for (Locale locale : SUPPORTED_LOCALES) {
+ for (String laf : LOOK_AND_FEELS) {
+ Locale.setDefault(locale);
+ if (!installLookAndFeel(laf)) {
+ continue;
+ }
+ testInternalFrameMnemonic();
+ }
+ }
+ }
+
+ static void testInternalFrameMnemonic() throws Exception {
+ SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ Robot robot = new Robot();
+ robot.setAutoDelay(50);
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ frame = new JFrame("Test");
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.setSize(300, 200);
+
+ JDesktopPane desktop = new JDesktopPane();
+ internalFrame = new JInternalFrame("Test");
+ internalFrame.setSize(200, 100);
+ internalFrame.setClosable(true);
+ desktop.add(internalFrame);
+ internalFrame.setVisible(true);
+ internalFrame.setMaximizable(true);
+
+ frame.getContentPane().add(desktop);
+ frame.setVisible(true);
+ }
+ });
+
+ toolkit.realSync();
+
+ Point clickPoint = Util.getCenterPoint(internalFrame);
+ robot.mouseMove(clickPoint.x, clickPoint.y);
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ toolkit.realSync();
+
+ Util.hitKeys(robot, KeyEvent.VK_CONTROL, KeyEvent.VK_SPACE);
+ toolkit.realSync();
+
+ Util.hitKeys(robot, KeyEvent.VK_C);
+ toolkit.realSync();
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ if (internalFrame.isVisible()) {
+ throw new RuntimeException("Close mnemonic does not work");
+ }
+ frame.dispose();
+ }
+ });
+ }
+
+ static final boolean installLookAndFeel(String lafName) throws Exception {
+ UIManager.LookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();
+ for (UIManager.LookAndFeelInfo info : infos) {
+ if (info.getClassName().contains(lafName)) {
+ UIManager.setLookAndFeel(info.getClassName());
+ return true;
+ }
+ }
+ return false;
+ }
+}
--- a/jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -35,13 +35,14 @@
import javax.swing.*;
public class ActionListenerCalledTwiceTest {
- static String menuItems[] = { "Item1", "Item2", "Item3", "Item4", "Item5" };
+ static String menuItems[] = { "Item1", "Item2", "Item3", "Item4", "Item5", "Item6" };
static KeyStroke keyStrokes[] = {
KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK),
KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.META_MASK),
- KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK)
+ KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK),
+ KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.META_MASK)
};
static volatile int listenerCallCounter = 0;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/html/8005391/bug8005391.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.CharArrayReader;
+import java.io.CharArrayWriter;
+import javax.swing.text.html.HTMLDocument;
+import javax.swing.text.html.HTMLEditorKit;
+
+/**
+ * @test
+ * @bug 8005391
+ * @author Alexander Shusherov
+ * @summary Floating behavior of HTMLEditorKit parser
+ * @run main bug8005391
+ */
+public class bug8005391 {
+
+ private static final String htmlDoc = "<html><body><tt><a href='one'>1</a>2</tt></body></html>";
+
+ public static void main(String[] args) throws Exception {
+ int N = 10;
+
+ for (int i = 0; i < N; i++) {
+ HTMLEditorKit kit = new HTMLEditorKit();
+ Class c = Class.forName("javax.swing.text.html.parser.ParserDelegator");
+ HTMLEditorKit.Parser parser = (HTMLEditorKit.Parser) c.newInstance();
+ HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument();
+ HTMLEditorKit.ParserCallback htmlReader = doc.getReader(0);
+ parser.parse(new CharArrayReader(htmlDoc.toCharArray()), htmlReader, true);
+ htmlReader.flush();
+ CharArrayWriter writer = new CharArrayWriter(1000);
+ kit.write(writer, doc, 0, doc.getLength());
+ writer.flush();
+
+ String result = writer.toString();
+ if (!result.contains("<tt><a")) {
+ throw new RuntimeException("The <a> and <tt> tags are swapped");
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/awt/AppContext/MultiThread/MultiThreadTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,100 @@
+/*
+ * 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 8019623
+ * @summary Tests that AppContext.getAppContext() works correctly in multi-threads scenario.
+ * @author Leonid Romanov
+ */
+
+import sun.awt.AppContext;
+
+public class MultiThreadTest {
+ private static final int NUM_THREADS = 2;
+
+ private static AppContextGetter[] getters = new AppContextGetter[NUM_THREADS];
+
+ public static void main(String[] args) {
+ createAndStartThreads();
+ compareAppContexts();
+ }
+
+ private static void createAndStartThreads() {
+ ThreadGroup systemGroup = getSystemThreadGroup();
+ for (int i = 0; i < NUM_THREADS; ++i) {
+ ThreadGroup tg = new ThreadGroup(systemGroup, "AppContextGetter" + i);
+ getters[i] = new AppContextGetter(tg);
+ }
+
+ for (int i = 0; i < NUM_THREADS; ++i) {
+ getters[i].start();
+ }
+
+ for (int i = 0; i < NUM_THREADS; ++i) {
+ try {
+ getters[i].join();
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ }
+ }
+
+ private static ThreadGroup getSystemThreadGroup() {
+ ThreadGroup currentThreadGroup =
+ Thread.currentThread().getThreadGroup();
+ ThreadGroup parentThreadGroup = currentThreadGroup.getParent();
+ while (parentThreadGroup != null) {
+ currentThreadGroup = parentThreadGroup;
+ parentThreadGroup = currentThreadGroup.getParent();
+ }
+
+ return currentThreadGroup;
+ }
+
+ private static void compareAppContexts() {
+ AppContext ctx = getters[0].getAppContext();
+ for (int i = 1; i < NUM_THREADS; ++i) {
+ if (!ctx.equals(getters[i].getAppContext())) {
+ throw new RuntimeException("Unexpected AppContexts difference, could be a race condition");
+ }
+ }
+ }
+
+ private static class AppContextGetter extends Thread {
+ private AppContext appContext;
+
+ public AppContextGetter(ThreadGroup tg) {
+ super(tg, tg.getName());
+ }
+
+ AppContext getAppContext() {
+ return appContext;
+ }
+
+ @Override
+ public void run() {
+ appContext = AppContext.getAppContext();
+ }
+ }
+}
--- a/jdk/test/sun/java2d/DirectX/TransformedPaintTest/TransformedPaintTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/jdk/test/sun/java2d/DirectX/TransformedPaintTest/TransformedPaintTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6689025
+ * @bug 6689025 8023483
* @summary Tests that transformed Paints are rendered correctly
* @author Dmitri.Trembovetski@sun.com: area=Graphics
* @run main/othervm TransformedPaintTest
--- a/langtools/.hgtags Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/.hgtags Fri Nov 08 17:36:14 2013 -0800
@@ -235,3 +235,4 @@
af6244ba81b6b8d1bf4ab06587a2067e021e4570 jdk8-b111
954dd199d6ff3e4cfc42b894c1f611150526eecd jdk8-b112
54150586ba785e1eb0c0de8d13906f643f640644 jdk8-b113
+850d2602ae9811687b0f404d05ec3e55df91d9cb jdk8-b114
--- a/langtools/src/share/classes/com/sun/javadoc/Tag.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/javadoc/Tag.java Fri Nov 08 17:36:14 2013 -0800
@@ -72,7 +72,7 @@
* <code>kind() == name()</code>;
* the following table lists those cases where there is more
* than one tag of a given kind:
- * <p>
+ *
* <table border="1" cellpadding="4" cellspacing="0" summary="related tags">
* <tr><th>{@code kind() }</th> <th>{@code name() }</th></tr>
* <tr><td>{@code @throws }</td> <td>{@code @throws }</td></tr>
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -101,10 +101,10 @@
Content tdSummary) {
ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
String name = emd.name();
- Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, cd, (MemberDoc) emd,
name, false));
- Content code = HtmlTree.CODE(strong);
+ Content code = HtmlTree.CODE(memberLink);
addParameters(emd, false, code, name.length() - 1);
tdSummary.addContent(code);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -176,7 +176,7 @@
String name = (member instanceof ExecutableMemberDoc)?
member.name() + ((ExecutableMemberDoc)member).flatSignature() :
member.name();
- Content span = HtmlTree.SPAN(HtmlStyle.strong,
+ Content span = HtmlTree.SPAN(HtmlStyle.memberNameLink,
getDocLink(LinkInfoImpl.Kind.INDEX, member, name));
Content dt = HtmlTree.DT(span);
dt.addContent(" - ");
@@ -198,7 +198,7 @@
*/
protected void addComment(ProgramElementDoc element, Content contentTree) {
Tag[] tags;
- Content span = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
+ Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.addStyle(HtmlStyle.block);
if (Util.isDeprecated(element)) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -480,7 +480,7 @@
if (cd != null && !(pgmdoc instanceof ConstructorDoc)
&& !(pgmdoc instanceof ClassDoc)) {
HtmlTree name = new HtmlTree(HtmlTag.SPAN);
- name.addStyle(HtmlStyle.strong);
+ name.addStyle(HtmlStyle.typeNameLabel);
name.addContent(cd.name() + ".");
tdLast.addContent(name);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -237,9 +237,9 @@
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, (MemberDoc) member, member.name(), false));
- Content code = HtmlTree.CODE(strong);
+ Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -239,9 +239,9 @@
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, (MemberDoc) member, member.name(), false));
- Content code = HtmlTree.CODE(strong);
+ Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -227,7 +227,7 @@
addSrcLink(annotationType, annotationName, pre);
pre.addContent(parameterLinks);
} else {
- Content span = HtmlTree.SPAN(HtmlStyle.strong, annotationName);
+ Content span = HtmlTree.SPAN(HtmlStyle.memberNameLabel, annotationName);
span.addContent(parameterLinks);
pre.addContent(span);
}
@@ -262,8 +262,8 @@
annotationInfoTree.addContent(hr);
Tag[] deprs = annotationType.tags("deprecated");
if (Util.isDeprecated(annotationType)) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
- Content div = HtmlTree.DIV(HtmlStyle.block, strong);
+ Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
+ Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
if (deprs.length > 0) {
Tag[] commentTags = deprs[0].inlineTags();
if (commentTags.length > 0) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -254,7 +254,7 @@
addSrcLink(classDoc, className, pre);
pre.addContent(parameterLinks);
} else {
- Content span = HtmlTree.SPAN(HtmlStyle.strong, className);
+ Content span = HtmlTree.SPAN(HtmlStyle.typeNameLabel, className);
span.addContent(parameterLinks);
pre.addContent(span);
}
@@ -547,8 +547,8 @@
classInfoTree.addContent(hr);
Tag[] deprs = classDoc.tags("deprecated");
if (Util.isDeprecated(classDoc)) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
- Content div = HtmlTree.DIV(HtmlStyle.block, strong);
+ Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
+ Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
if (deprs.length > 0) {
Tag[] commentTags = deprs[0].inlineTags();
if (commentTags.length > 0) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -284,7 +284,7 @@
setTopFile(root);
if (root instanceof RootDocImpl) {
- ((RootDocImpl) root).initDocLint(doclintOpts);
+ ((RootDocImpl) root).initDocLint(doclintOpts, tagletManager.getCustomTagNames());
}
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -224,9 +224,9 @@
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, (MemberDoc) member, member.name(), false));
- Content code = HtmlTree.CODE(strong);
+ Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -140,11 +140,11 @@
holder.typeName() : holder.qualifiedTypeName(),
false);
Content codeLink = HtmlTree.CODE(link);
- Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
+ Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.isClass()?
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
- strong.addContent(writer.getSpace());
- strong.addContent(codeLink);
- fieldDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
+ descfrmLabel.addContent(writer.getSpace());
+ descfrmLabel.addContent(codeLink);
+ fieldDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
writer.addInlineComment(field, fieldDocTree);
}
}
@@ -258,9 +258,9 @@
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false));
- Content code = HtmlTree.CODE(strong);
+ Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -316,7 +316,7 @@
liConst.addContent(constPara);
ul.addContent(liConst);
Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
- Content line30 = HtmlTree.SPAN(HtmlStyle.italic, getResource("doclet.Help_line_30"));
+ Content line30 = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, getResource("doclet.Help_line_30"));
divContent.addContent(line30);
contentTree.addContent(divContent);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -391,8 +391,7 @@
tbody.addContent(tr);
}
table.addContent(tbody);
- Content li = HtmlTree.LI(HtmlStyle.blockList, table);
- summaryContentTree.addContent(li);
+ summaryContentTree.addContent(table);
}
}
@@ -1051,7 +1050,7 @@
public Content italicsClassName(ClassDoc cd, boolean qual) {
Content name = new StringContent((qual)? cd.qualifiedName(): cd.name());
- return (cd.isInterface())? HtmlTree.SPAN(HtmlStyle.italic, name): name;
+ return (cd.isInterface())? HtmlTree.SPAN(HtmlStyle.interfaceName, name): name;
}
/**
@@ -1567,7 +1566,7 @@
Content div;
Content result = commentTagsToContent(null, doc, tags, first);
if (depr) {
- Content italic = HtmlTree.SPAN(HtmlStyle.italic, result);
+ Content italic = HtmlTree.SPAN(HtmlStyle.deprecationComment, result);
div = HtmlTree.DIV(HtmlStyle.block, italic);
htmltree.addContent(div);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -160,11 +160,11 @@
holder.typeName() : holder.qualifiedTypeName(),
false);
Content codelLink = HtmlTree.CODE(link);
- Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.asClassDoc().isClass()?
+ Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.asClassDoc().isClass()?
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
- strong.addContent(writer.getSpace());
- strong.addContent(codelLink);
- methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
+ descfrmLabel.addContent(writer.getSpace());
+ descfrmLabel.addContent(codelLink);
+ methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
writer.addInlineComment(method, methodDocTree);
}
}
@@ -310,7 +310,7 @@
label = writer.specifiedByLabel;
context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY;
}
- Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, label));
+ Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, label));
dl.addContent(dt);
Content overriddenTypeLink =
writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType));
@@ -365,7 +365,7 @@
Content intfaclink = writer.getLink(new LinkInfoImpl(
writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac));
Content codeIntfacLink = HtmlTree.CODE(intfaclink);
- Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, writer.specifiedByLabel));
+ Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, writer.specifiedByLabel));
dl.addContent(dt);
Content methlink = writer.getDocLink(
LinkInfoImpl.Kind.MEMBER, implementedMeth,
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -166,9 +166,9 @@
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member)));
- Content code = HtmlTree.CODE(strong);
+ Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -183,7 +183,7 @@
printedHeader = true;
}
Content arr_i_name = new StringContent(arr[i].name());
- if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
+ if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name);
Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
Content li = HtmlTree.LI(link);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -155,7 +155,7 @@
* @param div the content tree to which the link will be added
*/
protected void addLinkToMainTree(Content div) {
- Content span = HtmlTree.SPAN(HtmlStyle.strong,
+ Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
getResource("doclet.Package_Hierarchies"));
div.addContent(span);
HtmlTree ul = new HtmlTree (HtmlTag.UL);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -141,7 +141,7 @@
if (Util.isDeprecated(packageDoc)) {
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
deprDiv.addStyle(HtmlStyle.deprecatedContent);
- Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
+ Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
deprDiv.addContent(deprPhrase);
if (deprs.length > 0) {
Tag[] commentTags = deprs[0].inlineTags();
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -174,7 +174,7 @@
printedHeader = true;
}
Content arr_i_name = new StringContent(arr[i].name());
- if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
+ if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name);
Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
Content li = HtmlTree.LI(link);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -158,7 +158,7 @@
if (Util.isDeprecated(packageDoc)) {
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
deprDiv.addStyle(HtmlStyle.deprecatedContent);
- Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
+ Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
deprDiv.addContent(deprPhrase);
if (deprs.length > 0) {
Tag[] commentTags = deprs[0].inlineTags();
@@ -175,8 +175,11 @@
*/
public void addClassesSummary(ClassDoc[] classes, String label,
String tableSummary, String[] tableHeader, Content packageSummaryContentTree) {
+ HtmlTree li = new HtmlTree(HtmlTag.LI);
+ li.addStyle(HtmlStyle.blockList);
addClassesSummary(classes, label, tableSummary, tableHeader,
- packageSummaryContentTree, profileValue);
+ li, profileValue);
+ packageSummaryContentTree.addContent(li);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -187,7 +187,7 @@
deprs = pkg.tags("deprecated");
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
deprDiv.addStyle(HtmlStyle.deprecatedContent);
- Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
+ Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
deprDiv.addContent(deprPhrase);
if (deprs.length > 0) {
Tag[] commentTags = deprs[0].inlineTags();
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -136,11 +136,11 @@
holder.typeName() : holder.qualifiedTypeName(),
false);
Content codeLink = HtmlTree.CODE(link);
- Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
+ Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.isClass()?
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
- strong.addContent(writer.getSpace());
- strong.addContent(codeLink);
- propertyDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
+ descfrmLabel.addContent(writer.getSpace());
+ descfrmLabel.addContent(codeLink);
+ propertyDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
writer.addInlineComment(property, propertyDocTree);
}
}
@@ -255,14 +255,14 @@
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, cd,
(MemberDoc) member,
member.name().substring(0, member.name().lastIndexOf("Property")),
false,
true));
- Content code = HtmlTree.CODE(strong);
+ Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -175,8 +175,8 @@
Tag[] deprs = member.tags("deprecated");
Content div;
if (Util.isDeprecated((ProgramElementDoc) member)) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
- div = HtmlTree.DIV(HtmlStyle.block, strong);
+ Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
+ div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
div.addContent(getSpace());
if (deprs.length > 0) {
addInlineDeprecatedComment(member, deprs[0], div);
@@ -186,8 +186,8 @@
} else {
ClassDoc cd = ((ProgramElementDoc)member).containingClass();
if (cd != null && Util.isDeprecated(cd)) {
- Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
- div = HtmlTree.DIV(HtmlStyle.block, strong);
+ Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
+ div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
div.addContent(getSpace());
tdSummary.addContent(div);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -97,7 +97,7 @@
Tag[] deprs = doc.tags("deprecated");
if (doc instanceof ClassDoc) {
if (Util.isDeprecated((ProgramElementDoc) doc)) {
- result.addContent(HtmlTree.SPAN(HtmlStyle.strong,
+ result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
new StringContent(configuration.getText("doclet.Deprecated"))));
result.addContent(RawHtml.nbsp);
if (deprs.length > 0) {
@@ -112,18 +112,18 @@
} else {
MemberDoc member = (MemberDoc) doc;
if (Util.isDeprecated((ProgramElementDoc) doc)) {
- result.addContent(HtmlTree.SPAN(HtmlStyle.strong,
+ result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
new StringContent(configuration.getText("doclet.Deprecated"))));
result.addContent(RawHtml.nbsp);
if (deprs.length > 0) {
Content body = commentTagsToOutput(null, doc,
deprs[0].inlineTags(), false);
if (!body.isEmpty())
- result.addContent(HtmlTree.SPAN(HtmlStyle.italic, body));
+ result.addContent(HtmlTree.SPAN(HtmlStyle.deprecationComment, body));
}
} else {
if (Util.isDeprecated(member.containingClass())) {
- result.addContent(HtmlTree.SPAN(HtmlStyle.strong,
+ result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
new StringContent(configuration.getText("doclet.Deprecated"))));
result.addContent(RawHtml.nbsp);
}
@@ -151,7 +151,7 @@
* {@inheritDoc}
*/
public Content getParamHeader(String header) {
- HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong,
+ HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.paramLabel,
new StringContent(header)));
return result;
}
@@ -186,7 +186,7 @@
*/
public Content returnTagOutput(Tag returnTag) {
ContentBuilder result = new ContentBuilder();
- result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong,
+ result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.returnLabel,
new StringContent(configuration.getText("doclet.Returns")))));
result.addContent(HtmlTree.DD(htmlWriter.commentTagsToContent(
returnTag, null, returnTag.inlineTags(), false)));
@@ -231,7 +231,7 @@
return body;
ContentBuilder result = new ContentBuilder();
- result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong,
+ result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.seeLabel,
new StringContent(configuration.getText("doclet.See_Also")))));
result.addContent(HtmlTree.DD(body));
return result;
@@ -250,7 +250,7 @@
*/
public Content simpleTagOutput(Tag[] simpleTags, String header) {
ContentBuilder result = new ContentBuilder();
- result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, new RawHtml(header))));
+ result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header))));
ContentBuilder body = new ContentBuilder();
for (int i = 0; i < simpleTags.length; i++) {
if (i > 0) {
@@ -268,7 +268,7 @@
*/
public Content simpleTagOutput(Tag simpleTag, String header) {
ContentBuilder result = new ContentBuilder();
- result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, new RawHtml(header))));
+ result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header))));
Content body = htmlWriter.commentTagsToContent(
simpleTag, null, simpleTag.inlineTags(), false);
result.addContent(HtmlTree.DD(body));
@@ -279,7 +279,7 @@
* {@inheritDoc}
*/
public Content getThrowsHeader() {
- HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong,
+ HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.throwsLabel,
new StringContent(configuration.getText("doclet.Throws"))));
return result;
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -131,7 +131,7 @@
return;
}
if (!classesonly) {
- Content span = HtmlTree.SPAN(HtmlStyle.strong,
+ Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
getResource("doclet.Package_Hierarchies"));
contentTree.addContent(span);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Fri Nov 08 17:36:14 2013 -0800
@@ -236,7 +236,7 @@
String stylename, String title, String target) {
Content body = label;
if (strong) {
- body = HtmlTree.SPAN(HtmlStyle.strong, body);
+ body = HtmlTree.SPAN(HtmlStyle.typeNameLink, body);
}
if (stylename != null && stylename.length() != 0) {
HtmlTree t = new HtmlTree(HtmlTag.FONT, body);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java Fri Nov 08 17:36:14 2013 -0800
@@ -52,37 +52,51 @@
constantValuesContainer,
contentContainer,
deprecatedContent,
+ deprecatedLabel,
deprecatedSummary,
+ deprecationComment,
description,
+ descfrmTypeLabel,
details,
docSummary,
+ emphasizedPhrase,
header,
horizontal,
footer,
indexContainer,
indexHeader,
inheritance,
- italic,
+ interfaceName,
legalCopy,
+ memberNameLabel,
+ memberNameLink,
memberSummary,
nameValue,
navBarCell1Rev,
navList,
+ overrideSpecifyLabel,
overviewSummary,
+ packageHierarchyLabel,
+ paramLabel,
+ returnLabel,
rowColor,
+ seeLabel,
serializedFormContainer,
+ simpleTagLabel,
skipNav,
sourceContainer,
sourceLineNo,
- strong,
subNav,
subNavList,
subTitle,
summary,
tabEnd,
tableTab,
+ throwsLabel,
title,
topNav,
+ typeNameLabel,
+ typeNameLink,
typeSummary,
useSummary;
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Fri Nov 08 17:36:14 2013 -0800
@@ -514,9 +514,11 @@
display:block;
margin:3px 0 0 0;
}
-.strong {
+.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
+.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel,
+.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink {
font-weight:bold;
}
-.italic {
+.deprecationComment, .emphasizedPhrase, .interfaceName {
font-style:italic;
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java Fri Nov 08 17:36:14 2013 -0800
@@ -205,6 +205,10 @@
}
}
+ public Set<String> getCustomTagNames() {
+ return customTags.keySet();
+ }
+
/**
* Add a new <code>Taglet</code>. Print a message to indicate whether or not
* the Taglet was registered properly.
--- a/langtools/src/share/classes/com/sun/tools/doclint/Checker.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java Fri Nov 08 17:36:14 2013 -0800
@@ -71,6 +71,8 @@
import com.sun.source.doctree.StartElementTree;
import com.sun.source.doctree.TextTree;
import com.sun.source.doctree.ThrowsTree;
+import com.sun.source.doctree.UnknownBlockTagTree;
+import com.sun.source.doctree.UnknownInlineTagTree;
import com.sun.source.doctree.ValueTree;
import com.sun.source.doctree.VersionTree;
import com.sun.source.util.DocTreePath;
@@ -842,6 +844,23 @@
}
@Override
+ public Void visitUnknownBlockTag(UnknownBlockTagTree tree, Void ignore) {
+ checkUnknownTag(tree, tree.getTagName());
+ return super.visitUnknownBlockTag(tree, ignore);
+ }
+
+ @Override
+ public Void visitUnknownInlineTag(UnknownInlineTagTree tree, Void ignore) {
+ checkUnknownTag(tree, tree.getTagName());
+ return super.visitUnknownInlineTag(tree, ignore);
+ }
+
+ private void checkUnknownTag(DocTree tree, String tagName) {
+ if (env.customTags != null && !env.customTags.contains(tagName))
+ env.messages.error(SYNTAX, tree, "dc.tag.unknown", tagName);
+ }
+
+ @Override
public Void visitValue(ValueTree tree, Void ignore) {
ReferenceTree ref = tree.getReference();
if (ref == null || ref.getSignature().isEmpty()) {
--- a/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java Fri Nov 08 17:36:14 2013 -0800
@@ -78,6 +78,8 @@
public static final String XMSGS_CUSTOM_PREFIX = "-Xmsgs:";
private static final String STATS = "-stats";
public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:";
+ public static final String XCUSTOM_TAGS_PREFIX = "-XcustomTags:";
+ public static final String TAGS_SEPARATOR = ",";
// <editor-fold defaultstate="collapsed" desc="Command-line entry point">
public static void main(String... args) {
@@ -199,6 +201,8 @@
env.messages.setOptions(null);
} else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) {
env.messages.setOptions(arg.substring(arg.indexOf(":") + 1));
+ } else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
+ env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
} else if (arg.equals("-h") || arg.equals("-help") || arg.equals("--help")
|| arg.equals("-?") || arg.equals("-usage")) {
needHelp = true;
@@ -262,6 +266,8 @@
} else if (arg.matches(XIMPLICIT_HEADERS + "[1-6]")) {
char ch = arg.charAt(arg.length() - 1);
env.setImplicitHeaders(Character.digit(ch, 10));
+ } else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
+ env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
} else
throw new IllegalArgumentException(arg);
}
--- a/langtools/src/share/classes/com/sun/tools/doclint/Env.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Env.java Fri Nov 08 17:36:14 2013 -0800
@@ -27,6 +27,7 @@
import java.util.Set;
+import java.util.LinkedHashSet;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
@@ -86,6 +87,8 @@
int implicitHeaderLevel = 0;
+ Set<String> customTags;
+
// Utility classes
DocTrees trees;
Elements elements;
@@ -135,6 +138,14 @@
implicitHeaderLevel = n;
}
+ void setCustomTags(String cTags) {
+ customTags = new LinkedHashSet<String>();
+ for (String s : cTags.split(DocLint.TAGS_SEPARATOR)) {
+ if (!s.isEmpty())
+ customTags.add(s);
+ }
+ }
+
/** Set the current declaration and its doc comment. */
void setCurrent(TreePath path, DocCommentTree comment) {
currPath = path;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/AnnoConstruct.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/AnnoConstruct.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,6 +25,7 @@
package com.sun.tools.javac.code;
import java.lang.annotation.Annotation;
+import java.lang.annotation.Inherited;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -112,20 +113,17 @@
}
// Deal with inherited annotations
- if (direct == null && container == null)
+ if (direct == null && container == null &&
+ annoType.isAnnotationPresent(Inherited.class))
return getInheritedAnnotations(annoType);
- // Pack them in an array
- Attribute[] contained0 = null;
- if (container != null)
- contained0 = unpackAttributes(container);
- ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
- if (contained0 != null) {
- for (Attribute a : contained0)
- if (a instanceof Attribute.Compound)
- compounds = compounds.append((Attribute.Compound)a);
- }
- Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[compounds.size()]);
+ Attribute.Compound[] contained = unpackContained(container);
+
+ // In case of an empty legacy container we might need to look for
+ // inherited annos as well
+ if (direct == null && contained.length == 0 &&
+ annoType.isAnnotationPresent(Inherited.class))
+ return getInheritedAnnotations(annoType);
int size = (direct == null ? 0 : 1) + contained.length;
@SuppressWarnings("unchecked") // annoType is the Class for A
@@ -157,6 +155,19 @@
return arr;
}
+ private Attribute.Compound[] unpackContained(Attribute.Compound container) {
+ // Pack them in an array
+ Attribute[] contained0 = null;
+ if (container != null)
+ contained0 = unpackAttributes(container);
+ ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
+ if (contained0 != null) {
+ for (Attribute a : contained0)
+ if (a instanceof Attribute.Compound)
+ compounds = compounds.append((Attribute.Compound)a);
+ }
+ return compounds.toArray(new Attribute.Compound[compounds.size()]);
+ }
// This method is part of the javax.lang.model API, do not use this in javac code.
public <A extends Annotation> A getAnnotation(Class<A> annoType) {
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java Fri Nov 08 17:36:14 2013 -0800
@@ -270,6 +270,11 @@
*/
public static final long POTENTIALLY_AMBIGUOUS = 1L<<48;
+ /**
+ * Flag that marks a synthetic method body for a lambda expression
+ */
+ public static final long LAMBDA_METHOD = 1L<<49;
+
/** Modifier masks.
*/
public static final int
@@ -378,7 +383,8 @@
NOT_IN_PROFILE(Flags.NOT_IN_PROFILE),
BAD_OVERRIDE(Flags.BAD_OVERRIDE),
SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
- THROWS(Flags.THROWS);
+ THROWS(Flags.THROWS),
+ LAMBDA_METHOD(Flags.LAMBDA_METHOD);
Flag(long flag) {
this.value = flag;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Fri Nov 08 17:36:14 2013 -0800
@@ -100,7 +100,7 @@
/** The attributes of this symbol are contained in this
* SymbolMetadata. The SymbolMetadata instance is NOT immutable.
*/
- protected SymbolMetadata annotations;
+ protected SymbolMetadata metadata;
/** An accessor method for the attributes of this symbol.
@@ -108,9 +108,9 @@
* method to make sure that the class symbol is loaded.
*/
public List<Attribute.Compound> getRawAttributes() {
- return (annotations == null)
+ return (metadata == null)
? List.<Attribute.Compound>nil()
- : annotations.getDeclarationAttributes();
+ : metadata.getDeclarationAttributes();
}
/** An accessor method for the type attributes of this symbol.
@@ -118,9 +118,9 @@
* method to make sure that the class symbol is loaded.
*/
public List<Attribute.TypeCompound> getRawTypeAttributes() {
- return (annotations == null)
+ return (metadata == null)
? List.<Attribute.TypeCompound>nil()
- : annotations.getTypeAttributes();
+ : metadata.getTypeAttributes();
}
/** Fetch a particular annotation from a symbol. */
@@ -132,106 +132,106 @@
}
public boolean annotationsPendingCompletion() {
- return annotations == null ? false : annotations.pendingCompletion();
+ return metadata == null ? false : metadata.pendingCompletion();
}
public void appendAttributes(List<Attribute.Compound> l) {
if (l.nonEmpty()) {
- initedAnnos().append(l);
+ initedMetadata().append(l);
}
}
public void appendClassInitTypeAttributes(List<Attribute.TypeCompound> l) {
if (l.nonEmpty()) {
- initedAnnos().appendClassInitTypeAttributes(l);
+ initedMetadata().appendClassInitTypeAttributes(l);
}
}
public void appendInitTypeAttributes(List<Attribute.TypeCompound> l) {
if (l.nonEmpty()) {
- initedAnnos().appendInitTypeAttributes(l);
+ initedMetadata().appendInitTypeAttributes(l);
}
}
public void appendTypeAttributesWithCompletion(final Annotate.AnnotateRepeatedContext<Attribute.TypeCompound> ctx) {
- initedAnnos().appendTypeAttributesWithCompletion(ctx);
+ initedMetadata().appendTypeAttributesWithCompletion(ctx);
}
public void appendUniqueTypeAttributes(List<Attribute.TypeCompound> l) {
if (l.nonEmpty()) {
- initedAnnos().appendUniqueTypes(l);
+ initedMetadata().appendUniqueTypes(l);
}
}
public List<Attribute.TypeCompound> getClassInitTypeAttributes() {
- return (annotations == null)
+ return (metadata == null)
? List.<Attribute.TypeCompound>nil()
- : annotations.getClassInitTypeAttributes();
+ : metadata.getClassInitTypeAttributes();
}
public List<Attribute.TypeCompound> getInitTypeAttributes() {
- return (annotations == null)
+ return (metadata == null)
? List.<Attribute.TypeCompound>nil()
- : annotations.getInitTypeAttributes();
+ : metadata.getInitTypeAttributes();
}
public List<Attribute.Compound> getDeclarationAttributes() {
- return (annotations == null)
+ return (metadata == null)
? List.<Attribute.Compound>nil()
- : annotations.getDeclarationAttributes();
+ : metadata.getDeclarationAttributes();
}
public boolean hasAnnotations() {
- return (annotations != null && !annotations.isEmpty());
+ return (metadata != null && !metadata.isEmpty());
}
public boolean hasTypeAnnotations() {
- return (annotations != null && !annotations.isTypesEmpty());
+ return (metadata != null && !metadata.isTypesEmpty());
}
public void prependAttributes(List<Attribute.Compound> l) {
if (l.nonEmpty()) {
- initedAnnos().prepend(l);
+ initedMetadata().prepend(l);
}
}
public void resetAnnotations() {
- initedAnnos().reset();
+ initedMetadata().reset();
}
public void setAttributes(Symbol other) {
- if (annotations != null || other.annotations != null) {
- initedAnnos().setAttributes(other.annotations);
+ if (metadata != null || other.metadata != null) {
+ initedMetadata().setAttributes(other.metadata);
}
}
public void setDeclarationAttributes(List<Attribute.Compound> a) {
- if (annotations != null || a.nonEmpty()) {
- initedAnnos().setDeclarationAttributes(a);
+ if (metadata != null || a.nonEmpty()) {
+ initedMetadata().setDeclarationAttributes(a);
}
}
public void setDeclarationAttributesWithCompletion(final Annotate.AnnotateRepeatedContext<Attribute.Compound> ctx) {
- initedAnnos().setDeclarationAttributesWithCompletion(ctx);
+ initedMetadata().setDeclarationAttributesWithCompletion(ctx);
}
public void setTypeAttributes(List<Attribute.TypeCompound> a) {
- if (annotations != null || a.nonEmpty()) {
- if (annotations == null)
- annotations = new SymbolMetadata(this);
- annotations.setTypeAttributes(a);
+ if (metadata != null || a.nonEmpty()) {
+ if (metadata == null)
+ metadata = new SymbolMetadata(this);
+ metadata.setTypeAttributes(a);
}
}
- private SymbolMetadata initedAnnos() {
- if (annotations == null)
- annotations = new SymbolMetadata(this);
- return annotations;
+ private SymbolMetadata initedMetadata() {
+ if (metadata == null)
+ metadata = new SymbolMetadata(this);
+ return metadata;
}
/** This method is intended for debugging only. */
- public SymbolMetadata getAnnotations() {
- return annotations;
+ public SymbolMetadata getMetadata() {
+ return metadata;
}
// </editor-fold>
@@ -862,10 +862,10 @@
}
private void mergeAttributes() {
- if (annotations == null &&
- package_info.annotations != null) {
- annotations = new SymbolMetadata(this);
- annotations.setAttributes(package_info.annotations);
+ if (metadata == null &&
+ package_info.metadata != null) {
+ metadata = new SymbolMetadata(this);
+ metadata.setAttributes(package_info.metadata);
}
}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java Fri Nov 08 17:36:14 2013 -0800
@@ -323,7 +323,16 @@
if (type == null) {
// When type is null, put the type annotations to the symbol.
// This is used for constructor return annotations, for which
- // no appropriate type exists.
+ // we use the type of the enclosing class.
+ type = sym.getEnclosingElement().asType();
+
+ // Declaration annotations are always allowed on constructor returns.
+ // Therefore, use typeAnnotations instead of onlyTypeAnnos.
+ type = typeWithAnnotations(typetree, type, typeAnnotations, typeAnnotations);
+ // Note that we don't use the result, the call to
+ // typeWithAnnotations side-effects the type annotation positions.
+ // This is important for constructors of nested classes.
+
sym.appendUniqueTypeAttributes(typeAnnotations);
return;
}
@@ -361,9 +370,9 @@
sym.appendUniqueTypeAttributes(typeAnnotations);
if (sym.getKind() == ElementKind.PARAMETER ||
- sym.getKind() == ElementKind.LOCAL_VARIABLE ||
- sym.getKind() == ElementKind.RESOURCE_VARIABLE ||
- sym.getKind() == ElementKind.EXCEPTION_PARAMETER) {
+ sym.getKind() == ElementKind.LOCAL_VARIABLE ||
+ sym.getKind() == ElementKind.RESOURCE_VARIABLE ||
+ sym.getKind() == ElementKind.EXCEPTION_PARAMETER) {
// Make sure all type annotations from the symbol are also
// on the owner.
sym.owner.appendUniqueTypeAttributes(sym.getRawTypeAttributes());
@@ -404,11 +413,11 @@
depth = depth.append(TypePathEntry.ARRAY);
while (arType.elemtype.hasTag(TypeTag.ARRAY)) {
if (arType.elemtype.isAnnotated()) {
- Type.AnnotatedType aelemtype = (Type.AnnotatedType) arType.elemtype;
+ Type aelemtype = arType.elemtype;
arType = (Type.ArrayType) aelemtype.unannotatedType();
ArrayType prevToMod = tomodify;
tomodify = new Type.ArrayType(null, arType.tsym);
- prevToMod.elemtype = (Type.AnnotatedType) tomodify.annotatedType(arType.elemtype.getAnnotationMirrors());
+ prevToMod.elemtype = tomodify.annotatedType(arType.elemtype.getAnnotationMirrors());
} else {
arType = (Type.ArrayType) arType.elemtype;
tomodify.elemtype = new Type.ArrayType(null, arType.tsym);
@@ -1212,6 +1221,22 @@
super.visitTypeParameter(tree);
}
+ private void copyNewClassAnnotationsToOwner(JCNewClass tree) {
+ Symbol sym = tree.def.sym;
+ TypeAnnotationPosition pos = new TypeAnnotationPosition();
+ ListBuffer<Attribute.TypeCompound> newattrs =
+ new ListBuffer<Attribute.TypeCompound>();
+
+ for (Attribute.TypeCompound old : sym.getRawTypeAttributes()) {
+ newattrs.append(new Attribute.TypeCompound(old.type, old.values,
+ pos));
+ }
+
+ pos.type = TargetType.NEW;
+ pos.pos = tree.pos;
+ sym.owner.appendUniqueTypeAttributes(newattrs.toList());
+ }
+
@Override
public void visitNewClass(JCNewClass tree) {
if (tree.def != null &&
@@ -1230,7 +1255,7 @@
}
Type before = classdecl.sym.type;
separateAnnotationsKinds(classdecl, tree.clazz.type, classdecl.sym, pos);
-
+ copyNewClassAnnotationsToOwner(tree);
// classdecl.sym.type now contains an annotated type, which
// is not what we want there.
// TODO: should we put this type somewhere in the superclass/interface?
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Fri Nov 08 17:36:14 2013 -0800
@@ -250,6 +250,14 @@
Type owntype = found;
if (!owntype.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) {
if (allowPoly && inferenceContext.free(found)) {
+ if ((ownkind & ~resultInfo.pkind) == 0) {
+ owntype = resultInfo.check(tree, inferenceContext.asFree(owntype));
+ } else {
+ log.error(tree.pos(), "unexpected.type",
+ kindNames(resultInfo.pkind),
+ kindName(ownkind));
+ owntype = types.createErrorType(owntype);
+ }
inferenceContext.addFreeTypeListener(List.of(found, resultInfo.pt), new FreeTypeListener() {
@Override
public void typesInferred(InferenceContext inferenceContext) {
@@ -314,9 +322,6 @@
case CLASSDEF:
//class def is always an owner
return ((JCClassDecl)env.tree).sym;
- case LAMBDA:
- //a lambda is an owner - return a fresh synthetic method symbol
- return new MethodSymbol(0, names.empty, null, syms.methodClass);
case BLOCK:
//static/instance init blocks are owner
Symbol blockSym = env.info.scope.owner;
@@ -514,6 +519,15 @@
protected ResultInfo dup(CheckContext newContext) {
return new ResultInfo(pkind, pt, newContext);
}
+
+ @Override
+ public String toString() {
+ if (pt != null) {
+ return pt.toString();
+ } else {
+ return "";
+ }
+ }
}
class RecoveryInfo extends ResultInfo {
@@ -4065,8 +4079,6 @@
* Apply the annotations to the particular type.
*/
public void annotateType(final JCTree tree, final List<JCAnnotation> annotations) {
- // Callers ensure this.
- // Assert.check(annotations != null && annotations.nonEmpty());
annotate.typeAnnotation(new Annotate.Worker() {
@Override
public String toString() {
@@ -4084,8 +4096,9 @@
}
private static List<Attribute.TypeCompound> fromAnnotations(List<JCAnnotation> annotations) {
- if (annotations.isEmpty())
+ if (annotations.isEmpty()) {
return List.nil();
+ }
ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
for (JCAnnotation anno : annotations) {
@@ -4097,6 +4110,10 @@
// Any better solutions?
buf.append((Attribute.TypeCompound) anno.attribute);
}
+ // Eventually we will want to throw an exception here, but
+ // we can't do that just yet, because it gets triggered
+ // when attempting to attach an annotation that isn't
+ // defined.
}
return buf.toList();
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Fri Nov 08 17:36:14 2013 -0800
@@ -528,7 +528,7 @@
inferenceContext.addFreeTypeListener(List.of(req), new FreeTypeListener() {
@Override
public void typesInferred(InferenceContext inferenceContext) {
- checkType(pos, found, inferenceContext.asInstType(req), checkContext);
+ checkType(pos, inferenceContext.asInstType(found), inferenceContext.asInstType(req), checkContext);
}
});
}
@@ -3011,7 +3011,6 @@
boolean annotationApplicable(JCAnnotation a, Symbol s) {
Attribute.Array arr = getAttributeTargetAttribute(a.annotationType.type.tsym);
Name[] targets;
-
if (arr == null) {
targets = defaultTargetMetaInfo(a, s);
} else {
@@ -3028,7 +3027,7 @@
}
for (Name target : targets) {
if (target == names.TYPE)
- { if (s.kind == TYP) return true; }
+ { if (s.kind == TYP && !s.isAnonymous()) return true; }
else if (target == names.FIELD)
{ if (s.kind == VAR && s.owner.kind != MTH) return true; }
else if (target == names.METHOD)
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Fri Nov 08 17:36:14 2013 -0800
@@ -1718,9 +1718,9 @@
if (tree.body == null) {
return;
}
- /* MemberEnter can generate synthetic methods, ignore them
+ /* Ignore synthetic methods, except for translated lambda methods.
*/
- if ((tree.sym.flags() & SYNTHETIC) != 0) {
+ if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
return;
}
@@ -1795,7 +1795,7 @@
protected void initParam(JCVariableDecl def) {
inits.incl(def.sym.adr);
uninits.excl(def.sym.adr);
- }
+ }
public void visitVarDef(JCVariableDecl tree) {
boolean track = trackable(tree.sym);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Fri Nov 08 17:36:14 2013 -0800
@@ -1768,9 +1768,11 @@
public Type apply(Type t) {
if (t.hasTag(TYPEVAR)) {
TypeVar tv = (TypeVar)t;
- return tv.isCaptured() ?
- new CapturedUndetVar((CapturedType)tv, types) :
- new UndetVar(tv, types);
+ if (tv.isCaptured()) {
+ return new CapturedUndetVar((CapturedType)tv, types);
+ } else {
+ return new UndetVar(tv, types);
+ }
} else {
return t.map(this);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,6 +48,7 @@
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.source.tree.MemberReferenceTree.ReferenceMode;
+import java.util.EnumMap;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -68,6 +69,7 @@
*/
public class LambdaToMethod extends TreeTranslator {
+ private Attr attr;
private JCDiagnostic.Factory diags;
private Log log;
private Lower lower;
@@ -103,6 +105,35 @@
/** Flag for alternate metafactories indicating the lambda object requires multiple bridges */
public static final int FLAG_BRIDGES = 1 << 2;
+ // <editor-fold defaultstate="collapsed" desc="Instantiating">
+ protected static final Context.Key<LambdaToMethod> unlambdaKey =
+ new Context.Key<LambdaToMethod>();
+
+ public static LambdaToMethod instance(Context context) {
+ LambdaToMethod instance = context.get(unlambdaKey);
+ if (instance == null) {
+ instance = new LambdaToMethod(context);
+ }
+ return instance;
+ }
+ private LambdaToMethod(Context context) {
+ context.put(unlambdaKey, this);
+ diags = JCDiagnostic.Factory.instance(context);
+ log = Log.instance(context);
+ lower = Lower.instance(context);
+ names = Names.instance(context);
+ syms = Symtab.instance(context);
+ rs = Resolve.instance(context);
+ make = TreeMaker.instance(context);
+ types = Types.instance(context);
+ transTypes = TransTypes.instance(context);
+ analyzer = new LambdaAnalyzerPreprocessor();
+ Options options = Options.instance(context);
+ dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
+ attr = Attr.instance(context);
+ }
+ // </editor-fold>
+
private class KlassInfo {
/**
@@ -125,12 +156,15 @@
*/
private final VarSymbol deserParamSym;
- private KlassInfo(Symbol kSym) {
+ private final JCClassDecl clazz;
+
+ private KlassInfo(JCClassDecl clazz) {
+ this.clazz = clazz;
appendedMethodList = new ListBuffer<>();
deserializeCases = new HashMap<String, ListBuffer<JCStatement>>();
MethodType type = new MethodType(List.of(syms.serializedLambdaType), syms.objectType,
List.<Type>nil(), syms.methodClass);
- deserMethodSym = makePrivateSyntheticMethod(STATIC, names.deserializeLambda, type, kSym);
+ deserMethodSym = makePrivateSyntheticMethod(STATIC, names.deserializeLambda, type, clazz.sym);
deserParamSym = new VarSymbol(FINAL, names.fromString("lambda"),
syms.serializedLambdaType, deserMethodSym);
}
@@ -140,37 +174,6 @@
}
}
- // <editor-fold defaultstate="collapsed" desc="Instantiating">
- private static final Context.Key<LambdaToMethod> unlambdaKey =
- new Context.Key<LambdaToMethod>();
-
- public static LambdaToMethod instance(Context context) {
- LambdaToMethod instance = context.get(unlambdaKey);
- if (instance == null) {
- instance = new LambdaToMethod(context);
- }
- return instance;
- }
-
- private Attr attr;
-
- private LambdaToMethod(Context context) {
- diags = JCDiagnostic.Factory.instance(context);
- log = Log.instance(context);
- lower = Lower.instance(context);
- names = Names.instance(context);
- syms = Symtab.instance(context);
- rs = Resolve.instance(context);
- make = TreeMaker.instance(context);
- types = Types.instance(context);
- transTypes = TransTypes.instance(context);
- analyzer = new LambdaAnalyzerPreprocessor();
- Options options = Options.instance(context);
- dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
- attr = Attr.instance(context);
- }
- // </editor-fold>
-
// <editor-fold defaultstate="collapsed" desc="translate methods">
@Override
public <T extends JCTree> T translate(T tree) {
@@ -221,10 +224,16 @@
}
KlassInfo prevKlassInfo = kInfo;
try {
- kInfo = new KlassInfo(tree.sym);
+ kInfo = new KlassInfo(tree);
super.visitClassDef(tree);
if (!kInfo.deserializeCases.isEmpty()) {
- kInfo.addMethod(makeDeserializeMethod(tree.sym));
+ int prevPos = make.pos;
+ try {
+ make.at(tree);
+ kInfo.addMethod(makeDeserializeMethod(tree.sym));
+ } finally {
+ make.at(prevPos);
+ }
}
//add all translated instance methods here
List<JCTree> newMethods = kInfo.appendedMethodList.toList();
@@ -400,26 +409,21 @@
if (context == null || !analyzer.lambdaIdentSymbolFilter(tree.sym)) {
super.visitIdent(tree);
} else {
- LambdaTranslationContext lambdaContext = (LambdaTranslationContext) context;
- if (lambdaContext.getSymbolMap(PARAM).containsKey(tree.sym)) {
- Symbol translatedSym = lambdaContext.getSymbolMap(PARAM).get(tree.sym);
- result = make.Ident(translatedSym).setType(tree.type);
- translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
- } else if (lambdaContext.getSymbolMap(LOCAL_VAR).containsKey(tree.sym)) {
- Symbol translatedSym = lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym);
- result = make.Ident(translatedSym).setType(tree.type);
- translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
- } else if (lambdaContext.getSymbolMap(TYPE_VAR).containsKey(tree.sym)) {
- Symbol translatedSym = lambdaContext.getSymbolMap(TYPE_VAR).get(tree.sym);
- result = make.Ident(translatedSym).setType(translatedSym.type);
- translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
- } else if (lambdaContext.getSymbolMap(CAPTURED_VAR).containsKey(tree.sym)) {
- Symbol translatedSym = lambdaContext.getSymbolMap(CAPTURED_VAR).get(tree.sym);
- result = make.Ident(translatedSym).setType(tree.type);
- } else {
- //access to untranslated symbols (i.e. compile-time constants,
- //members defined inside the lambda body, etc.) )
- super.visitIdent(tree);
+ int prevPos = make.pos;
+ try {
+ make.at(tree);
+
+ LambdaTranslationContext lambdaContext = (LambdaTranslationContext) context;
+ JCTree ltree = lambdaContext.translate(tree);
+ if (ltree != null) {
+ result = ltree;
+ } else {
+ //access to untranslated symbols (i.e. compile-time constants,
+ //members defined inside the lambda body, etc.) )
+ super.visitIdent(tree);
+ }
+ } finally {
+ make.at(prevPos);
}
}
}
@@ -429,11 +433,21 @@
LambdaTranslationContext lambdaContext = (LambdaTranslationContext)context;
if (context != null && lambdaContext.getSymbolMap(LOCAL_VAR).containsKey(tree.sym)) {
JCExpression init = translate(tree.init);
- result = make.VarDef((VarSymbol)lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym), init);
+ int prevPos = make.pos;
+ try {
+ result = make.at(tree).VarDef((VarSymbol)lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym), init);
+ } finally {
+ make.at(prevPos);
+ }
} else if (context != null && lambdaContext.getSymbolMap(TYPE_VAR).containsKey(tree.sym)) {
JCExpression init = translate(tree.init);
VarSymbol xsym = (VarSymbol)lambdaContext.getSymbolMap(TYPE_VAR).get(tree.sym);
- result = make.VarDef(xsym, init);
+ int prevPos = make.pos;
+ try {
+ result = make.at(tree).VarDef(xsym, init);
+ } finally {
+ make.at(prevPos);
+ }
// Replace the entered symbol for this variable
Scope sc = tree.sym.owner.members();
if (sc != null) {
@@ -460,23 +474,28 @@
boolean isLambda_void = expr.type.hasTag(VOID);
boolean isTarget_void = restype.hasTag(VOID);
boolean isTarget_Void = types.isSameType(restype, types.boxedClass(syms.voidType).type);
- if (isTarget_void) {
- //target is void:
- // BODY;
- JCStatement stat = make.Exec(expr);
- return make.Block(0, List.<JCStatement>of(stat));
- } else if (isLambda_void && isTarget_Void) {
- //void to Void conversion:
- // BODY; return null;
- ListBuffer<JCStatement> stats = new ListBuffer<>();
- stats.append(make.Exec(expr));
- stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
- return make.Block(0, stats.toList());
- } else {
- //non-void to non-void conversion:
- // return (TYPE)BODY;
- JCExpression retExpr = transTypes.coerce(attrEnv, expr, restype);
- return make.at(retExpr).Block(0, List.<JCStatement>of(make.Return(retExpr)));
+ int prevPos = make.pos;
+ try {
+ if (isTarget_void) {
+ //target is void:
+ // BODY;
+ JCStatement stat = make.at(expr).Exec(expr);
+ return make.Block(0, List.<JCStatement>of(stat));
+ } else if (isLambda_void && isTarget_Void) {
+ //void to Void conversion:
+ // BODY; return null;
+ ListBuffer<JCStatement> stats = new ListBuffer<>();
+ stats.append(make.at(expr).Exec(expr));
+ stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
+ return make.Block(0, stats.toList());
+ } else {
+ //non-void to non-void conversion:
+ // return (TYPE)BODY;
+ JCExpression retExpr = transTypes.coerce(attrEnv, expr, restype);
+ return make.at(retExpr).Block(0, List.<JCStatement>of(make.Return(retExpr)));
+ }
+ } finally {
+ make.at(prevPos);
}
}
@@ -587,10 +606,10 @@
DiagnosticPosition pos, List<Object> staticArgs, MethodType indyType) {
String functionalInterfaceClass = classSig(targetType);
String functionalInterfaceMethodName = samSym.getSimpleName().toString();
- String functionalInterfaceMethodSignature = methodSig(types.erasure(samSym.type));
+ String functionalInterfaceMethodSignature = typeSig(types.erasure(samSym.type));
String implClass = classSig(types.erasure(refSym.owner.type));
String implMethodName = refSym.getQualifiedName().toString();
- String implMethodSignature = methodSig(types.erasure(refSym.type));
+ String implMethodSignature = typeSig(types.erasure(refSym.type));
JCExpression kindTest = eqTest(syms.intType, deserGetter("getImplMethodKind", syms.intType), make.Literal(implMethodKind));
ListBuffer<JCExpression> serArgs = new ListBuffer<>();
@@ -978,8 +997,14 @@
}
}
if (context.isSerializable()) {
- addDeserializationCase(refKind, refSym, tree.type, samSym,
- tree, staticArgs, indyType);
+ int prevPos = make.pos;
+ try {
+ make.at(kInfo.clazz);
+ addDeserializationCase(refKind, refSym, tree.type, samSym,
+ tree, staticArgs, indyType);
+ } finally {
+ make.at(prevPos);
+ }
}
}
@@ -1098,8 +1123,21 @@
* keep the count of lambda expression defined in given context (used to
* generate unambiguous names for serializable lambdas)
*/
- private Map<String, Integer> serializableLambdaCounts =
- new HashMap<String, Integer>();
+ private class SyntheticMethodNameCounter {
+ private Map<String, Integer> map = new HashMap<>();
+ int getIndex(StringBuilder buf) {
+ String temp = buf.toString();
+ Integer count = map.get(temp);
+ if (count == null) {
+ count = 0;
+ }
+ ++count;
+ map.put(temp, count);
+ return count;
+ }
+ }
+ private SyntheticMethodNameCounter syntheticMethodNameCounts =
+ new SyntheticMethodNameCounter();
private Map<Symbol, JCClassDecl> localClassDefs;
@@ -1133,13 +1171,13 @@
@Override
public void visitClassDef(JCClassDecl tree) {
List<Frame> prevStack = frameStack;
- Map<String, Integer> prevSerializableLambdaCount =
- serializableLambdaCounts;
+ SyntheticMethodNameCounter prevSyntheticMethodNameCounts =
+ syntheticMethodNameCounts;
Map<ClassSymbol, Symbol> prevClinits = clinits;
DiagnosticSource prevSource = log.currentSource();
try {
log.useSource(tree.sym.sourcefile);
- serializableLambdaCounts = new HashMap<String, Integer>();
+ syntheticMethodNameCounts = new SyntheticMethodNameCounter();
prevClinits = new HashMap<ClassSymbol, Symbol>();
if (tree.sym.owner.kind == MTH) {
localClassDefs.put(tree.sym, tree);
@@ -1165,7 +1203,7 @@
finally {
log.useSource(prevSource.getFile());
frameStack = prevStack;
- serializableLambdaCounts = prevSerializableLambdaCount;
+ syntheticMethodNameCounts = prevSyntheticMethodNameCounts;
clinits = prevClinits;
}
}
@@ -1315,7 +1353,9 @@
ListBuffer<JCVariableDecl> paramBuff = new ListBuffer<JCVariableDecl>();
int i = 0;
for (List<Type> l = ptypes; l.nonEmpty(); l = l.tail) {
- paramBuff.append(make.Param(make.paramName(i++), l.head, owner));
+ JCVariableDecl param = make.Param(make.paramName(i++), l.head, owner);
+ param.sym.pos = tree.pos;
+ paramBuff.append(param);
}
List<JCVariableDecl> params = paramBuff.toList();
@@ -1388,50 +1428,6 @@
}
}
- private Name lambdaName() {
- return names.lambda.append(names.fromString("" + lambdaCount++));
- }
-
- /**
- * For a serializable lambda, generate a name which maximizes name
- * stability across deserialization.
- * @param owner
- * @return Name to use for the synthetic lambda method name
- */
- private Name serializedLambdaName(Symbol owner) {
- StringBuilder buf = new StringBuilder();
- buf.append(names.lambda);
- // Append the name of the method enclosing the lambda.
- String methodName = owner.name.toString();
- if (methodName.equals("<clinit>"))
- methodName = "static";
- else if (methodName.equals("<init>"))
- methodName = "new";
- buf.append(methodName);
- buf.append('$');
- // Append a hash of the enclosing method signature to differentiate
- // overloaded enclosing methods. For lambdas enclosed in lambdas,
- // the generated lambda method will not have type yet, but the
- // enclosing method's name will have been generated with this same
- // method, so it will be unique and never be overloaded.
- Assert.check(owner.type != null || directlyEnclosingLambda() != null);
- if (owner.type != null) {
- int methTypeHash = methodSig(owner.type).hashCode();
- buf.append(Integer.toHexString(methTypeHash));
- }
- buf.append('$');
- // The above appended name components may not be unique, append a
- // count based on the above name components.
- String temp = buf.toString();
- Integer count = serializableLambdaCounts.get(temp);
- if (count == null) {
- count = 0;
- }
- buf.append(count++);
- serializableLambdaCounts.put(temp, count);
- return names.fromString(buf.toString());
- }
-
/**
* Return a valid owner given the current declaration stack
* (required to skip synthetic lambda symbols)
@@ -1648,19 +1644,19 @@
private abstract class TranslationContext<T extends JCFunctionalExpression> {
/** the underlying (untranslated) tree */
- T tree;
+ final T tree;
/** points to the adjusted enclosing scope in which this lambda/mref expression occurs */
- Symbol owner;
+ final Symbol owner;
/** the depth of this lambda expression in the frame stack */
- int depth;
+ final int depth;
/** the enclosing translation context (set for nested lambdas/mref) */
- TranslationContext<?> prev;
+ final TranslationContext<?> prev;
/** list of methods to be bridged by the meta-factory */
- List<Symbol> bridges;
+ final List<Symbol> bridges;
TranslationContext(T tree) {
this.tree = tree;
@@ -1688,6 +1684,31 @@
}
return false;
}
+
+ /**
+ * @return Name of the enclosing method to be folded into synthetic
+ * method name
+ */
+ String enclosingMethodName() {
+ return syntheticMethodNameComponent(owner.name);
+ }
+
+ /**
+ * @return Method name in a form that can be folded into a
+ * component of a synthetic method name
+ */
+ String syntheticMethodNameComponent(Name name) {
+ if (name == null) {
+ return "null";
+ }
+ String methodName = name.toString();
+ if (methodName.equals("<clinit>")) {
+ methodName = "static";
+ } else if (methodName.equals("<init>")) {
+ methodName = "new";
+ }
+ return methodName;
+ }
}
/**
@@ -1699,22 +1720,12 @@
private class LambdaTranslationContext extends TranslationContext<JCLambda> {
/** variable in the enclosing context to which this lambda is assigned */
- Symbol self;
-
- /** map from original to translated lambda parameters */
- Map<Symbol, Symbol> lambdaParams = new LinkedHashMap<Symbol, Symbol>();
-
- /** map from original to translated lambda locals */
- Map<Symbol, Symbol> lambdaLocals = new LinkedHashMap<Symbol, Symbol>();
+ final Symbol self;
- /** map from variables in enclosing scope to translated synthetic parameters */
- Map<Symbol, Symbol> capturedLocals = new LinkedHashMap<Symbol, Symbol>();
+ /** variable in the enclosing context to which this lambda is assigned */
+ final Symbol assignedTo;
- /** map from class symbols to translated synthetic parameters (for captured member access) */
- Map<Symbol, Symbol> capturedThis = new LinkedHashMap<Symbol, Symbol>();
-
- /** map from original to translated lambda locals */
- Map<Symbol, Symbol> typeVars = new LinkedHashMap<Symbol, Symbol>();
+ Map<LambdaSymbolKind, Map<Symbol, Symbol>> translatedSymbols;
/** the synthetic symbol for the method hoisting the translated lambda */
Symbol translatedSym;
@@ -1724,14 +1735,110 @@
LambdaTranslationContext(JCLambda tree) {
super(tree);
Frame frame = frameStack.head;
- if (frame.tree.hasTag(VARDEF)) {
- self = ((JCVariableDecl)frame.tree).sym;
- }
- Name name = isSerializable() ? serializedLambdaName(owner) : lambdaName();
- this.translatedSym = makePrivateSyntheticMethod(0, name, null, owner.enclClass());
+ switch (frame.tree.getTag()) {
+ case VARDEF:
+ assignedTo = self = ((JCVariableDecl) frame.tree).sym;
+ break;
+ case ASSIGN:
+ self = null;
+ assignedTo = TreeInfo.symbol(((JCAssign) frame.tree).getVariable());
+ break;
+ default:
+ assignedTo = self = null;
+ break;
+ }
+
+ // This symbol will be filled-in in complete
+ this.translatedSym = makePrivateSyntheticMethod(0, null, null, owner.enclClass());
+
if (dumpLambdaToMethodStats) {
log.note(tree, "lambda.stat", needsAltMetafactory(), translatedSym);
}
+ translatedSymbols = new EnumMap<>(LambdaSymbolKind.class);
+
+ translatedSymbols.put(PARAM, new LinkedHashMap<Symbol, Symbol>());
+ translatedSymbols.put(LOCAL_VAR, new LinkedHashMap<Symbol, Symbol>());
+ translatedSymbols.put(CAPTURED_VAR, new LinkedHashMap<Symbol, Symbol>());
+ translatedSymbols.put(CAPTURED_THIS, new LinkedHashMap<Symbol, Symbol>());
+ translatedSymbols.put(TYPE_VAR, new LinkedHashMap<Symbol, Symbol>());
+ }
+
+ /**
+ * For a serializable lambda, generate a disambiguating string
+ * which maximizes stability across deserialization.
+ *
+ * @return String to differentiate synthetic lambda method names
+ */
+ private String serializedLambdaDisambiguation() {
+ StringBuilder buf = new StringBuilder();
+ // Append the enclosing method signature to differentiate
+ // overloaded enclosing methods. For lambdas enclosed in
+ // lambdas, the generated lambda method will not have type yet,
+ // but the enclosing method's name will have been generated
+ // with this same method, so it will be unique and never be
+ // overloaded.
+ Assert.check(
+ owner.type != null ||
+ directlyEnclosingLambda() != null);
+ if (owner.type != null) {
+ buf.append(typeSig(owner.type));
+ buf.append(":");
+ }
+
+ // Add target type info
+ buf.append(types.findDescriptorSymbol(tree.type.tsym).owner.flatName());
+ buf.append(" ");
+
+ // Add variable assigned to
+ if (assignedTo != null) {
+ buf.append(assignedTo.flatName());
+ buf.append("=");
+ }
+ //add captured locals info: type, name, order
+ for (Symbol fv : getSymbolMap(CAPTURED_VAR).keySet()) {
+ if (fv != self) {
+ buf.append(typeSig(fv.type));
+ buf.append(" ");
+ buf.append(fv.flatName());
+ buf.append(",");
+ }
+ }
+
+ return buf.toString();
+ }
+
+ /**
+ * For a non-serializable lambda, generate a simple method.
+ *
+ * @return Name to use for the synthetic lambda method name
+ */
+ private Name lambdaName() {
+ return names.lambda.append(names.fromString(enclosingMethodName() + "$" + lambdaCount++));
+ }
+
+ /**
+ * For a serializable lambda, generate a method name which maximizes
+ * name stability across deserialization.
+ *
+ * @return Name to use for the synthetic lambda method name
+ */
+ private Name serializedLambdaName() {
+ StringBuilder buf = new StringBuilder();
+ buf.append(names.lambda);
+ // Append the name of the method enclosing the lambda.
+ buf.append(enclosingMethodName());
+ buf.append('$');
+ // Append a hash of the disambiguating string : enclosing method
+ // signature, etc.
+ String disam = serializedLambdaDisambiguation();
+ buf.append(Integer.toHexString(disam.hashCode()));
+ buf.append('$');
+ // The above appended name components may not be unique, append
+ // a count based on the above name components.
+ buf.append(syntheticMethodNameCounts.getIndex(buf));
+ String result = buf.toString();
+ //System.err.printf("serializedLambdaName: %s -- %s\n", result, disam);
+ return names.fromString(result);
}
/**
@@ -1755,7 +1862,7 @@
((VarSymbol)ret).pos = ((VarSymbol)sym).pos;
break;
case CAPTURED_VAR:
- ret = new VarSymbol(SYNTHETIC | FINAL, name, types.erasure(sym.type), translatedSym) {
+ ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym) {
@Override
public Symbol baseSymbol() {
//keep mapping with original captured symbol
@@ -1763,8 +1870,17 @@
}
};
break;
+ case LOCAL_VAR:
+ ret = new VarSymbol(FINAL, name, types.erasure(sym.type), translatedSym);
+ ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
+ break;
+ case PARAM:
+ ret = new VarSymbol(FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym);
+ ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
+ break;
default:
ret = makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym);
+ ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
}
if (ret != sym) {
ret.setDeclarationAttributes(sym.getRawAttributes());
@@ -1774,27 +1890,22 @@
}
void addSymbol(Symbol sym, LambdaSymbolKind skind) {
- Map<Symbol, Symbol> transMap = null;
+ Map<Symbol, Symbol> transMap = getSymbolMap(skind);
Name preferredName;
switch (skind) {
case CAPTURED_THIS:
- transMap = capturedThis;
- preferredName = names.fromString("encl$" + capturedThis.size());
+ preferredName = names.fromString("encl$" + transMap.size());
break;
case CAPTURED_VAR:
- transMap = capturedLocals;
- preferredName = names.fromString("cap$" + capturedLocals.size());
+ preferredName = names.fromString("cap$" + transMap.size());
break;
case LOCAL_VAR:
- transMap = lambdaLocals;
preferredName = sym.name;
break;
case PARAM:
- transMap = lambdaParams;
preferredName = sym.name;
break;
case TYPE_VAR:
- transMap = typeVars;
preferredName = sym.name;
break;
default: throw new AssertionError();
@@ -1804,29 +1915,22 @@
}
}
- Map<Symbol, Symbol> getSymbolMap(LambdaSymbolKind... skinds) {
- LinkedHashMap<Symbol, Symbol> translationMap = new LinkedHashMap<Symbol, Symbol>();
- for (LambdaSymbolKind skind : skinds) {
- switch (skind) {
- case CAPTURED_THIS:
- translationMap.putAll(capturedThis);
- break;
- case CAPTURED_VAR:
- translationMap.putAll(capturedLocals);
- break;
- case LOCAL_VAR:
- translationMap.putAll(lambdaLocals);
- break;
- case PARAM:
- translationMap.putAll(lambdaParams);
- break;
- case TYPE_VAR:
- translationMap.putAll(typeVars);
- break;
- default: throw new AssertionError();
+ Map<Symbol, Symbol> getSymbolMap(LambdaSymbolKind skind) {
+ Map<Symbol, Symbol> m = translatedSymbols.get(skind);
+ Assert.checkNonNull(m);
+ return m;
+ }
+
+ JCTree translate(JCIdent lambdaIdent) {
+ for (Map<Symbol, Symbol> m : translatedSymbols.values()) {
+ if (m.containsKey(lambdaIdent.sym)) {
+ Symbol tSym = m.get(lambdaIdent.sym);
+ JCTree t = make.Ident(tSym).setType(lambdaIdent.type);
+ tSym.setTypeAttributes(lambdaIdent.sym.getRawTypeAttributes());
+ return t;
}
}
- return translationMap;
+ return null;
}
/**
@@ -1845,7 +1949,7 @@
// If instance access isn't needed, make it static.
// Interface instance methods must be default methods.
// Lambda methods are private synthetic.
- translatedSym.flags_field = SYNTHETIC |
+ translatedSym.flags_field = SYNTHETIC | LAMBDA_METHOD |
PRIVATE |
(thisReferenced? (inInterface? DEFAULT : 0) : STATIC);
@@ -1857,11 +1961,18 @@
//
// 1) reference to enclosing contexts captured by the lambda expression
// 2) enclosing locals captured by the lambda expression
- for (Symbol thisSym : getSymbolMap(CAPTURED_VAR, PARAM).values()) {
+ for (Symbol thisSym : getSymbolMap(CAPTURED_VAR).values()) {
+ params.append(make.VarDef((VarSymbol) thisSym, null));
+ }
+ for (Symbol thisSym : getSymbolMap(PARAM).values()) {
params.append(make.VarDef((VarSymbol) thisSym, null));
}
+ syntheticParams = params.toList();
- syntheticParams = params.toList();
+ // Compute and set the lambda name
+ translatedSym.name = isSerializable()
+ ? serializedLambdaName()
+ : lambdaName();
//prepend synthetic args to translated lambda method signature
translatedSym.type = types.createMethodTypeWithParameters(
@@ -1890,7 +2001,7 @@
this.isSuper = tree.hasKind(ReferenceKind.SUPER);
this.bridgeSym = needsBridge()
? makePrivateSyntheticMethod(isSuper ? 0 : STATIC,
- lambdaName().append(names.fromString("$bridge")), null,
+ referenceBridgeName(), null,
owner.enclClass())
: null;
if (dumpLambdaToMethodStats) {
@@ -1904,7 +2015,9 @@
* Get the opcode associated with this method reference
*/
int referenceKind() {
- return LambdaToMethod.this.referenceKind(needsBridge() ? bridgeSym : tree.sym);
+ return LambdaToMethod.this.referenceKind(needsBridge()
+ ? bridgeSym
+ : tree.sym);
}
boolean needsVarArgsConversion() {
@@ -1912,19 +2025,68 @@
}
/**
+ * Generate a disambiguating string to increase stability (important
+ * if serialized)
+ *
+ * @return String to differentiate synthetic lambda method names
+ */
+ private String referenceBridgeDisambiguation() {
+ StringBuilder buf = new StringBuilder();
+ // Append the enclosing method signature to differentiate
+ // overloaded enclosing methods.
+ if (owner.type != null) {
+ buf.append(typeSig(owner.type));
+ buf.append(":");
+ }
+
+ // Append qualifier type
+ buf.append(classSig(tree.sym.owner.type));
+
+ // Note static/instance
+ buf.append(tree.sym.isStatic()? " S " : " I ");
+
+ // Append referenced signature
+ buf.append(typeSig(tree.sym.erasure(types)));
+
+ return buf.toString();
+ }
+
+ /**
+ * Construct a unique stable name for the method reference bridge
+ *
+ * @return Name to use for the synthetic method name
+ */
+ private Name referenceBridgeName() {
+ StringBuilder buf = new StringBuilder();
+ // Append lambda ID, this is semantically significant
+ buf.append(names.lambda);
+ // Note that it is a method reference bridge
+ buf.append("MR$");
+ // Append the enclosing method name
+ buf.append(enclosingMethodName());
+ buf.append('$');
+ // Append the referenced method name
+ buf.append(syntheticMethodNameComponent(tree.sym.name));
+ buf.append('$');
+ // Append a hash of the disambiguating string : enclosing method
+ // signature, etc.
+ String disam = referenceBridgeDisambiguation();
+ buf.append(Integer.toHexString(disam.hashCode()));
+ buf.append('$');
+ // The above appended name components may not be unique, append
+ // a count based on the above name components.
+ buf.append(syntheticMethodNameCounts.getIndex(buf));
+ String result = buf.toString();
+ return names.fromString(result);
+ }
+
+ /**
* @return Is this an array operation like clone()
*/
boolean isArrayOp() {
return tree.sym.owner == syms.arrayClass;
}
- boolean isPrivateConstructor() {
- //hack needed to workaround 292 bug (8005122)
- //when 292 issue is fixed we should simply remove this
- return tree.sym.name == names.init &&
- (tree.sym.flags() & PRIVATE) != 0;
- }
-
boolean receiverAccessible() {
//hack needed to workaround 292 bug (7087658)
//when 292 issue is fixed we should remove this and change the backend
@@ -1933,12 +2095,24 @@
}
/**
+ * The VM does not support access across nested classes (8010319).
+ * Were that ever to change, this should be removed.
+ */
+ boolean isPrivateInOtherClass() {
+ return (tree.sym.flags() & PRIVATE) != 0 &&
+ !types.isSameType(
+ types.erasure(tree.sym.enclClass().asType()),
+ types.erasure(owner.enclClass().asType()));
+ }
+
+ /**
* Does this reference needs a bridge (i.e. var args need to be
* expanded or "super" is used)
*/
final boolean needsBridge() {
return isSuper || needsVarArgsConversion() || isArrayOp() ||
- isPrivateConstructor() || !receiverAccessible();
+ isPrivateInOtherClass() ||
+ !receiverAccessible();
}
Type generatedRefSig() {
@@ -1952,12 +2126,16 @@
}
// </editor-fold>
+ /*
+ * These keys provide mappings for various translated lambda symbols
+ * and the prevailing order must be maintained.
+ */
enum LambdaSymbolKind {
- CAPTURED_VAR,
- CAPTURED_THIS,
- LOCAL_VAR,
- PARAM,
- TYPE_VAR;
+ PARAM, // original to translated lambda parameters
+ LOCAL_VAR, // original to translated lambda locals
+ CAPTURED_VAR, // variables in enclosing scope to translated synthetic parameters
+ CAPTURED_THIS, // class symbols to translated synthetic parameters (for captured member access)
+ TYPE_VAR; // original to translated lambda type variables
}
/**
@@ -1966,7 +2144,7 @@
* ****************************************************************
*/
- private String methodSig(Type type) {
+ private String typeSig(Type type) {
L2MSignatureGenerator sg = new L2MSignatureGenerator();
sg.assembleSig(type);
return sg.toString();
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Fri Nov 08 17:36:14 2013 -0800
@@ -573,45 +573,51 @@
Env<AttrContext> localEnv = methodEnv(tree, env);
- DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
+ annotate.enterStart();
try {
- // Compute the method type
- m.type = signature(m, tree.typarams, tree.params,
- tree.restype, tree.recvparam,
- tree.thrown,
- localEnv);
- } finally {
- deferredLintHandler.setPos(prevLintPos);
- }
+ DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
+ try {
+ // Compute the method type
+ m.type = signature(m, tree.typarams, tree.params,
+ tree.restype, tree.recvparam,
+ tree.thrown,
+ localEnv);
+ } finally {
+ deferredLintHandler.setPos(prevLintPos);
+ }
- if (types.isSignaturePolymorphic(m)) {
- m.flags_field |= SIGNATURE_POLYMORPHIC;
- }
+ if (types.isSignaturePolymorphic(m)) {
+ m.flags_field |= SIGNATURE_POLYMORPHIC;
+ }
- // Set m.params
- ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>();
- JCVariableDecl lastParam = null;
- for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
- JCVariableDecl param = lastParam = l.head;
- params.append(Assert.checkNonNull(param.sym));
- }
- m.params = params.toList();
+ // Set m.params
+ ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>();
+ JCVariableDecl lastParam = null;
+ for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
+ JCVariableDecl param = lastParam = l.head;
+ params.append(Assert.checkNonNull(param.sym));
+ }
+ m.params = params.toList();
+
+ // mark the method varargs, if necessary
+ if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0)
+ m.flags_field |= Flags.VARARGS;
- // mark the method varargs, if necessary
- if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0)
- m.flags_field |= Flags.VARARGS;
+ localEnv.info.scope.leave();
+ if (chk.checkUnique(tree.pos(), m, enclScope)) {
+ enclScope.enter(m);
+ }
- localEnv.info.scope.leave();
- if (chk.checkUnique(tree.pos(), m, enclScope)) {
- enclScope.enter(m);
+ annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
+ // Visit the signature of the method. Note that
+ // TypeAnnotate doesn't descend into the body.
+ typeAnnotate(tree, localEnv, m, tree.pos());
+
+ if (tree.defaultValue != null)
+ annotateDefaultValueLater(tree.defaultValue, localEnv, m);
+ } finally {
+ annotate.enterDone();
}
- annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
- // Visit the signature of the method. Note that
- // TypeAnnotate doesn't descend into the body.
- typeAnnotate(tree, localEnv, m, tree.pos());
-
- if (tree.defaultValue != null)
- annotateDefaultValueLater(tree.defaultValue, localEnv, m);
}
/** Create a fresh environment for method bodies.
@@ -639,61 +645,68 @@
localEnv.info.staticLevel++;
}
DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
+ annotate.enterStart();
try {
- if (TreeInfo.isEnumInit(tree)) {
- attr.attribIdentAsEnumType(localEnv, (JCIdent)tree.vartype);
- } else {
- attr.attribType(tree.vartype, localEnv);
- if (tree.nameexpr != null) {
- attr.attribExpr(tree.nameexpr, localEnv);
- MethodSymbol m = localEnv.enclMethod.sym;
- if (m.isConstructor()) {
- Type outertype = m.owner.owner.type;
- if (outertype.hasTag(TypeTag.CLASS)) {
- checkType(tree.vartype, outertype, "incorrect.constructor.receiver.type");
- checkType(tree.nameexpr, outertype, "incorrect.constructor.receiver.name");
+ try {
+ if (TreeInfo.isEnumInit(tree)) {
+ attr.attribIdentAsEnumType(localEnv, (JCIdent)tree.vartype);
+ } else {
+ attr.attribType(tree.vartype, localEnv);
+ if (tree.nameexpr != null) {
+ attr.attribExpr(tree.nameexpr, localEnv);
+ MethodSymbol m = localEnv.enclMethod.sym;
+ if (m.isConstructor()) {
+ Type outertype = m.owner.owner.type;
+ if (outertype.hasTag(TypeTag.CLASS)) {
+ checkType(tree.vartype, outertype, "incorrect.constructor.receiver.type");
+ checkType(tree.nameexpr, outertype, "incorrect.constructor.receiver.name");
+ } else {
+ log.error(tree, "receiver.parameter.not.applicable.constructor.toplevel.class");
+ }
} else {
- log.error(tree, "receiver.parameter.not.applicable.constructor.toplevel.class");
+ checkType(tree.vartype, m.owner.type, "incorrect.receiver.type");
+ checkType(tree.nameexpr, m.owner.type, "incorrect.receiver.name");
}
- } else {
- checkType(tree.vartype, m.owner.type, "incorrect.receiver.type");
- checkType(tree.nameexpr, m.owner.type, "incorrect.receiver.name");
}
}
+ } finally {
+ deferredLintHandler.setPos(prevLintPos);
+ }
+
+ if ((tree.mods.flags & VARARGS) != 0) {
+ //if we are entering a varargs parameter, we need to
+ //replace its type (a plain array type) with the more
+ //precise VarargsType --- we need to do it this way
+ //because varargs is represented in the tree as a
+ //modifier on the parameter declaration, and not as a
+ //distinct type of array node.
+ ArrayType atype = (ArrayType)tree.vartype.type.unannotatedType();
+ tree.vartype.type = atype.makeVarargs();
+ }
+ Scope enclScope = enter.enterScope(env);
+ VarSymbol v =
+ new VarSymbol(0, tree.name, tree.vartype.type, enclScope.owner);
+ v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);
+ tree.sym = v;
+ if (tree.init != null) {
+ v.flags_field |= HASINIT;
+ if ((v.flags_field & FINAL) != 0 &&
+ needsLazyConstValue(tree.init)) {
+ Env<AttrContext> initEnv = getInitEnv(tree, env);
+ initEnv.info.enclVar = v;
+ v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
+ }
}
+ if (chk.checkUnique(tree.pos(), v, enclScope)) {
+ chk.checkTransparentVar(tree.pos(), v, enclScope);
+ enclScope.enter(v);
+ }
+ annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
+ typeAnnotate(tree.vartype, env, v, tree.pos());
+ v.pos = tree.pos;
} finally {
- deferredLintHandler.setPos(prevLintPos);
- }
-
- if ((tree.mods.flags & VARARGS) != 0) {
- //if we are entering a varargs parameter, we need to replace its type
- //(a plain array type) with the more precise VarargsType --- we need
- //to do it this way because varargs is represented in the tree as a modifier
- //on the parameter declaration, and not as a distinct type of array node.
- ArrayType atype = (ArrayType)tree.vartype.type.unannotatedType();
- tree.vartype.type = atype.makeVarargs();
+ annotate.enterDone();
}
- Scope enclScope = enter.enterScope(env);
- VarSymbol v =
- new VarSymbol(0, tree.name, tree.vartype.type, enclScope.owner);
- v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);
- tree.sym = v;
- if (tree.init != null) {
- v.flags_field |= HASINIT;
- if ((v.flags_field & FINAL) != 0 &&
- needsLazyConstValue(tree.init)) {
- Env<AttrContext> initEnv = getInitEnv(tree, env);
- initEnv.info.enclVar = v;
- v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
- }
- }
- if (chk.checkUnique(tree.pos(), v, enclScope)) {
- chk.checkTransparentVar(tree.pos(), v, enclScope);
- enclScope.enter(v);
- }
- annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
- typeAnnotate(tree.vartype, env, v, tree.pos());
- v.pos = tree.pos;
}
// where
void checkType(JCTree tree, Type type, String diag) {
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java Fri Nov 08 17:36:14 2013 -0800
@@ -1652,9 +1652,10 @@
startpc, end, code.curCP(),
catchType);
if (subCatch.type.isAnnotated()) {
- // All compounds share the same position, simply update the
- // first one.
- subCatch.type.getAnnotationMirrors().head.position.type_index = catchType;
+ for (Attribute.TypeCompound tc :
+ subCatch.type.getAnnotationMirrors()) {
+ tc.position.type_index = catchType;
+ }
}
}
gaps = gaps.tail;
@@ -1668,9 +1669,10 @@
startpc, endpc, code.curCP(),
catchType);
if (subCatch.type.isAnnotated()) {
- // All compounds share the same position, simply update the
- // first one.
- subCatch.type.getAnnotationMirrors().head.position.type_index = catchType;
+ for (Attribute.TypeCompound tc :
+ subCatch.type.getAnnotationMirrors()) {
+ tc.position.type_index = catchType;
+ }
}
}
}
@@ -2892,7 +2894,8 @@
@Override
public void visitMethodDef(JCMethodDecl tree) {
- if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0) {
+ if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0
+ && (tree.sym.flags() & LAMBDA_METHOD) == 0) {
return;
}
if (tree.name.equals(names.clinit)) {
@@ -2906,6 +2909,7 @@
return;
}
currentMethod = tree.sym;
+
super.visitMethodDef(tree);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Fri Nov 08 17:36:14 2013 -0800
@@ -271,10 +271,6 @@
*/
protected TransTypes transTypes;
- /** The lambda translator.
- */
- protected LambdaToMethod lambdaToMethod;
-
/** The syntactic sugar desweetener.
*/
protected Lower lower;
@@ -388,8 +384,6 @@
options = Options.instance(context);
- lambdaToMethod = LambdaToMethod.instance(context);
-
verbose = options.isSet(VERBOSE);
sourceOutput = options.isSet(PRINTSOURCE); // used to be -s
stubOutput = options.isSet("-stubs");
@@ -1393,6 +1387,7 @@
*/
class ScanNested extends TreeScanner {
Set<Env<AttrContext>> dependencies = new LinkedHashSet<Env<AttrContext>>();
+ protected boolean hasLambdas;
@Override
public void visitClassDef(JCClassDecl node) {
Type st = types.supertype(node.sym.type);
@@ -1402,7 +1397,18 @@
Env<AttrContext> stEnv = enter.getEnv(c);
if (stEnv != null && env != stEnv) {
if (dependencies.add(stEnv)) {
- scan(stEnv.tree);
+ boolean prevHasLambdas = hasLambdas;
+ try {
+ scan(stEnv.tree);
+ } finally {
+ /*
+ * ignore any updates to hasLambdas made during
+ * the nested scan, this ensures an initalized
+ * LambdaToMethod is available only to those
+ * classes that contain lambdas
+ */
+ hasLambdas = prevHasLambdas;
+ }
}
envForSuperTypeFound = true;
}
@@ -1410,6 +1416,16 @@
}
super.visitClassDef(node);
}
+ @Override
+ public void visitLambda(JCLambda tree) {
+ hasLambdas = true;
+ super.visitLambda(tree);
+ }
+ @Override
+ public void visitReference(JCMemberReference tree) {
+ hasLambdas = true;
+ super.visitReference(tree);
+ }
}
ScanNested scanner = new ScanNested();
scanner.scan(env.tree);
@@ -1468,11 +1484,11 @@
env.tree = transTypes.translateTopLevelClass(env.tree, localMake);
compileStates.put(env, CompileState.TRANSTYPES);
- if (source.allowLambda()) {
+ if (source.allowLambda() && scanner.hasLambdas) {
if (shouldStop(CompileState.UNLAMBDA))
return;
- env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake);
+ env.tree = LambdaToMethod.instance(context).translateTopLevelClass(env, env.tree, localMake);
compileStates.put(env, CompileState.UNLAMBDA);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/JavacMessages.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/JavacMessages.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -184,19 +184,19 @@
String key,
Object... args) {
String msg = null;
- for (List<ResourceBundle> l = bundles; l.nonEmpty() && msg == null; l = l.tail) {
- ResourceBundle rb = l.head;
- try {
- msg = rb.getString(key);
- }
- catch (MissingResourceException e) {
- // ignore, try other bundles in list
- }
- }
- if (msg == null) {
- msg = "compiler message file broken: key=" + key +
- " arguments={0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}";
- }
- return MessageFormat.format(msg, args);
+ for (List<ResourceBundle> l = bundles; l.nonEmpty() && msg == null; l = l.tail) {
+ ResourceBundle rb = l.head;
+ try {
+ msg = rb.getString(key);
+ }
+ catch (MissingResourceException e) {
+ // ignore, try other bundles in list
+ }
+ }
+ if (msg == null) {
+ msg = "compiler message file broken: key=" + key +
+ " arguments={0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}";
+ }
+ return MessageFormat.format(msg, args);
}
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Fri Nov 08 17:36:14 2013 -0800
@@ -800,7 +800,7 @@
return result;
}
- void initDoclint(Collection<String> opts) {
+ void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
ArrayList<String> doclintOpts = new ArrayList<String>();
for (String opt: opts) {
@@ -814,6 +814,15 @@
return;
}
+ String sep = "";
+ StringBuilder customTags = new StringBuilder();
+ for (String customTag : customTagNames) {
+ customTags.append(sep);
+ customTags.append(customTag);
+ sep = DocLint.TAGS_SEPARATOR;
+ }
+ doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
+
JavacTask t = BasicJavacTask.instance(context);
doclint = new DocLint();
// standard doclet normally generates H1, H2
--- a/langtools/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java Fri Nov 08 17:36:14 2013 -0800
@@ -377,8 +377,8 @@
return env.fileManager;
}
- public void initDocLint(Collection<String> opts) {
- env.initDoclint(opts);
+ public void initDocLint(Collection<String> opts, Collection<String> customTagNames) {
+ env.initDoclint(opts, customTagNames);
}
public boolean showTagMessages() {
--- a/langtools/src/share/classes/com/sun/tools/jdeps/Analyzer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Analyzer.java Fri Nov 08 17:36:14 2013 -0800
@@ -26,9 +26,11 @@
import com.sun.tools.classfile.Dependency.Location;
import com.sun.tools.jdeps.PlatformClassPath.JDKArchive;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
@@ -52,7 +54,7 @@
private final Type type;
private final Map<Archive, ArchiveDeps> results = new HashMap<>();
- private final Map<String, Archive> map = new HashMap<>();
+ private final Map<Location, Archive> map = new HashMap<>();
private final Archive NOT_FOUND
= new Archive(JdepsTask.getMessage("artifact.not.found"));
@@ -69,6 +71,17 @@
* Performs the dependency analysis on the given archives.
*/
public void run(List<Archive> archives) {
+ // build a map from Location to Archive
+ for (Archive archive: archives) {
+ for (Location l: archive.getClasses()) {
+ if (!map.containsKey(l)) {
+ map.put(l, archive);
+ } else {
+ // duplicated class warning?
+ }
+ }
+ }
+ // traverse and analyze all dependencies
for (Archive archive : archives) {
ArchiveDeps deps;
if (type == Type.CLASS || type == Type.VERBOSE) {
@@ -76,33 +89,9 @@
} else {
deps = new PackageVisitor(archive);
}
- archive.visit(deps);
+ archive.visitDependences(deps);
results.put(archive, deps);
}
-
- // set the required dependencies
- for (ArchiveDeps result: results.values()) {
- for (Set<String> set : result.deps.values()) {
- for (String target : set) {
- Archive source = getArchive(target);
- if (result.archive != source) {
- String profile = "";
- if (source instanceof JDKArchive) {
- profile = result.profile != null ? result.profile.toString() : "";
- if (result.getTargetProfile(target) == null) {
- profile += ", JDK internal API";
- // override the value if it accesses any JDK internal
- result.requireArchives.put(source, profile);
- continue;
- }
- }
- if (!result.requireArchives.containsKey(source)) {
- result.requireArchives.put(source, profile);
- }
- }
- }
- }
- }
}
public boolean hasDependences(Archive archive) {
@@ -117,94 +106,143 @@
* Visits the source archive to its destination archive of
* a recorded dependency.
*/
- void visitArchiveDependence(Archive origin, Archive target, String profile);
+ void visitArchiveDependence(Archive origin, Archive target, Profile profile);
/**
* Visits a recorded dependency from origin to target which can be
* a fully-qualified classname, a package name, a profile or
* archive name depending on the Analyzer's type.
*/
- void visitDependence(String origin, Archive source, String target, Archive archive, String profile);
+ void visitDependence(String origin, Archive source, String target, Archive archive, Profile profile);
}
public void visitArchiveDependences(Archive source, Visitor v) {
ArchiveDeps r = results.get(source);
- for (Map.Entry<Archive,String> e : r.requireArchives.entrySet()) {
- v.visitArchiveDependence(r.archive, e.getKey(), e.getValue());
+ for (ArchiveDeps.Dep d: r.requireArchives()) {
+ v.visitArchiveDependence(r.archive, d.archive, d.profile);
}
}
public void visitDependences(Archive source, Visitor v) {
ArchiveDeps r = results.get(source);
- for (String origin : r.deps.keySet()) {
- for (String target : r.deps.get(origin)) {
- Archive archive = getArchive(target);
- assert source == getArchive(origin);
- Profile profile = r.getTargetProfile(target);
-
+ for (Map.Entry<String, SortedSet<ArchiveDeps.Dep>> e: r.deps.entrySet()) {
+ String origin = e.getKey();
+ for (ArchiveDeps.Dep d: e.getValue()) {
// filter intra-dependency unless in verbose mode
- if (type == Type.VERBOSE || archive != source) {
- v.visitDependence(origin, source, target, archive,
- profile != null ? profile.toString() : "");
+ if (type == Type.VERBOSE || d.archive != source) {
+ v.visitDependence(origin, source, d.target, d.archive, d.profile);
}
}
}
}
- public Archive getArchive(String name) {
- return map.containsKey(name) ? map.get(name) : NOT_FOUND;
- }
-
+ /**
+ * ArchiveDeps contains the dependencies for an Archive that
+ * can have one or more classes.
+ */
private abstract class ArchiveDeps implements Archive.Visitor {
final Archive archive;
- final Map<Archive,String> requireArchives;
- final SortedMap<String, SortedSet<String>> deps;
- Profile profile = null;
+ final SortedMap<String, SortedSet<Dep>> deps;
ArchiveDeps(Archive archive) {
this.archive = archive;
- this.requireArchives = new HashMap<>();
this.deps = new TreeMap<>();
}
- void add(String loc) {
- Archive a = map.get(loc);
- if (a == null) {
- map.put(loc, archive);
- } else if (a != archive) {
- // duplicated class warning?
- }
- }
-
- void add(String origin, String target) {
- SortedSet<String> set = deps.get(origin);
+ void add(String origin, String target, Archive targetArchive, String pkgName) {
+ SortedSet<Dep> set = deps.get(origin);
if (set == null) {
deps.put(origin, set = new TreeSet<>());
}
- if (!set.contains(target)) {
- set.add(target);
- // find the corresponding profile
- Profile p = getTargetProfile(target);
- if (profile == null || (p != null && profile.profile < p.profile)) {
- profile = p;
+ Profile p = targetArchive instanceof JDKArchive
+ ? Profile.getProfile(pkgName) : null;
+ set.add(new Dep(target, targetArchive, p));
+ }
+
+ /**
+ * Returns the list of Archive dependences. The returned
+ * list contains one {@code Dep} instance per one archive
+ * and with the minimum profile this archive depends on.
+ */
+ List<Dep> requireArchives() {
+ Map<Archive,Profile> map = new HashMap<>();
+ for (Set<Dep> set: deps.values()) {
+ for (Dep d: set) {
+ if (this.archive != d.archive) {
+ Profile p = map.get(d.archive);
+ if (p == null || (d.profile != null && p.profile < d.profile.profile)) {
+ map.put(d.archive, d.profile);
+ }
+ }
}
}
+ List<Dep> list = new ArrayList<>();
+ for (Map.Entry<Archive,Profile> e: map.entrySet()) {
+ list.add(new Dep("", e.getKey(), e.getValue()));
+ }
+ return list;
+ }
+
+ /**
+ * Dep represents a dependence where the target can be
+ * a classname or packagename and the archive and profile
+ * the target belongs to.
+ */
+ class Dep implements Comparable<Dep> {
+ final String target;
+ final Archive archive;
+ final Profile profile;
+ Dep(String target, Archive archive, Profile p) {
+ this.target = target;
+ this.archive = archive;
+ this.profile = p;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof Dep) {
+ Dep d = (Dep)o;
+ return this.archive == d.archive && this.target.equals(d.target);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 3;
+ hash = 17 * hash + Objects.hashCode(this.archive);
+ hash = 17 * hash + Objects.hashCode(this.target);
+ return hash;
+ }
+
+ @Override
+ public int compareTo(Dep o) {
+ if (this.target.equals(o.target)) {
+ if (this.archive == o.archive) {
+ return 0;
+ } else {
+ return this.archive.getFileName().compareTo(o.archive.getFileName());
+ }
+ }
+ return this.target.compareTo(o.target);
+ }
}
public abstract void visit(Location o, Location t);
- public abstract Profile getTargetProfile(String target);
}
private class ClassVisitor extends ArchiveDeps {
ClassVisitor(Archive archive) {
super(archive);
}
- public void visit(Location l) {
- add(l.getClassName());
- }
+ @Override
public void visit(Location o, Location t) {
- add(o.getClassName(), t.getClassName());
- }
- public Profile getTargetProfile(String target) {
- int i = target.lastIndexOf('.');
- return (i > 0) ? Profile.getProfile(target.substring(0, i)) : null;
+ Archive targetArchive =
+ this.archive.getClasses().contains(t) ? this.archive : map.get(t);
+ if (targetArchive == null) {
+ map.put(t, targetArchive = NOT_FOUND);
+ }
+
+ String origin = o.getClassName();
+ String target = t.getClassName();
+ add(origin, target, targetArchive, t.getPackageName());
}
}
@@ -212,18 +250,21 @@
PackageVisitor(Archive archive) {
super(archive);
}
+ @Override
public void visit(Location o, Location t) {
- add(packageOf(o), packageOf(t));
- }
- public void visit(Location l) {
- add(packageOf(l));
+ Archive targetArchive =
+ this.archive.getClasses().contains(t) ? this.archive : map.get(t);
+ if (targetArchive == null) {
+ map.put(t, targetArchive = NOT_FOUND);
+ }
+
+ String origin = packageOf(o);
+ String target = packageOf(t);
+ add(origin, target, targetArchive, t.getPackageName());
}
- private String packageOf(Location loc) {
- String pkg = loc.getPackageName();
+ public String packageOf(Location o) {
+ String pkg = o.getPackageName();
return pkg.isEmpty() ? "<unnamed>" : pkg;
}
- public Profile getTargetProfile(String target) {
- return Profile.getProfile(target);
- }
}
}
--- a/langtools/src/share/classes/com/sun/tools/jdeps/Archive.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Archive.java Fri Nov 08 17:36:14 2013 -0800
@@ -67,6 +67,7 @@
deps.put(origin, set);
}
}
+
public void addClass(Location origin, Location target) {
Set<Location> set = deps.get(origin);
if (set == null) {
@@ -76,21 +77,27 @@
set.add(target);
}
- public void visit(Visitor v) {
+ public Set<Location> getClasses() {
+ return deps.keySet();
+ }
+
+ public void visitDependences(Visitor v) {
for (Map.Entry<Location,Set<Location>> e: deps.entrySet()) {
- v.visit(e.getKey());
for (Location target : e.getValue()) {
v.visit(e.getKey(), target);
}
}
}
+ public String getPathName() {
+ return path != null ? path.toString() : filename;
+ }
+
public String toString() {
- return path != null ? path.toString() : filename;
+ return filename;
}
interface Visitor {
- void visit(Location loc);
void visit(Location origin, Location target);
}
}
--- a/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java Fri Nov 08 17:36:14 2013 -0800
@@ -190,6 +190,11 @@
task.options.fullVersion = true;
}
},
+ new HiddenOption(false, "-showlabel") {
+ void process(JdepsTask task, String opt, String arg) {
+ task.options.showLabel = true;
+ }
+ },
new HiddenOption(true, "-depth") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
try {
@@ -279,12 +284,21 @@
private void generateDotFiles(Path dir, Analyzer analyzer) throws IOException {
Path summary = dir.resolve("summary.dot");
- try (PrintWriter sw = new PrintWriter(Files.newOutputStream(summary));
- DotFileFormatter formatter = new DotFileFormatter(sw, "summary")) {
- for (Archive archive : sourceLocations) {
- analyzer.visitArchiveDependences(archive, formatter);
+ boolean verbose = options.verbose == Analyzer.Type.VERBOSE;
+ DotGraph<?> graph = verbose ? new DotSummaryForPackage()
+ : new DotSummaryForArchive();
+ for (Archive archive : sourceLocations) {
+ analyzer.visitArchiveDependences(archive, graph);
+ if (verbose || options.showLabel) {
+ // traverse detailed dependences to generate package-level
+ // summary or build labels for edges
+ analyzer.visitDependences(archive, graph);
}
}
+ try (PrintWriter sw = new PrintWriter(Files.newOutputStream(summary))) {
+ graph.writeTo(sw);
+ }
+ // output individual .dot file for each archive
if (options.verbose != Analyzer.Type.SUMMARY) {
for (Archive archive : sourceLocations) {
if (analyzer.hasDependences(archive)) {
@@ -365,17 +379,16 @@
}
}
}
+ sourceLocations.addAll(archives);
List<Archive> classpaths = new ArrayList<>(); // for class file lookup
+ classpaths.addAll(getClassPathArchives(options.classpath));
if (options.includePattern != null) {
- archives.addAll(getClassPathArchives(options.classpath));
- } else {
- classpaths.addAll(getClassPathArchives(options.classpath));
+ archives.addAll(classpaths);
}
classpaths.addAll(PlatformClassPath.getArchives());
- // add all archives to the source locations for reporting
- sourceLocations.addAll(archives);
+ // add all classpath archives to the source locations for reporting
sourceLocations.addAll(classpaths);
// Work queue of names of classfiles to be searched.
@@ -557,6 +570,7 @@
boolean showSummary;
boolean wildcard;
boolean apiOnly;
+ boolean showLabel;
String dotOutputDir;
String classpath = "";
int depth = 1;
@@ -627,16 +641,34 @@
return result;
}
+ /**
+ * If the given archive is JDK archive and non-null Profile,
+ * this method returns the profile name only if -profile option is specified;
+ * a null profile indicates it accesses a private JDK API and this method
+ * will return "JDK internal API".
+ *
+ * For non-JDK archives, this method returns the file name of the archive.
+ */
+ private String getProfileArchiveInfo(Archive source, Profile profile) {
+ if (options.showProfile && profile != null)
+ return profile.toString();
+
+ if (source instanceof JDKArchive) {
+ return profile == null ? "JDK internal API (" + source.getFileName() + ")" : "";
+ }
+ return source.getFileName();
+ }
/**
- * Returns the file name of the archive for non-JRE class or
- * internal JRE classes. It returns empty string for SE API.
+ * Returns the profile name or "JDK internal API" for JDK archive;
+ * otherwise empty string.
*/
- private static String getArchiveName(Archive source, String profile) {
- String name = source.getFileName();
- if (source instanceof JDKArchive)
- return profile.isEmpty() ? "JDK internal API (" + name + ")" : "";
- return name;
+ private String profileName(Archive archive, Profile profile) {
+ if (archive instanceof JDKArchive) {
+ return Objects.toString(profile, "JDK internal API");
+ } else {
+ return "";
+ }
}
class RawOutputFormatter implements Analyzer.Visitor {
@@ -648,21 +680,18 @@
private String pkg = "";
@Override
public void visitDependence(String origin, Archive source,
- String target, Archive archive, String profile) {
+ String target, Archive archive, Profile profile) {
if (!origin.equals(pkg)) {
pkg = origin;
writer.format(" %s (%s)%n", origin, source.getFileName());
}
- String name = (options.showProfile && !profile.isEmpty())
- ? profile
- : getArchiveName(archive, profile);
- writer.format(" -> %-50s %s%n", target, name);
+ writer.format(" -> %-50s %s%n", target, getProfileArchiveInfo(archive, profile));
}
@Override
- public void visitArchiveDependence(Archive origin, Archive target, String profile) {
- writer.format("%s -> %s", origin, target);
- if (options.showProfile && !profile.isEmpty()) {
+ public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
+ writer.format("%s -> %s", origin.getPathName(), target.getPathName());
+ if (options.showProfile && profile != null) {
writer.format(" (%s)%n", profile);
} else {
writer.format("%n");
@@ -670,19 +699,14 @@
}
}
- class DotFileFormatter implements Analyzer.Visitor, AutoCloseable {
+ class DotFileFormatter extends DotGraph<String> implements AutoCloseable {
private final PrintWriter writer;
private final String name;
- DotFileFormatter(PrintWriter writer, String name) {
- this.writer = writer;
- this.name = name;
- writer.format("digraph \"%s\" {%n", name);
- }
DotFileFormatter(PrintWriter writer, Archive archive) {
this.writer = writer;
this.name = archive.getFileName();
writer.format("digraph \"%s\" {%n", name);
- writer.format(" // Path: %s%n", archive.toString());
+ writer.format(" // Path: %s%n", archive.getPathName());
}
@Override
@@ -690,39 +714,169 @@
writer.println("}");
}
- private final Set<String> edges = new HashSet<>();
- private String node = "";
@Override
public void visitDependence(String origin, Archive source,
- String target, Archive archive, String profile) {
- if (!node.equals(origin)) {
- edges.clear();
- node = origin;
- }
+ String target, Archive archive, Profile profile) {
// if -P option is specified, package name -> profile will
// be shown and filter out multiple same edges.
- if (!edges.contains(target)) {
- StringBuilder sb = new StringBuilder();
- String name = options.showProfile && !profile.isEmpty()
- ? profile
- : getArchiveName(archive, profile);
- writer.format(" %-50s -> %s;%n",
- String.format("\"%s\"", origin),
- name.isEmpty() ? String.format("\"%s\"", target)
- : String.format("\"%s (%s)\"", target, name));
- edges.add(target);
+ String name = getProfileArchiveInfo(archive, profile);
+ writeEdge(writer, new Edge(origin, target, getProfileArchiveInfo(archive, profile)));
+ }
+ @Override
+ public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ class DotSummaryForArchive extends DotGraph<Archive> {
+ @Override
+ public void visitDependence(String origin, Archive source,
+ String target, Archive archive, Profile profile) {
+ Edge e = findEdge(source, archive);
+ assert e != null;
+ // add the dependency to the label if enabled and not compact1
+ if (profile == Profile.COMPACT1) {
+ return;
+ }
+ e.addLabel(origin, target, profileName(archive, profile));
+ }
+ @Override
+ public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
+ // add an edge with the archive's name with no tag
+ // so that there is only one node for each JDK archive
+ // while there may be edges to different profiles
+ Edge e = addEdge(origin, target, "");
+ if (target instanceof JDKArchive) {
+ // add a label to print the profile
+ if (profile == null) {
+ e.addLabel("JDK internal API");
+ } else if (options.showProfile && !options.showLabel) {
+ e.addLabel(profile.toString());
+ }
}
}
+ }
+ // DotSummaryForPackage generates the summary.dot file for verbose mode
+ // (-v or -verbose option) that includes all class dependencies.
+ // The summary.dot file shows package-level dependencies.
+ class DotSummaryForPackage extends DotGraph<String> {
+ private String packageOf(String cn) {
+ int i = cn.lastIndexOf('.');
+ return i > 0 ? cn.substring(0, i) : "<unnamed>";
+ }
+ @Override
+ public void visitDependence(String origin, Archive source,
+ String target, Archive archive, Profile profile) {
+ // add a package dependency edge
+ String from = packageOf(origin);
+ String to = packageOf(target);
+ Edge e = addEdge(from, to, getProfileArchiveInfo(archive, profile));
+
+ // add the dependency to the label if enabled and not compact1
+ if (!options.showLabel || profile == Profile.COMPACT1) {
+ return;
+ }
+
+ // trim the package name of origin to shorten the label
+ int i = origin.lastIndexOf('.');
+ String n1 = i < 0 ? origin : origin.substring(i+1);
+ e.addLabel(n1, target, profileName(archive, profile));
+ }
@Override
- public void visitArchiveDependence(Archive origin, Archive target, String profile) {
- String name = options.showProfile && !profile.isEmpty()
- ? profile : "";
- writer.format(" %-30s -> \"%s\";%n",
- String.format("\"%s\"", origin.getFileName()),
- name.isEmpty()
- ? target.getFileName()
- : String.format("%s (%s)", target.getFileName(), name));
+ public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
+ // nop
+ }
+ }
+ abstract class DotGraph<T> implements Analyzer.Visitor {
+ private final Set<Edge> edges = new LinkedHashSet<>();
+ private Edge curEdge;
+ public void writeTo(PrintWriter writer) {
+ writer.format("digraph \"summary\" {%n");
+ for (Edge e: edges) {
+ writeEdge(writer, e);
+ }
+ writer.println("}");
+ }
+
+ void writeEdge(PrintWriter writer, Edge e) {
+ writer.format(" %-50s -> \"%s\"%s;%n",
+ String.format("\"%s\"", e.from.toString()),
+ e.tag.isEmpty() ? e.to
+ : String.format("%s (%s)", e.to, e.tag),
+ getLabel(e));
+ }
+
+ Edge addEdge(T origin, T target, String tag) {
+ Edge e = new Edge(origin, target, tag);
+ if (e.equals(curEdge)) {
+ return curEdge;
+ }
+
+ if (edges.contains(e)) {
+ for (Edge e1 : edges) {
+ if (e.equals(e1)) {
+ curEdge = e1;
+ }
+ }
+ } else {
+ edges.add(e);
+ curEdge = e;
+ }
+ return curEdge;
+ }
+
+ Edge findEdge(T origin, T target) {
+ for (Edge e : edges) {
+ if (e.from.equals(origin) && e.to.equals(target)) {
+ return e;
+ }
+ }
+ return null;
+ }
+
+ String getLabel(Edge e) {
+ String label = e.label.toString();
+ return label.isEmpty() ? "" : String.format("[label=\"%s\",fontsize=9]", label);
+ }
+
+ class Edge {
+ final T from;
+ final T to;
+ final String tag; // optional tag
+ final StringBuilder label = new StringBuilder();
+ Edge(T from, T to, String tag) {
+ this.from = from;
+ this.to = to;
+ this.tag = tag;
+ }
+ void addLabel(String s) {
+ label.append(s).append("\\n");
+ }
+ void addLabel(String origin, String target, String profile) {
+ label.append(origin).append(" -> ").append(target);
+ if (!profile.isEmpty()) {
+ label.append(" (" + profile + ")");
+ }
+ label.append("\\n");
+ }
+ @Override @SuppressWarnings("unchecked")
+ public boolean equals(Object o) {
+ if (o instanceof DotGraph<?>.Edge) {
+ DotGraph<?>.Edge e = (DotGraph<?>.Edge)o;
+ return this.from.equals(e.from) &&
+ this.to.equals(e.to) &&
+ this.tag.equals(e.tag);
+ }
+ return false;
+ }
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 67 * hash + Objects.hashCode(this.from) +
+ Objects.hashCode(this.to) + Objects.hashCode(this.tag);
+ return hash;
+ }
}
}
}
--- a/langtools/src/share/classes/com/sun/tools/jdeps/Profile.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Profile.java Fri Nov 08 17:36:14 2013 -0800
@@ -81,8 +81,12 @@
}
static class PackageToProfile {
+ static String[] JAVAX_CRYPTO_PKGS = new String[] {
+ "javax.crypto",
+ "javax.crypto.interfaces",
+ "javax.crypto.spec"
+ };
static Map<String, Profile> map = initProfiles();
-
private static Map<String, Profile> initProfiles() {
try {
String profilesProps = System.getProperty("jdeps.profiles");
@@ -103,6 +107,9 @@
findProfile(cf);
}
}
+ // special case for javax.crypto.* classes that are not
+ // included in ct.sym since they are in jce.jar
+ Collections.addAll(Profile.COMPACT1.packages, JAVAX_CRYPTO_PKGS);
}
}
} catch (IOException | ConstantPoolException e) {
--- a/langtools/src/share/classes/javax/annotation/processing/Processor.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/javax/annotation/processing/Processor.java Fri Nov 08 17:36:14 2013 -0800
@@ -209,11 +209,11 @@
* <dl>
* <dt><i>SupportedOptionString:</i>
* <dd><i>Identifiers</i>
- * <p>
+ *
* <dt><i>Identifiers:</i>
* <dd> <i>Identifier</i>
* <dd> <i>Identifier</i> {@code .} <i>Identifiers</i>
- * <p>
+ *
* <dt><i>Identifier:</i>
* <dd>Syntactic identifier, including keywords and literals
* </dl>
@@ -250,7 +250,7 @@
* <dt><i>SupportedAnnotationTypeString:</i>
* <dd><i>TypeName</i> <i>DotStar</i><sub><i>opt</i></sub>
* <dd><tt>*</tt>
- * <p>
+ *
* <dt><i>DotStar:</i>
* <dd><tt>.</tt> <tt>*</tt>
* </dl>
--- a/langtools/src/share/classes/jdk/Exported.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/src/share/classes/jdk/Exported.java Fri Nov 08 17:36:14 2013 -0800
@@ -38,7 +38,30 @@
* com.sun.*} are official parts of the JDK meant to be generally
* usable while other portions of {@code com.sun.*} are not. This
* annotation type allows those portions to be easily and
- * programmaticly distinguished.
+ * programmatically distinguished.
+ *
+ * <p>If in one release a type or package is
+ * <code>@Exported(true)</code>, in a subsequent major release such a
+ * type or package can transition to <code>@Exported(false)</code>.
+ *
+ * <p>If a type or package is <code>@Exported(false)</code> in a
+ * release, it may be removed in a subsequent major release.
+ *
+ * <p>If a top-level type has an <code>@Exported</code> annotation,
+ * any nested member types with the top-level type should have an
+ * <code>@Exported</code> annotation with the same value.
+ *
+ * (In exceptional cases, if a nested type is going to be removed
+ * before its enclosing type, the nested type's could be
+ * <code>@Exported(false)</code> while its enclosing type was
+ * <code>@Exported(true)</code>.)
+ *
+ * Likewise, if a package has an <code>@Exported</code> annotation,
+ * top-level types within that package should also have an
+ * <code>@Exported</code> annotation.
+ *
+ * Sometimes a top-level type may have a different
+ * <code>@Exported</code> value than its package.
*
* @since 1.8
*/
--- a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4651598
+ * @bug 4651598 8026567
* @summary Javadoc wrongly inserts </DD> tags when using multiple @author tags
* @author dkramer
* @run main AuthorDD
@@ -86,12 +86,12 @@
// Test single @since tag:
- { "<dt><span class=\"strong\">Since:</span></dt>"+NL+"<dd>JDK 1.0</dd>",
+ { "<dt><span class=\"simpleTagLabel\">Since:</span></dt>"+NL+"<dd>JDK 1.0</dd>",
BUGID + FS + "p1" + FS + "C1.html" },
// Test multiple @author tags:
- { "<dt><span class=\"strong\">Author:</span></dt>"+NL+"<dd>Doug Kramer, Jamie, Neal</dd>",
+ { "<dt><span class=\"simpleTagLabel\">Author:</span></dt>"+NL+"<dd>Doug Kramer, Jamie, Neal</dd>",
BUGID + FS + "p1" + FS + "C1.html" },
};
--- a/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4973609 8015249 8025633
+ * @bug 4973609 8015249 8025633 8026567
* @summary Make sure that annotation types with 0 members does not have
* extra HR tags.
* @author jamieh
@@ -55,7 +55,7 @@
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
"<h3>Field Summary</h3>"},
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../" +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../" +
"pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>" +
"</code> </td>"},
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
--- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4652655 4857717 8025633
+ * @bug 4652655 4857717 8025633 8026567
* @summary This test verifies that class cross references work properly.
* @author jamieh
* @library ../lib/
@@ -48,7 +48,7 @@
"<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" " +
"title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>"},
{BUG_ID + FS + "C.html",
- "<dl>" + NL + "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dl>" + NL + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code>toString</code> in class <code>java.lang.Object</code></dd>" + NL +
"</dl>"}
};
--- a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4632553 4973607
+ * @bug 4632553 4973607 8026567
* @summary No need to include type name (class, interface, etc.) before
* every single type in class tree.
* Make sure class tree includes heirarchy for enums and annotation
@@ -49,12 +49,12 @@
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
"<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " +
- "title=\"class in pkg\"><span class=\"strong\">ParentClass</span></a>"},
+ "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>"},
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
"<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>" + NL +
"<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " +
- "title=\"annotation in pkg\"><span class=\"strong\">AnnotationType</span></a> " +
+ "title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> " +
"(implements java.lang.annotation.Annotation)</li>" + NL + "</ul>"},
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
@@ -63,14 +63,14 @@
"<li type=\"circle\">java.lang.Enum<E> (implements java.lang." +
"Comparable<T>, java.io.Serializable)" + NL + "<ul>" + NL +
"<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " +
- "title=\"enum in pkg\"><span class=\"strong\">Coin</span></a></li>" + NL +
+ "title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>" + NL +
"</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>"
},
};
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
"<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " +
- "title=\"class in pkg\"><span class=\"strong\">ParentClass</span></a></li>"}
+ "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>"}
};
/**
--- a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4904037
+ * @bug 4904037 8026567
* @summary The constructor comments should be surrounded by
* <dl></dl>. Check for this in the output.
* @author jamieh
@@ -47,7 +47,7 @@
private static final String[][] TEST = {
{BUG_ID + FS + "C.html", "<div class=\"block\">" +
"This is just a simple constructor.</div>" + NL +
- "<dl>" + NL + "<dt><span class=\"strong\">Parameters:</span></dt>" + NL +
+ "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL +
"<dd><code>i</code> - a param.</dd>" + NL +"</dl>"
}
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testCustomTag/TagTestClass.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @customTag A custom tag.
+ * @unknownTag An unknown tag
+ */
+public class TagTestClass {
+
+ public void method(){}
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,109 @@
+/*
+ * 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 8006248
+ * @summary Test custom tag. Verify that an unknown tag generates appropriate warnings.
+ * @author Bhavesh Patel
+ * @library ../lib/
+ * @build JavadocTester taglets.CustomTag TestCustomTag
+ * @run main TestCustomTag
+ */
+
+public class TestCustomTag extends JavadocTester {
+
+ //Test information.
+ private static final String BUG_ID = "8006248";
+
+ //Javadoc arguments.
+ private static final String[] ARGS = new String[] {
+ "-Xdoclint:none", "-d", BUG_ID, "-tagletpath", SRC_DIR,
+ "-taglet", "taglets.CustomTag", "-sourcepath",
+ SRC_DIR, SRC_DIR + FS + "TagTestClass.java"
+ };
+
+ private static final String[] ARGS1 = new String[] {
+ "-d", BUG_ID + "-1", "-tagletpath", SRC_DIR, "-taglet", "taglets.CustomTag",
+ "-sourcepath", SRC_DIR, SRC_DIR + FS + "TagTestClass.java"
+ };
+ private static final String[] ARGS2 = new String[] {
+ "-Xdoclint:none", "-d", BUG_ID + "-2", "-sourcepath",
+ SRC_DIR, SRC_DIR + FS + "TagTestClass.java"
+ };
+
+ private static final String[] ARGS3 = new String[] {
+ "-d", BUG_ID + "-3", "-sourcepath", SRC_DIR, SRC_DIR + FS + "TagTestClass.java"
+ };
+
+ //Input for string search tests.
+ private static final String[][] TEST = new String[][] {
+ {WARNING_OUTPUT, "warning - @unknownTag is an unknown tag."
+ }
+ };
+
+ private static final String[][] TEST1 = new String[][] {
+ {ERROR_OUTPUT, "error: unknown tag: unknownTag"
+ }
+ };
+ private static final String[][] TEST2 = new String[][] {
+ {WARNING_OUTPUT, "warning - @customTag is an unknown tag."
+ },
+ {WARNING_OUTPUT, "warning - @unknownTag is an unknown tag."
+ }
+ };
+
+ private static final String[][] TEST3 = new String[][] {
+ {ERROR_OUTPUT, "error: unknown tag: customTag"
+ },
+ {ERROR_OUTPUT, "error: unknown tag: unknownTag"
+ }
+ };
+
+ /**
+ * The entry point of the test.
+ * @param args the array of command line arguments.
+ */
+ public static void main(String[] args) {
+ TestCustomTag tester = new TestCustomTag();
+ run(tester, ARGS, TEST, NO_TEST);
+ run(tester, ARGS1, TEST1, NO_TEST);
+ run(tester, ARGS2, TEST2, NO_TEST);
+ run(tester, ARGS3, TEST3, NO_TEST);
+ tester.printSummary();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugId() {
+ return BUG_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugName() {
+ return getClass().getName();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testCustomTag/taglets/CustomTag.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package taglets;
+
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.taglets.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+import com.sun.javadoc.*;
+import java.util.*;
+
+public class CustomTag extends BaseTaglet {
+
+ public CustomTag() {
+ name = "customTag";
+ }
+
+ public static void register(Map tagletMap) {
+ CustomTag tag = new CustomTag();
+ Taglet t = (Taglet) tagletMap.get(tag.getName());
+ if (t != null) {
+ tagletMap.remove(tag.getName());
+ }
+ tagletMap.put(tag.getName(), tag);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Content getTagletOutput(Tag tag, TagletWriter writer) {
+ ArrayList inlineTags = new ArrayList();
+ inlineTags.add(new TextTag(tag.holder(), "<dt><span class=\"simpleTagLabel\">Custom Tag:</span></dt><dd>"));
+ inlineTags.addAll(Arrays.asList(tag.inlineTags()));
+ inlineTags.add(new TextTag(tag.holder(), "</dd>"));
+ return writer.commentTagsToOutput(tag,
+ (Tag[]) inlineTags.toArray(new Tag[] {}));
+ }
+}
--- a/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4927552
+ * @bug 4927552 8026567
* @summary <DESC>
* @author jamieh
* @library ../lib/
@@ -76,20 +76,20 @@
{TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"},
{TARGET_FILE2, "<pre>@Deprecated" + NL +
- "public class <span class=\"strong\">DeprecatedClassByAnnotation</span>" + NL +
+ "public class <span class=\"typeNameLabel\">DeprecatedClassByAnnotation</span>" + NL +
"extends java.lang.Object</pre>"},
{TARGET_FILE2, "<pre>@Deprecated" + NL +
"public int field</pre>" + NL +
- "<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
+ "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},
{TARGET_FILE2, "<pre>@Deprecated" + NL +
"public DeprecatedClassByAnnotation()</pre>" + NL +
- "<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
+ "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},
{TARGET_FILE2, "<pre>@Deprecated" + NL +
"public void method()</pre>" + NL +
- "<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
+ "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},
};
private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4857717 8025633
+ * @bug 4857717 8025633 8026567
* @summary Test to make sure that externally overriden and implemented methods
* are documented properly. The method should still include "implements" or
* "overrides" documentation even though the method is external.
@@ -38,13 +38,13 @@
private static final String BUG_ID = "4857717";
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "XReader.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read--\" " +
"title=\"class or interface in java.io\">read</a></code> in class <code>" +
"<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\" " +
"title=\"class or interface in java.io\">FilterReader</a></code></dd>"},
{BUG_ID + FS + "pkg" + FS + "XReader.html",
- "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
"<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt--\" " +
"title=\"class or interface in java.io\">readInt</a></code> in interface <code>" +
"<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\" " +
--- a/langtools/test/com/sun/javadoc/testHref/TestHref.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testHref/TestHref.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4663254 8016328 8025633
+ * @bug 4663254 8016328 8025633 8026567
* @summary Verify that spaces do not appear in hrefs and anchors.
* @author jamieh
* @library ../lib/
@@ -80,7 +80,7 @@
//Signature does not link to the page itself.
{BUG_ID + FS + "pkg" + FS + "C4.html",
- "public abstract class <span class=\"strong\">C4<E extends C4<E>></span>"
+ "public abstract class <span class=\"typeNameLabel\">C4<E extends C4<E>></span>"
},
};
private static final String[][] NEGATED_TEST =
--- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
/*
* @test
- * @bug 6786690 6820360 8025633
+ * @bug 6786690 6820360 8025633 8026567
* @summary This test verifies the nesting of definition list tags.
* @author Bhavesh Patel
* @library ../lib/
@@ -43,7 +43,7 @@
// for default value.
private static final String[][] TEST_ALL = {
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class " +
- "<span class=\"strong\">C1</span>" + NL +
+ "<span class=\"typeNameLabel\">C1</span>" + NL +
"extends java.lang.Object" + NL + "implements java.io.Serializable</pre>"},
{BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL +
"<dt>Default:</dt>" + NL + "<dd>true</dd>" + NL +
@@ -54,64 +54,64 @@
// enclosing comments, tags and deprecated information.
private static final String[][] TEST_CMNT_DEPR = {
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL +
- "<dt><span class=\"strong\">Since:</span></dt>" + NL +
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
"<dd>JDK1.0</dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
- "<dd>JDK1.0</dd>" + NL + "<dt><span class=\"strong\">See Also:</span></dt>" + NL +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
+ "<dd>JDK1.0</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL +
"<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\"><code>" +
"C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" +
"Serialized Form</a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
"<dd>1.4</dd>" + NL +
- "<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd>" +
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" +
"<a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>"+ NL + "<dt><span class=\"strong\">Parameters:</span></dt>" + NL + "<dd><code>title" +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>"+ NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>title" +
"</code> - the title</dd>" + NL + "<dd><code>test</code> - boolean value" +
- "</dd>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL +
+ "</dd>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL +
"<dd><code>java.lang.IllegalArgumentException</code> - if the " +
"<code>owner</code>'s" + NL +
" <code>GraphicsConfiguration</code> is not from a screen " +
"device</dd>" + NL + "<dd><code>HeadlessException</code></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Parameters:</span></dt>" + NL + "<dd><code>undecorated" +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>undecorated" +
"</code> - <code>true</code> if no decorations are" + NL +
" to be enabled;" + NL + " <code>false</code> " +
- "if decorations are to be enabled.</dd>" + NL + "<dt><span class=\"strong\">Since:" +
+ "if decorations are to be enabled.</dd>" + NL + "<dt><span class=\"simpleTagLabel\">Since:" +
"</span></dt>" + NL + "<dd>1.4</dd>" + NL +
- "<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd>" +
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" +
"<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()" +
"</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL +
- "<dd><code>java.io.IOException</code></dd>" + NL + "<dt><span class=\"strong\">See Also:" +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL +
+ "<dd><code>java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:" +
"</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "<dt><span class=\"strong\">Parameters:" +
- "</span></dt>" + NL + "<dd><code>set</code> - boolean</dd>" + NL + "<dt><span class=\"strong\">" +
+ {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" +
+ "</span></dt>" + NL + "<dd><code>set</code> - boolean</dd>" + NL + "<dt><span class=\"simpleTagLabel\">" +
"Since:</span></dt>" + NL + "<dd>1.4</dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span>" +
+ {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" +
"</dt>" + NL + "<dd><code>" +
- "java.io.IOException</code></dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
+ "java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
- " <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+ " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
"<div class=\"block\">This field indicates whether the C1 is " +
- "undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
- "<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
+ "undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
+ "<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
- " <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+ " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
"<div class=\"block\">Reads the object stream.</div>" + NL +
- "<dl>" + NL + "<dt><span class=\"strong\">Throws:" +
+ "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:" +
"</span></dt>" + NL + "<dd><code><code>" +
"IOException</code></code></dd>" + NL +
"<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
" </div>" + NL +
"<div class=\"block\">The name for this class.</div>"}};
@@ -122,55 +122,55 @@
// and deprecated information.
private static final String[][] TEST_NODEPR = {
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL +
- "<dt><span class=\"strong\">Since:</span></dt>" + NL +
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
"<dd>JDK1.0</dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Since:</span>" +
- "</dt>" + NL + "<dd>JDK1.0</dd>" + NL + "<dt><span class=\"strong\">See Also:" +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span>" +
+ "</dt>" + NL + "<dd>JDK1.0</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:" +
"</span></dt>" + NL + "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
"<code>C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" +
"Serialized Form</a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Parameters:" +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" +
"</span></dt>" + NL + "<dd><code>title</code> - the title</dd>" + NL + "<dd><code>" +
- "test</code> - boolean value</dd>" + NL + "<dt><span class=\"strong\">Throws:" +
+ "test</code> - boolean value</dd>" + NL + "<dt><span class=\"throwsLabel\">Throws:" +
"</span></dt>" + NL + "<dd><code>java.lang.IllegalArgumentException" +
"</code> - if the <code>owner</code>'s" + NL + " <code>GraphicsConfiguration" +
"</code> is not from a screen device</dd>" + NL + "<dd><code>" +
"HeadlessException</code></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Parameters:" +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" +
"</span></dt>" + NL + "<dd><code>undecorated</code> - <code>true</code>" +
" if no decorations are" + NL + " to be enabled;" + NL +
" <code>false</code> if decorations are to be enabled." +
- "</dd>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL + "<dd>1.4</dd>" + NL +
- "<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#readObject--\">" +
+ "</dd>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + "<dd>1.4</dd>" + NL +
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#readObject--\">" +
"<code>readObject()</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span>" +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" +
"</dt>" + NL + "<dd><code>java.io.IOException</code></dd>" + NL + "<dt>" +
- "<span class=\"strong\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
+ "<span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span>" +
+ {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" +
"</dt>" + NL + "<dd><code>" +
- "java.io.IOException</code></dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
+ "java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
- " <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+ " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
"<div class=\"block\">This field indicates whether the C1 is " +
- "undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
- "<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
+ "undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
+ "<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
- " <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+ " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
"<div class=\"block\">Reads the object stream.</div>" + NL +
- "<dl>" + NL + "<dt><span class=\"strong\">Throws:" +
+ "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:" +
"</span></dt>" + NL + "<dd><code><code>" +
"IOException</code></code></dd>" + NL +
"<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
" </div>" + NL + "<div class=\"block\">" +
"The name for this class.</div>"}};
@@ -186,12 +186,12 @@
"title=\"enum in pkg1\">C1.ModalExclusionType</a> " +
"APPLICATION_EXCLUDE</pre>" + NL + "</li>"},
{BUG_ID + FS + "serialized-form.html", "<pre>boolean " +
- "undecorated</pre>" + NL + "<div class=\"block\"><span class=\"strong\">" +
- "Deprecated.</span> <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+ "undecorated</pre>" + NL + "<div class=\"block\"><span class=\"deprecatedLabel\">" +
+ "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" +
"setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
- "Deprecated.</span> <span class=\"italic\">As of JDK version" +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" +
+ "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version" +
" 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}};
--- a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
/*
* @test
- * @bug 6786028
+ * @bug 6786028 8026567
* @summary This test verifys the use of <strong> HTML tag instead of <B> by Javadoc std doclet.
* @author Bhavesh Patel
* @library ../lib/
@@ -38,7 +38,7 @@
private static final String BUG_ID = "6786028";
private static final String[][] TEST1 = {
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "<span class=\"strong\">See Also:</span>"}};
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<span class=\"seeLabel\">See Also:</span>"}};
private static final String[][] NEGATED_TEST1 = {
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>Method Summary</STRONG>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<B>"},
--- a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4852280 4517115 4973608 4994589
+ * @bug 4852280 4517115 4973608 4994589 8026567
* @summary Perform tests on index.html file.
* Also test that index-all.html has the appropriate output.
* Test for unnamed package in index.
@@ -53,27 +53,27 @@
//Test index-all.html
{BUG_ID + FS + "index-all.html",
- "<a href=\"pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">C</span></a>" +
+ "<a href=\"pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">C</span></a>" +
" - Class in <a href=\"pkg/package-summary.html\">pkg</a>"},
{BUG_ID + FS + "index-all.html",
"<a href=\"pkg/Interface.html\" title=\"interface in pkg\">" +
- "<span class=\"strong\">Interface</span></a> - Interface in " +
+ "<span class=\"typeNameLink\">Interface</span></a> - Interface in " +
"<a href=\"pkg/package-summary.html\">pkg</a>"},
{BUG_ID + FS + "index-all.html",
"<a href=\"pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
- "<span class=\"strong\">AnnotationType</span></a> - Annotation Type in " +
+ "<span class=\"typeNameLink\">AnnotationType</span></a> - Annotation Type in " +
"<a href=\"pkg/package-summary.html\">pkg</a>"},
{BUG_ID + FS + "index-all.html",
"<a href=\"pkg/Coin.html\" title=\"enum in pkg\">" +
- "<span class=\"strong\">Coin</span></a> - Enum in " +
+ "<span class=\"typeNameLink\">Coin</span></a> - Enum in " +
"<a href=\"pkg/package-summary.html\">pkg</a>"},
{BUG_ID + FS + "index-all.html",
"Class in <a href=\"package-summary.html\"><Unnamed></a>"},
{BUG_ID + FS + "index-all.html",
- "<dl>" + NL + "<dt><span class=\"strong\"><a href=\"pkg/C.html#Java\">" +
+ "<dl>" + NL + "<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#Java\">" +
"Java</a></span> - Static variable in class pkg.<a href=\"pkg/C.html\" " +
"title=\"class in pkg\">C</a></dt>" + NL + "<dd> </dd>" + NL +
- "<dt><span class=\"strong\"><a href=\"pkg/C.html#JDK\">JDK</a></span> " +
+ "<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#JDK\">JDK</a></span> " +
"- Static variable in class pkg.<a href=\"pkg/C.html\" title=\"class in pkg\">" +
"C</a></dt>" + NL + "<dd> </dd>" + NL + "</dl>"},
};
--- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4682448 4947464 5029946 8025633
+ * @bug 4682448 4947464 5029946 8025633 8026567
* @summary Verify that the public modifier does not show up in the
* documentation for public methods, as recommended by the JLS.
* If A implements I and B extends A, B should be in the list of
@@ -83,7 +83,7 @@
},
//Make sure "Specified By" has substituted type parameters.
{BUG_ID + FS + "pkg" + FS + "Child.html",
- "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
"<dd><code><a href=\"../pkg/Interface.html#method--\">method</a>" +
"</code> in interface <code>" +
"<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
@@ -92,7 +92,7 @@
},
//Make sure "Overrides" has substituted type parameters.
{BUG_ID + FS + "pkg" + FS + "Child.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg/Parent.html#method--\">method</a>" +
"</code> in class <code><a href=\"../pkg/Parent.html\" " +
"title=\"class in pkg\">Parent</a><<a href=\"../pkg/Child.html\" " +
--- a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 7112427 8012295 8025633
+ * @bug 7112427 8012295 8025633 8026567
* @summary Test of the JavaFX doclet features.
* @author jvalenta
* @library ../lib/
@@ -38,32 +38,32 @@
private static final String[][] TEST =
new String[][] {
{"./" + BUG_ID + "/C.html",
- "<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd><a href=\"C.html#getRate--\"><code>getRate()</code></a>, " + NL +
+ "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"C.html#getRate--\"><code>getRate()</code></a>, " + NL +
"<a href=\"C.html#setRate-double-\"><code>setRate(double)</code></a></dd>"},
{"./" + BUG_ID + "/C.html",
"<pre>public final void setRate(double value)</pre>" + NL +
"<div class=\"block\">Sets the value of the property rate.</div>" + NL +
- "<dl>" + NL + "<dt><span class=\"strong\">Property description:</span></dt>" },
+ "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>" },
{"./" + BUG_ID + "/C.html",
"<pre>public final double getRate()</pre>" + NL +
"<div class=\"block\">Gets the value of the property rate.</div>" + NL +
- "<dl>" + NL + "<dt><span class=\"strong\">Property description:</span></dt>" },
+ "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>" },
{"./" + BUG_ID + "/C.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"C.html#rateProperty\">rate</a></span></code>" + NL +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#rateProperty\">rate</a></span></code>" + NL +
"<div class=\"block\">Defines the direction/speed at which the <code>Timeline</code> is expected to"},
{"./" + BUG_ID + "/C.html",
- "<span class=\"strong\">Default value:</span>"},
+ "<span class=\"simpleTagLabel\">Default value:</span>"},
{"./" + BUG_ID + "/C.html",
- "<span class=\"strong\">Since:</span></dt>" + NL + "<dd>JavaFX 8.0</dd>" },
+ "<span class=\"simpleTagLabel\">Since:</span></dt>" + NL + "<dd>JavaFX 8.0</dd>" },
{"./" + BUG_ID + "/C.html",
"<p>Sets the value of the property <code>Property</code>"},
{"./" + BUG_ID + "/C.html",
"<p>Gets the value of the property <code>Property</code>"},
{"./" + BUG_ID + "/C.html",
- "<span class=\"strong\">Property description:</span>"},
+ "<span class=\"simpleTagLabel\">Property description:</span>"},
{"./" + BUG_ID + "/C.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"C.html#setTestMethodProperty--\">setTestMethodProperty</a></span>()</code> </td>" },
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#setTestMethodProperty--\">setTestMethodProperty</a></span>()</code> </td>" },
{"./" + BUG_ID + "/C.html",
"<h4>isPaused</h4>" + NL +
"<pre>public final double isPaused()</pre>" + NL +
--- a/langtools/test/com/sun/javadoc/testLegacyTaglet/Check.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testLegacyTaglet/Check.java Fri Nov 08 17:36:14 2013 -0800
@@ -126,7 +126,7 @@
* @param tag the tag representation of this custom tag.
*/
public String toString(Tag tag) {
- return "<dt><span class=\"strong\">" + TAG_HEADER + ":</span></dt><dd>" + tag.text() +
+ return "<dt><span class=\"simpleTagLabel\">" + TAG_HEADER + ":</span></dt><dd>" + tag.text() +
"</dd>\n";
}
--- a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4720957 5020118
+ * @bug 4720957 5020118 8026567
* @summary Test to make sure that -link and -linkoffline link to
* right files.
* @author jamieh
@@ -61,7 +61,7 @@
"Object</a> p3)"
},
{BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html",
- "<pre>public abstract class <span class=\"strong\">StringBuilderChild</span>" + NL +
+ "<pre>public abstract class <span class=\"typeNameLabel\">StringBuilderChild</span>" + NL +
"extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
"title=\"class or interface in java.lang\">Object</a></pre>"
},
--- a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4638588 4635809 6256068 6270645 8025633
+ * @bug 4638588 4635809 6256068 6270645 8025633 8026567
* @summary Test to make sure that members are inherited properly in the Javadoc.
* Verify that inheritence labels are correct.
* @author jamieh
@@ -72,7 +72,7 @@
// Test overriding/implementing methods with generic parameters.
{BUG_ID + FS + "pkg" + FS + "BaseClass.html",
- "<dl>" + NL + "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
+ "<dl>" + NL + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
"<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation-java.lang.Class-\">" +
"getAnnotation</a></code> in interface <code>" +
"<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" +
--- a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4951228 6290760 8025633
+ * @bug 4951228 6290760 8025633 8026567
* @summary Test the case where the overriden method returns a different
* type than the method in the child class. Make sure the
* documentation is inherited but the return type isn't.
@@ -49,7 +49,7 @@
// Check return type in member summary.
{BUG_ID + FS + "pkg" + FS + "PublicChild.html",
"<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>" + NL +
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" +
"returnTypeTest</a></span>()</code>"
},
// Check return type in member detail.
--- a/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4131628 4664607 7025314 8023700 7198273 8025633
+ * @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567
* @summary Make sure the Next/Prev Class links iterate through all types.
* Make sure the navagation is 2 columns, not 3.
* @author jamieh
@@ -46,17 +46,17 @@
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "A.html", "<li>Prev Class</li>"},
{BUG_ID + FS + "pkg" + FS + "A.html",
- "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">Next Class</span></a>"},
+ "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"},
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"strong\">Prev Class</span></a>"},
+ "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"},
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">Next Class</span></a>"},
+ "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"},
{BUG_ID + FS + "pkg" + FS + "E.html",
- "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">Prev Class</span></a>"},
+ "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"},
{BUG_ID + FS + "pkg" + FS + "E.html",
- "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"strong\">Next Class</span></a>"},
+ "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"},
{BUG_ID + FS + "pkg" + FS + "I.html",
- "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">Prev Class</span></a>"},
+ "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"},
{BUG_ID + FS + "pkg" + FS + "I.html", "<li>Next Class</li>"},
// Test for 4664607
{BUG_ID + FS + "pkg" + FS + "I.html",
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 8025633
+ * @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 8025633 8026567
* @summary Run Javadoc on a set of source files that demonstrate new
* language features. Check the output to ensure that the new
* language features are properly documented.
@@ -53,7 +53,7 @@
{BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</h2>"},
//Make sure enum signature is correct.
{BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum " +
- "<span class=\"strong\">Coin</span>" + NL +
+ "<span class=\"typeNameLabel\">Coin</span>" + NL +
"extends java.lang.Enum<<a href=\"../pkg/Coin.html\" " +
"title=\"enum in pkg\">Coin</a>></pre>"
},
@@ -62,7 +62,7 @@
"</span><span class=\"tabEnd\"> </span></caption>"},
//Detail for enum constant
{BUG_ID + FS + "pkg" + FS + "Coin.html",
- "<span class=\"strong\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>"},
+ "<span class=\"memberNameLink\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>"},
//Automatically insert documentation for values() and valueOf().
{BUG_ID + FS + "pkg" + FS + "Coin.html",
"Returns an array containing the constants of this enum type,"},
@@ -80,11 +80,11 @@
"Class TypeParameters<E></h2>"},
//Check class type parameters section.
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
- "<dt><span class=\"strong\">Type Parameters:</span></dt>" + NL + "<dd><code>E</code> - " +
+ "<dt><span class=\"paramLabel\">Type Parameters:</span></dt>" + NL + "<dd><code>E</code> - " +
"the type parameter for this class."},
//Type parameters in @see/@link
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
- "<dl>" + NL + "<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd>" +
+ "<dl>" + NL + "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" +
"<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
"<code>TypeParameters</code></a></dd>" + NL + "</dl>"},
//Method that uses class type parameter.
@@ -93,7 +93,7 @@
"parameter in TypeParameters\">E</a> param)"},
//Method type parameter section.
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
- "<span class=\"strong\">Type Parameters:</span></dt>" + NL + "<dd><code>T</code> - This is the first " +
+ "<span class=\"paramLabel\">Type Parameters:</span></dt>" + NL + "<dd><code>T</code> - This is the first " +
"type parameter.</dd>" + NL + "<dd><code>V</code> - This is the second type " +
"parameter."},
//Signature of method with type parameters
@@ -118,7 +118,7 @@
//Signature of subclass that has type parameters.
{BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
- "<pre>public class <span class=\"strong\">TypeParameterSubClass<T extends " +
+ "<pre>public class <span class=\"typeNameLabel\">TypeParameterSubClass<T extends " +
"java.lang.String></span>" + NL + "extends " +
"<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" +
"TypeParameterSuperClass</a><T></pre>"},
@@ -168,7 +168,7 @@
"Annotation Type AnnotationType</h2>"},
//Make sure the signature is correct.
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
- "public @interface <span class=\"strong\">AnnotationType</span>"},
+ "public @interface <span class=\"memberNameLabel\">AnnotationType</span>"},
//Make sure member summary headings are correct.
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
"<h3>Required Element Summary</h3>"},
@@ -198,7 +198,7 @@
"<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" +
"=\"Class Annotation\"," + NL +
" <a href=\"../pkg/AnnotationType.html#required--\">" +
- "required</a>=1994)" + NL + "public class <span class=\"strong\">" +
+ "required</a>=1994)" + NL + "public class <span class=\"typeNameLabel\">" +
"AnnotationTypeUsage</span>" + NL + "extends java.lang.Object</pre>"},
//FIELD
@@ -299,7 +299,7 @@
{BUG_ID + FS + "pkg1" + FS + "B.html",
"<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"},
{BUG_ID + FS + "pkg1" + FS + "B.html",
- "public interface <span class=\"strong\">B</span></pre>"},
+ "public interface <span class=\"typeNameLabel\">B</span></pre>"},
//==============================================================
@@ -320,7 +320,7 @@
"Foo</a></span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
"title=\"class in pkg2\">ClassUseTest1</a><T extends " +
"<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
"</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
@@ -333,8 +333,8 @@
"pkg2\">Foo</a></span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
- "<td class=\"colLast\"><span class=\"strong\">ClassUseTest1." +
- "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+ "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest1." +
+ "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
"ClassUseTest1.html#method-T-\">method</a></span>" +
"(T t)</code> </td>"
},
@@ -372,7 +372,7 @@
"</span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
"title=\"class in pkg2\">ClassUseTest1</a><T extends " +
"<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
"</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
@@ -386,8 +386,8 @@
"</span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
- "<td class=\"colLast\"><span class=\"strong\">" +
- "ClassUseTest1.</span><code><span class=\"strong\"><a href=\"../../" +
+ "<td class=\"colLast\"><span class=\"typeNameLabel\">" +
+ "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../../" +
"pkg2/ClassUseTest1.html#method-T-\">method</a></span>" +
"(T t)</code> </td>"
},
@@ -401,7 +401,7 @@
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
"title=\"class in pkg2\">ClassUseTest2</a><T extends " +
"<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
"ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
@@ -415,8 +415,8 @@
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
- "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
- "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+ "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." +
+ "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
"ClassUseTest2.html#method-T-\">method</a></span>" +
"(T t)</code> </td>"
},
@@ -456,7 +456,7 @@
"Foo3</a></span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
"title=\"class in pkg2\">ClassUseTest2</a><T extends " +
"<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
"ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
@@ -470,8 +470,8 @@
"</span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
- "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
- "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+ "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." +
+ "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
"ClassUseTest2.html#method-T-\">method</a></span>" +
"(T t)</code> </td>"
},
@@ -500,7 +500,7 @@
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
"title=\"class in pkg2\">ClassUseTest3</a><T extends " +
"<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
"ParamTest2</a><java.util.List<? extends " +
@@ -515,8 +515,8 @@
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
- "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3" +
- ".</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+ "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3" +
+ ".</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." +
"html#method-T-\">method</a></span>(T t)</code> </td>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
@@ -538,7 +538,7 @@
"</span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
- "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
+ "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
"title=\"class in pkg2\">ClassUseTest3</a><T extends " +
"<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
"ParamTest2</a><java.util.List<? extends " +
@@ -552,8 +552,8 @@
"pkg2\">Foo4</a></span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
- "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
- "</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+ "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." +
+ "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." +
"html#method-T-\">method</a></span>(T t)</code>" +
" </td>"
},
@@ -586,8 +586,8 @@
"<th class=\"colLast\" scope=\"col\">Method and Description</th>" + NL +
"</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" + NL +
"<td class=\"colFirst\"><code>void</code></td>" + NL +
- "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
- "</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+ "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." +
+ "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." +
"html#method-java.util.Set-\">method</a></span>(java." +
"util.Set<<a href=\"../../pkg2/Foo4.html\" title=\"" +
"class in pkg2\">Foo4</a>> p)</code> </td>" + NL +
@@ -663,14 +663,14 @@
// TYPE PARAMETER IN INDEX
//=================================
{BUG_ID + FS + "index-all.html",
- "<span class=\"strong\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
+ "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
"method(Vector<Object>)</a></span>"
},
//=================================
// TYPE PARAMETER IN INDEX
//=================================
{BUG_ID + FS + "index-all.html",
- "<span class=\"strong\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
+ "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
"method(Vector<Object>)</a></span>"
},
};
@@ -679,7 +679,7 @@
// ENUM TESTING
//=================================
//NO constructor section
- {BUG_ID + FS + "pkg" + FS + "Coin.html", "<span class=\"strong\">Constructor Summary</span>"},
+ {BUG_ID + FS + "pkg" + FS + "Coin.html", "<h3>Constructor Summary</h3>"},
//=================================
// TYPE PARAMETER TESTING
//=================================
@@ -698,25 +698,25 @@
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
"<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\"," + NL +
" <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
- "public class <span class=\"strong\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>"},
+ "public class <span class=\"typeNameLabel\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>"},
//FIELD
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
"<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\"," + NL +
" <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
- "public int <span class=\"strong\">field</span>"},
+ "public int <span class=\"memberNameLabel\">field</span>"},
//CONSTRUCTOR
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
"<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\"," + NL +
" <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
- "public <span class=\"strong\">AnnotationTypeUsage</span>()"},
+ "public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>()"},
//METHOD
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
"<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\"," + NL +
" <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
- "public void <span class=\"strong\">method</span>()"},
+ "public void <span class=\"memberNameLabel\">method</span>()"},
//=================================
// Make sure annotation types do not
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4368820 8025633
+ * @bug 4368820 8025633 8026567
* @summary Inherited comment should link directly to member, not just
* class
* @author jamieh
@@ -46,7 +46,7 @@
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<span class=\"strong\">Description copied from class: <code>" +
+ "<span class=\"descfrmTypeLabel\">Description copied from class: <code>" +
"<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy--\">" +
"BaseClass</a></code></span>"
}
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4634891
+ * @bug 4634891 8026567
* @summary Determine if overriden methods are properly documented when
* -protected (default) visibility flag is used.
* @author jamieh
@@ -40,12 +40,12 @@
private static final String[][] TEST = {
//The public method should be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
//The public method in different package should be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}
};
@@ -54,17 +54,17 @@
//The package private method should be overriden since the base and sub class are in the same
//package. However, the link should not show up because the package private methods are not documented.
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
//The private method in should not be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
//The private method in different package should not be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
//The package private method should not be overriden since the base and sub class are in
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4634891 8025633
+ * @bug 4634891 8025633 8026567
* @summary Determine if overriden methods are properly documented when
* -protected (default) visibility flag is used.
* @author jamieh
@@ -40,14 +40,14 @@
private static final String[][] TEST = {
//The public method should be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" +
"publicMethod</a></code> in class <code>" +
"<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
//The public method in different package should be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" +
"publicMethod</a></code> in class <code>" +
"<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
@@ -55,7 +55,7 @@
//The package private method should be overriden since the base and sub class are in the same
//package.
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">" +
"packagePrivateMethod</a></code> in class <code>" +
"<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"}
@@ -65,18 +65,18 @@
//The private method in should not be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
//The private method in different package should not be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
//The package private method should not be overriden since the base and sub class are in
//different packages.
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">"},
};
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4634891
+ * @bug 4634891 8026567
* @summary Determine if overriden methods are properly documented when
* -protected (default) visibility flag is used.
* @author jamieh
@@ -40,18 +40,18 @@
private static final String[][] TEST = {
//The public method should be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
//The package private method should be overriden since the base and sub class are in the same
//package.
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
//The public method in different package should be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
};
@@ -59,18 +59,18 @@
//The private method in should not be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
//The private method in different package should not be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
//The package private method should not be overriden since the base and sub class are in
//different packages.
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
--- a/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6492694
+ * @bug 6492694 8026567
* @summary Test package deprecation.
* @author bpatel
* @library ../lib/
@@ -49,8 +49,8 @@
//Input for string search tests.
private static final String[][] TEST1 = {
{BUG_ID + "-1" + FS + "pkg1" + FS + "package-summary.html",
- "<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>" + NL +
- "<div class=\"block\"><span class=\"italic\">This package is Deprecated." +
+ "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>" + NL +
+ "<div class=\"block\"><span class=\"deprecationComment\">This package is Deprecated." +
"</span></div>"
},
{BUG_ID + "-1" + FS + "deprecated-list.html",
--- a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4802275 4967243
+ * @bug 4802275 4967243 8026567
* @summary Make sure param tags are still printed even though they do not
* match up with a real parameters.
* Make sure inheritDoc cannot be used in an invalid param tag.
@@ -48,12 +48,12 @@
private static final String[][] TEST = {
//Regular param tags.
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<span class=\"strong\">Parameters:</span></dt>" + NL + "<dd><code>param1</code> - testing 1 2 3.</dd>" +
+ "<span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>param1</code> - testing 1 2 3.</dd>" +
NL + "<dd><code>param2</code> - testing 1 2 3."
},
//Param tags that don't match with any real parameters.
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<span class=\"strong\">Parameters:</span></dt>" + NL + "<dd><code><I>p1</I></code> - testing 1 2 3.</dd>" +
+ "<span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code><I>p1</I></code> - testing 1 2 3.</dd>" +
NL + "<dd><code><I>p2</I></code> - testing 1 2 3."
},
//{@inherit} doc misuse does not cause doclet to throw exception.
--- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4780441 4874845 4978816 8014017 8016328 8025633
+ * @bug 4780441 4874845 4978816 8014017 8016328 8025633 8026567
* @summary Make sure that when the -private flag is not used, members
* inherited from package private class are documented in the child.
*
@@ -112,12 +112,12 @@
private static final String[][] NEGATED_TEST1 = {
// Should not document that a method overrides method from private class.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
- "<span class=\"strong\">Overrides:</span>"},
+ "<span class=\"overrideSpecifyLabel\">Overrides:</span>"},
// Should not document that a method specified by private interface.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
- "<span class=\"strong\">Specified by:</span>"},
+ "<span class=\"overrideSpecifyLabel\">Specified by:</span>"},
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
- "<span class=\"strong\">Specified by:</span>"},
+ "<span class=\"overrideSpecifyLabel\">Specified by:</span>"},
// Should not mention that any documentation was copied.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"Description copied from"},
@@ -139,7 +139,7 @@
//Do not inherit private interface method with generic parameters.
//This method has been implemented.
{BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
- "<span class=\"strong\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"},
+ "<span class=\"memberNameLink\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"},
};
// Test output when -private flag is used.
@@ -176,14 +176,14 @@
},
// Should document that a method overrides method from private class.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
- "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
"<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">" +
"methodOverridenFromParent</a></code> in class <code>" +
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a></code></dd>"},
// Should document that a method is specified by private interface.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
- "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
"<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" +
"methodInterface</a></code> in interface <code>" +
"<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
@@ -227,11 +227,11 @@
//Since private flag is used, we can document that private interface method
//with generic parameters has been implemented.
{BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
- "<span class=\"strong\">Description copied from interface: <code>" +
+ "<span class=\"descfrmTypeLabel\">Description copied from interface: <code>" +
"<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>"},
{BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
- "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
+ "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
"<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>" +
" in interface <code>" +
"<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
@@ -240,14 +240,14 @@
//Make sure when no modifier appear in the class signature, the
//signature is displayed correctly without extra space at the beginning.
{BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
- "<pre>class <span class=\"strong\">PrivateParent</span>"},
+ "<pre>class <span class=\"typeNameLabel\">PrivateParent</span>"},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
- "<pre>public class <span class=\"strong\">PublicChild</span>"},
+ "<pre>public class <span class=\"typeNameLabel\">PublicChild</span>"},
};
private static final String[][] NEGATED_TEST2 = {
{BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
- "<pre> class <span class=\"strong\">PrivateParent</span>"},
+ "<pre> class <span class=\"typeNameLabel\">PrivateParent</span>"},
};
/**
--- a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8006124 8009684 8016921 8023700 8024096 8008164
+ * @bug 8006124 8009684 8016921 8023700 8024096 8008164 8026567 8026770
* @summary Test javadoc support for profiles.
* @author Bhavesh Patel, Evgeniya Stepanova
* @library ../lib/
@@ -85,6 +85,20 @@
"<h3><a href=\"pkg2/compact2-package-summary.html\" "
+ "target=\"classFrame\">pkg2</a></h3>"
},
+ {PROFILE_BUG_ID + FS + "compact2-summary.html",
+ "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+ + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">"
+ + "pkg2</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" "
+ + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
+ + "listing classes, and an explanation\">"
+ },
+ {PROFILE_BUG_ID + FS + "compact2-summary.html",
+ "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+ + "<h3><a href=\"pkg4/compact2-package-summary.html\" target=\"classFrame\">"
+ + "pkg4</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" "
+ + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
+ + "listing classes, and an explanation\">"
+ },
// Tests for profileName-package-summary.html listing the summary for a
// package in a profile.
{PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
@@ -94,6 +108,12 @@
{PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
"<div class=\"subTitle\">compact3</div>"
},
+ {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
+ "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+ + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" "
+ + "cellspacing=\"0\" summary=\"Interface Summary table, listing "
+ + "interfaces, and an explanation\">"
+ },
//Test for "overview-frame.html" showing the "All Profiles" link.
{PROFILE_BUG_ID + FS + "overview-frame.html",
"<span><a href=\"profile-overview-frame.html\" "
@@ -122,17 +142,17 @@
},
{PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">"
+ "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">pkg2.Class1Pkg2</a>"
- + NL +"<div class=\"block\"><span class=\"italic\">Class1Pkg2. This class is deprecated</span></div>"
+ + NL +"<div class=\"block\"><span class=\"deprecationComment\">Class1Pkg2. This class is deprecated</span></div>"
},
//Test deprecated package in profile
{PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">"
+ "<a href=\"pkgDeprecated/package-summary.html\">pkgDeprecated</a>"
- + NL +"<div class=\"block\"><span class=\"italic\">This package is <b>Deprecated</b>."
+ + NL +"<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>."
+ " Use pkg1.</span></div>"
},
{PROFILE_BUG_ID + FS + "pkgDeprecated" + FS + "package-summary.html",
- "<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>"
- + NL + "<div class=\"block\"><span class=\"italic\">This package is <b>Deprecated</b>."
+ "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>"
+ + NL + "<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>."
+ " Use pkg1.</span></div>"
},
// need to add teststring when JDK-8015496 will be fixed
@@ -171,6 +191,21 @@
+ "target=\"classFrame\">Anno1Pkg4</a></li>"
},
{PROFILE_BUG_ID + FS + "compact1-summary.html","<li>Use</li>"
+ },
+ {PROFILE_BUG_ID + FS + "compact2-summary.html",
+ "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+ + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">"
+ + "pkg2</a></h3>" + NL + "<li class=\"blockList\">" + NL
+ + "<table class=\"typeSummary\" border=\"0\" "
+ + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
+ + "listing classes, and an explanation\">"
+ },
+ {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
+ "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+ + "<li class=\"blockList\">" + NL
+ + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" "
+ + "cellspacing=\"0\" summary=\"Interface Summary table, listing "
+ + "interfaces, and an explanation\">"
}
};
private static final String[][] PACKAGES_TEST = {
--- a/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8006124 8009684 8015663 8015496
+ * @bug 8006124 8009684 8015663 8015496 8026567
* @summary Test javadoc options support for profiles.
* @author Evgeniya Stepanova
* @library ../lib/
@@ -87,7 +87,7 @@
{PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html",
"<h3><a href=\"pkgDeprecated/compact1-package-summary.html\" target=\"" +
"classFrame\">pkgDeprecated</a></h3>" + NL + "<div class=\"deprecatedContent\">" +
- "<span class=\"strong\">Deprecated.</span></div>"
+ "<span class=\"deprecatedLabel\">Deprecated.</span></div>"
}
};
private static final String[][] PROFILES_CONFIGURATION_NEGATED_TEST = {
--- a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
/*
* @test
- * @bug 6802694 8025633
+ * @bug 6802694 8025633 8026567
* @summary This test verifies deprecation info in serialized-form.html.
* @author Bhavesh Patel
* @library ../lib/
@@ -42,29 +42,29 @@
// display the inline comments, tags and deprecation information if any.
private static final String[][] TEST_CMNT_DEPR = {
{BUG_ID + FS + "serialized-form.html", "<dl>" + NL +
- "<dt><span class=\"strong\">Throws:</span></dt>" + NL + "<dd><code>" +
- "java.io.IOException</code></dd>"+ NL + "<dt><span class=\"strong\">See Also:</span>" +
+ "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL + "<dd><code>" +
+ "java.io.IOException</code></dd>"+ NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
- " <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+ " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
"<div class=\"block\">This field indicates whether the C1 " +
"is undecorated.</div>" + NL + " " + NL +
- "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
- "<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
+ "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
+ "<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
- " <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+ " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
"<div class=\"block\">Reads the object stream.</div>" + NL +
- "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL + "<dd><code><code>" +
+ "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL + "<dd><code><code>" +
"IOException</code></code></dd>" + NL +
"<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
" </div>" + NL + "<div class=\"block\">" +
"The name for this class.</div>"}};
@@ -73,12 +73,12 @@
// information if any.
private static final String[][] TEST_NOCMNT = {
{BUG_ID + FS + "serialized-form.html", "<pre>boolean undecorated</pre>" + NL +
- "<div class=\"block\"><span class=\"strong\">Deprecated.</span> <span class=\"italic\">" +
+ "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> <span class=\"deprecationComment\">" +
"As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" +
"setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"},
- {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
- "Deprecated.</span> <span class=\"italic\">As of JDK version" +
+ {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" +
+ "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version" +
" 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}};
--- a/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4695326 4750173 4920381
+ * @bug 4695326 4750173 4920381 8026567
* @summary Test the declarartion of simple tags using -tag. Verify that
* "-tag name" is a shortcut for "-tag name:a:Name:". Also verity that
* you can escape the ":" character with a back slash so that it is not
@@ -42,13 +42,13 @@
private static final String[][] TEST =
new String[][] {
{"./" + BUG_ID + "/C.html",
- "<span class=\"strong\">Todo:</span>"},
+ "<span class=\"simpleTagLabel\">Todo:</span>"},
{"./" + BUG_ID + "/C.html",
- "<span class=\"strong\">EJB Beans:</span>"},
+ "<span class=\"simpleTagLabel\">EJB Beans:</span>"},
{"./" + BUG_ID + "/C.html",
- "<span class=\"strong\">Regular Tag:</span>"},
+ "<span class=\"simpleTagLabel\">Regular Tag:</span>"},
{"./" + BUG_ID + "/C.html",
- "<span class=\"strong\">Back-Slash-Tag:</span>"},
+ "<span class=\"simpleTagLabel\">Back-Slash-Tag:</span>"},
};
private static final String[] ARGS = new String[] {
--- a/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8008768
+ * @bug 8008768 8026567
* @summary Using {@inheritDoc} in simple tag defined via -tag fails
* @library ../lib/
* @build JavadocTester TestSimpleTagInherit
@@ -46,10 +46,10 @@
//Input for string search tests.
private static final String[][] TEST = {
{ BUG_ID + FS + "p" + FS + "TestClass.html",
- "<dt><span class=\"strong\"><em>Custom:</em></span></dt>" + NL +
+ "<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>" + NL +
"<dd>doc for BaseClass class</dd>" },
{ BUG_ID + FS + "p" + FS + "TestClass.html",
- "<dt><span class=\"strong\"><em>Custom:</em></span></dt>" + NL +
+ "<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>" + NL +
"<dd>doc for BaseClass method</dd>" }
};
private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 7180906
+ * @bug 7180906 8026567
* @summary Test to make sure that the since tag works correctly
* @author Bhavesh Patel
* @library ../lib/
@@ -48,11 +48,11 @@
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "pkg1" + FS + "C1.html",
- "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
+ "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
"<dd>JDK1.0</dd>"
},
{BUG_ID + FS + "serialized-form.html",
- "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
+ "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
"<dd>1.4</dd>"
}
};
--- a/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,7 @@
/*
* @test
- * @bug 8026370
+ * @bug 8026370 8026567
* @summary This test checks the generated tag output.
* @author Bhavesh Patel
* @library ../lib/
@@ -38,15 +38,15 @@
private static final String BUG_ID = "8026370";
private static final String[][] TEST = {
{BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html",
- "<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
+ "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},
{BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html",
- "<div class=\"block\"><span class=\"strong\">Deprecated.</span> " +
- "<span class=\"italic\">Do not use this.</span></div>"}};
+ "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> " +
+ "<span class=\"deprecationComment\">Do not use this.</span></div>"}};
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html",
- "<div class=\"block\"><span class=\"strong\">Deprecated." +
- "</span> <span class=\"italic\"></span></div>"}};
+ "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated." +
+ "</span> <span class=\"deprecationComment\"></span></div>"}};
private static final String[] ARGS =
new String[] {
--- a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java Fri Nov 08 17:36:14 2013 -0800
@@ -55,7 +55,7 @@
//Input for string search tests.
private static final String[][] TEST_4654308 = new String[][] {
- {"4654308" + FS + "C.html", "<span class=\"strong\">Foo:</span></dt>" +
+ {"4654308" + FS + "C.html", "<span class=\"simpleTagLabel\">Foo:</span></dt>" +
"<dd>my only method is <a href=\"C.html#method--\"><code>here" +
"</code></a></dd></dl>"}
};
--- a/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java Fri Nov 08 17:36:14 2013 -0800
@@ -50,7 +50,7 @@
*/
public Content getTagletOutput(Tag tag, TagletWriter writer) {
ArrayList inlineTags = new ArrayList();
- inlineTags.add(new TextTag(tag.holder(), "<dt><span class=\"strong\">Foo:</span></dt><dd>"));
+ inlineTags.add(new TextTag(tag.holder(), "<dt><span class=\"simpleTagLabel\">Foo:</span></dt><dd>"));
inlineTags.addAll(Arrays.asList(tag.inlineTags()));
inlineTags.add(new TextTag(tag.holder(), "</dd>"));
return writer.commentTagsToOutput(tag,
--- a/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4530727
+ * @bug 4530727 8026567
* @summary When an exception is declared in the method signature but
* not documented with a throws tag, we generate a link to it in the
* throws section. Make sure that the link is below a Throws heading.
@@ -38,7 +38,7 @@
private static final String BUG_ID = "4530727";
private static final String[][] TEST = {
- {BUG_ID + FS + "C.html", "<dt><span class=\"strong\">Throws:</span>"}
+ {BUG_ID + FS + "C.html", "<dt><span class=\"throwsLabel\">Throws:</span>"}
};
private static final String[][] NEGATED_TEST = NO_TEST;
private static final String[] ARGS = new String[] {
--- a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8005091 8009686 8025633
+ * @bug 8005091 8009686 8025633 8026567
* @summary Make sure that type annotations are displayed correctly
* @author Bhavesh Patel
* @library ../lib/
@@ -74,12 +74,12 @@
// Test for type annotations on Class Parameters (ClassParameters.java).
{BUG_ID + FS + "typeannos" + FS + "ExtendsBound.html",
- "class <span class=\"strong\">ExtendsBound<K extends <a " +
+ "class <span class=\"typeNameLabel\">ExtendsBound<K extends <a " +
"href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
"typeannos\">@ClassParamA</a> java.lang.String></span>"
},
{BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
- "<pre>class <span class=\"strong\">ExtendsGeneric<K extends " +
+ "<pre>class <span class=\"typeNameLabel\">ExtendsGeneric<K extends " +
"<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
"typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " +
"title=\"class in typeannos\">Unannotated</a><<a href=\"" +
@@ -87,24 +87,24 @@
"@ClassParamB</a> java.lang.String>></span>"
},
{BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
- "<pre>class <span class=\"strong\">TwoBounds<K extends <a href=\"" +
+ "<pre>class <span class=\"typeNameLabel\">TwoBounds<K extends <a href=\"" +
"../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
"@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" +
"ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" +
"</a> java.lang.String></span>"
},
{BUG_ID + FS + "typeannos" + FS + "Complex1.html",
- "class <span class=\"strong\">Complex1<K extends <a href=\"../" +
+ "class <span class=\"typeNameLabel\">Complex1<K extends <a href=\"../" +
"typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
"@ClassParamA</a> java.lang.String & java.lang.Runnable></span>"
},
{BUG_ID + FS + "typeannos" + FS + "Complex2.html",
- "class <span class=\"strong\">Complex2<K extends java.lang." +
+ "class <span class=\"typeNameLabel\">Complex2<K extends java.lang." +
"String & <a href=\"../typeannos/ClassParamB.html\" title=\"" +
"annotation in typeannos\">@ClassParamB</a> java.lang.Runnable></span>"
},
{BUG_ID + FS + "typeannos" + FS + "ComplexBoth.html",
- "class <span class=\"strong\">ComplexBoth<K extends <a href=\"" +
+ "class <span class=\"typeNameLabel\">ComplexBoth<K extends <a href=\"" +
"../typeannos/ClassParamA.html\" title=\"annotation in typeannos\"" +
">@ClassParamA</a> java.lang.String & <a href=\"../typeannos/" +
"ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA" +
--- a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java Fri Nov 08 17:36:14 2013 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4764045 8004825
+ * @bug 4764045 8004825 8026567
* @summary This test ensures that the value tag works in all
* use cases. The explainations for each test case are written below.
* @author jamieh
@@ -94,7 +94,7 @@
"Result: <a href=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>"},
//Test @value tag used with custom tag.
{BUG_ID + FS + "pkg1" + FS + "CustomTagUsage.html",
- "<dt><span class=\"strong\">Todo:</span></dt>" + NL +
+ "<dt><span class=\"simpleTagLabel\">Todo:</span></dt>" + NL +
"<dd>the value of this constant is 55.</dd>"},
//Test @value errors printed dues to invalid use or when used with
//non-constant or with bad references.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/CustomTagTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,19 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8006248
+ * @summary DocLint should report unknown tags
+ * @build DocLintTester
+ * @run main DocLintTester CustomTagTest.java
+ * @run main DocLintTester -XcustomTags: -ref CustomTagTest.out CustomTagTest.java
+ * @run main DocLintTester -XcustomTags:customTag -ref CustomTagTestWithOption.out CustomTagTest.java
+ * @run main DocLintTester -XcustomTags:customTag,anotherCustomTag -ref CustomTagTestWithOption.out CustomTagTest.java
+ * @author bpatel
+ */
+
+/**
+ * @customTag Text for a custom tag.
+ * @unknownTag Text for an unknown tag.
+ */
+public class CustomTagTest {
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/CustomTagTest.out Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,8 @@
+CustomTagTest.java:14: error: unknown tag: customTag
+ * @customTag Text for a custom tag.
+ ^
+CustomTagTest.java:15: error: unknown tag: unknownTag
+ * @unknownTag Text for an unknown tag.
+ ^
+2 errors
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/CustomTagTestWithOption.out Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,5 @@
+CustomTagTest.java:15: error: unknown tag: unknownTag
+ * @unknownTag Text for an unknown tag.
+ ^
+1 error
+
--- a/langtools/test/tools/doclint/DocLintTester.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/doclint/DocLintTester.java Fri Nov 08 17:36:14 2013 -0800
@@ -58,6 +58,8 @@
badArgs = true;
} else if (arg.startsWith("-Xmsgs")) {
opts.add(arg);
+ } else if (arg.startsWith("-XcustomTags")) {
+ opts.add(arg);
} else if (arg.startsWith("-")) {
opts.add(arg);
if (i < args.length - 1 && !args[i+1].startsWith("-"))
--- a/langtools/test/tools/javac/ExtDirs/ExtDirTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/ExtDirs/ExtDirTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -112,11 +112,6 @@
}
void createJars() throws Exception {
-
-// for i in 1 2 3; do
-// if test ! -d ext${i}; then mkdir ext${i}; fi
-// cp ${TESTSRC}${FS}ext${i}${FS}*.jar ext${i}
-// done
sun.tools.jar.Main jarGenerator =
new sun.tools.jar.Main(System.out, System.err, "jar");
@@ -155,19 +150,19 @@
void compileWithExtDirs() throws Exception {
-//"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext1 "${TESTSRC}${FS}ExtDirTest_1.java"
+//javac -extdirs ext1 ExtDirTest_1.java
ToolBox.JavaToolArgs params =
new ToolBox.JavaToolArgs()
.setOptions("-d", ".", "-extdirs", "ext1")
.setSources(ExtDirTest_1Src);
ToolBox.javac(params);
-//"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext1${PS}ext2 "${TESTSRC}${FS}ExtDirTest_2.java"
+//javac -extdirs ext1:ext2 ExtDirTest_2.java
params.setOptions("-d", ".", "-extdirs", "ext1" + File.pathSeparator + "ext2")
.setSources(ExtDirTest_2Src);
ToolBox.javac(params);
-//"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext3 "${TESTSRC}${FS}ExtDirTest_3.java"
+//javac -extdirs ext3 ExtDirTest_3.java
params.setOptions("-d", ".", "-extdirs", "ext3")
.setSources(ExtDirTest_3Src);
ToolBox.javac(params);
Binary file langtools/test/tools/javac/ExtDirs/ext1/pkg1.jar has changed
Binary file langtools/test/tools/javac/ExtDirs/ext2/pkg2.jar has changed
Binary file langtools/test/tools/javac/ExtDirs/ext3/pkg1.jar has changed
Binary file langtools/test/tools/javac/ExtDirs/ext3/pkg2.jar has changed
--- a/langtools/test/tools/javac/MethodParameters/LambdaTest.out Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/MethodParameters/LambdaTest.out Fri Nov 08 17:36:14 2013 -0800
@@ -1,7 +1,7 @@
class LambdaTest --
LambdaTest.<init>()
LambdaTest.foo(i)
-LambdaTest.lambda$1(arg0, arg1)/*synthetic*/
-LambdaTest.lambda$0(arg0)/*synthetic*/
+LambdaTest.lambda$static$1(arg0)/*synthetic*/
+LambdaTest.lambda$null$0(arg0, arg1)/*synthetic*/
static interface LambdaTest$I -- inner
-LambdaTest$I.m(x)
\ No newline at end of file
+LambdaTest$I.m(x)
--- a/langtools/test/tools/javac/MethodParameters/Tester.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/MethodParameters/Tester.java Fri Nov 08 17:36:14 2013 -0800
@@ -27,7 +27,6 @@
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
/**
@@ -152,14 +151,14 @@
throws FileNotFoundException, IOException {
List<String> refFileList = Files.readAllLines(refFile.toPath(), StandardCharsets.UTF_8);
- List<String> sbList = Arrays.asList(sb.split(System.getProperty("line.separator")));
+ List<String> sbList = Arrays.asList(sb.split("[\r\n]+"));
// Check if test output contains unexpected lines or is missing expected lines.
- List<String> sbOnly = new ArrayList<String>(sbList);
+ List<String> sbOnly = new ArrayList<>(sbList);
sbOnly.removeAll(refFileList);
for (String line: sbOnly)
error("unexpected line found: " + line);
- List<String> refOnly = new ArrayList<String>(refFileList);
+ List<String> refOnly = new ArrayList<>(refFileList);
refOnly.removeAll(sbList);
for (String line: refOnly)
error("expected line not found: " + line);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8019486/WrongLNTForLambdaTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8019486 8026861
+ * @summary javac, generates erroneous LVT for a test case with lambda code
+ * @library /tools/javac/lib
+ * @build ToolBox
+ * @run main WrongLNTForLambdaTest
+ */
+
+import java.io.File;
+import java.nio.file.Paths;
+
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.LineNumberTable_attribute;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.util.Assert;
+
+public class WrongLNTForLambdaTest {
+
+ static final String testSource =
+ /* 01 */ "import java.util.List;\n" +
+ /* 02 */ "import java.util.Arrays;\n" +
+ /* 03 */ "import java.util.stream.Collectors;\n" +
+ /* 04 */ "\n" +
+ /* 05 */ "public class Foo {\n" +
+ /* 06 */ " void bar(int value) {\n" +
+ /* 07 */ " final List<Integer> numbers = Arrays.asList(1, 2, 3);\n" +
+ /* 08 */ " final List<Integer> numbersPlusOne = \n" +
+ /* 09 */ " numbers.stream().map(number -> number / 1).collect(Collectors.toList());\n" +
+ /* 10 */ " }\n" +
+ /* 11 */ " void variablesInLambdas(int value) {\n" +
+ /* 12 */ " Runnable r1 = () -> {\n" +
+ /* 13 */ " int i = value;\n" +
+ /* 14 */ " class FooBar<T extends CharSequence> {\n" +
+ /* 15 */ " public void run() {\n" +
+ /* 16 */ " T t = null;\n" +
+ /* 17 */ " }\n" +
+ /* 18 */ " }\n" +
+ /* 19 */ " };\n" +
+ /* 20 */ " Runnable r2 = () -> System.err.println(1);\n" +
+ /* 21 */ " Runnable r3 = (Runnable & java.io.Serializable) this::foo;\n" +
+ /* 22 */ " Runnable r4 = super :: notify;\n" +
+ /* 23 */ " }\n" +
+ /* 24 */ " private void foo() {}\n" +
+ /* 25 */ "}";
+
+ static final int[][] simpleLambdaExpectedLNT = {
+ // {line-number, start-pc},
+ {9, 0}, //number -> number / 1
+ };
+
+ static final int[][] lambdaWithVarsExpectedLNT = {
+ // {line-number, start-pc},
+ {13, 0}, //number -> number / 1
+ {19, 2}, //number -> number / 1
+ };
+
+ static final int[][] insideLambdaWithVarsExpectedLNT = {
+ // {line-number, start-pc},
+ {16, 0}, //number -> number / 1
+ {17, 2}, //number -> number / 1
+ };
+
+ static final int[][] lambdaVoid2VoidExpectedLNT = {
+ // {line-number, start-pc},
+ {20, 0}, //number -> number / 1
+ };
+
+ static final int[][] deserializeExpectedLNT = {
+ // {line-number, start-pc},
+ {05, 0}, //number -> number / 1
+ };
+
+ static final int[][] lambdaBridgeExpectedLNT = {
+ // {line-number, start-pc},
+ {22, 0}, //number -> number / 1
+ };
+
+ public static void main(String[] args) throws Exception {
+ new WrongLNTForLambdaTest().run();
+ }
+
+ void run() throws Exception {
+ compileTestClass();
+ checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
+ "Foo.class").toUri()), "lambda$bar$0", simpleLambdaExpectedLNT);
+ checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
+ "Foo.class").toUri()), "lambda$variablesInLambdas$1", lambdaWithVarsExpectedLNT);
+ checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
+ "Foo$1FooBar.class").toUri()), "run", insideLambdaWithVarsExpectedLNT);
+ checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
+ "Foo.class").toUri()), "lambda$variablesInLambdas$2", lambdaVoid2VoidExpectedLNT);
+ checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
+ "Foo.class").toUri()), "$deserializeLambda$", deserializeExpectedLNT);
+ checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
+ "Foo.class").toUri()), "lambda$MR$variablesInLambdas$notify$8bc4f5bd$1", lambdaBridgeExpectedLNT);
+ }
+
+ void compileTestClass() throws Exception {
+ ToolBox.JavaToolArgs javacSuccessArgs =
+ new ToolBox.JavaToolArgs().setSources(testSource);
+ ToolBox.javac(javacSuccessArgs);
+ }
+
+ void checkClassFile(final File cfile, String methodToFind, int[][] expectedLNT) throws Exception {
+ ClassFile classFile = ClassFile.read(cfile);
+ boolean methodFound = false;
+ for (Method method : classFile.methods) {
+ if (method.getName(classFile.constant_pool).equals(methodToFind)) {
+ methodFound = true;
+ Code_attribute code = (Code_attribute) method.attributes.get("Code");
+ LineNumberTable_attribute lnt =
+ (LineNumberTable_attribute) code.attributes.get("LineNumberTable");
+ Assert.check(lnt.line_number_table_length == expectedLNT.length,
+ "The LineNumberTable found has a length different to the expected one");
+ int i = 0;
+ for (LineNumberTable_attribute.Entry entry: lnt.line_number_table) {
+ Assert.check(entry.line_number == expectedLNT[i][0] &&
+ entry.start_pc == expectedLNT[i][1],
+ "LNT entry at pos " + i + " differ from expected." +
+ "Found " + entry.line_number + ":" + entry.start_pc +
+ ". Expected " + expectedLNT[i][0] + ":" + expectedLNT[i][1]);
+ i++;
+ }
+ }
+ }
+ Assert.check(methodFound, "The seek method was not found");
+ }
+
+ void error(String msg) {
+ throw new AssertionError(msg);
+ }
+
+}
--- a/langtools/test/tools/javac/T8019486/WrongLVTForLambdaTest.java Fri Nov 08 17:50:24 2013 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8019486
- * @summary javac, generates erroneous LVT for a test case with lambda code
- * @library /tools/javac/lib
- * @build ToolBox
- * @run main WrongLVTForLambdaTest
- */
-
-import java.io.File;
-import java.nio.file.Paths;
-
-import com.sun.tools.classfile.ClassFile;
-import com.sun.tools.classfile.Code_attribute;
-import com.sun.tools.classfile.LineNumberTable_attribute;
-import com.sun.tools.classfile.Method;
-import com.sun.tools.javac.util.Assert;
-
-public class WrongLVTForLambdaTest {
-
- static final String testSource =
- /* 01 */ "import java.util.List;\n" +
- /* 02 */ "import java.util.Arrays;\n" +
- /* 03 */ "import java.util.stream.Collectors;\n" +
- /* 04 */ "\n" +
- /* 05 */ "public class Foo {\n" +
- /* 06 */ " void bar(int value) {\n" +
- /* 07 */ " final List<Integer> numbers = Arrays.asList(1, 2, 3);\n" +
- /* 08 */ " final List<Integer> numbersPlusOne = \n" +
- /* 09 */ " numbers.stream().map(number -> number / 1).collect(Collectors.toList());\n" +
- /* 10 */ " }\n" +
- /* 11 */ "}";
-
- static final int[][] expectedLNT = {
- // {line-number, start-pc},
- {9, 0}, //number -> number / 1
- };
-
- static final String methodToLookFor = "lambda$0";
-
- public static void main(String[] args) throws Exception {
- new WrongLVTForLambdaTest().run();
- }
-
- void run() throws Exception {
- compileTestClass();
- checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
- "Foo.class").toUri()), methodToLookFor);
- }
-
- void compileTestClass() throws Exception {
- ToolBox.JavaToolArgs javacSuccessArgs =
- new ToolBox.JavaToolArgs().setSources(testSource);
- ToolBox.javac(javacSuccessArgs);
- }
-
- void checkClassFile(final File cfile, String methodToFind) throws Exception {
- ClassFile classFile = ClassFile.read(cfile);
- boolean methodFound = false;
- for (Method method : classFile.methods) {
- if (method.getName(classFile.constant_pool).equals(methodToFind)) {
- methodFound = true;
- Code_attribute code = (Code_attribute) method.attributes.get("Code");
- LineNumberTable_attribute lnt =
- (LineNumberTable_attribute) code.attributes.get("LineNumberTable");
- Assert.check(lnt.line_number_table_length == expectedLNT.length,
- "The LineNumberTable found has a length different to the expected one");
- int i = 0;
- for (LineNumberTable_attribute.Entry entry: lnt.line_number_table) {
- Assert.check(entry.line_number == expectedLNT[i][0] &&
- entry.start_pc == expectedLNT[i][1],
- "LNT entry at pos " + i + " differ from expected." +
- "Found " + entry.line_number + ":" + entry.start_pc +
- ". Expected " + expectedLNT[i][0] + ":" + expectedLNT[i][1]);
- i++;
- }
- }
- }
- Assert.check(methodFound, "The seek method was not found");
- }
-
- void error(String msg) {
- throw new AssertionError(msg);
- }
-
-}
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.java Fri Nov 08 17:36:14 2013 -0800
@@ -3,7 +3,6 @@
* @bug 8006733 8006775
* @summary Ensure behavior for nested types is correct.
* @author Werner Dietl
- * @ignore
* @compile/fail/ref=CantAnnotateStaticClass2.out -XDrawDiagnostics CantAnnotateStaticClass2.java
*/
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.out Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.out Fri Nov 08 17:36:14 2013 -0800
@@ -24,10 +24,6 @@
CantAnnotateStaticClass2.java:58:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:65:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:66:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:105:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:107:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:112:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:114:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:120:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:121:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:128:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
@@ -50,6 +46,10 @@
CantAnnotateStaticClass2.java:167:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:169:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:171:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:105:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:107:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:112:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:114:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:184:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:186:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:187:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
@@ -62,4 +62,4 @@
CantAnnotateStaticClass2.java:202:44: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:203:44: compiler.err.cant.type.annotate.scoping.1: @Top.TB
CantAnnotateStaticClass2.java:204:49: compiler.err.cant.type.annotate.scoping: @Top.TA,@Top.TB,@Top.TC
-64 errors
\ No newline at end of file
+64 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/TypeOnAnonClass.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,13 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8023682
+ * @summary Cannot annotate an anonymous class with a target type of TYPE
+ * @compile/fail/ref=TypeOnAnonClass.out -XDrawDiagnostics TypeOnAnonClass.java
+ */
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@interface X {}
+interface Foo {}
+class TypeOnAnonClass { void m() { new @X Foo() {}; } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/TypeOnAnonClass.out Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,2 @@
+TypeOnAnonClass.java:13:40: compiler.err.annotation.type.not.applicable
+1 error
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out Fri Nov 08 17:36:14 2013 -0800
@@ -1,4 +1,5 @@
DeclarationAnnotation.java:10:21: compiler.err.annotation.type.not.applicable
DeclarationAnnotation.java:11:21: compiler.err.annotation.type.not.applicable
DeclarationAnnotation.java:12:21: compiler.err.annotation.type.not.applicable
-3 errors
\ No newline at end of file
+DeclarationAnnotation.java:16:21: compiler.err.annotation.type.not.applicable
+4 errors
--- a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AnonymousClass.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AnonymousClass.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,12 +32,9 @@
*/
class AnonymousClass {
Object o1 = new @TA Object() { };
- // Declaration annotations are also allowed.
- Object o2 = new @TA @DA Object() { };
+ Object o2 = new @TA Object() { };
}
-@interface DA { }
-
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA { }
--- a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/MultiCatch.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/MultiCatch.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,6 @@
/*
* @test
- * @ignore 8008762 Type annotations failures
* @bug 8006775
* @summary new type annotation location: multicatch
* @author Werner Dietl
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java Fri Nov 08 17:36:14 2013 -0800
@@ -21,14 +21,16 @@
* questions.
*/
-import static com.sun.tools.classfile.TypeAnnotation.TargetType.*;
-
/*
* @test
+ * @bug 8026791
* @summary Test population of reference info for constructor results
* @compile -g Driver.java ReferenceInfoUtil.java Constructors.java
* @run main Driver Constructors
*/
+
+import static com.sun.tools.classfile.TypeAnnotation.TargetType.*;
+
public class Constructors {
@TADescriptions({
@@ -42,8 +44,8 @@
}
@TADescriptions({
- @TADescription(annotation = "TA", type = METHOD_RETURN),
- @TADescription(annotation = "TB", type = METHOD_RETURN),
+ @TADescription(annotation = "TA", type = METHOD_RETURN, genericLocation = {1, 0}),
+ @TADescription(annotation = "TB", type = METHOD_RETURN, genericLocation = {1, 0}),
@TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
})
@TestClass("Test$Inner")
@@ -56,9 +58,9 @@
@TADescriptions({
@TADescription(annotation = "TA", type = METHOD_RECEIVER),
- @TADescription(annotation = "TB", type = METHOD_RETURN),
+ @TADescription(annotation = "TB", type = METHOD_RETURN, genericLocation = {1, 0}),
@TADescription(annotation = "TC", type = METHOD_RECEIVER),
- @TADescription(annotation = "TD", type = METHOD_RETURN),
+ @TADescription(annotation = "TD", type = METHOD_RETURN, genericLocation = {1, 0}),
@TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
})
@TestClass("Test$Inner")
@@ -72,9 +74,9 @@
@TADescriptions({
@TADescription(annotation = "TA", type = METHOD_RECEIVER),
@TADescription(annotation = "TB", type = METHOD_RECEIVER, genericLocation = {1, 0}),
- @TADescription(annotation = "TC", type = METHOD_RETURN),
+ @TADescription(annotation = "TC", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0}),
@TADescription(annotation = "TD", type = METHOD_RECEIVER, genericLocation = {1, 0}),
- @TADescription(annotation = "TE", type = METHOD_RETURN),
+ @TADescription(annotation = "TE", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0}),
@TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
})
@TestClass("Outer$Middle$Inner")
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,7 +25,6 @@
/*
* @test
- * @ignore 8008762 Type annotation failures
* @bug 8006732 8006775
* @summary Test population of reference info for multicatch exception parameters
* @author Werner Dietl
--- a/langtools/test/tools/javac/lambda/8016081/T8016081.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/lambda/8016081/T8016081.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,7 @@
interface fint { int get(); }
@interface atype {
- fint fld = ()->( fld == null ?0 : 1);
+ fint fld = ()->1;
}
@atype class T {}
--- a/langtools/test/tools/javac/lambda/LambdaExpr13.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/lambda/LambdaExpr13.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,13 +26,14 @@
* @bug 8003280
* @summary Add lambda tests
* check that recursive lambda (through field ref) is accepted in all contexts
+ * but field initialization
* @compile LambdaExpr13.java
*/
class LambdaExpr13 {
- Runnable ir = () -> { ir.run(); };;
- static Runnable sr = () -> { sr.run(); };
+ Runnable ir;
+ static Runnable sr;
{ ir = () -> { ir.run(); }; }
static { sr = () -> { sr.run(); }; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/LocalVariableTable.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8025998 8026749
+ * @summary Missing LV table in lambda bodies
+ * @compile -g LocalVariableTable.java
+ * @run main LocalVariableTable
+ */
+
+import java.io.*;
+import java.lang.annotation.*;
+import java.util.*;
+import com.sun.tools.classfile.*;
+
+/*
+ * The test checks that a LocalVariableTable attribute is generated for the
+ * method bodies representing lambda expressions, and checks that the expected
+ * set of entries is found in the attribute.
+ *
+ * Since the bug was about missing entries in the LVT, not malformed entries,
+ * the test is not intended to be a detailed test of the contents of each
+ * LocalVariableTable entry: it is assumed that if a entry is present, it
+ * will have the correct contents.
+ *
+ * The test looks for test cases represented by nested classes whose
+ * name begins with "Lambda". Each such class contains a lambda expression
+ * that will mapped into a lambda method, and because the test is compiled
+ * with -g, these methods should have a LocalVariableTable. The set of
+ * expected names in the LVT is provided in an annotation on the class for
+ * the test case.
+ */
+public class LocalVariableTable {
+ public static void main(String... args) throws Exception {
+ new LocalVariableTable().run();
+ }
+
+ void run() throws Exception {
+ // the declared classes are returned in an unspecified order,
+ // so for neatness, sort them by name before processing them
+ Class<?>[] classes = getClass().getDeclaredClasses();
+ Arrays.sort(classes, (c1, c2) -> c1.getName().compareTo(c2.getName()));
+
+ for (Class<?> c : classes) {
+ if (c.getSimpleName().startsWith("Lambda"))
+ check(c);
+ }
+ if (errors > 0)
+ throw new Exception(errors + " errors found");
+ }
+
+ /** Check an individual test case. */
+ void check(Class<?> c) throws Exception {
+ System.err.println("Checking " + c.getSimpleName());
+
+ Expect expect = c.getAnnotation(Expect.class);
+ if (expect == null) {
+ error("@Expect not found for class " + c.getSimpleName());
+ return;
+ }
+
+ ClassFile cf = ClassFile.read(getClass().getResource(c.getName() + ".class").openStream());
+ Method m = getLambdaMethod(cf);
+ if (m == null) {
+ error("lambda method not found");
+ return;
+ }
+
+ Code_attribute code = (Code_attribute) m.attributes.get(Attribute.Code);
+ if (code == null) {
+ error("Code attribute not found");
+ return;
+ }
+
+ LocalVariableTable_attribute lvt =
+ (LocalVariableTable_attribute) code.attributes.get(Attribute.LocalVariableTable);
+ if (lvt == null) {
+ error("LocalVariableTable attribute not found");
+ return;
+ }
+
+ Set<String> foundNames = new LinkedHashSet<>();
+ for (LocalVariableTable_attribute.Entry e: lvt.local_variable_table) {
+ foundNames.add(cf.constant_pool.getUTF8Value(e.name_index));
+ }
+
+ Set<String> expectNames = new LinkedHashSet<>(Arrays.asList(expect.value()));
+ if (!foundNames.equals(expectNames)) {
+ Set<String> foundOnly = new LinkedHashSet<>(foundNames);
+ foundOnly.removeAll(expectNames);
+ for (String s: foundOnly)
+ error("Unexpected name found: " + s);
+ Set<String> expectOnly = new LinkedHashSet<>(expectNames);
+ expectOnly.removeAll(foundNames);
+ for (String s: expectOnly)
+ error("Expected name not found: " + s);
+ }
+ }
+
+ /** Get a method whose name begins "lambda$...". */
+ Method getLambdaMethod(ClassFile cf) throws ConstantPoolException {
+ for (Method m: cf.methods) {
+ if (m.getName(cf.constant_pool).startsWith("lambda$"))
+ return m;
+ }
+ return null;
+ }
+
+ /** Report an error. */
+ void error(String msg) {
+ System.err.println("Error: " + msg);
+ errors++;
+ }
+
+ int errors;
+
+ /**
+ * Annotation used to provide the set of names expected in the LVT attribute.
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @interface Expect {
+ String[] value();
+ }
+
+ /** Functional interface with nullary method. */
+ interface Run0 {
+ public void run();
+ }
+
+ /** Functional interface with 1-ary method. */
+ interface Run1 {
+ public void run(int a0);
+ }
+
+ /** Functional interface with 2-ary method. */
+ interface Run2 {
+ public void run(int a0, int a1);
+ }
+
+ /*
+ * ---------- Test cases ---------------------------------------------------
+ */
+
+ @Expect({ "x" })
+ static class Lambda_Args0_Local1 {
+ Run0 r = () -> { int x = 0; };
+ }
+
+ @Expect({ "x", "this" })
+ static class Lambda_Args0_Local1_this {
+ int v;
+ Run0 r = () -> { int x = v; };
+ }
+
+ @Expect({ "a" })
+ static class Lambda_Args1_Local0 {
+ Run1 r = (a) -> { };
+ }
+
+ @Expect({ "a", "x" })
+ static class Lambda_Args1_Local1 {
+ Run1 r = (a) -> { int x = a; };
+ }
+
+ @Expect({ "a", "x" })
+ static class Lambda_Args1_Local1_Captured1 {
+ void m() {
+ int v = 0;
+ Run1 r = (a) -> { int x = a + v; };
+ }
+ }
+
+ @Expect({ "a1", "a2", "x1", "x2", "this" })
+ static class Lambda_Args2_Local2_Captured2_this {
+ int v;
+ void m() {
+ int v1 = 0;
+ int v2 = 0;
+ Run2 r = (a1, a2) -> {
+ int x1 = a1 + v1 + v;
+ int x2 = a2 + v2 + v;
+ };
+ }
+ }
+
+ @Expect({ "e" })
+ static class Lambda_Try_Catch {
+ private static Runnable asUncheckedRunnable(Closeable c) {
+ return () -> {
+ try {
+ c.close();
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ };
+ }
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8024809/SelfInitializerInLambdaTesta.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 8024809
+ * @summary javac, some lambda programs are rejected by flow analysis
+ * @compile/fail/ref=SelfInitializerInLambdaTesta.out -XDrawDiagnostics SelfInitializerInLambdaTesta.java
+ */
+
+public class SelfInitializerInLambdaTesta {
+
+ final Runnable r1 = ()->System.out.println(r1);
+
+ final Object lock = new Object();
+
+ final Runnable r2 = ()->{
+ System.out.println(r2);
+ synchronized (lock){}
+ };
+
+ final Runnable r3 = ()->{
+ synchronized (lock){
+ System.out.println(r3);
+ }
+ };
+
+ final Runnable r4 = ()->{
+ System.out.println(r4);
+ };
+
+ interface SAM {
+ int m(String s);
+ }
+
+ final SAM s1 = (String s)->{
+ System.out.println(s + s1.toString());
+ return 0;
+ };
+
+ final SAM s2 = (s)->{
+ System.out.println(s + s2.toString());
+ return 0;
+ };
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8024809/SelfInitializerInLambdaTesta.out Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,7 @@
+SelfInitializerInLambdaTesta.java:33:48: compiler.err.illegal.self.ref
+SelfInitializerInLambdaTesta.java:38:28: compiler.err.illegal.self.ref
+SelfInitializerInLambdaTesta.java:44:32: compiler.err.illegal.self.ref
+SelfInitializerInLambdaTesta.java:49:28: compiler.err.illegal.self.ref
+SelfInitializerInLambdaTesta.java:57:32: compiler.err.illegal.self.ref
+SelfInitializerInLambdaTesta.java:62:32: compiler.err.illegal.self.ref
+6 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8024809/SelfInitializerInLambdaTestb.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8024809
+ * @summary javac, some lambda programs are rejected by flow analysis
+ * @compile/fail/ref=SelfInitializerInLambdaTestb.out -XDrawDiagnostics SelfInitializerInLambdaTestb.java
+ */
+
+public class SelfInitializerInLambdaTestb {
+
+ final Runnable r1;
+
+ final Runnable r2 = ()-> System.out.println(r1);
+
+ SelfInitializerInLambdaTestb() {
+ r1 = ()->System.out.println(r1);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8024809/SelfInitializerInLambdaTestb.out Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,3 @@
+SelfInitializerInLambdaTestb.java:35:49: compiler.err.var.might.not.have.been.initialized: r1
+SelfInitializerInLambdaTestb.java:38:37: compiler.err.var.might.not.have.been.initialized: r1
+2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8025290/ExplicitVSImplicitLambdaTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8025290
+ * @summary javac implicit versus explicit lambda compilation error
+ * @compile ExplicitVSImplicitLambdaTest.java
+ */
+
+import java.util.function.*;
+
+public class ExplicitVSImplicitLambdaTest {
+ private void test()
+ {
+ /* in the explicit case "e" is inferred to String so we can use a String
+ * only method.
+ */
+ MyComparator.mycomparing1((String e) -> e.concat(""));
+ MyComparator.mycomparing2((String e) -> e.concat(""));
+ MyComparator.mycomparing3((String e) -> e.concat(""));
+ MyComparator.mycomparing4((String e) -> e.concat(""));
+
+ /* in the implicit case "e" is inferred to Object so toString() is OK.
+ */
+ MyComparator.mycomparing1((e) -> e.toString());
+ MyComparator.mycomparing2((e) -> e.toString());
+ MyComparator.mycomparing3((e) -> e.toString());
+ MyComparator.mycomparing4((e) -> e.toString());
+ }
+}
+
+interface MyComparator<T> {
+ public static <T, U extends Comparable<? super U>> MyComparator<T> mycomparing1(
+ Function<? super T, ? extends U> keyExtractor) {
+ return null;
+ }
+
+ public static <T, U extends Comparable<? super U>> MyComparator<T> mycomparing2(
+ Function<? super T, ? super U> keyExtractor) {
+ return null;
+ }
+
+ public static <T, U extends Comparable<? super U>> MyComparator<T> mycomparing3(
+ Function<? extends T, ? extends U> keyExtractor) {
+ return null;
+ }
+
+ public static <T, U extends Comparable<? super U>> MyComparator<T> mycomparing4(
+ Function<? extends T, ? super U> keyExtractor) {
+ return null;
+ }
+}
--- a/langtools/test/tools/javac/lambda/TargetType58.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/lambda/TargetType58.java Fri Nov 08 17:36:14 2013 -0800
@@ -35,7 +35,7 @@
class TargetType58 {
void test(List<Integer> li) {
- g(li, s -> s.substream(200), Collections.emptyList());
+ g(li, s -> s.skip(200), Collections.emptyList());
}
<T, U, S_OUT extends Stream<U>,
--- a/langtools/test/tools/javac/lambda/TestSelfRef.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/lambda/TestSelfRef.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
* consistently w.r.t. local inner classes
*/
-import com.sun.source.util.JavacTask;
import java.net.URI;
import java.util.Arrays;
import javax.tools.Diagnostic;
@@ -38,6 +37,7 @@
import javax.tools.SimpleJavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
+import com.sun.source.util.JavacTask;
public class TestSelfRef {
@@ -176,10 +176,16 @@
check();
}
- void check() {
+ boolean isErrorExpected() {
//illegal forward ref
- boolean errorExpected = ik.inMethodContext(sk) &&
- (rk.selfRef || rk.forwardRef);
+ boolean result = ik.inMethodContext(sk) && (rk.selfRef || rk.forwardRef);
+ result |= (rk == RefKind.SELF_LAMBDA || rk == RefKind.FORWARD_LAMBDA);
+ return result;
+ }
+
+ void check() {
+ checkCount++;
+ boolean errorExpected = isErrorExpected();
if (diagChecker.errorFound != errorExpected) {
throw new Error("invalid diagnostics for source:\n" +
source.getCharContent(true) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/TestSerializedLambdaNameStability.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8023668
+ * @summary Desugar serializable lambda bodies using more robust naming scheme
+ * @library /tools/javac/lib
+ * @build ToolBox
+ * @run main TestSerializedLambdaNameStability
+ */
+
+import java.io.*;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.file.*;
+
+public class TestSerializedLambdaNameStability {
+
+ final ClassLoader writingClassLoader;
+ final ClassLoader clonedClassLoader;
+ final ClassLoader checkingClassLoader;
+
+ TestSerializedLambdaNameStability() {
+ writingClassLoader = new TestClassLoader("before");
+ clonedClassLoader = new TestClassLoader("before");
+ checkingClassLoader = new TestClassLoader("after");
+ }
+
+ public static void main(String... args) throws Exception {
+ new TestSerializedLambdaNameStability().doit("NameOfCapturedArgs", true);
+ new TestSerializedLambdaNameStability().doit("TypesOfCapturedArgs", true);
+ new TestSerializedLambdaNameStability().doit("OrderOfCapturedArgs", true);
+ new TestSerializedLambdaNameStability().doit("VariableAssignmentTarget", false);
+ new TestSerializedLambdaNameStability().doit("TargetName", true);
+ new TestSerializedLambdaNameStability().doit("TargetType", true);
+ }
+
+ public void doit(String name, boolean expectFail) throws Exception {
+ String iName = "I" + name;
+ String testName = "TEST" + name;
+ Class<?> kw = writingClassLoader.loadClass(testName);
+ Object instw = getInstance(kw);
+ Method mw = getMethod(kw, "write", ObjectOutput.class);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try (ObjectOutput out = new ObjectOutputStream(baos)) {
+ mw.invoke(instw, out);
+ }
+ byte[] ser = baos.toByteArray();
+
+ // Read and check clone
+ readCheck(iName, testName, clonedClassLoader, ser);
+ System.err.printf("cloned test readCheck %s\n", testName);
+
+ // Read and check other
+ if (expectFail) {
+ try {
+ readCheck(iName, testName, checkingClassLoader, ser);
+ } catch (InvocationTargetException ite) {
+ Throwable underlying = ite;
+ while (underlying != null && !(underlying instanceof IllegalArgumentException)) {
+ underlying = underlying.getCause();
+ }
+ if (underlying != null) {
+ if (underlying.getMessage().contains("deserialization")) {
+ System.err.printf("PASS: other test %s got expected exception %s\n", testName, underlying);
+ return;
+ }
+ }
+ System.err.printf("FAIL: other test %s got unexpected exception %s\n", testName, ite);
+ throw new Exception("unexpected exception ", ite);
+ }
+ System.err.printf("FAIL: other test %s expected an exception", testName);
+ throw new Exception("expected an exception" + testName);
+ } else {
+ readCheck(iName, testName, checkingClassLoader, ser);
+ System.err.printf("PASS: other test %s readCheck\n", testName);
+ }
+ }
+
+ void readCheck(String iName, String testName, ClassLoader loader, byte[] ser) throws Exception {
+ Class<?> k = loader.loadClass(testName);
+ Object inst = getInstance(k);
+ Method mrc = getMethod(k, "readCheck", ObjectInput.class);
+ ByteArrayInputStream bais = new ByteArrayInputStream(ser);
+ try (ObjectInput in = new ObjectInputStream(bais)) {
+ mrc.invoke(inst, in);
+ }
+ }
+
+ Method getMethod(Class<?> k, String name, Class<?> argTypes) throws Exception {
+ Method meth = k.getDeclaredMethod(name, argTypes);
+ meth.setAccessible(true);
+ return meth;
+ }
+
+ Object getInstance(Class<?> k) throws Exception {
+ Constructor<?> cons = k.getConstructors()[0];
+ cons.setAccessible(true);
+ return cons.newInstance();
+ }
+
+ static class TestClassLoader extends ClassLoader {
+ static final String compiledDir = System.getProperty("user.dir");
+ static final String sourceBaseDir = System.getProperty("test.src");
+
+ final String context;
+
+ public TestClassLoader(String context) {
+ super();
+ this.context = context;
+ }
+
+ @Override
+ public Class findClass(String name) throws ClassNotFoundException {
+ byte[] b;
+
+ try {
+ b = loadClassData(name);
+ } catch (Throwable th) {
+ // th.printStackTrace();
+ throw new ClassNotFoundException("Loading error", th);
+ }
+ return defineClass(name, b, 0, b.length);
+ }
+
+ private byte[] loadClassData(String name) throws Exception {
+ String srcName;
+ if (name.startsWith("TEST"))
+ srcName = name;
+ else if (name.startsWith("I"))
+ srcName = "TEST" + name.substring(1);
+ else
+ throw new Exception("Did not expect to load " + name);
+ Path srcFile = Paths.get(sourceBaseDir, context, srcName + ".java");
+ String testSource = new String(Files.readAllBytes(srcFile));
+ ToolBox.JavaToolArgs javacSuccessArgs =
+ new ToolBox.JavaToolArgs().setSources(testSource);
+ ToolBox.javac(javacSuccessArgs);
+ Path cfFile = Paths.get(compiledDir, name + ".class");
+ byte[] bytes = Files.readAllBytes(cfFile);
+ return bytes;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/after/TESTNameOfCapturedArgs.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+
+interface INameOfCapturedArgs extends Serializable {
+ int get();
+}
+
+class TESTNameOfCapturedArgs {
+
+ public TESTNameOfCapturedArgs() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ int y = 44;
+ INameOfCapturedArgs res = () -> y;
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ INameOfCapturedArgs lam = (INameOfCapturedArgs) in.readObject();
+ int val = lam.get();
+ if (val != 44) {
+ throw new IllegalArgumentException("Expected 44");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/after/TESTOrderOfCapturedArgs.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+
+interface IOrderOfCapturedArgs extends Serializable {
+ String get();
+}
+
+class TESTOrderOfCapturedArgs {
+
+ public TESTOrderOfCapturedArgs() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ String a = "fu";
+ String b = "bar";
+ IOrderOfCapturedArgs res = () -> b + a;
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ IOrderOfCapturedArgs lam = (IOrderOfCapturedArgs) in.readObject();
+ Object val = lam.get();
+ if (!val.equals("fubar")) {
+ throw new IllegalArgumentException("Expected 'fubar'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/after/TESTTargetName.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+
+interface ITargetName extends Serializable {
+ String get();
+}
+
+class TESTTargetName {
+
+ public TESTTargetName() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ ITargetName resist = () -> "fubar";
+ out.writeObject(resist);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ ITargetName lam = (ITargetName) in.readObject();
+ Object val = lam.get();
+ if (!val.equals("fubar")) {
+ throw new IllegalArgumentException("Expected 'fubar'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/after/TESTTargetType.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+import java.util.function.*;
+
+class TESTTargetType {
+
+ public TESTTargetType() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ Object res = (Predicate<String> & Serializable) ((str) -> str.length() > 3);
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ in.readObject();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/after/TESTTypesOfCapturedArgs.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+
+interface ITypesOfCapturedArgs extends Serializable {
+ Object get();
+}
+
+class TESTTypesOfCapturedArgs {
+
+ public TESTTypesOfCapturedArgs() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ Object x = "hi";
+ ITypesOfCapturedArgs res = () -> x;
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ ITypesOfCapturedArgs lam = (ITypesOfCapturedArgs) in.readObject();
+ Object val = lam.get();
+ if (!val.equals("hi")) {
+ throw new IllegalArgumentException("Expected 'hi'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/after/TESTVariableAssignmentTarget.java Fri Nov 08 17:36:14 2013 -0800
@@ -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.
+ */
+
+import java.io.*;
+
+interface IVariableAssignmentTarget extends Serializable {
+ String get();
+}
+
+class TESTVariableAssignmentTarget {
+
+ public TESTVariableAssignmentTarget() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ IVariableAssignmentTarget res2 = () -> "bar";
+ IVariableAssignmentTarget res1 = () -> "fu";
+ out.writeObject(res1);
+ out.writeObject(res2);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ IVariableAssignmentTarget lam = (IVariableAssignmentTarget) in.readObject();
+ Object val = lam.get();
+ if (!val.equals("fu")) {
+ throw new IllegalArgumentException("Expected 'fu'");
+ }
+ lam = (IVariableAssignmentTarget) in.readObject();
+ val = lam.get();
+ if (!val.equals("bar")) {
+ throw new IllegalArgumentException("Expected 'bar'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/before/TESTNameOfCapturedArgs.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+
+interface INameOfCapturedArgs extends Serializable {
+ int get();
+}
+
+class TESTNameOfCapturedArgs {
+
+ public TESTNameOfCapturedArgs() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ int x = 44;
+ INameOfCapturedArgs res = () -> x;
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ INameOfCapturedArgs lam = (INameOfCapturedArgs) in.readObject();
+ int val = lam.get();
+ if (val != 44) {
+ throw new IllegalArgumentException("Expected 44");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/before/TESTOrderOfCapturedArgs.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+
+interface IOrderOfCapturedArgs extends Serializable {
+ String get();
+}
+
+class TESTOrderOfCapturedArgs {
+
+ public TESTOrderOfCapturedArgs() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ String a = "fu";
+ String b = "bar";
+ IOrderOfCapturedArgs res = () -> a + b;
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ IOrderOfCapturedArgs lam = (IOrderOfCapturedArgs) in.readObject();
+ Object val = lam.get();
+ if (!val.equals("fubar")) {
+ throw new IllegalArgumentException("Expected 'fubar'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/before/TESTTargetName.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+
+interface ITargetName extends Serializable {
+ String get();
+}
+
+class TESTTargetName {
+
+ public TESTTargetName() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ ITargetName res = () -> "fubar";
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ ITargetName lam = (ITargetName) in.readObject();
+ Object val = lam.get();
+ if (!val.equals("fubar")) {
+ throw new IllegalArgumentException("Expected 'fubar'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/before/TESTTargetType.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+import java.util.function.*;
+
+class TESTTargetType {
+
+ public TESTTargetType() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ Object res = (Function<String, Boolean> & Serializable) ((str) -> str.length() > 3);
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ in.readObject();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/before/TESTTypesOfCapturedArgs.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.*;
+
+interface ITypesOfCapturedArgs extends Serializable {
+ Object get();
+}
+
+class TESTTypesOfCapturedArgs {
+
+ public TESTTypesOfCapturedArgs() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ String x = "hi";
+ ITypesOfCapturedArgs res = () -> x;
+ out.writeObject(res);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ ITypesOfCapturedArgs lam = (ITypesOfCapturedArgs) in.readObject();
+ Object val = lam.get();
+ if (!val.equals("hi")) {
+ throw new IllegalArgumentException("Expected 'hi'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/lambdaNaming/before/TESTVariableAssignmentTarget.java Fri Nov 08 17:36:14 2013 -0800
@@ -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.
+ */
+
+import java.io.*;
+
+interface IVariableAssignmentTarget extends Serializable {
+ String get();
+}
+
+class TESTVariableAssignmentTarget {
+
+ public TESTVariableAssignmentTarget() {
+ }
+
+ public void write(ObjectOutput out) throws IOException {
+ IVariableAssignmentTarget res1 = () -> "fu";
+ IVariableAssignmentTarget res2 = () -> "bar";
+ out.writeObject(res1);
+ out.writeObject(res2);
+ }
+
+ public void readCheck(ObjectInput in) throws Exception {
+ IVariableAssignmentTarget lam = (IVariableAssignmentTarget) in.readObject();
+ Object val = lam.get();
+ if (!val.equals("fu")) {
+ throw new IllegalArgumentException("Expected 'fu'");
+ }
+ lam = (IVariableAssignmentTarget) in.readObject();
+ val = lam.get();
+ if (!val.equals("bar")) {
+ throw new IllegalArgumentException("Expected 'bar'");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/privateMethodReferences/MethodInvoker.java Fri Nov 08 17:36:14 2013 -0800
@@ -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
+ * @bug 8022720
+ * @summary private method should be accessible (nested classes)
+ * @run main MethodInvoker
+ */
+
+interface MyFunctionalInterface1 {
+ int invokeMethodReference();
+}
+
+public class MethodInvoker {
+ public static void main(String[] args) throws Exception {
+ MethodInvoker.invoke();
+ System.out.println("Passed!");
+ }
+ public static void invoke() throws Exception {
+ MethodSupplier ms = new MethodSupplier();
+ MyFunctionalInterface1 fi = ms::m;
+ if (fi.invokeMethodReference() != 123) {
+ throw new Exception();
+ }
+ }
+ static class MethodSupplier {
+ private int m() {
+ return 123;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/privateMethodReferences/MethodSupplier.java Fri Nov 08 17:36:14 2013 -0800
@@ -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
+ * @bug 8022720
+ * @summary private method should be accessible (nested classes)
+ * @run main MethodSupplier
+ */
+
+interface MyFunctionalInterface2 {
+ int invokeMethodReference();
+}
+
+public class MethodSupplier {
+ public static void main(String[] args) throws Exception {
+ MethodInvoker.invoke();
+ System.out.println("Passed!");
+ }
+ private int m() {
+ return 4321;
+ }
+ static class MethodInvoker {
+ public static void invoke() throws Exception {
+ MethodSupplier ms = new MethodSupplier();
+ MyFunctionalInterface2 fi = ms::m;
+ if (fi.invokeMethodReference() != 4321) {
+ throw new Exception();
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/privateMethodReferences/ThirdClass.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,55 @@
+/*
+ * 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 8022720
+ * @summary private method should be accessible (nested classes)
+ * @run main ThirdClass
+ */
+
+interface MyFunctionalInterface3 {
+ int invokeMethodReference();
+}
+
+public class ThirdClass {
+ public static void main(String[] args) throws Exception {
+ MethodInvoker.invoke();
+ System.out.println("Passed!");
+ }
+ static class MethodSupplier {
+ private int m() {
+ return 999;
+ }
+ }
+
+ static class MethodInvoker {
+ public static void invoke() throws Exception {
+ MethodSupplier ms = new MethodSupplier();
+ MyFunctionalInterface3 fi = ms::m;
+ if (fi.invokeMethodReference() != 999) {
+ throw new Exception();
+ }
+ }
+ }
+}
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/Compiler.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/Compiler.java Fri Nov 08 17:36:14 2013 -0800
@@ -46,7 +46,7 @@
USECACHE // Keeps results around for reuse. Only use this is
// you're sure that each compilation name maps to the
// same source code
- };
+ }
private static final AtomicInteger counter = new AtomicInteger();
private static final String targetDir = "gen-separate";
@@ -85,7 +85,7 @@
}
public void setFlags(Flags ... flags) {
- this.flags = new HashSet<Flags>(Arrays.asList(flags));
+ this.flags = new HashSet<>(Arrays.asList(flags));
}
public void addPostprocessor(ClassFilePreprocessor cfp) {
@@ -131,17 +131,10 @@
outputDirs.put(type.getName(), outDir);
Class superClass = type.getSuperclass();
- if (superClass != null) {
- for( Map.Entry<String,File> each : compileHierarchy(superClass).entrySet()) {
- outputDirs.put(each.getKey(), each.getValue());
- }
- }
- for (Extends ext : type.getSupertypes()) {
- Type iface = ext.getType();
- for( Map.Entry<String,File> each : compileHierarchy(iface).entrySet()) {
- outputDirs.put(each.getKey(), each.getValue());
- }
- }
+ if (superClass != null)
+ outputDirs.putAll(compileHierarchy(superClass));
+ for (Extends ext : type.getSupertypes())
+ outputDirs.putAll(compileHierarchy(ext.getType()));
return outputDirs;
}
@@ -157,8 +150,12 @@
SourceProcessor accum =
(name, src) -> { files.add(new SourceFile(name, src)); };
- for (Type dep : type.typeDependencies()) {
- dep.generateAsDependency(accum, type.methodDependencies());
+ Collection<Type> deps = type.typeDependencies(type.isFullCompilation());
+ for (Type dep : deps) {
+ if (type.isFullCompilation())
+ dep.generate(accum);
+ else
+ dep.generateAsDependency(accum, type.methodDependencies());
}
type.generate(accum);
@@ -185,7 +182,7 @@
StandardLocation.CLASS_OUTPUT, Arrays.asList(destDir));
} catch (IOException e) {
throw new RuntimeException(
- "IOException encountered during compilation");
+ "IOException encountered during compilation", e);
}
Boolean result = ct.call();
if (result == Boolean.FALSE) {
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/SourceModel.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/SourceModel.java Fri Nov 08 17:36:14 2013 -0800
@@ -48,7 +48,7 @@
generate(pw);
return sw.toString();
}
- };
+ }
public static class AccessFlag extends Element {
private String flag;
@@ -125,6 +125,7 @@
// (and thus will be present in stubs)
private Set<Method> methodDependencies;
private List<Type> typeDependencies;
+ private boolean fullCompilation;
protected Type(String name,
List<AccessFlag> flags, List<TypeParameter> params,
@@ -214,6 +215,14 @@
methodDependencies.add(m);
}
+ public boolean isFullCompilation() {
+ return fullCompilation;
+ }
+
+ public void setFullCompilation(boolean fullCompilation) {
+ this.fullCompilation = fullCompilation;
+ }
+
// Convenience method for creating an Extends object using this
// class and specified type arguments.
public Extends with(String ... args) {
@@ -255,14 +264,23 @@
pw.println("}");
}
- public Collection<Type> typeDependencies() {
+ public Collection<Type> typeDependencies(boolean recursive) {
HashMap<String,Type> dependencies = new HashMap<>();
Type superclass = getSuperclass();
if (superclass != null) {
dependencies.put(superclass.getName(), superclass);
+ if (recursive) {
+ for (Type t : superclass.typeDependencies(true))
+ dependencies.put(t.getName(), t);
+ }
}
- for (Extends e : getSupertypes())
+ for (Extends e : getSupertypes()) {
dependencies.put(e.getType().getName(), e.getType());
+ if (recursive) {
+ for (Type t : e.getType().typeDependencies(true))
+ dependencies.put(t.getName(), t);
+ }
+ }
// Do these last so that they override
for (Type t : this.typeDependencies)
dependencies.put(t.getName(), t);
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/TestHarness.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/TestHarness.java Fri Nov 08 17:36:14 2013 -0800
@@ -198,7 +198,7 @@
assertEquals(res, value);
}
} catch (InvocationTargetException | IllegalAccessException e) {
- fail("Unexpected exception thrown: " + e.getCause());
+ fail("Unexpected exception thrown: " + e.getCause(), e.getCause());
}
}
@@ -227,8 +227,7 @@
* a return type of 'int', and no arguments.
*/
public void assertInvokeVirtualEquals(int value, Class target) {
- assertInvokeVirtualEquals(
- new Integer(value), target, stdCM, "-1");
+ assertInvokeVirtualEquals(value, target, stdCM, "-1");
}
/**
@@ -260,12 +259,31 @@
Compiler compiler = compilerLocal.get();
compiler.setFlags(compilerFlags());
- assertInvokeInterfaceEquals(
- new Integer(value), target, new Extends(iface), stdAM);
+ assertInvokeInterfaceEquals(value, target, new Extends(iface), stdAM);
compiler.cleanup();
}
+ protected void assertInvokeInterfaceThrows(java.lang.Class<? extends Throwable> errorClass,
+ Class target, Extends iface, AbstractMethod method,
+ String... args) {
+ try {
+ assertInvokeInterfaceEquals(0, target, iface, method, args);
+ fail("Expected exception: " + errorClass);
+ }
+ catch (AssertionError e) {
+ Throwable cause = e.getCause();
+ if (cause == null)
+ throw e;
+ else if ((errorClass.isAssignableFrom(cause.getClass()))) {
+ // this is success
+ return;
+ }
+ else
+ throw e;
+ }
+ }
+
/**
* Creates a class which calls target::method(args) via invokevirtual,
* compiles and loads both the new class and 'target', and then invokes
@@ -300,7 +318,7 @@
if (verboseLocal.get() == Boolean.TRUE) {
System.out.println(e.getCause());
}
- assertEquals(e.getCause().getClass(), exceptionType);
+ assertTrue(exceptionType.isAssignableFrom(e.getCause().getClass()));
}
compiler.cleanup();
}
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,22 @@
package org.openjdk.tests.vm;
-import java.lang.reflect.*;
-import java.util.*;
-import java.io.File;
-import java.io.IOException;
-
+import org.openjdk.tests.separate.Compiler;
+import org.openjdk.tests.separate.TestHarness;
import org.testng.annotations.Test;
-import org.openjdk.tests.separate.*;
-import org.openjdk.tests.separate.Compiler;
-import static org.testng.Assert.*;
-import static org.openjdk.tests.separate.SourceModel.*;
+import static org.openjdk.tests.separate.SourceModel.AbstractMethod;
+import static org.openjdk.tests.separate.SourceModel.AccessFlag;
import static org.openjdk.tests.separate.SourceModel.Class;
+import static org.openjdk.tests.separate.SourceModel.ConcreteMethod;
+import static org.openjdk.tests.separate.SourceModel.DefaultMethod;
+import static org.openjdk.tests.separate.SourceModel.Extends;
+import static org.openjdk.tests.separate.SourceModel.Interface;
+import static org.openjdk.tests.separate.SourceModel.MethodParameter;
+import static org.openjdk.tests.separate.SourceModel.TypeParameter;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.fail;
@Test(groups = "vm")
public class DefaultMethodsTest extends TestHarness {
@@ -186,7 +190,7 @@
* TEST: D d = new D(); d.m() == 22;
* TEST: I i = new D(); i.m() == 22;
*/
- void testExistingInheritedOverride() {
+ public void testExistingInheritedOverride() {
Interface I = new Interface("I", DefaultMethod.std("99"));
Class C = new Class("C", I, ConcreteMethod.std("11"));
Class D = new Class("D", C, ConcreteMethod.std("22"));
@@ -255,15 +259,14 @@
* interface J { default int m() { return 88; } }
* class C implements I, J {}
*
- * TEST: C c = new C(); c.m() throws AME
+ * TEST: C c = new C(); c.m() throws ICCE
*/
public void testConflict() {
- // debugTest();
Interface I = new Interface("I", DefaultMethod.std("99"));
Interface J = new Interface("J", DefaultMethod.std("88"));
Class C = new Class("C", I, J);
- assertThrows(AbstractMethodError.class, C);
+ assertThrows(IncompatibleClassChangeError.class, C);
}
/**
@@ -271,14 +274,14 @@
* interface J { default int m() { return 88; } }
* class C implements I, J {}
*
- * TEST: C c = new C(); c.m() throws AME
+ * TEST: C c = new C(); c.m() == 88
*/
public void testAmbiguousReabstract() {
Interface I = new Interface("I", AbstractMethod.std());
Interface J = new Interface("J", DefaultMethod.std("88"));
Class C = new Class("C", I, J);
- assertThrows(AbstractMethodError.class, C);
+ assertInvokeVirtualEquals(88, C);
}
/**
@@ -390,19 +393,16 @@
/**
* interface I<T> { default int m(T t) { return 99; } }
- * Class C implements I<String> { public int m() { return 88; } }
+ * Class C implements I<String> { public int m(String s) { return 88; } }
*
- * TEST: C c = new C(); c.m() == 88;
- * TEST: I i = new C(); i.m() == 88;
+ * TEST: C c = new C(); c.m("string") == 88;
+ * TEST: I i = new C(); i.m("string") == 88;
*/
- @Test(enabled=false)
public void testSelfFill() {
// This test ensures that a concrete method overrides a default method
// that matches at the language-level, but has a different method
// signature due to erasure.
- // debugTest();
-
DefaultMethod dm = new DefaultMethod(
"int", "m", "return 99;", new MethodParameter("T", "t"));
ConcreteMethod cm = new ConcreteMethod(
@@ -415,9 +415,11 @@
AbstractMethod pm = new AbstractMethod(
"int", "m", new MethodParameter("T", "t"));
- assertInvokeVirtualEquals(new Integer(88), C, cm, "-1", "\"string\"");
- assertInvokeInterfaceEquals(
- new Integer(88), C, I.with("String"), pm, "\"string\"");
+ assertInvokeVirtualEquals(88, C, cm, "-1", "\"string\"");
+ assertInvokeInterfaceEquals(99, C, I.with("String"), pm, "\"string\"");
+
+ C.setFullCompilation(true); // Force full bridge generation
+ assertInvokeInterfaceEquals(88, C, I.with("String"), pm, "\"string\"");
}
/**
@@ -485,7 +487,6 @@
* TEST: J<String,String> j = new C(); j.m("A","B","C") == 88;
* TEST: K<String> k = new C(); k.m("A","B","C") == 88;
*/
- @Test(enabled=false)
public void testBridges() {
DefaultMethod dm = new DefaultMethod("int", stdMethodName, "return 99;",
new MethodParameter("T", "t"), new MethodParameter("V", "v"),
@@ -518,13 +519,17 @@
J.with("String", "T"), pm2);
Class C = new Class("C", K.with("String"), cm);
+ // First, without compiler bridges
String[] args = new String[] { "\"A\"", "\"B\"", "\"C\"" };
- assertInvokeInterfaceEquals(new Integer(88), C,
- I.with("String", "String", "String"), pm0, args);
- assertInvokeInterfaceEquals(new Integer(88), C,
- J.with("String", "String"), pm1, args);
- assertInvokeInterfaceEquals(new Integer(88), C,
- K.with("String"), pm2, args);
+ assertInvokeInterfaceEquals(99, C, I.with("String", "String", "String"), pm0, args);
+ assertInvokeInterfaceThrows(AbstractMethodError.class, C, J.with("String", "String"), pm1, args);
+ assertInvokeInterfaceThrows(AbstractMethodError.class, C, K.with("String"), pm2, args);
+
+ // Then with compiler bridges
+ C.setFullCompilation(true);
+ assertInvokeInterfaceEquals(88, C, I.with("String", "String", "String"), pm0, args);
+ assertInvokeInterfaceEquals(88, C, J.with("String", "String"), pm1, args);
+ assertInvokeInterfaceEquals(88, C, K.with("String"), pm2, args);
}
/**
@@ -536,8 +541,6 @@
* TEST: I i = new C(); i.m() == 88;
*/
public void testSuperBasic() {
- // debugTest();
-
Interface J = new Interface("J", DefaultMethod.std("88"));
Interface I = new Interface("I", J, new DefaultMethod(
"int", stdMethodName, "return J.super.m();"));
@@ -555,12 +558,10 @@
* interface I extends J, K { int m() default { J.super.m(); } }
* class C implements I {}
*
- * TEST: C c = new C(); c.m() throws AME
- * TODO: add case for K k = new C(); k.m() throws AME
+ * TEST: C c = new C(); c.m() throws ICCE
+ * TODO: add case for K k = new C(); k.m() throws ICCE
*/
public void testSuperConflict() {
- // debugTest();
-
Interface K = new Interface("K", DefaultMethod.std("99"));
Interface L = new Interface("L", DefaultMethod.std("101"));
Interface J = new Interface("J", K, L);
@@ -571,7 +572,7 @@
I.addCompilationDependency(Jstub.findMethod(stdMethodName));
Class C = new Class("C", I);
- assertThrows(AbstractMethodError.class, C);
+ assertThrows(IncompatibleClassChangeError.class, C);
}
/**
@@ -579,8 +580,8 @@
* interface J extends I { default int m() { return 55; } }
* class C implements I, J { public int m() { return I.super.m(); } }
*
- * TEST: C c = new C(); c.m() throws AME
- * TODO: add case for J j = new C(); j.m() throws AME
+ * TEST: C c = new C(); c.m() == 99
+ * TODO: add case for J j = new C(); j.m() == ???
*/
public void testSuperDisqual() {
Interface I = new Interface("I", DefaultMethod.std("99"));
@@ -590,7 +591,7 @@
AccessFlag.PUBLIC));
C.addCompilationDependency(I.findMethod(stdMethodName));
- assertThrows(AbstractMethodError.class, C);
+ assertInvokeVirtualEquals(99, C);
}
/**
@@ -635,8 +636,7 @@
AbstractMethod pm = new AbstractMethod("int", stdMethodName,
new MethodParameter("String", "s"));
- assertInvokeInterfaceEquals(
- new Integer(88), C, new Extends(I), pm, "\"\"");
+ assertInvokeInterfaceEquals(88, C, new Extends(I), pm, "\"\"");
}
/**
@@ -646,7 +646,7 @@
* public int m(String s) { return I.super.m(s); }
* }
*
- * TEST: C c = new C(); c.m("string") throws AME
+ * TEST: C c = new C(); c.m("string") == 44
*/
public void testSuperGenericDisqual() {
MethodParameter t = new MethodParameter("T", "t");
@@ -661,7 +661,7 @@
"return I.super.m(s);", AccessFlag.PUBLIC, s));
C.addCompilationDependency(I.findMethod(stdMethodName));
- assertThrows(AbstractMethodError.class, C,
+ assertInvokeVirtualEquals(44, C,
new ConcreteMethod(
"int", stdMethodName, "return -1;", AccessFlag.PUBLIC, s),
"-1", "\"string\"");
@@ -674,7 +674,6 @@
* class S { Object foo() { return (new D()).m(); } // link sig: ()LInteger;
* TEST: S s = new S(); s.foo() == new Integer(99)
*/
- @Test(enabled=false)
public void testCovarBridge() {
Interface I = new Interface("I", new DefaultMethod(
"Integer", "m", "return new Integer(88);"));
@@ -692,7 +691,8 @@
S.addCompilationDependency(Dstub);
S.addCompilationDependency(DstubMethod);
- assertInvokeVirtualEquals(new Integer(99), S, toCall, "null");
+ // NEGATIVE test for separate compilation -- dispatches to I, not C
+ assertInvokeVirtualEquals(88, S, toCall, "null");
}
/**
@@ -719,7 +719,7 @@
S.addCompilationDependency(Dstub);
S.addCompilationDependency(DstubMethod);
- assertInvokeVirtualEquals(new Integer(88), S, toCall, "null");
+ assertInvokeVirtualEquals(88, S, toCall, "null");
}
/**
@@ -757,7 +757,6 @@
* Test that a erased-signature-matching method does not implement
* non-language-level matching methods
*/
- @Test(enabled=false)
public void testNonConcreteFill() {
AbstractMethod ipm = new AbstractMethod("int", "m",
new MethodParameter("T", "t"),
@@ -781,13 +780,14 @@
new MethodParameter("T", "t"),
new MethodParameter("String", "s"),
new MethodParameter("String", "w"));
+ DefaultMethod kdm = new DefaultMethod("int", "m", "return 99;",
+ new MethodParameter("T", "t"),
+ new MethodParameter("String", "v"),
+ new MethodParameter("String", "w"));
Interface K = new Interface("K",
new TypeParameter("T"),
J.with("T", "String"),
- new DefaultMethod("int", "m", "return 99;",
- new MethodParameter("T", "t"),
- new MethodParameter("String", "v"),
- new MethodParameter("String", "w")));
+ kdm);
Class C = new Class("C",
K.with("String"),
@@ -797,13 +797,18 @@
new MethodParameter("Object", "v"),
new MethodParameter("String", "w")));
+ // First, without compiler bridges
String a = "\"\"";
- assertInvokeInterfaceEquals(99, C,
- K.with("String"), kpm, a, a, a);
- assertInvokeInterfaceEquals(77, C,
- J.with("String", "String"), jpm, a, a, a);
- assertInvokeInterfaceEquals(99, C,
- I.with("String", "String", "String"), ipm, a, a, a);
+ assertInvokeInterfaceEquals(99, C, K.with("String"), kpm, a, a, a);
+ assertInvokeInterfaceEquals(77, C, J.with("String", "String"), jpm, a, a, a);
+ assertInvokeInterfaceThrows(AbstractMethodError.class, C, I.with("String", "String", "String"), ipm, a, a, a);
+
+ // Now, with bridges
+ J.setFullCompilation(true);
+ K.setFullCompilation(true);
+ assertInvokeInterfaceEquals(99, C, K.with("String"), kpm, a, a, a);
+ assertInvokeInterfaceEquals(77, C, J.with("String", "String"), jpm, a, a, a);
+ assertInvokeInterfaceEquals(99, C, I.with("String", "String", "String"), ipm, a, a, a);
}
public void testStrictfpDefault() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestEmptyContainer.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8026857
+ * @summary Test that an empty container does not stop us from looking at
+ * supertypes for inherited repeated annotations.
+ * @library /tools/javac/lib
+ * @build JavacTestingAbstractProcessor TestEmptyContainer
+ * @compile -processor TestEmptyContainer -proc:only TestEmptyContainer.java
+ */
+
+import com.sun.tools.javac.util.Assert;
+
+import java.lang.annotation.*;
+import java.util.Arrays;
+import java.util.Set;
+import javax.annotation.processing.*;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+
+import static javax.lang.model.util.ElementFilter.*;
+
+@TestEmptyContainer.Foo(1)
+public class TestEmptyContainer extends JavacTestingAbstractProcessor {
+ public boolean process(Set<? extends TypeElement> annotations,
+ RoundEnvironment roundEnv) {
+ if (!roundEnv.processingOver()) {
+ boolean hasRun = false;
+ for (Element element : roundEnv.getRootElements())
+ for (TypeElement te : typesIn(element.getEnclosedElements()))
+ if (te.getQualifiedName().contentEquals("TestEmptyContainer.T2")) {
+ hasRun = true;
+ Foo[] foos = te.getAnnotationsByType(Foo.class);
+ System.out.println(" " + te);
+ System.out.println(" " + Arrays.asList(foos));
+ Assert.check(foos.length == 1, "Should find one @Foo");
+ Assert.check(foos[0].value() == 1, "Should find @Foo(1)");
+ }
+ if (!hasRun)
+ throw new RuntimeException("Annotation processor couldn't find class T2, test broken!");
+ }
+ return true;
+ }
+
+ // This empty container should not stop us from finding @Foo(1) on TestEmptyContainer above
+ @TestEmptyContainer.FooContainer({})
+ public static class T2 extends TestEmptyContainer {
+ }
+
+ @Repeatable(FooContainer.class)
+ @Inherited
+ public static @interface Foo {
+ int value();
+ }
+
+ @Inherited
+ public static @interface FooContainer {
+ Foo[] value();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestNonInherited.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8026855
+ * @summary Javac should only look on supertypes for repeatable annotations if
+ * both container and containee are inherited.
+ * @library /tools/javac/lib
+ * @build JavacTestingAbstractProcessor TestNonInherited
+ * @compile -processor TestNonInherited -proc:only TestNonInherited.java
+ */
+
+import com.sun.tools.javac.util.Assert;
+
+import java.lang.annotation.*;
+import java.util.Arrays;
+import java.util.Set;
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+import javax.lang.model.util.*;
+
+import static javax.lang.model.util.ElementFilter.*;
+
+@TestNonInherited.Foo(1)
+public class TestNonInherited extends JavacTestingAbstractProcessor {
+ public boolean process(Set<? extends TypeElement> annotations,
+ RoundEnvironment roundEnv) {
+ if (!roundEnv.processingOver()) {
+ boolean hasRun = false;
+ for (Element element : roundEnv.getRootElements())
+ for (TypeElement te : typesIn(element.getEnclosedElements()))
+ if (te.getQualifiedName().contentEquals("TestNonInherited.T2")) {
+ hasRun = true;
+ Foo[] foos = te.getAnnotationsByType(Foo.class);
+ System.out.println(" " + te);
+ System.out.println(" " + Arrays.asList(foos));
+ Assert.check(foos.length == 0, "Should not find any instance of @Foo");
+ }
+ if (!hasRun)
+ throw new RuntimeException("The annotation processor could not find the declaration of T2, test broken!");
+ }
+ return true;
+ }
+
+ public static class T2 extends TestNonInherited {
+ }
+
+ @Repeatable(FooContainer.class)
+ public static @interface Foo {
+ int value();
+ }
+
+ @Inherited
+ public static @interface FooContainer {
+ Foo[] value();
+ }
+}
--- a/langtools/test/tools/jdeps/Basic.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/jdeps/Basic.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,9 @@
/*
* @test
- * @bug 8003562 8005428 8015912
+ * @bug 8003562 8005428 8015912 8027481
* @summary Basic tests for jdeps tool
- * @build Test p.Foo
+ * @build Test p.Foo p.Bar javax.activity.NotCompactProfile
* @run main Basic
*/
@@ -33,10 +33,12 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.regex.*;
+import static java.nio.file.StandardCopyOption.*;
public class Basic {
private static boolean symbolFileExist = initProfiles();
@@ -74,23 +76,25 @@
new String[] {"java.lang", "p"},
new String[] {"compact1", "not found"});
// test a directory
+ // also test non-SE javax.activity class dependency
test(new File(testDir, "p"),
- new String[] {"java.lang", "java.util", "java.lang.management"},
- new String[] {"compact1", "compact1", "compact3"});
+ new String[] {"java.lang", "java.util", "java.lang.management", "javax.activity", "javax.crypto"},
+ new String[] {"compact1", "compact1", "compact3", testDir.getName(), "compact1"},
+ new String[] {"-classpath", testDir.getPath()});
// test class-level dependency output
test(new File(testDir, "Test.class"),
- new String[] {"java.lang.Object", "java.lang.String", "p.Foo"},
- new String[] {"compact1", "compact1", "not found"},
+ new String[] {"java.lang.Object", "java.lang.String", "p.Foo", "p.Bar"},
+ new String[] {"compact1", "compact1", "not found", "not found"},
new String[] {"-verbose:class"});
// test -p option
test(new File(testDir, "Test.class"),
- new String[] {"p.Foo"},
- new String[] {"not found"},
+ new String[] {"p.Foo", "p.Bar"},
+ new String[] {"not found", "not found"},
new String[] {"-verbose:class", "-p", "p"});
// test -e option
test(new File(testDir, "Test.class"),
- new String[] {"p.Foo"},
- new String[] {"not found"},
+ new String[] {"p.Foo", "p.Bar"},
+ new String[] {"not found", "not found"},
new String[] {"-verbose:class", "-e", "p\\..*"});
test(new File(testDir, "Test.class"),
new String[] {"java.lang"},
@@ -99,13 +103,34 @@
// test -classpath and -include options
test(null,
new String[] {"java.lang", "java.util",
- "java.lang.management"},
- new String[] {"compact1", "compact1", "compact3"},
+ "java.lang.management", "javax.crypto"},
+ new String[] {"compact1", "compact1", "compact3", "compact1"},
new String[] {"-classpath", testDir.getPath(), "-include", "p.+|Test.class"});
test(new File(testDir, "Test.class"),
- new String[] {"java.lang.Object", "java.lang.String", "p.Foo"},
- new String[] {"compact1", "compact1", testDir.getName()},
+ new String[] {"java.lang.Object", "java.lang.String", "p.Foo", "p.Bar"},
+ new String[] {"compact1", "compact1", testDir.getName(), testDir.getName()},
new String[] {"-v", "-classpath", testDir.getPath(), "Test.class"});
+
+ // split package p - move p/Foo.class to dir1 and p/Bar.class to dir2
+ Path testClassPath = testDir.toPath();
+ Path dirP = testClassPath.resolve("p");
+ Path dir1 = testClassPath.resolve("dir1");
+ Path subdir1P = dir1.resolve("p");
+ Path dir2 = testClassPath.resolve("dir2");
+ Path subdir2P = dir2.resolve("p");
+ if (!Files.exists(subdir1P))
+ Files.createDirectories(subdir1P);
+ if (!Files.exists(subdir2P))
+ Files.createDirectories(subdir2P);
+ Files.move(dirP.resolve("Foo.class"), subdir1P.resolve("Foo.class"), REPLACE_EXISTING);
+ Files.move(dirP.resolve("Bar.class"), subdir2P.resolve("Bar.class"), REPLACE_EXISTING);
+ StringBuilder cpath = new StringBuilder(testDir.toString());
+ cpath.append(File.pathSeparator).append(dir1.toString());
+ cpath.append(File.pathSeparator).append(dir2.toString());
+ test(new File(testDir, "Test.class"),
+ new String[] {"java.lang.Object", "java.lang.String", "p.Foo", "p.Bar"},
+ new String[] {"compact1", "compact1", dir1.toFile().getName(), dir2.toFile().getName()},
+ new String[] {"-v", "-classpath", cpath.toString(), "Test.class"});
return errors;
}
@@ -148,7 +173,7 @@
// Use the linePattern to break the given String into lines, applying
// the pattern to each line to see if we have a match
private static Map<String,String> findDeps(String out) {
- Map<String,String> result = new HashMap<>();
+ Map<String,String> result = new LinkedHashMap<>();
Matcher lm = linePattern.matcher(out); // Line matcher
Matcher pm = null; // Pattern matcher
int lines = 0;
--- a/langtools/test/tools/jdeps/Test.java Fri Nov 08 17:50:24 2013 -0500
+++ b/langtools/test/tools/jdeps/Test.java Fri Nov 08 17:36:14 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
public class Test {
public void test() {
p.Foo f = new p.Foo();
+ p.Bar b = new p.Bar();
}
private String name() {
return "this test";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/jdeps/javax/activity/NotCompactProfile.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.activity;
+
+public class NotCompactProfile {
+ public static String name() {
+ return "not Java SE API";
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/jdeps/p/Bar.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 p;
+
+public class Bar extends javax.activity.NotCompactProfile {
+ public String bar() {
+ return "bar";
+ }
+ public javax.crypto.Cipher getCiper() {
+ return null;
+ }
+}
--- a/nashorn/.hgtags Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/.hgtags Fri Nov 08 17:36:14 2013 -0800
@@ -223,3 +223,4 @@
75fd3486e584f20475c064a2cd4d01ac6406a511 jdk8-b111
6a4fdb3bb4e34af4c5bb8db467bb01e13b1a7e31 jdk8-b112
676cd7bf5e092356f7ee2116c8cf88cdc12377c7 jdk8-b113
+79f7b79bf97b71c9b5c9b103dbdef5f269eeb86d jdk8-b114
--- a/nashorn/make/build.xml Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/make/build.xml Fri Nov 08 17:36:14 2013 -0800
@@ -46,6 +46,16 @@
<available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
<!-- check if testng.jar is avaiable -->
<available property="testng.available" file="${file.reference.testng.jar}"/>
+ <!-- check if Jemmy ang testng.jar are avaiable -->
+ <condition property="jemmy.jfx.testng.available" value="true">
+ <and>
+ <available file="${file.reference.jemmyfx.jar}"/>
+ <available file="${file.reference.jemmycore.jar}"/>
+ <available file="${file.reference.jemmyawtinput.jar}"/>
+ <available file="${file.reference.jfxrt.jar}"/>
+ <isset property="testng.available"/>
+ </and>
+ </condition>
<!-- enable/disable make code coverage -->
<condition property="cc.enabled">
@@ -351,6 +361,31 @@
</java>
</target>
+ <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
+ <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy testng.jar, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar under test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
+ </target>
+
+ <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
+ <fileset id="test.classes" dir="${build.test.classes.dir}">
+ <include name="**/framework/*Test.class"/>
+ </fileset>
+
+ <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
+
+ <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
+ verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
+ <jvmarg line="${ext.class.path}"/>
+ <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
+ <propertyset>
+ <propertyref prefix="testjfx-test-sys-prop."/>
+ <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
+ </propertyset>
+ <classpath>
+ <pathelement path="${testjfx.run.test.classpath}"/>
+ </classpath>
+ </testng>
+ </target>
+
<target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
<fileset id="test.classes" dir="${build.test.classes.dir}">
<include name="**/framework/*Test.class"/>
--- a/nashorn/make/project.properties Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/make/project.properties Fri Nov 08 17:36:14 2013 -0800
@@ -118,6 +118,7 @@
test.external.dir=test/script/external
test262.dir=${test.external.dir}/test262
test262.suite.dir=${test262.dir}/test/suite
+testjfx.dir=${test.script.dir}/jfx
test-sys-prop.test.dir=${test.dir}
test-sys-prop.test.js.roots=${test.basic.dir} ${test.error.dir} ${test.sandbox.dir} ${test.trusted.dir}
@@ -208,6 +209,32 @@
${test262.dir}/test/harness/framework.js \
${test262.dir}/test/harness/sta.js
+# testjfx test root
+testjfx-test-sys-prop.test.js.roots=${testjfx.dir}
+
+# execute testjfx tests in shared nashorn context or not?
+testjfx-test-sys-prop.test.js.shared.context=false
+
+# framework root for our script tests
+testjfx-test-sys-prop.test.js.framework=\
+ -fx \
+ ${test.script.dir}${file.separator}jfx.js
+
+file.reference.jemmyfx.jar=test${file.separator}lib${file.separator}JemmyFX.jar
+file.reference.jemmycore.jar=test${file.separator}lib${file.separator}JemmyCore.jar
+file.reference.jemmyawtinput.jar=test${file.separator}lib${file.separator}JemmyAWTInput.jar
+file.reference.jfxrt.jar=${java.home}${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar
+testjfx.run.test.classpath=\
+ ${file.reference.jemmyfx.jar}${path.separator}\
+ ${file.reference.jemmycore.jar}${path.separator}\
+ ${file.reference.jemmyawtinput.jar}${path.separator}\
+ ${file.reference.testng.jar}${path.separator}\
+ ${nashorn.internal.tests.jar}${path.separator}\
+ ${nashorn.api.tests.jar}
+
+# testjfx VM options for script tests with @fork option
+testjfx-test-sys-prop.test.fork.jvm.options=${run.test.jvmargs.main} -Xmx${run.test.xmx} -cp ${testjfx.run.test.classpath}
+
run.test.classpath=\
${file.reference.testng.jar}:\
${nashorn.internal.tests.jar}:\
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/api/scripting/AbstractJSObject.java Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.api.scripting;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * This is the base class for nashorn ScriptObjectMirror class.
+ *
+ * This class can also be subclassed by an arbitrary Java class. Nashorn will
+ * treat objects of such classes just like nashorn script objects. Usual nashorn
+ * operations like obj[i], obj.foo, obj.func(), delete obj.foo will be glued
+ * to appropriate method call of this class.
+ */
+public abstract class AbstractJSObject implements JSObject {
+ /**
+ * Call this object as a JavaScript function. This is equivalent to
+ * 'func.apply(thiz, args)' in JavaScript.
+ *
+ * @param thiz 'this' object to be passed to the function
+ * @param args arguments to method
+ * @return result of call
+ */
+ @Override
+ public Object call(final Object thiz, final Object... args) {
+ throw new UnsupportedOperationException("call");
+ }
+
+ /**
+ * Call this 'constructor' JavaScript function to create a new object.
+ * This is equivalent to 'new func(arg1, arg2...)' in JavaScript.
+ *
+ * @param args arguments to method
+ * @return result of constructor call
+ */
+ @Override
+ public Object newObject(final Object... args) {
+ throw new UnsupportedOperationException("newObject");
+ }
+
+ /**
+ * Evaluate a JavaScript expression.
+ *
+ * @param s JavaScript expression to evaluate
+ * @return evaluation result
+ */
+ @Override
+ public Object eval(final String s) {
+ throw new UnsupportedOperationException("eval");
+ }
+
+ /**
+ * Retrieves a named member of this JavaScript object.
+ *
+ * @param name of member
+ * @return member
+ */
+ @Override
+ public Object getMember(final String name) {
+ return null;
+ }
+
+ /**
+ * Retrieves an indexed member of this JavaScript object.
+ *
+ * @param index index slot to retrieve
+ * @return member
+ */
+ @Override
+ public Object getSlot(final int index) {
+ return null;
+ }
+
+ /**
+ * Does this object have a named member?
+ *
+ * @param name name of member
+ * @return true if this object has a member of the given name
+ */
+ @Override
+ public boolean hasMember(final String name) {
+ return false;
+ }
+
+ /**
+ * Does this object have a indexed property?
+ *
+ * @param slot index to check
+ * @return true if this object has a slot
+ */
+ @Override
+ public boolean hasSlot(final int slot) {
+ return false;
+ }
+
+ /**
+ * Remove a named member from this JavaScript object
+ *
+ * @param name name of the member
+ */
+ @Override
+ public void removeMember(final String name) {
+ //empty
+ }
+
+ /**
+ * Set a named member in this JavaScript object
+ *
+ * @param name name of the member
+ * @param value value of the member
+ */
+ @Override
+ public void setMember(final String name, final Object value) {
+ //empty
+ }
+
+ /**
+ * Set an indexed member in this JavaScript object
+ *
+ * @param index index of the member slot
+ * @param value value of the member
+ */
+ @Override
+ public void setSlot(final int index, final Object value) {
+ //empty
+ }
+
+ // property and value iteration
+
+ /**
+ * Returns the set of all property names of this object.
+ *
+ * @return set of property names
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public Set<String> keySet() {
+ return Collections.EMPTY_SET;
+ }
+
+ /**
+ * Returns the set of all property values of this object.
+ *
+ * @return set of property values.
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public Collection<Object> values() {
+ return Collections.EMPTY_SET;
+ }
+
+ // JavaScript instanceof check
+
+ /**
+ * Checking whether the given object is an instance of 'this' object.
+ *
+ * @param instance instace to check
+ * @return true if the given 'instance' is an instance of this 'function' object
+ */
+ @Override
+ public boolean isInstance(final Object instance) {
+ return false;
+ }
+
+ /**
+ * Checking whether this object is an instance of the given 'clazz' object.
+ *
+ * @param clazz clazz to check
+ * @return true if this object is an instance of the given 'clazz'
+ */
+ @Override
+ public boolean isInstanceOf(final Object clazz) {
+ if (clazz instanceof JSObject) {
+ return ((JSObject)clazz).isInstance(this);
+ }
+
+ return false;
+ }
+
+ /**
+ * ECMA [[Class]] property
+ *
+ * @return ECMA [[Class]] property value of this object
+ */
+ @Override
+ public String getClassName() {
+ return getClass().getName();
+ }
+
+ /**
+ * Is this a function object?
+ *
+ * @return if this mirror wraps a ECMAScript function instance
+ */
+ @Override
+ public boolean isFunction() {
+ return false;
+ }
+
+ /**
+ * Is this a 'use strict' function object?
+ *
+ * @return true if this mirror represents a ECMAScript 'use strict' function
+ */
+ @Override
+ public boolean isStrictFunction() {
+ return false;
+ }
+
+ /**
+ * Is this an array object?
+ *
+ * @return if this mirror wraps a ECMAScript array object
+ */
+ @Override
+ public boolean isArray() {
+ return false;
+ }
+
+ /**
+ * Returns this object's numeric value.
+ *
+ * @return this object's numeric value.
+ */
+ @Override
+ public double toNumber() {
+ return Double.NaN;
+ }
+}
--- a/nashorn/src/jdk/nashorn/api/scripting/JSObject.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/api/scripting/JSObject.java Fri Nov 08 17:36:14 2013 -0800
@@ -30,14 +30,12 @@
import java.util.Set;
/**
- * This is the base class for nashorn ScriptObjectMirror class.
- *
- * This class can also be subclassed by an arbitrary Java class. Nashorn will
+ * This interface can be implemented by an arbitrary Java class. Nashorn will
* treat objects of such classes just like nashorn script objects. Usual nashorn
* operations like obj[i], obj.foo, obj.func(), delete obj.foo will be glued
- * to appropriate method call of this class.
+ * to appropriate method call of this interface.
*/
-public abstract class JSObject {
+public interface JSObject {
/**
* Call this object as a JavaScript function. This is equivalent to
* 'func.apply(thiz, args)' in JavaScript.
@@ -46,9 +44,7 @@
* @param args arguments to method
* @return result of call
*/
- public Object call(final Object thiz, final Object... args) {
- throw new UnsupportedOperationException("call");
- }
+ public Object call(final Object thiz, final Object... args);
/**
* Call this 'constructor' JavaScript function to create a new object.
@@ -57,9 +53,7 @@
* @param args arguments to method
* @return result of constructor call
*/
- public Object newObject(final Object... args) {
- throw new UnsupportedOperationException("newObject");
- }
+ public Object newObject(final Object... args);
/**
* Evaluate a JavaScript expression.
@@ -67,20 +61,7 @@
* @param s JavaScript expression to evaluate
* @return evaluation result
*/
- public Object eval(final String s) {
- throw new UnsupportedOperationException("eval");
- }
-
- /**
- * Call a JavaScript function member of this object.
- *
- * @param name name of the member function to call
- * @param args arguments to be passed to the member function
- * @return result of call
- */
- public Object callMember(final String name, final Object... args) {
- throw new UnsupportedOperationException("call");
- }
+ public Object eval(final String s);
/**
* Retrieves a named member of this JavaScript object.
@@ -88,9 +69,7 @@
* @param name of member
* @return member
*/
- public Object getMember(final String name) {
- return null;
- }
+ public Object getMember(final String name);
/**
* Retrieves an indexed member of this JavaScript object.
@@ -98,9 +77,7 @@
* @param index index slot to retrieve
* @return member
*/
- public Object getSlot(final int index) {
- return null;
- }
+ public Object getSlot(final int index);
/**
* Does this object have a named member?
@@ -108,9 +85,7 @@
* @param name name of member
* @return true if this object has a member of the given name
*/
- public boolean hasMember(final String name) {
- return false;
- }
+ public boolean hasMember(final String name);
/**
* Does this object have a indexed property?
@@ -118,18 +93,14 @@
* @param slot index to check
* @return true if this object has a slot
*/
- public boolean hasSlot(final int slot) {
- return false;
- }
+ public boolean hasSlot(final int slot);
/**
* Remove a named member from this JavaScript object
*
* @param name name of the member
*/
- public void removeMember(final String name) {
- //empty
- }
+ public void removeMember(final String name);
/**
* Set a named member in this JavaScript object
@@ -137,9 +108,7 @@
* @param name name of the member
* @param value value of the member
*/
- public void setMember(final String name, final Object value) {
- //empty
- }
+ public void setMember(final String name, final Object value);
/**
* Set an indexed member in this JavaScript object
@@ -147,9 +116,7 @@
* @param index index of the member slot
* @param value value of the member
*/
- public void setSlot(final int index, final Object value) {
- //empty
- }
+ public void setSlot(final int index, final Object value);
// property and value iteration
@@ -158,20 +125,14 @@
*
* @return set of property names
*/
- @SuppressWarnings("unchecked")
- public Set<String> keySet() {
- return Collections.EMPTY_SET;
- }
+ public Set<String> keySet();
/**
* Returns the set of all property values of this object.
*
* @return set of property values.
*/
- @SuppressWarnings("unchecked")
- public Collection<Object> values() {
- return Collections.EMPTY_SET;
- }
+ public Collection<Object> values();
// JavaScript instanceof check
@@ -181,9 +142,7 @@
* @param instance instace to check
* @return true if the given 'instance' is an instance of this 'function' object
*/
- public boolean isInstance(final Object instance) {
- return false;
- }
+ public boolean isInstance(final Object instance);
/**
* Checking whether this object is an instance of the given 'clazz' object.
@@ -191,47 +150,40 @@
* @param clazz clazz to check
* @return true if this object is an instance of the given 'clazz'
*/
- public boolean isInstanceOf(final Object clazz) {
- if (clazz instanceof JSObject) {
- return ((JSObject)clazz).isInstance(this);
- }
-
- return false;
- }
+ public boolean isInstanceOf(final Object clazz);
/**
* ECMA [[Class]] property
*
* @return ECMA [[Class]] property value of this object
*/
- public String getClassName() {
- return getClass().getName();
- }
+ public String getClassName();
/**
* Is this a function object?
*
* @return if this mirror wraps a ECMAScript function instance
*/
- public boolean isFunction() {
- return false;
- }
+ public boolean isFunction();
/**
* Is this a 'use strict' function object?
*
* @return true if this mirror represents a ECMAScript 'use strict' function
*/
- public boolean isStrictFunction() {
- return false;
- }
+ public boolean isStrictFunction();
/**
* Is this an array object?
*
* @return if this mirror wraps a ECMAScript array object
*/
- public boolean isArray() {
- return false;
- }
+ public boolean isArray();
+
+ /**
+ * Returns this object's numeric value.
+ *
+ * @return this object's numeric value.
+ */
+ public double toNumber();
}
--- a/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java Fri Nov 08 17:36:14 2013 -0800
@@ -43,6 +43,7 @@
import javax.script.Bindings;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.GlobalObject;
+import jdk.nashorn.internal.runtime.JSType;
import jdk.nashorn.internal.runtime.ScriptFunction;
import jdk.nashorn.internal.runtime.ScriptObject;
import jdk.nashorn.internal.runtime.ScriptRuntime;
@@ -50,7 +51,7 @@
/**
* Mirror object that wraps a given Nashorn Script object.
*/
-public final class ScriptObjectMirror extends JSObject implements Bindings {
+public final class ScriptObjectMirror extends AbstractJSObject implements Bindings {
private static AccessControlContext getContextAccCtxt() {
final Permissions perms = new Permissions();
perms.add(new RuntimePermission(Context.NASHORN_GET_CONTEXT));
@@ -161,7 +162,6 @@
});
}
- @Override
public Object callMember(final String functionName, final Object... args) {
functionName.getClass(); // null check
final ScriptObject oldGlobal = Context.getGlobal();
@@ -705,4 +705,13 @@
}
}
}
+
+ @Override
+ public double toNumber() {
+ return inGlobal(new Callable<Double>() {
+ @Override public Double call() {
+ return JSType.toNumber(sobj);
+ }
+ });
+ }
}
--- a/nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java Fri Nov 08 17:36:14 2013 -0800
@@ -72,8 +72,7 @@
}
// convert to boolean
- codegen.load(unaryNode);
- method.convert(Type.BOOLEAN);
+ codegen.load(unaryNode, Type.BOOLEAN);
if (state) {
method.ifne(label);
} else {
@@ -146,8 +145,7 @@
break;
}
- codegen.load(binaryNode);
- method.convert(Type.BOOLEAN);
+ codegen.load(binaryNode, Type.BOOLEAN);
if (state) {
method.ifne(label);
} else {
@@ -169,8 +167,7 @@
}
}
- codegen.load(node);
- method.convert(Type.BOOLEAN);
+ codegen.load(node, Type.BOOLEAN);
if (state) {
method.ifne(label);
} else {
--- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java Fri Nov 08 17:36:14 2013 -0800
@@ -359,8 +359,11 @@
return load(node, node.hasType() ? node.getType() : null, false);
}
- private static boolean safeLiteral(final Expression rhs) {
- return rhs instanceof LiteralNode && !(rhs instanceof ArrayLiteralNode);
+ // Test whether conversion from source to target involves a call of ES 9.1 ToPrimitive
+ // with possible side effects from calling an object's toString or valueOf methods.
+ private boolean noToPrimitiveConversion(final Type source, final Type target) {
+ // Object to boolean conversion does not cause ToPrimitive call
+ return source.isJSPrimitive() || !target.isJSPrimitive() || target.isBoolean();
}
MethodEmitter loadBinaryOperands(final Expression lhs, final Expression rhs, final Type type) {
@@ -374,25 +377,19 @@
// can combine a LOAD with a CONVERT operation (e.g. use a dynamic getter with the conversion target type as its
// return value). What we do here is reorder LOAD RIGHT and CONVERT LEFT when possible; it is possible only when
// we can prove that executing CONVERT LEFT can't have a side effect that changes the value of LOAD RIGHT.
- // Basically, if we know that either LEFT is not an object, or RIGHT is a constant literal, then we can do the
+ // Basically, if we know that either LEFT already is a primitive value, or does not have to be converted to
+ // a primitive value, or RIGHT is an expression that loads without side effects, then we can do the
// reordering and collapse LOAD/CONVERT into a single operation; otherwise we need to do the more costly
// separate operations to preserve specification semantics.
- final Type lhsType = lhs.getType();
- if (lhsType.isObject() && !safeLiteral(rhs)) {
- // Can't reorder. Load and convert separately.
- load(lhs, lhsType, baseAlreadyOnStack);
- load(rhs, rhs.getType(), false);
- // Avoid empty SWAP, SWAP bytecode sequence if CONVERT LEFT is a no-op
- if (!lhsType.isEquivalentTo(type)) {
- method.swap();
- method.convert(type);
- method.swap();
- }
- method.convert(type);
- } else {
+ if (noToPrimitiveConversion(lhs.getType(), type) || rhs.isLocal()) {
// Can reorder. Combine load and convert into single operations.
load(lhs, type, baseAlreadyOnStack);
load(rhs, type, false);
+ } else {
+ // Can't reorder. Load and convert separately.
+ load(lhs, lhs.getType(), baseAlreadyOnStack);
+ load(rhs, rhs.getType(), false);
+ method.swap().convert(type).swap().convert(type);
}
return method;
@@ -402,7 +399,7 @@
return loadBinaryOperands(node.lhs(), node.rhs(), node.getType(), false);
}
- private MethodEmitter load(final Expression node, final Type type) {
+ MethodEmitter load(final Expression node, final Type type) {
return load(node, type, false);
}
@@ -432,7 +429,7 @@
@Override
public boolean enterAccessNode(final AccessNode accessNode) {
if (!baseAlreadyOnStack) {
- load(accessNode.getBase()).convert(Type.OBJECT);
+ load(accessNode.getBase(), Type.OBJECT);
}
assert method.peekType().isObject();
method.dynamicGet(type, accessNode.getProperty().getName(), getCallSiteFlags(), accessNode.isFunction());
@@ -442,7 +439,7 @@
@Override
public boolean enterIndexNode(final IndexNode indexNode) {
if (!baseAlreadyOnStack) {
- load(indexNode.getBase()).convert(Type.OBJECT);
+ load(indexNode.getBase(), Type.OBJECT);
load(indexNode.getIndex());
}
method.dynamicGetIndex(type, getCallSiteFlags(), indexNode.isFunction());
@@ -632,11 +629,13 @@
final Type[] params = signature == null ? null : Type.getMethodArguments(signature);
for (final Expression arg : args) {
assert arg != null;
- load(arg);
if (n >= argCount) {
+ load(arg);
method.pop(); // we had to load the arg for its side effects
} else if (params != null) {
- method.convert(params[n]);
+ load(arg, params[n]);
+ } else {
+ load(arg);
}
n++;
}
@@ -707,6 +706,12 @@
final CallNode.EvalArgs evalArgs = callNode.getEvalArgs();
// load evaluated code
load(evalArgs.getCode(), Type.OBJECT);
+ // load second and subsequent args for side-effect
+ final List<Expression> args = callNode.getArgs();
+ final int numArgs = args.size();
+ for (int i = 1; i < numArgs; i++) {
+ load(args.get(i)).pop();
+ }
// special/extra 'eval' arguments
load(evalArgs.getThis());
method.load(evalArgs.getLocation());
@@ -1277,7 +1282,7 @@
for (int i = 0; i < args.size(); i++) {
method.dup();
method.load(i);
- load(args.get(i)).convert(Type.OBJECT); //has to be upcast to object or we fail
+ load(args.get(i), Type.OBJECT); //has to be upcast to object or we fail
method.arraystore();
}
@@ -1719,7 +1724,7 @@
}
for (final Expression arg : args) {
- load(arg).convert(Type.OBJECT);
+ load(arg, Type.OBJECT);
}
method.invokestatic(
@@ -2105,7 +2110,7 @@
if (exceptionCondition != null) {
next = new Label("next");
- load(exceptionCondition).convert(Type.BOOLEAN).ifeq(next);
+ load(exceptionCondition, Type.BOOLEAN).ifeq(next);
} else {
next = null;
}
@@ -2352,7 +2357,7 @@
final List<Expression> args = callNode.getArgs();
// Load function reference.
- load(callNode.getFunction()).convert(Type.OBJECT); // must detect type error
+ load(callNode.getFunction(), Type.OBJECT); // must detect type error
method.dynamicNew(1 + loadArgs(args), getCallSiteFlags());
method.store(unaryNode.getSymbol());
@@ -2383,7 +2388,7 @@
@Override
public boolean enterSUB(final UnaryNode unaryNode) {
assert unaryNode.getType().isNumeric();
- load(unaryNode.rhs()).convert(unaryNode.getType()).neg().store(unaryNode.getSymbol());
+ load(unaryNode.rhs(), unaryNode.getType()).neg().store(unaryNode.getSymbol());
return false;
}
@@ -2424,7 +2429,7 @@
final Label skip = new Label("skip");
- load(lhs).convert(Type.OBJECT).dup().convert(Type.BOOLEAN);
+ load(lhs, Type.OBJECT).dup().convert(Type.BOOLEAN);
if (binaryNode.tokenType() == TokenType.AND) {
method.ifeq(skip);
@@ -2433,7 +2438,7 @@
}
method.pop();
- load(rhs).convert(Type.OBJECT);
+ load(rhs, Type.OBJECT);
method.label(skip);
method.store(binaryNode.getSymbol());
--- a/nashorn/src/jdk/nashorn/internal/codegen/Lower.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Lower.java Fri Nov 08 17:36:14 2013 -0800
@@ -88,12 +88,12 @@
private static final DebugLogger LOG = new DebugLogger("lower");
// needed only to get unique eval id
- private final CodeInstaller installer;
+ private final CodeInstaller<?> installer;
/**
* Constructor.
*/
- Lower(final CodeInstaller installer) {
+ Lower(final CodeInstaller<?> installer) {
super(new BlockLexicalContext() {
@Override
--- a/nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java Fri Nov 08 17:36:14 2013 -0800
@@ -32,7 +32,6 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-
import jdk.nashorn.internal.codegen.types.Type;
import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.LiteralNode;
@@ -143,7 +142,7 @@
method.dup();
method.getField(Type.getInternalName(ScriptObject.class), "spill", Type.OBJECT_ARRAY.getDescriptor());
method.load(property.getSlot());
- codegen.load(values.get(i)).convert(OBJECT);
+ codegen.load(values.get(i), OBJECT);
method.arraystore();
}
}
--- a/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java Fri Nov 08 17:36:14 2013 -0800
@@ -292,6 +292,16 @@
}
/**
+ * Determines whether this type represents an primitive type according to the ECMAScript specification,
+ * which includes Boolean, Number, and String.
+ *
+ * @return true if a JavaScript primitive type, false otherwise.
+ */
+ public boolean isJSPrimitive() {
+ return !isObject() || isString();
+ }
+
+ /**
* Determines whether a type is the BOOLEAN type
* @return true if BOOLEAN, false otherwise
*/
@@ -443,7 +453,7 @@
} else if (type0.isArray() != type1.isArray()) {
//array and non array is always object, widest(Object[], int) NEVER returns Object[], which has most weight. that does not make sense
return Type.OBJECT;
- } else if (type0.isObject() && type1.isObject() && ((ObjectType)type0).getTypeClass() != ((ObjectType)type1).getTypeClass()) {
+ } else if (type0.isObject() && type1.isObject() && type0.getTypeClass() != type1.getTypeClass()) {
// Object<type=String> and Object<type=ScriptFunction> will produce Object
// TODO: maybe find most specific common superclass?
return Type.OBJECT;
--- a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java Fri Nov 08 17:36:14 2013 -0800
@@ -90,6 +90,9 @@
return Type.LONG;
case ASSIGN_SAR:
case ASSIGN_SHL:
+ case BIT_AND:
+ case BIT_OR:
+ case BIT_XOR:
case ASSIGN_BIT_AND:
case ASSIGN_BIT_OR:
case ASSIGN_BIT_XOR:
@@ -170,6 +173,42 @@
}
@Override
+ public boolean isLocal() {
+ switch (tokenType()) {
+ case SAR:
+ case SHL:
+ case SHR:
+ case BIT_AND:
+ case BIT_OR:
+ case BIT_XOR:
+ case ADD:
+ case DIV:
+ case MOD:
+ case MUL:
+ case SUB:
+ return lhs.isLocal() && lhs.getType().isJSPrimitive()
+ && rhs.isLocal() && rhs.getType().isJSPrimitive();
+ case ASSIGN_ADD:
+ case ASSIGN_BIT_AND:
+ case ASSIGN_BIT_OR:
+ case ASSIGN_BIT_XOR:
+ case ASSIGN_DIV:
+ case ASSIGN_MOD:
+ case ASSIGN_MUL:
+ case ASSIGN_SAR:
+ case ASSIGN_SHL:
+ case ASSIGN_SHR:
+ case ASSIGN_SUB:
+ return lhs instanceof IdentNode && lhs.isLocal() && lhs.getType().isJSPrimitive()
+ && rhs.isLocal() && rhs.getType().isJSPrimitive();
+ case ASSIGN:
+ return lhs instanceof IdentNode && lhs.isLocal() && rhs.isLocal();
+ default:
+ return false;
+ }
+ }
+
+ @Override
public void toString(final StringBuilder sb) {
final TokenType type = tokenType();
--- a/nashorn/src/jdk/nashorn/internal/ir/Expression.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/ir/Expression.java Fri Nov 08 17:36:14 2013 -0800
@@ -96,4 +96,16 @@
assert hasType() : this + " has no type";
return symbol.getSymbolType();
}
+
+ /**
+ * Returns {@code true} if this expression depends exclusively on state that is constant
+ * or local to the currently running function and thus inaccessible to other functions.
+ * This implies that a local expression must not call any other functions (neither directly
+ * nor implicitly through a getter, setter, or object-to-primitive type conversion).
+ *
+ * @return true if this expression does not depend on state shared with other functions.
+ */
+ public boolean isLocal() {
+ return false;
+ }
}
--- a/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java Fri Nov 08 17:36:14 2013 -0800
@@ -138,6 +138,11 @@
return getName();
}
+ @Override
+ public boolean isLocal() {
+ return !getSymbol().isScope();
+ }
+
/**
* Check if this IdentNode is a property name
* @return true if this is a property name
--- a/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java Fri Nov 08 17:36:14 2013 -0800
@@ -275,6 +275,11 @@
public boolean isTrue() {
return JSType.toBoolean(value);
}
+
+ @Override
+ public boolean isLocal() {
+ return true;
+ }
}
@Immutable
--- a/nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java Fri Nov 08 17:36:14 2013 -0800
@@ -109,6 +109,13 @@
}
}
+ @Override
+ public boolean isLocal() {
+ return getTest().isLocal()
+ && getTrueExpression().isLocal()
+ && getFalseExpression().isLocal();
+ }
+
/**
* Get the test expression for this ternary expression, i.e. "x" in x ? y : z
* @return the test expression
--- a/nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java Fri Nov 08 17:36:14 2013 -0800
@@ -129,6 +129,26 @@
}
@Override
+ public boolean isLocal() {
+ switch (tokenType()) {
+ case NEW:
+ return false;
+ case ADD:
+ case SUB:
+ case NOT:
+ case BIT_NOT:
+ return rhs.isLocal() && rhs.getType().isJSPrimitive();
+ case DECPOSTFIX:
+ case DECPREFIX:
+ case INCPOSTFIX:
+ case INCPREFIX:
+ return rhs instanceof IdentNode && rhs.isLocal() && rhs.getType().isJSPrimitive();
+ default:
+ return rhs.isLocal();
+ }
+ }
+
+ @Override
public void toString(final StringBuilder sb) {
toString(sb, new Runnable() {
@Override
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,10 +25,10 @@
package jdk.nashorn.internal.ir.debug;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryPoolMXBean;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayDeque;
import java.util.ArrayList;
@@ -51,9 +51,9 @@
* switch, it can not detect
* this fact and will report incorrect sizes, as it will presume the default JVM
* behavior.
- *
- * @author Attila Szegedi
*/
+
+@SuppressWarnings("StaticNonFinalUsedInInitialization")
public class ObjectSizeCalculator {
/**
@@ -368,6 +368,29 @@
type.getName());
}
+ // ALERT: java.lang.management is not available in compact 1. We need
+ // to use reflection to soft link test memory statistics.
+
+ static Class<?> managementFactory = null;
+ static Class<?> memoryPoolMXBean = null;
+ static Class<?> memoryUsage = null;
+ static Method getMemoryPoolMXBeans = null;
+ static Method getUsage = null;
+ static Method getMax = null;
+ static {
+ try {
+ managementFactory = Class.forName("java.lang.management.ManagementFactory");
+ memoryPoolMXBean = Class.forName("java.lang.management.MemoryPoolMXBean");
+ memoryUsage = Class.forName("java.lang.management.MemoryUsage");
+
+ getMemoryPoolMXBeans = managementFactory.getMethod("getMemoryPoolMXBeans");
+ getUsage = memoryPoolMXBean.getMethod("getUsage");
+ getMax = memoryUsage.getMethod("getMax");
+ } catch (ClassNotFoundException | NoSuchMethodException | SecurityException ex) {
+ // Pass thru, asserts when attempting to use.
+ }
+ }
+
/**
* Return the current memory usage
* @return current memory usage derived from system configuration
@@ -409,9 +432,33 @@
strVmVersion.indexOf('.')));
if (vmVersion >= 17) {
long maxMemory = 0;
- for (MemoryPoolMXBean mp : ManagementFactory.getMemoryPoolMXBeans()) {
- maxMemory += mp.getUsage().getMax();
+
+ /*
+ See ALERT above. The reflection code below duplicates the following
+ sequence, and avoids hard coding of java.lang.management.
+
+ for (MemoryPoolMXBean mp : ManagementFactory.getMemoryPoolMXBeans()) {
+ maxMemory += mp.getUsage().getMax();
+ }
+ */
+
+ if (getMemoryPoolMXBeans == null) {
+ throw new AssertionError("java.lang.management not available in compact 1");
}
+
+ try {
+ final List<?> memoryPoolMXBeans = (List<?>)getMemoryPoolMXBeans.invoke(managementFactory);
+ for (final Object mp : memoryPoolMXBeans) {
+ final Object usage = getUsage.invoke(mp);
+ final Object max = getMax.invoke(usage);
+ maxMemory += ((Long)max).longValue();
+ }
+ } catch (IllegalAccessException |
+ IllegalArgumentException |
+ InvocationTargetException ex) {
+ throw new AssertionError("java.lang.management not available in compact 1");
+ }
+
if (maxMemory < 30L * 1024 * 1024 * 1024) {
// HotSpot 17.0 and above use compressed OOPs below 30GB of RAM total
// for all memory pools (yes, including code cache).
--- a/nashorn/src/jdk/nashorn/internal/objects/Global.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java Fri Nov 08 17:36:14 2013 -0800
@@ -1665,9 +1665,9 @@
final ScriptObject stringPrototype = getStringPrototype();
stringPrototype.addOwnProperty("length", Attribute.NON_ENUMERABLE_CONSTANT, 0.0);
- // add Array.prototype.length
+ // set isArray flag on Array.prototype
final ScriptObject arrayPrototype = getArrayPrototype();
- arrayPrototype.addOwnProperty("length", Attribute.NOT_ENUMERABLE|Attribute.NOT_CONFIGURABLE, 0.0);
+ arrayPrototype.setIsArray();
this.DEFAULT_DATE = new NativeDate(Double.NaN, this);
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java Fri Nov 08 17:36:14 2013 -0800
@@ -372,9 +372,7 @@
*/
@Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
public static Object isArray(final Object self, final Object arg) {
- return isArray(arg) || (arg == Global.instance().getArrayPrototype())
- || (arg instanceof NativeRegExpExecResult)
- || (arg instanceof JSObject && ((JSObject)arg).isArray());
+ return isArray(arg) || (arg instanceof JSObject && ((JSObject)arg).isArray());
}
/**
@@ -403,6 +401,26 @@
}
}
+ /**
+ * Prototype length getter
+ * @param self self reference
+ * @return the length of the object
+ */
+ @Getter(name = "length", where = Where.PROTOTYPE, attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
+ public static Object getProtoLength(final Object self) {
+ return length(self); // Same as instance getter but we can't make nasgen use the same method for prototype
+ }
+
+ /**
+ * Prototype length setter
+ * @param self self reference
+ * @param length new length property
+ */
+ @Setter(name = "length", where = Where.PROTOTYPE, attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
+ public static void setProtoLength(final Object self, final Object length) {
+ length(self, length); // Same as instance setter but we can't make nasgen use the same method for prototype
+ }
+
static long validLength(final Object length, final boolean reject) {
final double doubleLength = JSType.toNumber(length);
if (!Double.isNaN(doubleLength) && JSType.isRepresentableAsLong(doubleLength)) {
@@ -1007,19 +1025,42 @@
final long actualStart = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);
final long actualDeleteCount = Math.min(Math.max(JSType.toLong(deleteCount), 0), len - actualStart);
- final NativeArray array = new NativeArray(actualDeleteCount);
+ NativeArray returnValue;
+
+ if (actualStart <= Integer.MAX_VALUE && actualDeleteCount <= Integer.MAX_VALUE && bulkable(sobj)) {
+ try {
+ returnValue = new NativeArray(sobj.getArray().fastSplice((int)actualStart, (int)actualDeleteCount, items.length));
- for (long k = 0; k < actualDeleteCount; k++) {
- final long from = actualStart + k;
+ // Since this is a dense bulkable array we can use faster defineOwnProperty to copy new elements
+ int k = (int) actualStart;
+ for (int i = 0; i < items.length; i++, k++) {
+ sobj.defineOwnProperty(k, items[i]);
+ }
+ } catch (UnsupportedOperationException uoe) {
+ returnValue = slowSplice(sobj, actualStart, actualDeleteCount, items, len);
+ }
+ } else {
+ returnValue = slowSplice(sobj, actualStart, actualDeleteCount, items, len);
+ }
+
+ return returnValue;
+ }
+
+ private static NativeArray slowSplice(final ScriptObject sobj, final long start, final long deleteCount, final Object[] items, final long len) {
+
+ final NativeArray array = new NativeArray(deleteCount);
+
+ for (long k = 0; k < deleteCount; k++) {
+ final long from = start + k;
if (sobj.has(from)) {
array.defineOwnProperty(ArrayIndex.getArrayIndex(k), sobj.get(from));
}
}
- if (items.length < actualDeleteCount) {
- for (long k = actualStart; k < (len - actualDeleteCount); k++) {
- final long from = k + actualDeleteCount;
+ if (items.length < deleteCount) {
+ for (long k = start; k < (len - deleteCount); k++) {
+ final long from = k + deleteCount;
final long to = k + items.length;
if (sobj.has(from)) {
@@ -1029,12 +1070,12 @@
}
}
- for (long k = len; k > (len - actualDeleteCount + items.length); k--) {
+ for (long k = len; k > (len - deleteCount + items.length); k--) {
sobj.delete(k - 1, true);
}
- } else if (items.length > actualDeleteCount) {
- for (long k = len - actualDeleteCount; k > actualStart; k--) {
- final long from = k + actualDeleteCount - 1;
+ } else if (items.length > deleteCount) {
+ for (long k = len - deleteCount; k > start; k--) {
+ final long from = k + deleteCount - 1;
final long to = k + items.length - 1;
if (sobj.has(from)) {
@@ -1046,12 +1087,12 @@
}
}
- long k = actualStart;
+ long k = start;
for (int i = 0; i < items.length; i++, k++) {
sobj.set(k, items[i], true);
}
- final long newLength = len - actualDeleteCount + items.length;
+ final long newLength = len - deleteCount + items.length;
sobj.set("length", newLength, true);
return array;
@@ -1122,12 +1163,16 @@
try {
final ScriptObject sobj = (ScriptObject)Global.toObject(self);
final long len = JSType.toUint32(sobj.getLength());
- final long n = JSType.toLong(fromIndex);
-
- if (len == 0 || n >= len) {
+ if (len == 0) {
return -1;
}
+ final long n = JSType.toLong(fromIndex);
+ if (n >= len) {
+ return -1;
+ }
+
+
for (long k = Math.max(0, (n < 0) ? (len - Math.abs(n)) : n); k < len; k++) {
if (sobj.has(k)) {
if (ScriptRuntime.EQ_STRICT(sobj.get(k), searchElement)) {
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java Fri Nov 08 17:36:14 2013 -0800
@@ -629,7 +629,8 @@
// to name. Probably not a big deal, but if we can ever make it leaner, it'd be nice.
return new GuardedInvocation(MH.dropArguments(MH.constant(Object.class,
func.makeBoundFunction(this, new Object[] { name })), 0, Object.class),
- adaptee.getMap().getProtoGetSwitchPoint(adaptee.getProto(), __call__), testJSAdaptor(adaptee, null, null, null));
+ adaptee.getMap().getProtoGetSwitchPoint(adaptee.getProto(), __call__),
+ testJSAdaptor(adaptee, null, null, null));
}
}
throw typeError("no.such.function", desc.getNameToken(2), ScriptRuntime.safeToString(this));
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeString.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeString.java Fri Nov 08 17:36:14 2013 -0800
@@ -505,7 +505,7 @@
*/
@Function(attributes = Attribute.NOT_ENUMERABLE)
public static Object charAt(final Object self, final Object pos) {
- return charAt(self, JSType.toInteger(pos));
+ return charAtImpl(checkObjectToString(self), JSType.toInteger(pos));
}
/**
@@ -527,7 +527,10 @@
*/
@SpecializedFunction
public static String charAt(final Object self, final int pos) {
- final String str = checkObjectToString(self);
+ return charAtImpl(checkObjectToString(self), pos);
+ }
+
+ private static String charAtImpl(final String str, final int pos) {
return (pos < 0 || pos >= str.length()) ? "" : String.valueOf(str.charAt(pos));
}
@@ -539,7 +542,7 @@
*/
@Function(attributes = Attribute.NOT_ENUMERABLE)
public static Object charCodeAt(final Object self, final Object pos) {
- return charCodeAt(self, JSType.toInteger(pos));
+ return charCodeAtImpl(checkObjectToString(self), JSType.toInteger(pos));
}
/**
@@ -561,7 +564,10 @@
*/
@SpecializedFunction
public static double charCodeAt(final Object self, final int pos) {
- final String str = checkObjectToString(self);
+ return charCodeAtImpl(checkObjectToString(self), pos);
+ }
+
+ private static double charCodeAtImpl(final String str, final int pos) {
return (pos < 0 || pos >= str.length()) ? Double.NaN : str.charAt(pos);
}
--- a/nashorn/src/jdk/nashorn/internal/parser/Lexer.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/parser/Lexer.java Fri Nov 08 17:36:14 2013 -0800
@@ -47,7 +47,6 @@
import jdk.nashorn.internal.runtime.ECMAErrors;
import jdk.nashorn.internal.runtime.ErrorManager;
import jdk.nashorn.internal.runtime.JSErrorType;
-import jdk.nashorn.internal.runtime.JSType;
import jdk.nashorn.internal.runtime.ParserException;
import jdk.nashorn.internal.runtime.Source;
import jdk.nashorn.internal.runtime.options.Options;
@@ -1054,16 +1053,6 @@
}
/**
- * Convert string to number.
- *
- * @param valueString String to convert.
- * @return Converted number.
- */
- private static Number valueOf(final String valueString) throws NumberFormatException {
- return JSType.narrowestIntegerRepresentation(Double.valueOf(valueString));
- }
-
- /**
* Scan a number.
*/
protected void scanNumber() {
@@ -1623,7 +1612,7 @@
case HEXADECIMAL:
return Lexer.valueOf(source.getString(start + 2, len - 2), 16); // number
case FLOATING:
- return Lexer.valueOf(source.getString(start, len)); // number
+ return Double.valueOf(source.getString(start, len)); // number
case STRING:
return source.getString(start, len); // String
case ESCSTRING:
--- a/nashorn/src/jdk/nashorn/internal/runtime/CompiledFunctions.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/CompiledFunctions.java Fri Nov 08 17:36:14 2013 -0800
@@ -24,6 +24,7 @@
*/
package jdk.nashorn.internal.runtime;
+import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
import java.util.Iterator;
import java.util.TreeSet;
@@ -35,6 +36,8 @@
@SuppressWarnings("serial")
final class CompiledFunctions extends TreeSet<CompiledFunction> {
+ private CompiledFunction generic;
+
CompiledFunction best(final MethodType type) {
final Iterator<CompiledFunction> iter = iterator();
while (iter.hasNext()) {
@@ -43,13 +46,10 @@
return next;
}
}
- return mostGeneric();
+ return generic();
}
boolean needsCallee() {
- for (final CompiledFunction inv : this) {
- assert ScriptFunctionData.needsCallee(inv.getInvoker()) == ScriptFunctionData.needsCallee(mostGeneric().getInvoker());
- }
return ScriptFunctionData.needsCallee(mostGeneric().getInvoker());
}
@@ -57,6 +57,48 @@
return last();
}
+ CompiledFunction generic() {
+ CompiledFunction gen = this.generic;
+ if (gen == null) {
+ gen = this.generic = makeGeneric(mostGeneric());
+ }
+ return gen;
+ }
+
+ private static CompiledFunction makeGeneric(final CompiledFunction func) {
+ final MethodHandle invoker = composeGenericMethod(func.getInvoker());
+ final MethodHandle constructor = func.hasConstructor() ? composeGenericMethod(func.getConstructor()) : null;
+ return new CompiledFunction(invoker.type(), invoker, constructor);
+ }
+
+ /**
+ * Takes a method handle, and returns a potentially different method handle that can be used in
+ * {@code ScriptFunction#invoke(Object, Object...)} or {code ScriptFunction#construct(Object, Object...)}.
+ * The returned method handle will be sure to return {@code Object}, and will have all its parameters turned into
+ * {@code Object} as well, except for the following ones:
+ * <ul>
+ * <li>a last parameter of type {@code Object[]} which is used for vararg functions,</li>
+ * <li>the first argument, which is forced to be {@link ScriptFunction}, in case the function receives itself
+ * (callee) as an argument.</li>
+ * </ul>
+ *
+ * @param mh the original method handle
+ *
+ * @return the new handle, conforming to the rules above.
+ */
+ private static MethodHandle composeGenericMethod(final MethodHandle mh) {
+ final MethodType type = mh.type();
+ final boolean isVarArg = ScriptFunctionData.isVarArg(mh);
+ final int paramCount = isVarArg ? type.parameterCount() - 1 : type.parameterCount();
+
+ MethodType newType = MethodType.genericMethodType(paramCount, isVarArg);
+
+ if (ScriptFunctionData.needsCallee(mh)) {
+ newType = newType.changeParameterType(0, ScriptFunction.class);
+ }
+ return type.equals(newType) ? mh : mh.asType(newType);
+ }
+
/**
* Is the given type even more specific than this entire list? That means
* we have an opportunity for more specific versions of the method
--- a/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java Fri Nov 08 17:36:14 2013 -0800
@@ -40,7 +40,7 @@
*
* @param name name
* @param arity arity
- * @param list precompiled code
+ * @param functions precompiled code
* @param isStrict strict
* @param isBuiltin builtin
* @param isConstructor constructor
@@ -73,12 +73,13 @@
}
private void addInvoker(final MethodHandle mh) {
- boolean needsCallee = needsCallee(mh);
if (isConstructor(mh)) {
- //only nasgen constructors: (boolean, self, args) are subject to binding a boolean newObj. isConstructor
- //is too conservative a check. However, isConstructor(mh) always implies isConstructor param
+ // only nasgen constructors: (boolean, self, args) are subject to binding a boolean newObj. isConstructor
+ // is too conservative a check. However, isConstructor(mh) always implies isConstructor param
assert isConstructor();
- code.add(new CompiledFunction(mh.type(), MH.insertArguments(mh, 0, false), composeConstructor(MH.insertArguments(mh, 0, true), needsCallee))); //make sure callee state can be determined when we reach constructor
+ final MethodHandle invoker = MH.insertArguments(mh, 0, false);
+ final MethodHandle constructor = composeConstructor(MH.insertArguments(mh, 0, true));
+ code.add(new CompiledFunction(mh.type(), invoker, constructor));
} else {
code.add(new CompiledFunction(mh.type(), mh));
}
--- a/nashorn/src/jdk/nashorn/internal/runtime/JSType.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/JSType.java Fri Nov 08 17:36:14 2013 -0800
@@ -210,26 +210,6 @@
}
/**
- * Get the smallest integer representation of a number. Returns an Integer
- * for something that is int representable, and Long for something that
- * is long representable. If the number needs to be a double, this is an
- * identity function
- *
- * @param number number to check
- *
- * @return Number instanceof the narrowest possible integer representation for number
- */
- public static Number narrowestIntegerRepresentation(final double number) {
- if (isRepresentableAsInt(number)) {
- return (int)number;
- } else if (isRepresentableAsLong(number)) {
- return (long)number;
- } else {
- return number;
- }
- }
-
- /**
* Check whether an object is primitive
*
* @param obj an object
@@ -266,12 +246,11 @@
* @return the primitive form of the object
*/
public static Object toPrimitive(final Object obj, final Class<?> hint) {
- if (!(obj instanceof ScriptObject)) {
- return obj;
- }
+ return obj instanceof ScriptObject ? toPrimitive((ScriptObject)obj, hint) : obj;
+ }
- final ScriptObject sobj = (ScriptObject)obj;
- final Object result = sobj.getDefaultValue(hint);
+ private static Object toPrimitive(final ScriptObject sobj, final Class<?> hint) {
+ final Object result = sobj.getDefaultValue(hint);
if (!isPrimitive(result)) {
throw typeError("bad.default.value", result.toString());
@@ -495,6 +474,19 @@
return toNumberGeneric(obj);
}
+
+ /**
+ * JavaScript compliant conversion of Object to number
+ * See ECMA 9.3 ToNumber
+ *
+ * @param obj an object
+ *
+ * @return a number
+ */
+ public static double toNumber(final ScriptObject obj) {
+ return toNumber(toPrimitive(obj, Number.class));
+ }
+
/**
* Digit representation for a character
*
@@ -1048,7 +1040,11 @@
}
if (obj instanceof ScriptObject) {
- return toNumber(toPrimitive(obj, Number.class));
+ return toNumber((ScriptObject)obj);
+ }
+
+ if (obj instanceof JSObject) {
+ return ((JSObject)obj).toNumber();
}
return Double.NaN;
--- a/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java Fri Nov 08 17:36:14 2013 -0800
@@ -33,6 +33,7 @@
import java.util.RandomAccess;
import java.util.concurrent.Callable;
import jdk.nashorn.api.scripting.JSObject;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
import jdk.nashorn.internal.runtime.linker.Bootstrap;
import jdk.nashorn.internal.runtime.linker.InvokeByName;
@@ -135,7 +136,8 @@
*/
public static ListAdapter create(final Object obj) {
if (obj instanceof ScriptObject) {
- return new ScriptObjectListAdapter((ScriptObject)obj);
+ final Object mirror = ScriptObjectMirror.wrap(obj, Context.getGlobal());
+ return new JSObjectListAdapter((JSObject)mirror);
} else if (obj instanceof JSObject) {
return new JSObjectListAdapter((JSObject)obj);
} else {
--- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java Fri Nov 08 17:36:14 2013 -0800
@@ -26,6 +26,8 @@
package jdk.nashorn.internal.runtime;
import static jdk.nashorn.internal.runtime.PropertyHashMap.EMPTY_HASHMAP;
+import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.getArrayIndex;
+import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.isValidArrayIndex;
import java.lang.invoke.SwitchPoint;
import java.lang.ref.WeakReference;
@@ -50,6 +52,8 @@
public final class PropertyMap implements Iterable<Object>, PropertyListener {
/** Used for non extensible PropertyMaps, negative logic as the normal case is extensible. See {@link ScriptObject#preventExtensions()} */
public static final int NOT_EXTENSIBLE = 0b0000_0001;
+ /** Does this map contain valid array keys? */
+ public static final int CONTAINS_ARRAY_KEYS = 0b0000_0010;
/** This mask is used to preserve certain flags when cloning the PropertyMap. Others should not be copied */
private static final int CLONEABLE_FLAGS_MASK = 0b0000_1111;
/** Has a listener been added to this property map. This flag is not copied when cloning a map. See {@link PropertyListener} */
@@ -91,12 +95,16 @@
* @param fieldCount Number of fields in use.
* @param fieldMaximum Number of fields available.
* @param spillLength Number of spill slots used.
+ * @param containsArrayKeys True if properties contain numeric keys
*/
- private PropertyMap(final PropertyHashMap properties, final int fieldCount, final int fieldMaximum, final int spillLength) {
+ private PropertyMap(final PropertyHashMap properties, final int fieldCount, final int fieldMaximum, final int spillLength, final boolean containsArrayKeys) {
this.properties = properties;
this.fieldCount = fieldCount;
this.fieldMaximum = fieldMaximum;
this.spillLength = spillLength;
+ if (containsArrayKeys) {
+ setContainsArrayKeys();
+ }
if (Context.DEBUG) {
count++;
@@ -104,15 +112,6 @@
}
/**
- * Constructor.
- *
- * @param properties A {@link PropertyHashMap} with initial contents.
- */
- private PropertyMap(final PropertyHashMap properties) {
- this(properties, 0, 0, 0);
- }
-
- /**
* Cloning constructor.
*
* @param propertyMap Existing property map.
@@ -152,12 +151,15 @@
if (Context.DEBUG) {
duplicatedCount++;
}
- return new PropertyMap(this.properties);
+ return new PropertyMap(this.properties, 0, 0, 0, containsArrayKeys());
}
/**
* Public property map allocator.
*
+ * <p>It is the caller's responsibility to make sure that {@code properties} does not contain
+ * properties with keys that are valid array indices.</p>
+ *
* @param properties Collection of initial properties.
* @param fieldCount Number of fields in use.
* @param fieldMaximum Number of fields available.
@@ -166,11 +168,15 @@
*/
public static PropertyMap newMap(final Collection<Property> properties, final int fieldCount, final int fieldMaximum, final int spillLength) {
PropertyHashMap newProperties = EMPTY_HASHMAP.immutableAdd(properties);
- return new PropertyMap(newProperties, fieldCount, fieldMaximum, spillLength);
+ return new PropertyMap(newProperties, fieldCount, fieldMaximum, spillLength, false);
}
/**
* Public property map allocator. Used by nasgen generated code.
+ *
+ * <p>It is the caller's responsibility to make sure that {@code properties} does not contain
+ * properties with keys that are valid array indices.</p>
+ *
* @param properties Collection of initial properties.
* @return New {@link PropertyMap}.
*/
@@ -184,7 +190,7 @@
* @return New empty {@link PropertyMap}.
*/
public static PropertyMap newMap() {
- return new PropertyMap(EMPTY_HASHMAP);
+ return new PropertyMap(EMPTY_HASHMAP, 0, 0, 0, false);
}
/**
@@ -294,6 +300,9 @@
if(!property.isSpill()) {
newMap.fieldCount = Math.max(newMap.fieldCount, property.getSlot() + 1);
}
+ if (isValidArrayIndex(getArrayIndex(property.getKey()))) {
+ newMap.setContainsArrayKeys();
+ }
newMap.spillLength += property.getSpillCount();
}
@@ -408,6 +417,9 @@
final PropertyMap newMap = new PropertyMap(this, newProperties);
for (final Property property : otherProperties) {
+ if (isValidArrayIndex(getArrayIndex(property.getKey()))) {
+ newMap.setContainsArrayKeys();
+ }
newMap.spillLength += property.getSpillCount();
}
@@ -700,6 +712,22 @@
}
/**
+ * Check if this map contains properties with valid array keys
+ *
+ * @return {@code true} if this map contains properties with valid array keys
+ */
+ public final boolean containsArrayKeys() {
+ return (flags & CONTAINS_ARRAY_KEYS) != 0;
+ }
+
+ /**
+ * Flag this object as having array keys in defined properties
+ */
+ private void setContainsArrayKeys() {
+ flags |= CONTAINS_ARRAY_KEYS;
+ }
+
+ /**
* Check whether a {@link PropertyListener} has been added to this map.
*
* @return {@code true} if {@link PropertyListener} exists
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java Fri Nov 08 17:36:14 2013 -0800
@@ -213,13 +213,13 @@
*/
public final MethodHandle getGenericInvoker() {
ensureCodeGenerated();
- return composeGenericMethod(code.mostGeneric().getInvoker());
+ return code.generic().getInvoker();
}
final MethodHandle getGenericConstructor() {
ensureCodeGenerated();
- ensureConstructor(code.mostGeneric());
- return composeGenericMethod(code.mostGeneric().getConstructor());
+ ensureConstructor(code.generic());
+ return code.generic().getConstructor();
}
private CompiledFunction getBest(final MethodType callSiteType) {
@@ -267,18 +267,17 @@
}
/**
- * Compose a constructor given a primordial constructor handle
+ * Compose a constructor given a primordial constructor handle.
*
- * @param ctor primordial constructor handle
- * @param needsCallee do we need to pass a callee
- *
+ * @param ctor primordial constructor handle
* @return the composed constructor
*/
- protected MethodHandle composeConstructor(final MethodHandle ctor, final boolean needsCallee) {
+ protected MethodHandle composeConstructor(final MethodHandle ctor) {
// If it was (callee, this, args...), permute it to (this, callee, args...). We're doing this because having
// "this" in the first argument position is what allows the elegant folded composition of
// (newFilter x constructor x allocator) further down below in the code. Also, ensure the composite constructor
// always returns Object.
+ final boolean needsCallee = needsCallee(ctor);
MethodHandle composedCtor = needsCallee ? swapCalleeAndThis(ctor) : ctor;
composedCtor = changeReturnTypeToObject(composedCtor);
@@ -472,33 +471,6 @@
}
/**
- * Takes a method handle, and returns a potentially different method handle that can be used in
- * {@code ScriptFunction#invoke(Object, Object...)} or {code ScriptFunction#construct(Object, Object...)}.
- * The returned method handle will be sure to return {@code Object}, and will have all its parameters turned into
- * {@code Object} as well, except for the following ones:
- * <ul>
- * <li>a last parameter of type {@code Object[]} which is used for vararg functions,</li>
- * <li>the first argument, which is forced to be {@link ScriptFunction}, in case the function receives itself
- * (callee) as an argument.</li>
- * </ul>
- *
- * @param mh the original method handle
- *
- * @return the new handle, conforming to the rules above.
- */
- protected MethodHandle composeGenericMethod(final MethodHandle mh) {
- final MethodType type = mh.type();
- MethodType newType = type.generic();
- if (isVarArg(mh)) {
- newType = newType.changeParameterType(type.parameterCount() - 1, Object[].class);
- }
- if (needsCallee(mh)) {
- newType = newType.changeParameterType(0, ScriptFunction.class);
- }
- return type.equals(newType) ? mh : mh.asType(newType);
- }
-
- /**
* Execute this script function.
*
* @param self Target object.
@@ -508,10 +480,9 @@
* @throws Throwable if there is an exception/error with the invocation or thrown from it
*/
Object invoke(final ScriptFunction fn, final Object self, final Object... arguments) throws Throwable {
- final MethodHandle mh = getGenericInvoker();
-
- final Object selfObj = convertThisObject(self);
- final Object[] args = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
+ final MethodHandle mh = getGenericInvoker();
+ final Object selfObj = convertThisObject(self);
+ final Object[] args = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
if (isVarArg(mh)) {
if (needsCallee(mh)) {
@@ -531,6 +502,12 @@
return mh.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1));
case 5:
return mh.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2));
+ case 6:
+ return mh.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3));
+ case 7:
+ return mh.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3), getArg(args, 4));
+ case 8:
+ return mh.invokeExact(fn, selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3), getArg(args, 4), getArg(args, 5));
default:
return mh.invokeWithArguments(withArguments(fn, selfObj, paramCount, args));
}
@@ -545,15 +522,20 @@
return mh.invokeExact(selfObj, getArg(args, 0), getArg(args, 1));
case 4:
return mh.invokeExact(selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2));
+ case 5:
+ return mh.invokeExact(selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3));
+ case 6:
+ return mh.invokeExact(selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3), getArg(args, 4));
+ case 7:
+ return mh.invokeExact(selfObj, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3), getArg(args, 4), getArg(args, 5));
default:
return mh.invokeWithArguments(withArguments(null, selfObj, paramCount, args));
}
}
Object construct(final ScriptFunction fn, final Object... arguments) throws Throwable {
- final MethodHandle mh = getGenericConstructor();
-
- final Object[] args = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
+ final MethodHandle mh = getGenericConstructor();
+ final Object[] args = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
if (isVarArg(mh)) {
if (needsCallee(mh)) {
@@ -573,6 +555,12 @@
return mh.invokeExact(fn, getArg(args, 0), getArg(args, 1));
case 4:
return mh.invokeExact(fn, getArg(args, 0), getArg(args, 1), getArg(args, 2));
+ case 5:
+ return mh.invokeExact(fn, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3));
+ case 6:
+ return mh.invokeExact(fn, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3), getArg(args, 4));
+ case 7:
+ return mh.invokeExact(fn, getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3), getArg(args, 4), getArg(args, 5));
default:
return mh.invokeWithArguments(withArguments(fn, paramCount, args));
}
@@ -587,6 +575,12 @@
return mh.invokeExact(getArg(args, 0), getArg(args, 1));
case 3:
return mh.invokeExact(getArg(args, 0), getArg(args, 1), getArg(args, 2));
+ case 4:
+ return mh.invokeExact(getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3));
+ case 5:
+ return mh.invokeExact(getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3), getArg(args, 4));
+ case 6:
+ return mh.invokeExact(getArg(args, 0), getArg(args, 1), getArg(args, 2), getArg(args, 3), getArg(args, 4), getArg(args, 5));
default:
return mh.invokeWithArguments(withArguments(null, paramCount, args));
}
@@ -664,20 +658,21 @@
* @return the adapted handle
*/
private static MethodHandle changeReturnTypeToObject(final MethodHandle mh) {
- return MH.asType(mh, mh.type().changeReturnType(Object.class));
+ final MethodType type = mh.type();
+ return (type.returnType() == Object.class) ? mh : MH.asType(mh, type.changeReturnType(Object.class));
}
private void ensureConstructor(final CompiledFunction inv) {
if (!inv.hasConstructor()) {
- inv.setConstructor(composeConstructor(inv.getInvoker(), needsCallee(inv.getInvoker())));
+ inv.setConstructor(composeConstructor(inv.getInvoker()));
}
}
/**
- * Heuristic to figure out if the method handle has a callee argument. If it's type is either
- * {@code (boolean, ScriptFunction, ...)} or {@code (ScriptFunction, ...)}, then we'll assume it has
- * a callee argument. We need this as the constructor above is not passed this information, and can't just blindly
- * assume it's false (notably, it's being invoked for creation of new scripts, and scripts have scopes, therefore
+ * Heuristic to figure out if the method handle has a callee argument. If it's type is
+ * {@code (ScriptFunction, ...)}, then we'll assume it has a callee argument. We need this as
+ * the constructor above is not passed this information, and can't just blindly assume it's false
+ * (notably, it's being invoked for creation of new scripts, and scripts have scopes, therefore
* they also always receive a callee).
*
* @param mh the examined method handle
@@ -685,18 +680,8 @@
* @return true if the method handle expects a callee, false otherwise
*/
protected static boolean needsCallee(final MethodHandle mh) {
- final MethodType type = mh.type();
- final int length = type.parameterCount();
-
- if (length == 0) {
- return false;
- }
-
- if (type.parameterType(0) == ScriptFunction.class) {
- return true;
- }
-
- return length > 1 && type.parameterType(0) == boolean.class && type.parameterType(1) == ScriptFunction.class;
+ final MethodType type = mh.type();
+ return (type.parameterCount() > 0 && type.parameterType(0) == ScriptFunction.class);
}
/**
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java Fri Nov 08 17:36:14 2013 -0800
@@ -52,24 +52,10 @@
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
checkPackageAccess(name);
- try {
- return super.loadClass(name, resolve);
- } catch (final ClassNotFoundException | SecurityException e) {
- // We'll get ClassNotFoundException for Nashorn 'struct' classes.
- // Also, we'll get SecurityException for jdk.nashorn.internal.*
- // classes. So, load these using to context's 'shared' loader.
- // All these classes start with "jdk.nashorn.internal." prefix.
- try {
- if (name.startsWith(NASHORN_PKG_PREFIX)) {
- return context.getSharedLoader().loadClass(name);
- }
- } catch (final ClassNotFoundException ignored) {
- //ignored
- }
-
- // throw the original exception from here
- throw e;
+ if (name.startsWith(NASHORN_PKG_PREFIX)) {
+ return context.getSharedLoader().loadClass(name);
}
+ return super.loadClass(name, resolve);
}
// package-private and private stuff below this point
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java Fri Nov 08 17:36:14 2013 -0800
@@ -508,7 +508,7 @@
if (property == null) {
// promoting an arrayData value to actual property
addOwnProperty(key, propFlags, value);
- removeArraySlot(key);
+ checkIntegerKey(key);
} else {
// Now set the new flags
modifyOwnProperty(property, propFlags);
@@ -594,7 +594,7 @@
* @param index key for property
* @param value value to define
*/
- protected final void defineOwnProperty(final int index, final Object value) {
+ public final void defineOwnProperty(final int index, final Object value) {
assert isValidArrayIndex(index) : "invalid array index";
final long longIndex = ArrayIndex.toLongIndex(index);
if (longIndex >= getArray().length()) {
@@ -616,15 +616,6 @@
}
}
- private void removeArraySlot(final String key) {
- final int index = getArrayIndex(key);
- final ArrayData array = getArray();
-
- if (array.has(index)) {
- setArray(array.delete(index));
- }
- }
-
/**
* Add a new property to the object.
*
@@ -1203,21 +1194,10 @@
* Check if this ScriptObject has array entries. This means that someone has
* set values with numeric keys in the object.
*
- * Note: this can be O(n) up to the array length
- *
* @return true if array entries exists.
*/
public boolean hasArrayEntries() {
- final ArrayData array = getArray();
- final long length = array.length();
-
- for (long i = 0; i < length; i++) {
- if (array.has((int)i)) {
- return true;
- }
- }
-
- return false;
+ return getArray().length() > 0 || getMap().containsArrayKeys();
}
/**
@@ -2356,8 +2336,29 @@
}
if (newLength < arrayLength) {
- setArray(getArray().shrink(newLength));
- getArray().setLength(newLength);
+ long actualLength = newLength;
+
+ // Check for numeric keys in property map and delete them or adjust length, depending on whether
+ // they're defined as configurable. See ES5 #15.4.5.2
+ if (getMap().containsArrayKeys()) {
+
+ for (long l = arrayLength - 1; l >= newLength; l--) {
+ final FindProperty find = findProperty(JSType.toString(l), false);
+
+ if (find != null) {
+
+ if (find.getProperty().isConfigurable()) {
+ deleteOwnProperty(find.getProperty());
+ } else {
+ actualLength = l + 1;
+ break;
+ }
+ }
+ }
+ }
+
+ setArray(getArray().shrink(actualLength));
+ getArray().setLength(actualLength);
}
}
@@ -2680,7 +2681,7 @@
final long oldLength = getArray().length();
final long longIndex = index & JSType.MAX_UINT;
- if (!getArray().has(index)) {
+ if (getMap().containsArrayKeys()) {
final String key = JSType.toString(longIndex);
final FindProperty find = findProperty(key, true);
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObjectListAdapter.java Fri Nov 08 17:50:24 2013 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.nashorn.internal.runtime;
-
-/**
- * A ListAdapter that can wrap a ScriptObject.
- */
-public final class ScriptObjectListAdapter extends ListAdapter {
- /**
- * Creates a new list wrapper for the specified ScriptObject.
- * @param obj script the object to wrap
- */
- public ScriptObjectListAdapter(final ScriptObject obj) {
- super(obj);
- }
-
- @Override
- public int size() {
- return JSType.toInt32(((ScriptObject)obj).getLength());
- }
-
- @Override
- protected Object getAt(int index) {
- return ((ScriptObject)obj).get(index);
- }
-
- @Override
- protected void setAt(int index, Object element) {
- ((ScriptObject)obj).set(index, element, false);
- }
-}
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java Fri Nov 08 17:36:14 2013 -0800
@@ -47,6 +47,7 @@
import jdk.nashorn.api.scripting.ScriptObjectMirror;
import jdk.nashorn.internal.codegen.CompilerConstants.Call;
import jdk.nashorn.internal.ir.debug.JSONWriter;
+import jdk.nashorn.internal.objects.Global;
import jdk.nashorn.internal.parser.Lexer;
import jdk.nashorn.internal.runtime.linker.Bootstrap;
@@ -258,6 +259,11 @@
return ((Map<?,?>)obj).keySet().iterator();
}
+ final Object wrapped = Global.instance().wrapAsObject(obj);
+ if (wrapped instanceof ScriptObject) {
+ return ((ScriptObject)wrapped).propertyIterator();
+ }
+
return Collections.emptyIterator();
}
@@ -336,6 +342,11 @@
return ((Iterable<?>)obj).iterator();
}
+ final Object wrapped = Global.instance().wrapAsObject(obj);
+ if (wrapped instanceof ScriptObject) {
+ return ((ScriptObject)wrapped).valueIterator();
+ }
+
return Collections.emptyIterator();
}
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java Fri Nov 08 17:36:14 2013 -0800
@@ -190,7 +190,7 @@
char buffer[] = new char[1024];
try (final InputStreamReader inputStream = new InputStreamReader(process.getErrorStream())) {
for (int length; (length = inputStream.read(buffer, 0, buffer.length)) != -1; ) {
- outBuffer.append(buffer, 0, length);
+ errBuffer.append(buffer, 0, length);
}
} catch (IOException ex) {
exception[1] = ex;
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java Fri Nov 08 17:36:14 2013 -0800
@@ -461,7 +461,23 @@
*/
public abstract ArrayData slice(long from, long to);
- private static Class<?> widestType(final Object... items) {
+ /**
+ * Fast splice operation. This just modifies the array according to the number of
+ * elements added and deleted but does not insert the added elements. Throws
+ * {@code UnsupportedOperationException} if fast splice operation is not supported
+ * for this class or arguments.
+ *
+ * @param start start index of splice operation
+ * @param removed number of removed elements
+ * @param added number of added elements
+ * @throws UnsupportedOperationException if fast splice is not supported for the class or arguments.
+ */
+ public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+
+ static Class<?> widestType(final Object... items) {
assert items.length > 0;
Class<?> widest = Integer.class;
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java Fri Nov 08 17:36:14 2013 -0800
@@ -269,4 +269,32 @@
return new IntArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
}
+
+ @Override
+ public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+ final long oldLength = length();
+ final long newLength = oldLength - removed + added;
+ if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
+ throw new UnsupportedOperationException();
+ }
+ final ArrayData returnValue = (removed == 0) ?
+ EMPTY_ARRAY : new IntArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+
+ if (newLength != oldLength) {
+ final int[] newArray;
+
+ if (newLength > array.length) {
+ newArray = new int[ArrayData.nextSize((int)newLength)];
+ System.arraycopy(array, 0, newArray, 0, start);
+ } else {
+ newArray = array;
+ }
+
+ System.arraycopy(array, start + removed, newArray, start + added, (int)(oldLength - start - removed));
+ array = newArray;
+ setLength(newLength);
+ }
+
+ return returnValue;
+ }
}
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java Fri Nov 08 17:36:14 2013 -0800
@@ -92,7 +92,7 @@
@Override
public ArrayData convert(final Class<?> type) {
- if (type == Long.class) {
+ if (type == Integer.class || type == Long.class) {
return this;
}
final int length = (int) length();
@@ -238,4 +238,32 @@
final long newLength = to - start;
return new LongArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
}
+
+ @Override
+ public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+ final long oldLength = length();
+ final long newLength = oldLength - removed + added;
+ if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
+ throw new UnsupportedOperationException();
+ }
+ final ArrayData returnValue = (removed == 0) ?
+ EMPTY_ARRAY : new LongArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+
+ if (newLength != oldLength) {
+ final long[] newArray;
+
+ if (newLength > array.length) {
+ newArray = new long[ArrayData.nextSize((int)newLength)];
+ System.arraycopy(array, 0, newArray, 0, start);
+ } else {
+ newArray = array;
+ }
+
+ System.arraycopy(array, start + removed, newArray, start + added, (int)(oldLength - start - removed));
+ array = newArray;
+ setLength(newLength);
+ }
+
+ return returnValue;
+ }
}
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java Fri Nov 08 17:36:14 2013 -0800
@@ -218,4 +218,32 @@
final long newLength = to - start;
return new NumberArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
}
+
+ @Override
+ public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+ final long oldLength = length();
+ final long newLength = oldLength - removed + added;
+ if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
+ throw new UnsupportedOperationException();
+ }
+ final ArrayData returnValue = (removed == 0) ?
+ EMPTY_ARRAY : new NumberArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+
+ if (newLength != oldLength) {
+ final double[] newArray;
+
+ if (newLength > array.length) {
+ newArray = new double[ArrayData.nextSize((int)newLength)];
+ System.arraycopy(array, 0, newArray, 0, start);
+ } else {
+ newArray = array;
+ }
+
+ System.arraycopy(array, start + removed, newArray, start + added, (int)(oldLength - start - removed));
+ array = newArray;
+ setLength(newLength);
+ }
+
+ return returnValue;
+ }
}
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java Fri Nov 08 17:36:14 2013 -0800
@@ -206,4 +206,32 @@
final long newLength = to - start;
return new ObjectArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
}
+
+ @Override
+ public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+ final long oldLength = length();
+ final long newLength = oldLength - removed + added;
+ if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
+ throw new UnsupportedOperationException();
+ }
+ final ArrayData returnValue = (removed == 0) ?
+ EMPTY_ARRAY : new ObjectArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+
+ if (newLength != oldLength) {
+ final Object[] newArray;
+
+ if (newLength > array.length) {
+ newArray = new Object[ArrayData.nextSize((int)newLength)];
+ System.arraycopy(array, 0, newArray, 0, start);
+ } else {
+ newArray = array;
+ }
+
+ System.arraycopy(array, start + removed, newArray, start + added, (int)(oldLength - start - removed));
+ array = newArray;
+ setLength(newLength);
+ }
+
+ return returnValue;
+ }
}
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java Fri Nov 08 17:36:14 2013 -0800
@@ -25,25 +25,28 @@
package jdk.nashorn.internal.runtime.linker;
-import jdk.nashorn.internal.lookup.MethodHandleFunctionality;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
+import java.util.HashMap;
+import java.util.Map;
import jdk.internal.dynalink.CallSiteDescriptor;
import jdk.internal.dynalink.linker.GuardedInvocation;
+import jdk.internal.dynalink.linker.GuardingTypeConverterFactory;
import jdk.internal.dynalink.linker.LinkRequest;
import jdk.internal.dynalink.linker.LinkerServices;
import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
+import jdk.nashorn.api.scripting.JSObject;
+import jdk.nashorn.internal.lookup.MethodHandleFactory;
+import jdk.nashorn.internal.lookup.MethodHandleFunctionality;
import jdk.nashorn.internal.runtime.JSType;
-import jdk.nashorn.api.scripting.JSObject;
/**
* A Dynalink linker to handle web browser built-in JS (DOM etc.) objects as well
* as ScriptObjects from other Nashorn contexts.
*/
-final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
+final class JSObjectLinker implements TypeBasedGuardingDynamicLinker, GuardingTypeConverterFactory {
@Override
public boolean canLinkType(final Class<?> type) {
return canLinkTypeStatic(type);
@@ -75,6 +78,22 @@
return Bootstrap.asType(inv, linkerServices, desc);
}
+ @Override
+ public GuardedInvocation convertToType(final Class<?> sourceType, final Class<?> targetType) throws Exception {
+ final boolean sourceIsAlwaysJSObject = JSObject.class.isAssignableFrom(sourceType);
+ if(!sourceIsAlwaysJSObject && !sourceType.isAssignableFrom(JSObject.class)) {
+ return null;
+ }
+
+ final MethodHandle converter = CONVERTERS.get(targetType);
+ if(converter == null) {
+ return null;
+ }
+
+ return new GuardedInvocation(converter, sourceIsAlwaysJSObject ? null : IS_JSOBJECT_GUARD).asType(MethodType.methodType(targetType, sourceType));
+ }
+
+
private static GuardedInvocation lookup(final CallSiteDescriptor desc) {
final String operator = CallSiteDescriptorFactory.tokenizeOperators(desc).get(0);
final int c = desc.getNameTokenCount();
@@ -87,9 +106,7 @@
case "setElem":
return c > 2 ? findSetMethod(desc) : findSetIndexMethod();
case "call":
- return findCallMethod(desc, operator);
- case "callMethod":
- return findCallMethodMethod(desc, operator);
+ return findCallMethod(desc);
case "new":
return findNewMethod(desc);
default:
@@ -115,14 +132,7 @@
return new GuardedInvocation(JSOBJECTLINKER_PUT, null, IS_JSOBJECT_GUARD);
}
- private static GuardedInvocation findCallMethodMethod(final CallSiteDescriptor desc, final String operator) {
- final String methodName = desc.getNameToken(2);
- MethodHandle func = MH.insertArguments(JSOBJECT_CALLMEMBER, 1, methodName);
- func = MH.asCollector(func, Object[].class, desc.getMethodType().parameterCount() - 1);
- return new GuardedInvocation(func, null, IS_JSOBJECT_GUARD);
- }
-
- private static GuardedInvocation findCallMethod(final CallSiteDescriptor desc, final String operator) {
+ private static GuardedInvocation findCallMethod(final CallSiteDescriptor desc) {
final MethodHandle func = MH.asCollector(JSOBJECT_CALL, Object[].class, desc.getMethodType().parameterCount() - 2);
return new GuardedInvocation(func, null, IS_JSOBJECT_GUARD);
}
@@ -163,6 +173,25 @@
}
}
+ @SuppressWarnings("unused")
+ private static int toInt32(final JSObject obj) {
+ return JSType.toInt32(toNumber(obj));
+ }
+
+ @SuppressWarnings("unused")
+ private static long toInt64(final JSObject obj) {
+ return JSType.toInt64(toNumber(obj));
+ }
+
+ private static double toNumber(final JSObject obj) {
+ return obj == null ? 0 : obj.toNumber();
+ }
+
+ @SuppressWarnings("unused")
+ private static boolean toBoolean(final JSObject obj) {
+ return obj != null;
+ }
+
private static int getIndex(final Number n) {
final double value = n.doubleValue();
return JSType.isRepresentableAsInt(value) ? (int)value : -1;
@@ -178,27 +207,31 @@
// method handles of JSObject class
private static final MethodHandle JSOBJECT_GETMEMBER = findJSObjectMH("getMember", Object.class, String.class);
private static final MethodHandle JSOBJECT_SETMEMBER = findJSObjectMH("setMember", Void.TYPE, String.class, Object.class);
- private static final MethodHandle JSOBJECT_CALLMEMBER = findJSObjectMH("callMember", Object.class, String.class, Object[].class);
private static final MethodHandle JSOBJECT_CALL = findJSObjectMH("call", Object.class, Object.class, Object[].class);
private static final MethodHandle JSOBJECT_NEW = findJSObjectMH("newObject", Object.class, Object[].class);
+ private static final Map<Class<?>, MethodHandle> CONVERTERS = new HashMap<>();
+ static {
+ CONVERTERS.put(boolean.class, findOwnMH("toBoolean", boolean.class, JSObject.class));
+ CONVERTERS.put(int.class, findOwnMH("toInt32", int.class, JSObject.class));
+ CONVERTERS.put(long.class, findOwnMH("toInt64", long.class, JSObject.class));
+ CONVERTERS.put(double.class, findOwnMH("toNumber", double.class, JSObject.class));
+ }
+
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
- final Class<?> own = JSObjectLinker.class;
- final MethodType mt = MH.type(rtype, types);
- try {
- return MH.findStatic(MethodHandles.lookup(), own, name, mt);
- } catch (final MethodHandleFactory.LookupException e) {
- return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
- }
+ return findMH(name, JSObjectLinker.class, rtype, types);
}
private static MethodHandle findJSObjectMH(final String name, final Class<?> rtype, final Class<?>... types) {
- final Class<?> own = JSObject.class;
+ return findMH(name, JSObject.class, rtype, types);
+ }
+
+ private static MethodHandle findMH(final String name, final Class<?> target, final Class<?> rtype, final Class<?>... types) {
final MethodType mt = MH.type(rtype, types);
try {
- return MH.findVirtual(MethodHandles.publicLookup(), own, name, mt);
+ return MH.findStatic(MethodHandles.lookup(), target, name, mt);
} catch (final MethodHandleFactory.LookupException e) {
- return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
+ return MH.findVirtual(MethodHandles.lookup(), target, name, mt);
}
}
}
--- a/nashorn/src/overview.html Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/src/overview.html Fri Nov 08 17:36:14 2013 -0800
@@ -108,6 +108,6 @@
<h2>Other non-standard built-in objects</h2>
In addition to {@code Java}, Nashorn also exposes some other non-standard built-in objects:
<a href="jdk/nashorn/internal/objects/NativeJSAdapter.html">{@code JSAdapter}</a>,
-<a href="jdk/nashorn/internal/objects/NativeJavaImporter.html">{@code JavaImporter},
+<a href="jdk/nashorn/internal/objects/NativeJavaImporter.html">{@code JavaImporter}</a>,
<a href="jdk/nashorn/internal/runtime/NativeJavaPackage.html">{@code Packages}.</a>
</body>
--- a/nashorn/test/examples/array-micro.js Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/test/examples/array-micro.js Fri Nov 08 17:36:14 2013 -0800
@@ -90,6 +90,24 @@
array[6] = 6;
});
+bench("push", function() {
+ var arr = [1, 2, 3];
+ arr.push(4);
+ arr.push(5);
+ arr.push(6);
+});
+
+bench("pop", function() {
+ var arr = [1, 2, 3];
+ arr.pop();
+ arr.pop();
+ arr.pop();
+});
+
+bench("splice", function() {
+ [1, 2, 3].splice(0, 2, 5, 6, 7);
+});
+
var all = function(e) { return true; };
var none = function(e) { return false; };
--- a/nashorn/test/script/basic/JDK-8024847.js Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/test/script/basic/JDK-8024847.js Fri Nov 08 17:36:14 2013 -0800
@@ -100,3 +100,9 @@
var jlist = Java.to(obj, java.util.List);
print(jlist instanceof java.util.List);
print(jlist);
+
+var obj = new JSObject() {
+ toNumber: function() { return 42; }
+};
+
+print(32 + obj);
--- a/nashorn/test/script/basic/JDK-8024847.js.EXPECTED Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/test/script/basic/JDK-8024847.js.EXPECTED Fri Nov 08 17:36:14 2013 -0800
@@ -10,3 +10,4 @@
[hello, world]
true
[nashorn, js]
+74
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8026161.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8026161: Don't narrow floating-point literals in the lexer
+ *
+ * @test
+ * @run
+ */
+
+print(new java.awt.Color(1, 1, 1)) // creates Color[r=1,g=1,b=1]
+print(new java.awt.Color(1.0, 1.0, 1.0)) // Color[r=255,g=255,b=255]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8026161.js.EXPECTED Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,2 @@
+java.awt.Color[r=1,g=1,b=1]
+java.awt.Color[r=255,g=255,b=255]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8026701.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8026701: Array.prototype.splice is slow on dense arrays
+ *
+ * @test
+ * @run
+ */
+
+function testSplice(arr, e1, e2, e3) {
+ try {
+ print(arr);
+ print(arr.splice(3, 0, e1, e2, e3));
+ print(arr);
+ print(arr.splice(2, 3));
+ print(arr);
+ print(arr.splice(2, 3, arr[2], arr[3], arr[4]));
+ print(arr);
+ print(arr.splice(20, 10));
+ print(arr);
+ print(arr.splice(arr.length, 0, e1, e2, e3));
+ print(arr);
+ print(arr.splice(0, 2, arr[0], arr[1], arr[2], arr[3]));
+ print(arr);
+ } catch (error) {
+ print(error);
+ }
+}
+
+function convert(array, type) {
+ return (typeof Java === "undefined") ? array : Java.from(Java.to(array, type));
+}
+
+// run some splice tests on all dense array implementations
+testSplice([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], -1, -2, -3);
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "long[]"), -1, -2, -3);
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "double[]"), -1, -2, -3);
+testSplice(["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], -1, -2, -3);
+
+// test array conversion during splice
+testSplice([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], -1, "-2", "-3");
+testSplice([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], -1, -2.5, -3.5);
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "long[]"), -1, "-2", "-3");
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "long[]"), -1, -2.5, -3.5);
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "double[]"), -1, "-2", "-3");
+
+// test combination with defined elements
+testSplice(Object.defineProperty([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, {value: 13}), -1, -2, -3);
+testSplice(Object.defineProperty([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, {value: 13, writable: false}), -1, -2, -3);
+testSplice(Object.defineProperty([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, {value: 13, configurable: false}), -1, -2, -3);
+testSplice(Object.defineProperty([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, {value: 13, writable: false, configurable: false}), -1, -2, -3);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8026701.js.EXPECTED Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,147 @@
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,6,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,6,7,8,9,10
+-3,4,5
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,6,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,6,7,8,9,10
+-3,4,5
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,6,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,6,7,8,9,10
+-3,4,5
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,6,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,6,7,8,9,10
+-3,4,5
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,6,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,6,7,8,9,10
+-3,4,5
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2.5,-3.5,4,5,6,7,8,9,10
+3,-1,-2.5
+1,2,-3.5,4,5,6,7,8,9,10
+-3.5,4,5
+1,2,-3.5,4,5,6,7,8,9,10
+
+1,2,-3.5,4,5,6,7,8,9,10
+
+1,2,-3.5,4,5,6,7,8,9,10,-1,-2.5,-3.5
+1,2
+1,2,-3.5,4,-3.5,4,5,6,7,8,9,10,-1,-2.5,-3.5
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,6,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,6,7,8,9,10
+-3,4,5
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2.5,-3.5,4,5,6,7,8,9,10
+3,-1,-2.5
+1,2,-3.5,4,5,6,7,8,9,10
+-3.5,4,5
+1,2,-3.5,4,5,6,7,8,9,10
+
+1,2,-3.5,4,5,6,7,8,9,10
+
+1,2,-3.5,4,5,6,7,8,9,10,-1,-2.5,-3.5
+1,2
+1,2,-3.5,4,-3.5,4,5,6,7,8,9,10,-1,-2.5,-3.5
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,6,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,6,7,8,9,10
+-3,4,5
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10
+
+1,2,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,6,7,8,9,10,-1,-2,-3
+1,2,3,4,5,13,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,13,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,13,7,8,9,10
+-3,4,5
+1,2,-3,4,5,13,7,8,9,10
+
+1,2,-3,4,5,13,7,8,9,10
+
+1,2,-3,4,5,13,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,13,7,8,9,10,-1,-2,-3
+1,2,3,4,5,13,7,8,9,10
+TypeError: "5" is not a writable property of [object Array]
+1,2,3,4,5,13,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,13,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,13,7,8,9,10
+-3,4,5
+1,2,-3,4,5,13,7,8,9,10
+
+1,2,-3,4,5,13,7,8,9,10
+
+1,2,-3,4,5,13,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,13,7,8,9,10,-1,-2,-3
+1,2,3,4,5,13,7,8,9,10
+TypeError: "5" is not a writable property of [object Array]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8026805.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8026805: Array.prototype.length doesn't work as expected
+ *
+ * @test
+ * @run
+ */
+
+if (Array.prototype.length !== 0) {
+ throw new Error("Initial length not 0");
+}
+
+Array.prototype[3] = 1;
+
+if (Array.prototype.length !== 4) {
+ throw new Error("length not updated to 4");
+}
+
+Array.prototype.length = 0;
+
+if (Array.prototype.length !== 0) {
+ throw new Error("length not reset to 0");
+}
+
+if (3 in Array.prototype) {
+ throw new Error("array element not deleted");
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8026858.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8026858: Array length does not handle defined properties correctly
+ *
+ * @test
+ * @run
+ */
+
+var arr = [];
+
+Object.defineProperty(arr, "3", {value: 1 /* configurable: false */});
+
+if (arr[3] != 1) {
+ throw new Error("arr[3] not defined");
+}
+
+if (arr.length !== 4) {
+ throw new Error("Array length not updated to 4");
+}
+
+Object.defineProperty(arr, "5", {value: 1, configurable: true});
+
+if (arr[5] != 1) {
+ throw new Error("arr[5] not defined");
+}
+
+if (arr.length !== 6) {
+ throw new Error("Array length not updated to 4");
+}
+
+arr.length = 0;
+
+if (5 in arr) {
+ throw new Error("configurable element was not deleted");
+}
+
+if (arr[3] != 1) {
+ throw new Error("non-configurable element was deleted");
+}
+
+if (arr.length !== 4) {
+ throw new Error("Array length not set");
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8026955.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8026955: for-in should convert primitive values to object
+ *
+ * @test
+ * @run
+ */
+
+Object.prototype[4] = "world";
+String.prototype[3] = "hello";
+Number.prototype[3] = "hello";
+Boolean.prototype[3] = "hello";
+
+function testForIn(x) {
+ for (var i in x) {
+ print(i, x[i]);
+ }
+ for each (var i in x) {
+ print(i);
+ }
+}
+
+testForIn("abc");
+testForIn(false);
+testForIn(3);
+testForIn(null);
+testForIn();
+testForIn(String.prototype);
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8026955.js.EXPECTED Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,22 @@
+0 a
+1 b
+2 c
+3 hello
+4 world
+a
+b
+c
+hello
+world
+3 hello
+4 world
+hello
+world
+3 hello
+4 world
+hello
+world
+3 hello
+4 world
+hello
+world
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8027016.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8027016: Array.prototype.indexOf should return -1 when array is of length zero
+ *
+ * @test
+ * @run
+ */
+
+var res = [].indexOf(null, {valueOf:function(){throw "not reached"}});
+if (res != -1) {
+ fail("expected -1 on indexOf on empty array");
+}
+
+// add index beyond length check as well
+
+res = [].indexOf(null, 1);
+if (res != -1) {
+ fail("expected -1 on indexOf on empty array");
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8027024.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8027024: String.prototype.charAt and charCodeAt do not evaluate 'self' and 'pos' arguments in right order
+ *
+ * @test
+ * @run
+ */
+
+
+String.prototype.charAt.call(
+ {
+ toString: function() {
+ print("charAt.self.toString");
+ }
+ },
+
+ {
+ valueOf: function() {
+ print("charAt.pos.valueOf");
+ }
+ }
+);
+
+String.prototype.charCodeAt.call(
+ {
+ toString: function() {
+ print("charCodeAt.self.toString");
+ }
+ },
+
+ {
+ valueOf: function() {
+ print("charCodeAt.pos.valueOf");
+ }
+ }
+);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8027024.js.EXPECTED Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,4 @@
+charAt.self.toString
+charAt.pos.valueOf
+charCodeAt.self.toString
+charCodeAt.pos.valueOf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8027042.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8027042: Evaluation order for binary operators can be improved
+ *
+ * @test
+ * @run
+ */
+
+// var with getter side effect
+Object.defineProperty(this, "a", { get: function() {print("get a"); return 1; }});
+
+// var with both getter and conversion side effect
+Object.defineProperty(this, "b", { get: function() {print("get b"); return {valueOf: function() { print("conv b"); return 10; }}; }});
+
+(function() {
+ // var with toPrimitive conversion side effect
+ var c = {valueOf: function() { print("conv c"); return 100; }};
+
+ print(b + (c + a));
+ print(b + (c + b));
+ print(b + (a + b));
+ print(b + (b + c));
+ print(b + (b + c));
+ print(b + (c + (a - b)));
+ print(b + (c + (c - b)));
+ print(b + (c + (b - c)));
+ print(b + (b + (a ? 2 : 3)));
+ print(b + (b + (b ? 2 : 3)));
+ print(b + (b + (c ? 2 : 3)));
+ print(b + ((-c) + (-a)));
+ print(b + ((-c) + (-b)));
+ print(b + ((-c) + (-c)));
+ try { print(b + new a); } catch (e) {}
+ try { print(b + new b); } catch (e) {}
+ try { print(b + new c); } catch (e) {}
+})();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8027042.js.EXPECTED Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,88 @@
+get b
+get a
+conv c
+conv b
+111
+get b
+get b
+conv c
+conv b
+conv b
+120
+get b
+get a
+get b
+conv b
+conv b
+21
+get b
+get b
+conv b
+conv c
+conv b
+120
+get b
+get b
+conv b
+conv c
+conv b
+120
+get b
+get a
+get b
+conv b
+conv c
+conv b
+101
+get b
+get b
+conv c
+conv b
+conv c
+conv b
+200
+get b
+get b
+conv b
+conv c
+conv c
+conv b
+20
+get b
+get b
+get a
+conv b
+conv b
+22
+get b
+get b
+get b
+conv b
+conv b
+22
+get b
+get b
+conv b
+conv b
+22
+get b
+conv c
+get a
+conv b
+-91
+get b
+conv c
+get b
+conv b
+conv b
+-100
+get b
+conv c
+conv c
+conv b
+-190
+get b
+get a
+get b
+get b
+get b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8027562.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8027562: eval should load second and subsequent arguments for side effect
+ *
+ * @test
+ * @run
+ */
+
+try {
+ eval("", x);
+ fail("should have thrown ReferenceError for 'x'");
+} catch (e) {
+ if (! (e instanceof ReferenceError)) {
+ fail("Expected ReferenceError, got " + e);
+ }
+ print(e);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8027562.js.EXPECTED Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,1 @@
+ReferenceError: "x" is not defined
--- a/nashorn/test/script/basic/NASHORN-397.js Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/test/script/basic/NASHORN-397.js Fri Nov 08 17:36:14 2013 -0800
@@ -35,11 +35,8 @@
fail("typeof(5).x is not 'number'");
}
-// It is function because PrintStream implements Closeable, which is
-// marked with @FunctionalInterface. Yes, this means calling a stream
-// like "stream()" closes it.
-if (typeof (java.lang.System.out) != 'function') {
- fail("typeof java.lang.System.out is not 'object'");
+if (typeof (java.net.Proxy.NO_PROXY) != 'object') {
+ fail("typeof java.net.Proxy.NO_PROXY is not 'object'");
}
if (typeof (java.lang.Math.PI) != 'number') {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/jfx.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Base library for JavaFX canvas run by Nashorn testing.
+ * @subtest
+ *
+ *
+ */
+
+var System = Java.type("java.lang.System");
+var AWTImage = Java.type("org.jemmy.image.AWTImage");
+var PNGDecoder = Java.type("org.jemmy.image.PNGDecoder");
+var JemmyFxRoot = Java.type("org.jemmy.fx.Root");
+var AWTRobotCapturer = Java.type("org.jemmy.image.AWTRobotCapturer");
+var ByWindowType = Java.type("org.jemmy.fx.ByWindowType");
+var Scene = Java.type("javafx.scene.Scene");
+var Stage = Java.type("javafx.stage.Stage");
+var File = Java.type("java.io.File");
+var Timer = Java.type("java.util.Timer");
+var TimerTask = Java.type("java.util.TimerTask");
+var OSInfo = Java.type("sun.awt.OSInfo");
+var OSType = Java.type("sun.awt.OSInfo.OSType");
+var StringBuffer = Java.type("java.lang.StringBuffer");
+
+var WAIT = 2000;
+var TESTNAME = "test";
+var fsep = System.getProperty("file.separator");
+
+function checkImageAndExit() {
+ var raceTimer = new Timer(true);
+ var timerTask = new TimerTask() {
+ run: function run() {
+ var tmpdir = System.getProperty("java.io.tmpdir");
+ var timenow = (new Date()).getTime();
+ makeScreenShot(tmpdir + fsep + "screenshot" + timenow +".png");
+ var dupImg = isDuplicateImages(tmpdir + fsep + "screenshot" + timenow +".png", __DIR__ + "jfx" + fsep + TESTNAME + fsep + "golden");
+ (new File(mpdir + fsep + "screenshot" + timenow +".png")).delete();
+ if (!dupImg) System.err.println("ERROR: screenshot does not match golden image");
+ exit(0);
+ }
+ };
+ raceTimer.schedule(timerTask, WAIT);
+}
+
+function makeScreenShot(shootToImg) {
+ JemmyFxRoot.ROOT.getEnvironment().setImageCapturer(new AWTRobotCapturer());
+ var wrap = JemmyFxRoot.ROOT.lookup(new ByWindowType($STAGE.class)).lookup(Scene.class).wrap(0);
+ var imageJemmy = wrap.getScreenImage();
+ imageJemmy.save(shootToImg);
+}
+
+function isDuplicateImages(file1, file2) {
+ var f1 = new File(file1);
+ var f2;
+ var sb = new StringBuffer(file2);
+ if (OSInfo.getOSType() == OSType.WINDOWS) {
+ f2 = new File(sb.append(fsep + "windows.png").toString());
+ } else if (OSInfo.getOSType() == OSType.LINUX) {
+ f2 = new File(sb.append(fsep + "linux.png").toString());
+ } else if (OSInfo.getOSType() == OSType.MACOSX) {
+ f2 = new File(sb.append(fsep + "macosx.png").toString());
+ }
+ print(f1.getAbsolutePath());
+ print(f2.getAbsolutePath());
+ if (f1.exists() && f2.exists()) {
+ var image1 = new AWTImage(PNGDecoder.decode(f1.getAbsolutePath()));
+ var image2 = new AWTImage(PNGDecoder.decode(f2.getAbsolutePath()));
+ return image1.compareTo(image2) == null ? true : false;
+ }
+ return false;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/jfx/flyingimage.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+/**
+ * Testing JavaFX canvas run by Nashorn.
+ *
+ * @test/nocompare
+ * @run
+ * @fork
+ */
+
+TESTNAME = "flyingimage";
+
+var Image = Java.type("javafx.scene.image.Image");
+var Color = Java.type("javafx.scene.paint.Color");
+var Canvas = Java.type("javafx.scene.canvas.Canvas");
+var BorderPane = Java.type("javafx.scene.layout.BorderPane");
+var StackPane = Java.type("javafx.scene.layout.StackPane");
+var Font = Java.type("javafx.scene.text.Font");
+var FontSmoothingType = Java.type("javafx.scene.text.FontSmoothingType");
+var Text = Java.type("javafx.scene.text.Text");
+
+var WIDTH = 800;
+var HEIGHT = 600;
+var canvas = new Canvas(WIDTH, HEIGHT);
+function fileToURL(file) {
+ return new File(file).toURI().toURL().toExternalForm();
+}
+var imageUrl = fileToURL(__DIR__ + "flyingimage/flyingimage.png");
+var img = new Image(imageUrl);
+var font = new Font("Arial", 16);
+var t = 0;
+var isFrameRendered = false;
+function renderFrame() {
+ var gc = canvas.graphicsContext2D;
+ gc.setFill(Color.web("#cccccc"));
+ gc.fillRect(0, 0, WIDTH, HEIGHT);
+ gc.setStroke(Color.web("#000000"));
+ gc.setLineWidth(1);
+ gc.strokeRect(5, 5, WIDTH - 10, HEIGHT - 10);
+ var c = 200;
+ var msc= 0.5 * HEIGHT / img.height;
+ var sp0 = 0.003;
+ for (var h = 0; h < c; h++, t++) {
+ gc.setTransform(1, 0, 0, 1, 0, 0);
+ var yh = h / (c - 1);
+ gc.translate((0.5 + Math.sin(t * sp0 + h * 0.1) / 3) * WIDTH, 25 + (HEIGHT * 3 / 4 - 40) * (yh * yh));
+ var sc = 30 / img.height + msc * yh * yh;
+ gc.rotate(90 * Math.sin(t * sp0 + h * 0.1 + Math.PI));
+ gc.scale(sc, sc);
+ gc.drawImage(img, -img.width / 2, -img.height / 2);
+ }
+ gc.setTransform(1, 0, 0, 1, 0, 0);
+ isFrameRendered = true;
+}
+var stack = new StackPane();
+var pane = new BorderPane();
+
+pane.setCenter(canvas);
+stack.getChildren().add(pane);
+$STAGE.scene = new Scene(stack);
+renderFrame();
+checkImageAndExit();
Binary file nashorn/test/script/jfx/flyingimage/flyingimage.png has changed
Binary file nashorn/test/script/jfx/flyingimage/golden/linux.png has changed
Binary file nashorn/test/script/jfx/flyingimage/golden/macosx.png has changed
Binary file nashorn/test/script/jfx/flyingimage/golden/windows.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/jfx/kaleidoscope.js Fri Nov 08 17:36:14 2013 -0800
@@ -0,0 +1,162 @@
+/*
+ * 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.
+ */
+
+/**
+ * Testing JavaFX canvas run by Nashorn.
+ *
+ * @test/nocompare
+ * @run
+ * @fork
+ */
+
+TESTNAME = "kaleidoscope";
+WAIT = 4000;
+
+var Paint = Java.type("javafx.scene.paint.Paint");
+var Canvas = Java.type("javafx.scene.canvas.Canvas");
+var BorderPane = Java.type("javafx.scene.layout.BorderPane");
+var StackPane = Java.type("javafx.scene.layout.StackPane");
+var StrokeLineCap = Java.type("javafx.scene.shape.StrokeLineCap");
+
+var WIDTH = 800;
+var HEIGHT = 600;
+var canvas = new Canvas(WIDTH, HEIGHT);
+var context = canvas.graphicsContext2D;
+
+var x,y;
+var p_x,p_y;
+var a=0;
+var b=0;
+var angle=Math.PI/180*8;
+var color=0;
+var limit1=Math.PI*1.5;
+var limit2=Math.PI*1.79;
+var c=new Array(6);
+var d=new Array(6);
+var r,e;
+var fade;
+var prv_x,prv_y,prv_x2,prv_y2;
+
+function renderFrame() {
+ a=0.2*angle;
+ b=0.7*angle;
+ r=0;
+ fade=32;
+ for(var i=0;i<6;i++)
+ {
+ c[i]=1.0/(i+1)/2;
+ d[i]=1.0/(i+1)/2;
+ }
+ radius=Math.round((WIDTH+HEIGHT)/8);
+ e=radius*0.2;
+ p_x=Math.round(WIDTH/2);
+ p_y=Math.round(HEIGHT/2);
+ x=(radius*c[0])*Math.cos(a*d[1])+(radius*c[2])*Math.sin(a*d[3])+(radius*c[4])*Math.sin(a*d[5]);
+ y=(radius*c[5])*Math.sin(a*d[4])+(radius*c[3])*Math.cos(a*d[2])+(radius*c[1])*Math.cos(a*d[0]);
+ for (i = 0; i < 800; i++) {
+ anim();
+ }
+}
+
+function anim() {
+ var a1=Math.cos(a*2);
+ var a2=Math.cos(a*4);
+ var a3=Math.cos(a);
+ var a4=Math.sin(a);
+ if(b>limit1&&b<limit2) {
+ r+=radius*0.02*a1;
+ prv_x=x;
+ prv_y=y;
+ x=prv_x2+r*a3;
+ y=prv_y2+r*a4;
+ } else {
+ prv_x=x;
+ prv_y=y;
+ prv_x2=x;
+ prv_y2=y;
+ x=(radius*c[0])*Math.cos(a*d[1])+(radius*c[2])*Math.sin(a*d[3])+(radius*c[4])*Math.sin(a*d[5]);
+ y=(radius*c[5])*Math.sin(a*d[4])+(radius*c[3])*Math.cos(a*d[2])+(radius*c[1])*Math.cos(a*d[0]);
+ }
+ var c3=16*Math.cos(a*10);
+ var c1=Math.floor(56*Math.cos(a*angle*4)+c3);
+ var c2=Math.floor(56*Math.sin(a*angle*4)-c3);
+ context.lineCap=StrokeLineCap.ROUND;
+ context.setStroke(Paint.valueOf('rgba('+(192+c1)+','+(192+c2)+','+(192-c1)+','+(0.01-0.005*-a1)+')'));
+ context.lineWidth=e*1.4+e*0.8*a3;
+ draw_line(p_x,p_y,prv_x,prv_y,x,y);
+ context.lineWidth=e+e*0.8*a3;
+ draw_line(p_x,p_y,prv_x,prv_y,x,y);
+ context.setStroke(Paint.valueOf('rgba('+(192+c1)+','+(192+c2)+','+(192-c1)+','+(0.06-0.03*-a1)+')'));
+ context.lineWidth=e*0.6+e*0.35*a3;
+ draw_line(p_x,p_y,prv_x,prv_y,x,y);
+ context.setStroke(Paint.valueOf('rgba(0,0,0,0.06)'));
+ context.lineWidth=e*0.4+e*0.225*a3;
+ draw_line(p_x,p_y,prv_x,prv_y,x,y);
+ context.setStroke(Paint.valueOf('rgba('+(192+c1)+','+(192+c2)+','+(192-c1)+','+(0.1-0.075*-a1)+')'));
+ context.lineWidth=e*0.2+e*0.1*a3;
+ draw_line(p_x,p_y,prv_x,prv_y,x,y);
+ context.setStroke(Paint.valueOf('rgba(255,255,255,0.4)'));
+ context.lineWidth=e*(0.1-0.05*-a2);
+ draw_line(p_x,p_y,prv_x,prv_y,x,y);
+ a+=angle*Math.cos(b);
+ b+=angle*0.1;
+}
+
+function draw_line(x,y,x1,y1,x2,y2) {
+ context.beginPath();
+ context.moveTo(x+x1,y+y1);
+ context.lineTo(x+x2,y+y2);
+ context.moveTo(x-x1,y+y1);
+ context.lineTo(x-x2,y+y2);
+ context.moveTo(x-x1,y-y1);
+ context.lineTo(x-x2,y-y2);
+ context.moveTo(x+x1,y-y1);
+ context.lineTo(x+x2,y-y2);
+ context.moveTo(x+y1,y+x1);
+ context.lineTo(x+y2,y+x2);
+ context.moveTo(x-y1,y+x1);
+ context.lineTo(x-y2,y+x2);
+ context.moveTo(x-y1,y-x1);
+ context.lineTo(x-y2,y-x2);
+ context.moveTo(x+y1,y-x1);
+ context.lineTo(x+y2,y-x2);
+ context.moveTo(x,y+x2);
+ context.lineTo(x,y+x1);
+ context.moveTo(x,y-x2);
+ context.lineTo(x,y-x1);
+ context.moveTo(x+x2,y);
+ context.lineTo(x+x1,y);
+ context.moveTo(x-x2,y);
+ context.lineTo(x-x1,y);
+ context.stroke();
+ context.closePath();
+}
+
+var stack = new StackPane();
+var pane = new BorderPane();
+
+pane.setCenter(canvas);
+stack.getChildren().add(pane);
+$STAGE.scene = new Scene(stack);
+renderFrame();
+checkImageAndExit();
\ No newline at end of file
Binary file nashorn/test/script/jfx/kaleidoscope/golden/linux.png has changed
Binary file nashorn/test/script/jfx/kaleidoscope/golden/macosx.png has changed
Binary file nashorn/test/script/jfx/kaleidoscope/golden/windows.png has changed
--- a/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -412,7 +412,7 @@
@Test
public void accessMethodMixedWithEllipsis() throws ScriptException {
- assertArrayEquals(new Object[] { "Hello", 10, true, -100500, 80 }, (Object[])e.eval("o.methodMixedWithEllipsis('Hello', 10, true, -100500,80.0);"));
+ assertArrayEquals(new Object[] { "Hello", 10, true, -100500, 80d }, (Object[])e.eval("o.methodMixedWithEllipsis('Hello', 10, true, -100500,80.0);"));
assertArrayEquals(new Object[] { "Nashorn", 15 }, (Object[])e.eval("o.methodMixedWithEllipsis('Nashorn',15);"));
}
@@ -431,8 +431,8 @@
@Test
public void accessMethodDoubleVSintOverloaded() throws ScriptException {
- assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(0.0);"));
- assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(1000.0);"));
+ assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(0.0);"));
+ assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(1000.0);"));
assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(0.01);"));
assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(100.02);"));
assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(0);"));
--- a/nashorn/test/src/jdk/nashorn/api/scripting/PluggableJSObjectTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/PluggableJSObjectTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -46,7 +46,7 @@
* JSObject implementations.
*/
public class PluggableJSObjectTest {
- public static class MapWrapperObject extends JSObject {
+ public static class MapWrapperObject extends AbstractJSObject {
private final HashMap<String, Object> map = new LinkedHashMap<>();
public HashMap<String, Object> getMap() {
@@ -109,7 +109,7 @@
}
}
- public static class BufferObject extends JSObject {
+ public static class BufferObject extends AbstractJSObject {
private final IntBuffer buf;
public BufferObject(int size) {
@@ -170,7 +170,7 @@
}
}
- public static class Adder extends JSObject {
+ public static class Adder extends AbstractJSObject {
@Override
public Object call(Object thiz, Object... args) {
double res = 0.0;
@@ -202,7 +202,7 @@
}
}
- public static class Factory extends JSObject {
+ public static class Factory extends AbstractJSObject {
@Override
public Object newObject(Object... args) {
return new HashMap<Object, Object>();
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java Fri Nov 08 17:50:24 2013 -0500
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java Fri Nov 08 17:36:14 2013 -0800
@@ -129,7 +129,7 @@
final ScriptEngine e = m.getEngineByName("nashorn");
try {
e.eval("var obj = { '1': 'world', func: function() { return this.bar; }, bar: 'hello' }");
- JSObject obj = (JSObject) e.get("obj");
+ ScriptObjectMirror obj = (ScriptObjectMirror) e.get("obj");
// try basic get on existing properties
if (!obj.getMember("bar").equals("hello")) {