Merge
authormgerdin
Mon, 11 Nov 2013 16:20:48 +0100
changeset 21569 094a031ae9e3
parent 21568 5f57686b1d84 (current diff)
parent 21553 e4cee1ccd856 (diff)
child 21570 7006807e3cc8
Merge
hotspot/src/share/vm/memory/metaspace.cpp
jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java
jdk/src/share/demo/jfc/Notepad/resources/Notepad_fr.properties
jdk/src/share/demo/jfc/Notepad/resources/Notepad_sv.properties
jdk/test/java/net/NetworkInterface/MemLeakTest.java
jdk/test/jdk/lambda/vm/DefaultMethodsTest.java
jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh
jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh
jdk/test/sun/tools/jstatd/jpsOutput1.awk
jdk/test/sun/tools/jstatd/jstatGcutilOutput1.awk
jdk/test/sun/tools/jstatd/jstatdDefaults.sh
jdk/test/sun/tools/jstatd/jstatdExternalRegistry.sh
jdk/test/sun/tools/jstatd/jstatdPort.sh
jdk/test/sun/tools/jstatd/jstatdServerName.sh
jdk/test/sun/tools/jstatd/jstatdUsage1.sh
jdk/test/sun/tools/jstatd/usage.out
langtools/test/tools/javac/ExtDirs/ext1/pkg1.jar
langtools/test/tools/javac/ExtDirs/ext2/pkg2.jar
langtools/test/tools/javac/ExtDirs/ext3/pkg1.jar
langtools/test/tools/javac/ExtDirs/ext3/pkg2.jar
langtools/test/tools/javac/T8019486/WrongLVTForLambdaTest.java
nashorn/src/jdk/nashorn/internal/runtime/ScriptObjectListAdapter.java
--- a/.hgtags	Mon Nov 11 05:05:36 2013 -0800
+++ b/.hgtags	Mon Nov 11 16:20:48 2013 +0100
@@ -235,3 +235,5 @@
 b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111
 ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112
 4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113
+dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114
+3dd9732b17034f45d111996d1d50287b05a3998c jdk8-b115
--- a/.hgtags-top-repo	Mon Nov 11 05:05:36 2013 -0800
+++ b/.hgtags-top-repo	Mon Nov 11 16:20:48 2013 +0100
@@ -235,3 +235,5 @@
 d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111
 547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112
 6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113
+4f2011496393a26dcfd7b1f7787a3673ddd32599 jdk8-b114
+763ada2a1d8c5962bc8c3d297e57c562d2e95338 jdk8-b115
--- a/common/autoconf/basics.m4	Mon Nov 11 05:05:36 2013 -0800
+++ b/common/autoconf/basics.m4	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/common/autoconf/generated-configure.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/corba/.hgtags	Mon Nov 11 16:20:48 2013 +0100
@@ -235,3 +235,5 @@
 85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111
 43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112
 a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113
+0bbccf77c23e566170b88b52c2cf28e5d31ce927 jdk8-b114
+8d07115924b7d703a5048adb24e8aba751442f13 jdk8-b115
--- a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/corba/src/share/classes/javax/rmi/CORBA/Stub.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/corba/src/share/classes/javax/rmi/CORBA/Util.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/corba/src/share/classes/org/omg/CORBA/ORB.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/.hgtags	Mon Nov 11 16:20:48 2013 +0100
@@ -391,3 +391,5 @@
 82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56
 7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114
 3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57
+9ebaac78a8a0061fb9597e07f806498cb626cdeb jdk8-b115
+e510dfdec6dd701410f3398ed86ebcdff0cca63a hs25-b58
--- a/hotspot/make/hotspot_version	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/make/hotspot_version	Mon Nov 11 16:20:48 2013 +0100
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=25
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=58
+HS_BUILD_NUMBER=59
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=8
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -3526,8 +3526,12 @@
   delayed()->sub(Rtsp, Roffset, Rtsp);
 
   // Bang down shadow pages too.
-  // The -1 because we already subtracted 1 page.
-  for (int i = 0; i< StackShadowPages-1; i++) {
+  // At this point, (tmp-0) is the last address touched, so don't
+  // touch it again.  (It was touched as (tmp-pagesize) but then tmp
+  // was post-decremented.)  Skip this address by starting at i=1, and
+  // touch a few more pages below.  N.B.  It is important to touch all
+  // the way down to and including i=StackShadowPages.
+  for (int i = 1; i <= StackShadowPages; i++) {
     set((-i*offset)+STACK_BIAS, Rscratch);
     st(G0, Rtsp, Rscratch);
   }
--- a/hotspot/src/cpu/sparc/vm/sparc.ad	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad	Mon Nov 11 16:20:48 2013 +0100
@@ -2916,6 +2916,9 @@
       __ bind(LSkip2);
     }
 
+    // We have no guarantee that on 64 bit the higher half of limit_reg is 0
+    __ signx(limit_reg);
+
     __ subcc(limit_reg, 1 * sizeof(jchar), chr1_reg);
     __ br(Assembler::equal, true, Assembler::pn, Ldone);
     __ delayed()->mov(O7, result_reg);  // result is difference in lengths
@@ -2973,6 +2976,9 @@
     Register  chr1_reg = result_reg;
     Register  chr2_reg =   tmp1_reg;
 
+    // We have no guarantee that on 64 bit the higher half of limit_reg is 0
+    __ signx(limit_reg);
+
     //check for alignment and position the pointers to the ends
     __ or3(str1_reg, str2_reg, chr1_reg);
     __ andcc(chr1_reg, 0x3, chr1_reg);
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -196,7 +196,7 @@
 
 void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) {
   assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
-  movl(reg, Address(rsi, bcp_offset));
+  load_unsigned_short(reg, Address(rsi, bcp_offset));
   bswapl(reg);
   shrl(reg, 16);
 }
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -192,7 +192,7 @@
   Register reg,
   int bcp_offset) {
   assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
-  movl(reg, Address(r13, bcp_offset));
+  load_unsigned_short(reg, Address(r13, bcp_offset));
   bswapl(reg);
   shrl(reg, 16);
 }
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -1381,8 +1381,12 @@
   jcc(Assembler::greater, loop);
 
   // Bang down shadow pages too.
-  // The -1 because we already subtracted 1 page.
-  for (int i = 0; i< StackShadowPages-1; i++) {
+  // At this point, (tmp-0) is the last address touched, so don't
+  // touch it again.  (It was touched as (tmp-pagesize) but then tmp
+  // was post-decremented.)  Skip this address by starting at i=1, and
+  // touch a few more pages below.  N.B.  It is important to touch all
+  // the way down to and including i=StackShadowPages.
+  for (int i = 1; i <= StackShadowPages; i++) {
     // this could be any sized move but this is can be a debugging crumb
     // so the bigger the better.
     movptr(Address(tmp, (-i*os::vm_page_size())), size );
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -558,7 +558,7 @@
 
 
 void TemplateTable::locals_index_wide(Register reg) {
-  __ movl(reg, at_bcp(2));
+  __ load_unsigned_short(reg, at_bcp(2));
   __ bswapl(reg);
   __ shrl(reg, 16);
   __ negptr(reg);
@@ -1552,7 +1552,11 @@
                               InvocationCounter::counter_offset();
 
   // Load up EDX with the branch displacement
-  __ movl(rdx, at_bcp(1));
+  if (is_wide) {
+    __ movl(rdx, at_bcp(1));
+  } else {
+    __ load_signed_short(rdx, at_bcp(1));
+  }
   __ bswapl(rdx);
   if (!is_wide) __ sarl(rdx, 16);
   LP64_ONLY(__ movslq(rdx, rdx));
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -568,7 +568,7 @@
 }
 
 void TemplateTable::locals_index_wide(Register reg) {
-  __ movl(reg, at_bcp(2));
+  __ load_unsigned_short(reg, at_bcp(2));
   __ bswapl(reg);
   __ shrl(reg, 16);
   __ negptr(reg);
@@ -1575,7 +1575,11 @@
                               InvocationCounter::counter_offset();
 
   // Load up edx with the branch displacement
-  __ movl(rdx, at_bcp(1));
+  if (is_wide) {
+    __ movl(rdx, at_bcp(1));
+  } else {
+    __ load_signed_short(rdx, at_bcp(1));
+  }
   __ bswapl(rdx);
 
   if (!is_wide) {
--- a/hotspot/src/share/vm/asm/assembler.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/asm/assembler.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -122,7 +122,7 @@
 void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) {
   if (UseStackBanging) {
     // Each code entry causes one stack bang n pages down the stack where n
-    // is configurable by StackBangPages.  The setting depends on the maximum
+    // is configurable by StackShadowPages.  The setting depends on the maximum
     // depth of VM call stack or native before going back into java code,
     // since only java code can raise a stack overflow exception using the
     // stack banging mechanism.  The VM and native code does not detect stack
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -1138,8 +1138,10 @@
         }
       }
     }
-
-  } else if (opr_type != T_LONG) {
+    // We want to sometimes use logical operations on pointers, in particular in GC barriers.
+    // Since 64bit logical operations do not current support operands on stack, we have to make sure
+    // T_OBJECT doesn't get spilled along with T_LONG.
+  } else if (opr_type != T_LONG LP64_ONLY(&& opr_type != T_OBJECT)) {
     // integer instruction (note: long operands must always be in register)
     switch (op->code()) {
       case lir_cmp:
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -392,10 +392,16 @@
     }
 
     GrowableArray<Method*> qualified_methods;
+    int num_defaults = 0;
+    int default_index = -1;
     for (int i = 0; i < _members.length(); ++i) {
       Pair<Method*,QualifiedState> entry = _members.at(i);
       if (entry.second == QUALIFIED) {
         qualified_methods.append(entry.first);
+        default_index++;
+        if (entry.first->is_default_method()) {
+          num_defaults++;
+        }
       }
     }
 
@@ -408,6 +414,9 @@
       if (!method->is_abstract()) {
         _selected_target = qualified_methods.at(0);
       }
+      // If only one qualified method is default, select that
+    } else if (num_defaults == 1) {
+        _selected_target = qualified_methods.at(default_index);
     } else {
       _exception_message = generate_conflicts_message(&qualified_methods,CHECK);
       _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
--- a/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -27,6 +27,7 @@
 #include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "oops/metadata.hpp"
+#include "prims/jvmtiImpl.hpp"
 #include "runtime/synchronizer.hpp"
 #include "runtime/thread.hpp"
 #include "utilities/growableArray.hpp"
@@ -48,6 +49,7 @@
   Threads::metadata_do(Metadata::mark_on_stack);
   CodeCache::alive_nmethods_do(nmethod::mark_on_stack);
   CompileBroker::mark_on_stack();
+  JvmtiCurrentBreakpoints::metadata_do(Metadata::mark_on_stack);
 }
 
 MetadataOnStackMark::~MetadataOnStackMark() {
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -2869,7 +2869,7 @@
 
   Universe::set_narrow_klass_base(lower_base);
 
-  if ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax) {
+  if ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax) {
     Universe::set_narrow_klass_shift(0);
   } else {
     assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces");
@@ -2885,7 +2885,7 @@
   address lower_base = MIN2((address)metaspace_base, cds_base);
   address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()),
                                 (address)(metaspace_base + compressed_class_space_size()));
-  return ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax);
+  return ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax);
 }
 
 // Try to allocate the metaspace at the requested addr.
--- a/hotspot/src/share/vm/opto/compile.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/opto/compile.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -848,6 +848,7 @@
   }
 #endif
 
+  NOT_PRODUCT( verify_barriers(); )
   // Now that we know the size of all the monitors we can add a fixed slot
   // for the original deopt pc.
 
@@ -3018,12 +3019,17 @@
           // Phi nodes shouldn't be moved. They would only match below if they
           // had the same control as the MathExactNode. The only time that
           // would happen is if the Phi is also an input to the MathExact
-          if (!out->is_Phi()) {
-            if (out->in(0) == NULL) {
-              out->set_req(0, non_throwing);
-            } else if (out->in(0) == ctrl) {
-              out->set_req(0, non_throwing);
-            }
+          //
+          // Cmp nodes shouldn't have control set at all.
+          if (out->is_Phi() ||
+              out->is_Cmp()) {
+            continue;
+          }
+
+          if (out->in(0) == NULL) {
+            out->set_req(0, non_throwing);
+          } else if (out->in(0) == ctrl) {
+            out->set_req(0, non_throwing);
           }
         }
       }
@@ -3368,6 +3374,72 @@
     }
   }
 }
+
+// Verify GC barriers consistency
+// Currently supported:
+// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre())
+void Compile::verify_barriers() {
+  if (UseG1GC) {
+    // Verify G1 pre-barriers
+    const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active());
+
+    ResourceArea *area = Thread::current()->resource_area();
+    Unique_Node_List visited(area);
+    Node_List worklist(area);
+    // We're going to walk control flow backwards starting from the Root
+    worklist.push(_root);
+    while (worklist.size() > 0) {
+      Node* x = worklist.pop();
+      if (x == NULL || x == top()) continue;
+      if (visited.member(x)) {
+        continue;
+      } else {
+        visited.push(x);
+      }
+
+      if (x->is_Region()) {
+        for (uint i = 1; i < x->req(); i++) {
+          worklist.push(x->in(i));
+        }
+      } else {
+        worklist.push(x->in(0));
+        // We are looking for the pattern:
+        //                            /->ThreadLocal
+        // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset)
+        //              \->ConI(0)
+        // We want to verify that the If and the LoadB have the same control
+        // See GraphKit::g1_write_barrier_pre()
+        if (x->is_If()) {
+          IfNode *iff = x->as_If();
+          if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) {
+            CmpNode *cmp = iff->in(1)->in(1)->as_Cmp();
+            if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0
+                && cmp->in(1)->is_Load()) {
+              LoadNode* load = cmp->in(1)->as_Load();
+              if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal
+                  && load->in(2)->in(3)->is_Con()
+                  && load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) {
+
+                Node* if_ctrl = iff->in(0);
+                Node* load_ctrl = load->in(0);
+
+                if (if_ctrl != load_ctrl) {
+                  // Skip possible CProj->NeverBranch in infinite loops
+                  if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj)
+                      && (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) {
+                    if_ctrl = if_ctrl->in(0)->in(0);
+                  }
+                }
+                assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match");
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
 #endif
 
 // The Compile object keeps track of failure reasons separately from the ciEnv.
--- a/hotspot/src/share/vm/opto/compile.hpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/opto/compile.hpp	Mon Nov 11 16:20:48 2013 +0100
@@ -1148,6 +1148,9 @@
   // graph is strongly connected from root in both directions.
   void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN;
 
+  // Verify GC barrier patterns
+  void verify_barriers() PRODUCT_RETURN;
+
   // End-of-run dumps.
   static void print_statistics() PRODUCT_RETURN;
 
--- a/hotspot/src/share/vm/opto/loopTransform.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -1964,7 +1964,7 @@
       // Find loads off the surviving projection; remove their control edge
       for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) {
         Node* cd = dp->fast_out(i); // Control-dependent node
-        if( cd->is_Load() ) {   // Loads can now float around in the loop
+        if (cd->is_Load() && cd->depends_only_on_test()) {   // Loads can now float around in the loop
           // Allow the load to float around in the loop, or before it
           // but NOT before the pre-loop.
           _igvn.replace_input_of(cd, 0, ctrl); // ctrl, not NULL
--- a/hotspot/src/share/vm/opto/memnode.hpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/opto/memnode.hpp	Mon Nov 11 16:20:48 2013 +0100
@@ -204,6 +204,17 @@
 protected:
   const Type* load_array_final_field(const TypeKlassPtr *tkls,
                                      ciKlass* klass) const;
+  // depends_only_on_test is almost always true, and needs to be almost always
+  // true to enable key hoisting & commoning optimizations.  However, for the
+  // special case of RawPtr loads from TLS top & end, and other loads performed by
+  // GC barriers, the control edge carries the dependence preventing hoisting past
+  // a Safepoint instead of the memory edge.  (An unfortunate consequence of having
+  // Safepoints not set Raw Memory; itself an unfortunate consequence of having Nodes
+  // which produce results (new raw memory state) inside of loops preventing all
+  // manner of other optimizations).  Basically, it's ugly but so is the alternative.
+  // See comment in macro.cpp, around line 125 expand_allocate_common().
+  virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
+
 };
 
 //------------------------------LoadBNode--------------------------------------
@@ -370,16 +381,6 @@
   virtual uint ideal_reg() const { return Op_RegP; }
   virtual int store_Opcode() const { return Op_StoreP; }
   virtual BasicType memory_type() const { return T_ADDRESS; }
-  // depends_only_on_test is almost always true, and needs to be almost always
-  // true to enable key hoisting & commoning optimizations.  However, for the
-  // special case of RawPtr loads from TLS top & end, the control edge carries
-  // the dependence preventing hoisting past a Safepoint instead of the memory
-  // edge.  (An unfortunate consequence of having Safepoints not set Raw
-  // Memory; itself an unfortunate consequence of having Nodes which produce
-  // results (new raw memory state) inside of loops preventing all manner of
-  // other optimizations).  Basically, it's ugly but so is the alternative.
-  // See comment in macro.cpp, around line 125 expand_allocate_common().
-  virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
 };
 
 
@@ -393,16 +394,6 @@
   virtual uint ideal_reg() const { return Op_RegN; }
   virtual int store_Opcode() const { return Op_StoreN; }
   virtual BasicType memory_type() const { return T_NARROWOOP; }
-  // depends_only_on_test is almost always true, and needs to be almost always
-  // true to enable key hoisting & commoning optimizations.  However, for the
-  // special case of RawPtr loads from TLS top & end, the control edge carries
-  // the dependence preventing hoisting past a Safepoint instead of the memory
-  // edge.  (An unfortunate consequence of having Safepoints not set Raw
-  // Memory; itself an unfortunate consequence of having Nodes which produce
-  // results (new raw memory state) inside of loops preventing all manner of
-  // other optimizations).  Basically, it's ugly but so is the alternative.
-  // See comment in macro.cpp, around line 125 expand_allocate_common().
-  virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
 };
 
 //------------------------------LoadKlassNode----------------------------------
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -210,6 +210,14 @@
   }
 }
 
+void GrowableCache::metadata_do(void f(Metadata*)) {
+  int len = _elements->length();
+  for (int i=0; i<len; i++) {
+    GrowableElement *e = _elements->at(i);
+    e->metadata_do(f);
+  }
+}
+
 void GrowableCache::gc_epilogue() {
   int len = _elements->length();
   for (int i=0; i<len; i++) {
@@ -224,20 +232,20 @@
 JvmtiBreakpoint::JvmtiBreakpoint() {
   _method = NULL;
   _bci    = 0;
-  _class_loader = NULL;
+  _class_holder = NULL;
 }
 
 JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location) {
   _method        = m_method;
-  _class_loader  = _method->method_holder()->class_loader_data()->class_loader();
+  _class_holder  = _method->method_holder()->klass_holder();
 #ifdef CHECK_UNHANDLED_OOPS
-  // _class_loader can't be wrapped in a Handle, because JvmtiBreakpoint:s are
-  // eventually allocated on the heap.
+  // _class_holder can't be wrapped in a Handle, because JvmtiBreakpoints are
+  // sometimes allocated on the heap.
   //
-  // The code handling JvmtiBreakpoint:s allocated on the stack can't be
-  // interrupted by a GC until _class_loader is reachable by the GC via the
+  // The code handling JvmtiBreakpoints allocated on the stack can't be
+  // interrupted by a GC until _class_holder is reachable by the GC via the
   // oops_do method.
-  Thread::current()->allow_unhandled_oop(&_class_loader);
+  Thread::current()->allow_unhandled_oop(&_class_holder);
 #endif // CHECK_UNHANDLED_OOPS
   assert(_method != NULL, "_method != NULL");
   _bci           = (int) location;
@@ -247,7 +255,7 @@
 void JvmtiBreakpoint::copy(JvmtiBreakpoint& bp) {
   _method   = bp._method;
   _bci      = bp._bci;
-  _class_loader = bp._class_loader;
+  _class_holder = bp._class_holder;
 }
 
 bool JvmtiBreakpoint::lessThan(JvmtiBreakpoint& bp) {
@@ -365,6 +373,13 @@
   }
 }
 
+void VM_ChangeBreakpoints::metadata_do(void f(Metadata*)) {
+  // Walk metadata in breakpoints to keep from being deallocated with RedefineClasses
+  if (_bp != NULL) {
+    _bp->metadata_do(f);
+  }
+}
+
 //
 // class JvmtiBreakpoints
 //
@@ -381,6 +396,10 @@
   _bps.oops_do(f);
 }
 
+void  JvmtiBreakpoints::metadata_do(void f(Metadata*)) {
+  _bps.metadata_do(f);
+}
+
 void JvmtiBreakpoints::gc_epilogue() {
   _bps.gc_epilogue();
 }
@@ -499,6 +518,12 @@
   }
 }
 
+void JvmtiCurrentBreakpoints::metadata_do(void f(Metadata*)) {
+  if (_jvmti_breakpoints != NULL) {
+    _jvmti_breakpoints->metadata_do(f);
+  }
+}
+
 void JvmtiCurrentBreakpoints::gc_epilogue() {
   if (_jvmti_breakpoints != NULL) {
     _jvmti_breakpoints->gc_epilogue();
--- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp	Mon Nov 11 16:20:48 2013 +0100
@@ -69,6 +69,7 @@
   virtual bool lessThan(GrowableElement *e)=0;
   virtual GrowableElement *clone()         =0;
   virtual void oops_do(OopClosure* f)      =0;
+  virtual void metadata_do(void f(Metadata*)) =0;
 };
 
 class GrowableCache VALUE_OBJ_CLASS_SPEC {
@@ -115,6 +116,8 @@
   void clear();
   // apply f to every element and update the cache
   void oops_do(OopClosure* f);
+  // walk metadata to preserve for RedefineClasses
+  void metadata_do(void f(Metadata*));
   // update the cache after a full gc
   void gc_epilogue();
 };
@@ -148,6 +151,7 @@
   void remove (int index)               { _cache.remove(index); }
   void clear()                          { _cache.clear(); }
   void oops_do(OopClosure* f)           { _cache.oops_do(f); }
+  void metadata_do(void f(Metadata*))   { _cache.metadata_do(f); }
   void gc_epilogue()                    { _cache.gc_epilogue(); }
 };
 
@@ -169,7 +173,7 @@
   Method*               _method;
   int                   _bci;
   Bytecodes::Code       _orig_bytecode;
-  oop                   _class_loader;
+  oop                   _class_holder;  // keeps _method memory from being deallocated
 
 public:
   JvmtiBreakpoint();
@@ -191,9 +195,15 @@
   bool lessThan(GrowableElement* e) { Unimplemented(); return false; }
   bool equals(GrowableElement* e) { return equals((JvmtiBreakpoint&) *e); }
   void oops_do(OopClosure* f)     {
-    // Mark the method loader as live
-    f->do_oop(&_class_loader);
+    // Mark the method loader as live so the Method* class loader doesn't get
+    // unloaded and Method* memory reclaimed.
+    f->do_oop(&_class_holder);
   }
+  void metadata_do(void f(Metadata*)) {
+    // walk metadata to preserve for RedefineClasses
+    f(_method);
+  }
+
   GrowableElement *clone()        {
     JvmtiBreakpoint *bp = new JvmtiBreakpoint();
     bp->copy(*this);
@@ -239,6 +249,7 @@
 
   int length();
   void oops_do(OopClosure* f);
+  void metadata_do(void f(Metadata*));
   void print();
 
   int  set(JvmtiBreakpoint& bp);
@@ -288,6 +299,7 @@
   static inline bool is_breakpoint(address bcp);
 
   static void oops_do(OopClosure* f);
+  static void metadata_do(void f(Metadata*));
   static void gc_epilogue();
 };
 
@@ -332,6 +344,7 @@
   VMOp_Type type() const { return VMOp_ChangeBreakpoints; }
   void doit();
   void oops_do(OopClosure* f);
+  void metadata_do(void f(Metadata*));
 };
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8026722
+ * @summary Verify that the compare after addExact is a signed compare
+ * @compile CompareTest.java
+ * @run main CompareTest
+ *
+ */
+
+public class CompareTest {
+    public static long store = 0;
+    public static long addValue = 1231;
+
+    public static void main(String[] args) {
+        for (int i = 0; i < 20000; ++i) {
+            runTest(i, i);
+            runTest(i-1, i);
+        }
+    }
+
+    public static long create(long value, int v) {
+        if ((value | v) == 0) {
+            return 0;
+        }
+
+        // C2 turned this test into unsigned test when a control edge was set on the Cmp
+        if (value < -31557014167219200L || value > 31556889864403199L) {
+            throw new RuntimeException("error");
+        }
+
+        return value;
+    }
+
+    public static void runTest(long value, int value2) {
+        long res = Math.addExact(value, addValue);
+        store = create(res, Math.floorMod(value2, 100000));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8027445
+ * @summary String.equals() may be called with a length whose upper bits are not cleared
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestStringEqualsBadLength
+ *
+ */
+
+import java.util.Arrays;
+
+public class TestStringEqualsBadLength {
+
+    int v1;
+    int v2;
+
+    boolean m(String s1) {
+        int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001
+        char[] arr = new char[l];
+        arr[0] = 'a';
+        String s2 = new String(arr);
+        // The string length is not reloaded but the value computed is
+        // reused so pointer computation must not use
+        // 0xffffffff00000001
+        return s2.equals(s1);
+    }
+
+    // Same thing with String.compareTo()
+    int m2(String s1) {
+        int l = v2 - v1;
+        char[] arr = new char[l+1];
+        arr[0] = 'a';
+        arr[1] = 'b';
+        String s2 = new String(arr);
+        return s2.compareTo(s1);
+    }
+
+    // Same thing with equals() for arrays
+    boolean m3(char[] arr1) {
+        int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001
+        char[] arr2 = new char[l];
+        arr2[0] = 'a';
+        return Arrays.equals(arr2, arr1);
+    }
+
+    static public void main(String[] args) {
+        TestStringEqualsBadLength tse = new TestStringEqualsBadLength();
+        tse.v1 = -1;
+        tse.v2 = 0;
+        char[] arr = new char[1];
+        arr[0] = 'a';
+        for (int i = 0; i < 20000; i++) {
+            tse.m("a");
+            tse.m2("ab");
+            tse.m3(arr);
+        }
+
+        System.out.println("TEST PASSED");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8027751
+ * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill
+ * @run main/othervm -XX:+UseG1GC C1ObjectSpillInLogicOp
+ *
+ * G1 barriers use logical operators (xor) on T_OBJECT mixed with T_LONG or T_INT.
+ * The current implementation of logical operations on x86 in C1 doesn't allow for long operands to be on stack.
+ * There is a special code in the register allocator that forces long arguments in registers on x86. However T_OBJECT
+ * can be spilled just fine, and in that case the xor emission will fail.
+ */
+
+import java.util.concurrent.atomic.*;
+class C1ObjectSpillInLogicOp {
+  static public void main(String[] args) {
+    AtomicReferenceArray<Integer> x = new AtomicReferenceArray(128);
+    Integer y = new Integer(0);
+    for (int i = 0; i < 50000; i++) {
+      x.getAndSet(i % x.length(), y);
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,10908 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8026775
+ * @summary Uncommon trap blob did not bang all the stack shadow pages
+ *
+ * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:+TieredCompilation UncommonTrapStackBang
+ * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation UncommonTrapStackBang
+ *
+ *
+ * Note: This test does not reproduce the problem with absolute
+ * certainty. Empirically the bug reproduces on Windows some 80+% of
+ * the time. Setting everything up to fail in 100% of the cases turns
+ * out to be tricky at best.
+ *
+ *
+ * The goal of this test is to set up the following stack:
+ *
+ * doIt()
+ * eatStack()
+ * ...
+ * eatStack()
+ * run()
+ *
+ *
+ * When doIt() gets executed it will hit an uncommon trap and expand
+ * into a huge interpreter frame. The doIt method then calls the
+ * compiled version of StringBuilder.<init>() which does a single
+ * stack bang StackShadowPages down.
+ *
+ * The uncommon trap blob is supposed to prepare for the interpreter
+ * by pre-touching stack pages. The bug was that it didn't correctly
+ * pre-touch all the stack shadow pages, leaving a "hole" on the stack
+ * which raises an exception on Windows when the stack bang in
+ * StringBuilder is performed.
+ */
+public class UncommonTrapStackBang extends Thread {
+    class Foo { }
+
+    public static void main(String[] args) throws Exception {
+        doWarmup();
+
+        // Fork off a new thread to increase odds of the stack being unmapped
+        UncommonTrapStackBang htsb = new UncommonTrapStackBang();
+        htsb.run();
+        htsb.join();
+    }
+
+    // Make sure:
+    //
+    // a) StringBuilder.<init>()V is compiled
+    // b) doIt() is compiled with an uncommon trap in the unlikely path
+    public static void doWarmup() {
+        for (int i = 0; i < 100_000; i++) {
+            new StringBuilder();
+
+            doIt(false);
+        }
+    }
+
+    public void run() {
+        eatStack(200);
+    }
+
+    // Consume some stack to get down to some unused/unmapped pages,
+    // then call doIt and provoke the uncommon trap/deoptimization
+    private void eatStack(int n) {
+        if (n <= 0) {
+            doIt(true);
+            return;
+        }
+
+        eatStack(n - 1);
+    }
+
+    static public void doIt(boolean unlikely) {
+        int i0;
+        int i1;
+        int i2;
+        int i3;
+        int i4;
+        int i5;
+        int i6;
+        int i7;
+        int i8;
+        int i9;
+        int i10;
+        int i11;
+        int i12;
+        int i13;
+        int i14;
+        int i15;
+        int i16;
+        int i17;
+        int i18;
+        int i19;
+        int i20;
+        int i21;
+        int i22;
+        int i23;
+        int i24;
+        int i25;
+        int i26;
+        int i27;
+        int i28;
+        int i29;
+        int i30;
+        int i31;
+        int i32;
+        int i33;
+        int i34;
+        int i35;
+        int i36;
+        int i37;
+        int i38;
+        int i39;
+        int i40;
+        int i41;
+        int i42;
+        int i43;
+        int i44;
+        int i45;
+        int i46;
+        int i47;
+        int i48;
+        int i49;
+        int i50;
+        int i51;
+        int i52;
+        int i53;
+        int i54;
+        int i55;
+        int i56;
+        int i57;
+        int i58;
+        int i59;
+        int i60;
+        int i61;
+        int i62;
+        int i63;
+        int i64;
+        int i65;
+        int i66;
+        int i67;
+        int i68;
+        int i69;
+        int i70;
+        int i71;
+        int i72;
+        int i73;
+        int i74;
+        int i75;
+        int i76;
+        int i77;
+        int i78;
+        int i79;
+        int i80;
+        int i81;
+        int i82;
+        int i83;
+        int i84;
+        int i85;
+        int i86;
+        int i87;
+        int i88;
+        int i89;
+        int i90;
+        int i91;
+        int i92;
+        int i93;
+        int i94;
+        int i95;
+        int i96;
+        int i97;
+        int i98;
+        int i99;
+        int i100;
+        int i101;
+        int i102;
+        int i103;
+        int i104;
+        int i105;
+        int i106;
+        int i107;
+        int i108;
+        int i109;
+        int i110;
+        int i111;
+        int i112;
+        int i113;
+        int i114;
+        int i115;
+        int i116;
+        int i117;
+        int i118;
+        int i119;
+        int i120;
+        int i121;
+        int i122;
+        int i123;
+        int i124;
+        int i125;
+        int i126;
+        int i127;
+        int i128;
+        int i129;
+        int i130;
+        int i131;
+        int i132;
+        int i133;
+        int i134;
+        int i135;
+        int i136;
+        int i137;
+        int i138;
+        int i139;
+        int i140;
+        int i141;
+        int i142;
+        int i143;
+        int i144;
+        int i145;
+        int i146;
+        int i147;
+        int i148;
+        int i149;
+        int i150;
+        int i151;
+        int i152;
+        int i153;
+        int i154;
+        int i155;
+        int i156;
+        int i157;
+        int i158;
+        int i159;
+        int i160;
+        int i161;
+        int i162;
+        int i163;
+        int i164;
+        int i165;
+        int i166;
+        int i167;
+        int i168;
+        int i169;
+        int i170;
+        int i171;
+        int i172;
+        int i173;
+        int i174;
+        int i175;
+        int i176;
+        int i177;
+        int i178;
+        int i179;
+        int i180;
+        int i181;
+        int i182;
+        int i183;
+        int i184;
+        int i185;
+        int i186;
+        int i187;
+        int i188;
+        int i189;
+        int i190;
+        int i191;
+        int i192;
+        int i193;
+        int i194;
+        int i195;
+        int i196;
+        int i197;
+        int i198;
+        int i199;
+        int i200;
+        int i201;
+        int i202;
+        int i203;
+        int i204;
+        int i205;
+        int i206;
+        int i207;
+        int i208;
+        int i209;
+        int i210;
+        int i211;
+        int i212;
+        int i213;
+        int i214;
+        int i215;
+        int i216;
+        int i217;
+        int i218;
+        int i219;
+        int i220;
+        int i221;
+        int i222;
+        int i223;
+        int i224;
+        int i225;
+        int i226;
+        int i227;
+        int i228;
+        int i229;
+        int i230;
+        int i231;
+        int i232;
+        int i233;
+        int i234;
+        int i235;
+        int i236;
+        int i237;
+        int i238;
+        int i239;
+        int i240;
+        int i241;
+        int i242;
+        int i243;
+        int i244;
+        int i245;
+        int i246;
+        int i247;
+        int i248;
+        int i249;
+        int i250;
+        int i251;
+        int i252;
+        int i253;
+        int i254;
+        int i255;
+        int i256;
+        int i257;
+        int i258;
+        int i259;
+        int i260;
+        int i261;
+        int i262;
+        int i263;
+        int i264;
+        int i265;
+        int i266;
+        int i267;
+        int i268;
+        int i269;
+        int i270;
+        int i271;
+        int i272;
+        int i273;
+        int i274;
+        int i275;
+        int i276;
+        int i277;
+        int i278;
+        int i279;
+        int i280;
+        int i281;
+        int i282;
+        int i283;
+        int i284;
+        int i285;
+        int i286;
+        int i287;
+        int i288;
+        int i289;
+        int i290;
+        int i291;
+        int i292;
+        int i293;
+        int i294;
+        int i295;
+        int i296;
+        int i297;
+        int i298;
+        int i299;
+        int i300;
+        int i301;
+        int i302;
+        int i303;
+        int i304;
+        int i305;
+        int i306;
+        int i307;
+        int i308;
+        int i309;
+        int i310;
+        int i311;
+        int i312;
+        int i313;
+        int i314;
+        int i315;
+        int i316;
+        int i317;
+        int i318;
+        int i319;
+        int i320;
+        int i321;
+        int i322;
+        int i323;
+        int i324;
+        int i325;
+        int i326;
+        int i327;
+        int i328;
+        int i329;
+        int i330;
+        int i331;
+        int i332;
+        int i333;
+        int i334;
+        int i335;
+        int i336;
+        int i337;
+        int i338;
+        int i339;
+        int i340;
+        int i341;
+        int i342;
+        int i343;
+        int i344;
+        int i345;
+        int i346;
+        int i347;
+        int i348;
+        int i349;
+        int i350;
+        int i351;
+        int i352;
+        int i353;
+        int i354;
+        int i355;
+        int i356;
+        int i357;
+        int i358;
+        int i359;
+        int i360;
+        int i361;
+        int i362;
+        int i363;
+        int i364;
+        int i365;
+        int i366;
+        int i367;
+        int i368;
+        int i369;
+        int i370;
+        int i371;
+        int i372;
+        int i373;
+        int i374;
+        int i375;
+        int i376;
+        int i377;
+        int i378;
+        int i379;
+        int i380;
+        int i381;
+        int i382;
+        int i383;
+        int i384;
+        int i385;
+        int i386;
+        int i387;
+        int i388;
+        int i389;
+        int i390;
+        int i391;
+        int i392;
+        int i393;
+        int i394;
+        int i395;
+        int i396;
+        int i397;
+        int i398;
+        int i399;
+        int i400;
+        int i401;
+        int i402;
+        int i403;
+        int i404;
+        int i405;
+        int i406;
+        int i407;
+        int i408;
+        int i409;
+        int i410;
+        int i411;
+        int i412;
+        int i413;
+        int i414;
+        int i415;
+        int i416;
+        int i417;
+        int i418;
+        int i419;
+        int i420;
+        int i421;
+        int i422;
+        int i423;
+        int i424;
+        int i425;
+        int i426;
+        int i427;
+        int i428;
+        int i429;
+        int i430;
+        int i431;
+        int i432;
+        int i433;
+        int i434;
+        int i435;
+        int i436;
+        int i437;
+        int i438;
+        int i439;
+        int i440;
+        int i441;
+        int i442;
+        int i443;
+        int i444;
+        int i445;
+        int i446;
+        int i447;
+        int i448;
+        int i449;
+        int i450;
+        int i451;
+        int i452;
+        int i453;
+        int i454;
+        int i455;
+        int i456;
+        int i457;
+        int i458;
+        int i459;
+        int i460;
+        int i461;
+        int i462;
+        int i463;
+        int i464;
+        int i465;
+        int i466;
+        int i467;
+        int i468;
+        int i469;
+        int i470;
+        int i471;
+        int i472;
+        int i473;
+        int i474;
+        int i475;
+        int i476;
+        int i477;
+        int i478;
+        int i479;
+        int i480;
+        int i481;
+        int i482;
+        int i483;
+        int i484;
+        int i485;
+        int i486;
+        int i487;
+        int i488;
+        int i489;
+        int i490;
+        int i491;
+        int i492;
+        int i493;
+        int i494;
+        int i495;
+        int i496;
+        int i497;
+        int i498;
+        int i499;
+        int i500;
+        int i501;
+        int i502;
+        int i503;
+        int i504;
+        int i505;
+        int i506;
+        int i507;
+        int i508;
+        int i509;
+        int i510;
+        int i511;
+        int i512;
+        int i513;
+        int i514;
+        int i515;
+        int i516;
+        int i517;
+        int i518;
+        int i519;
+        int i520;
+        int i521;
+        int i522;
+        int i523;
+        int i524;
+        int i525;
+        int i526;
+        int i527;
+        int i528;
+        int i529;
+        int i530;
+        int i531;
+        int i532;
+        int i533;
+        int i534;
+        int i535;
+        int i536;
+        int i537;
+        int i538;
+        int i539;
+        int i540;
+        int i541;
+        int i542;
+        int i543;
+        int i544;
+        int i545;
+        int i546;
+        int i547;
+        int i548;
+        int i549;
+        int i550;
+        int i551;
+        int i552;
+        int i553;
+        int i554;
+        int i555;
+        int i556;
+        int i557;
+        int i558;
+        int i559;
+        int i560;
+        int i561;
+        int i562;
+        int i563;
+        int i564;
+        int i565;
+        int i566;
+        int i567;
+        int i568;
+        int i569;
+        int i570;
+        int i571;
+        int i572;
+        int i573;
+        int i574;
+        int i575;
+        int i576;
+        int i577;
+        int i578;
+        int i579;
+        int i580;
+        int i581;
+        int i582;
+        int i583;
+        int i584;
+        int i585;
+        int i586;
+        int i587;
+        int i588;
+        int i589;
+        int i590;
+        int i591;
+        int i592;
+        int i593;
+        int i594;
+        int i595;
+        int i596;
+        int i597;
+        int i598;
+        int i599;
+        int i600;
+        int i601;
+        int i602;
+        int i603;
+        int i604;
+        int i605;
+        int i606;
+        int i607;
+        int i608;
+        int i609;
+        int i610;
+        int i611;
+        int i612;
+        int i613;
+        int i614;
+        int i615;
+        int i616;
+        int i617;
+        int i618;
+        int i619;
+        int i620;
+        int i621;
+        int i622;
+        int i623;
+        int i624;
+        int i625;
+        int i626;
+        int i627;
+        int i628;
+        int i629;
+        int i630;
+        int i631;
+        int i632;
+        int i633;
+        int i634;
+        int i635;
+        int i636;
+        int i637;
+        int i638;
+        int i639;
+        int i640;
+        int i641;
+        int i642;
+        int i643;
+        int i644;
+        int i645;
+        int i646;
+        int i647;
+        int i648;
+        int i649;
+        int i650;
+        int i651;
+        int i652;
+        int i653;
+        int i654;
+        int i655;
+        int i656;
+        int i657;
+        int i658;
+        int i659;
+        int i660;
+        int i661;
+        int i662;
+        int i663;
+        int i664;
+        int i665;
+        int i666;
+        int i667;
+        int i668;
+        int i669;
+        int i670;
+        int i671;
+        int i672;
+        int i673;
+        int i674;
+        int i675;
+        int i676;
+        int i677;
+        int i678;
+        int i679;
+        int i680;
+        int i681;
+        int i682;
+        int i683;
+        int i684;
+        int i685;
+        int i686;
+        int i687;
+        int i688;
+        int i689;
+        int i690;
+        int i691;
+        int i692;
+        int i693;
+        int i694;
+        int i695;
+        int i696;
+        int i697;
+        int i698;
+        int i699;
+        int i700;
+        int i701;
+        int i702;
+        int i703;
+        int i704;
+        int i705;
+        int i706;
+        int i707;
+        int i708;
+        int i709;
+        int i710;
+        int i711;
+        int i712;
+        int i713;
+        int i714;
+        int i715;
+        int i716;
+        int i717;
+        int i718;
+        int i719;
+        int i720;
+        int i721;
+        int i722;
+        int i723;
+        int i724;
+        int i725;
+        int i726;
+        int i727;
+        int i728;
+        int i729;
+        int i730;
+        int i731;
+        int i732;
+        int i733;
+        int i734;
+        int i735;
+        int i736;
+        int i737;
+        int i738;
+        int i739;
+        int i740;
+        int i741;
+        int i742;
+        int i743;
+        int i744;
+        int i745;
+        int i746;
+        int i747;
+        int i748;
+        int i749;
+        int i750;
+        int i751;
+        int i752;
+        int i753;
+        int i754;
+        int i755;
+        int i756;
+        int i757;
+        int i758;
+        int i759;
+        int i760;
+        int i761;
+        int i762;
+        int i763;
+        int i764;
+        int i765;
+        int i766;
+        int i767;
+        int i768;
+        int i769;
+        int i770;
+        int i771;
+        int i772;
+        int i773;
+        int i774;
+        int i775;
+        int i776;
+        int i777;
+        int i778;
+        int i779;
+        int i780;
+        int i781;
+        int i782;
+        int i783;
+        int i784;
+        int i785;
+        int i786;
+        int i787;
+        int i788;
+        int i789;
+        int i790;
+        int i791;
+        int i792;
+        int i793;
+        int i794;
+        int i795;
+        int i796;
+        int i797;
+        int i798;
+        int i799;
+        int i800;
+        int i801;
+        int i802;
+        int i803;
+        int i804;
+        int i805;
+        int i806;
+        int i807;
+        int i808;
+        int i809;
+        int i810;
+        int i811;
+        int i812;
+        int i813;
+        int i814;
+        int i815;
+        int i816;
+        int i817;
+        int i818;
+        int i819;
+        int i820;
+        int i821;
+        int i822;
+        int i823;
+        int i824;
+        int i825;
+        int i826;
+        int i827;
+        int i828;
+        int i829;
+        int i830;
+        int i831;
+        int i832;
+        int i833;
+        int i834;
+        int i835;
+        int i836;
+        int i837;
+        int i838;
+        int i839;
+        int i840;
+        int i841;
+        int i842;
+        int i843;
+        int i844;
+        int i845;
+        int i846;
+        int i847;
+        int i848;
+        int i849;
+        int i850;
+        int i851;
+        int i852;
+        int i853;
+        int i854;
+        int i855;
+        int i856;
+        int i857;
+        int i858;
+        int i859;
+        int i860;
+        int i861;
+        int i862;
+        int i863;
+        int i864;
+        int i865;
+        int i866;
+        int i867;
+        int i868;
+        int i869;
+        int i870;
+        int i871;
+        int i872;
+        int i873;
+        int i874;
+        int i875;
+        int i876;
+        int i877;
+        int i878;
+        int i879;
+        int i880;
+        int i881;
+        int i882;
+        int i883;
+        int i884;
+        int i885;
+        int i886;
+        int i887;
+        int i888;
+        int i889;
+        int i890;
+        int i891;
+        int i892;
+        int i893;
+        int i894;
+        int i895;
+        int i896;
+        int i897;
+        int i898;
+        int i899;
+        int i900;
+        int i901;
+        int i902;
+        int i903;
+        int i904;
+        int i905;
+        int i906;
+        int i907;
+        int i908;
+        int i909;
+        int i910;
+        int i911;
+        int i912;
+        int i913;
+        int i914;
+        int i915;
+        int i916;
+        int i917;
+        int i918;
+        int i919;
+        int i920;
+        int i921;
+        int i922;
+        int i923;
+        int i924;
+        int i925;
+        int i926;
+        int i927;
+        int i928;
+        int i929;
+        int i930;
+        int i931;
+        int i932;
+        int i933;
+        int i934;
+        int i935;
+        int i936;
+        int i937;
+        int i938;
+        int i939;
+        int i940;
+        int i941;
+        int i942;
+        int i943;
+        int i944;
+        int i945;
+        int i946;
+        int i947;
+        int i948;
+        int i949;
+        int i950;
+        int i951;
+        int i952;
+        int i953;
+        int i954;
+        int i955;
+        int i956;
+        int i957;
+        int i958;
+        int i959;
+        int i960;
+        int i961;
+        int i962;
+        int i963;
+        int i964;
+        int i965;
+        int i966;
+        int i967;
+        int i968;
+        int i969;
+        int i970;
+        int i971;
+        int i972;
+        int i973;
+        int i974;
+        int i975;
+        int i976;
+        int i977;
+        int i978;
+        int i979;
+        int i980;
+        int i981;
+        int i982;
+        int i983;
+        int i984;
+        int i985;
+        int i986;
+        int i987;
+        int i988;
+        int i989;
+        int i990;
+        int i991;
+        int i992;
+        int i993;
+        int i994;
+        int i995;
+        int i996;
+        int i997;
+        int i998;
+        int i999;
+        int i1000;
+        int i1001;
+        int i1002;
+        int i1003;
+        int i1004;
+        int i1005;
+        int i1006;
+        int i1007;
+        int i1008;
+        int i1009;
+        int i1010;
+        int i1011;
+        int i1012;
+        int i1013;
+        int i1014;
+        int i1015;
+        int i1016;
+        int i1017;
+        int i1018;
+        int i1019;
+        int i1020;
+        int i1021;
+        int i1022;
+        int i1023;
+        int i1024;
+        int i1025;
+        int i1026;
+        int i1027;
+        int i1028;
+        int i1029;
+        int i1030;
+        int i1031;
+        int i1032;
+        int i1033;
+        int i1034;
+        int i1035;
+        int i1036;
+        int i1037;
+        int i1038;
+        int i1039;
+        int i1040;
+        int i1041;
+        int i1042;
+        int i1043;
+        int i1044;
+        int i1045;
+        int i1046;
+        int i1047;
+        int i1048;
+        int i1049;
+        int i1050;
+        int i1051;
+        int i1052;
+        int i1053;
+        int i1054;
+        int i1055;
+        int i1056;
+        int i1057;
+        int i1058;
+        int i1059;
+        int i1060;
+        int i1061;
+        int i1062;
+        int i1063;
+        int i1064;
+        int i1065;
+        int i1066;
+        int i1067;
+        int i1068;
+        int i1069;
+        int i1070;
+        int i1071;
+        int i1072;
+        int i1073;
+        int i1074;
+        int i1075;
+        int i1076;
+        int i1077;
+        int i1078;
+        int i1079;
+        int i1080;
+        int i1081;
+        int i1082;
+        int i1083;
+        int i1084;
+        int i1085;
+        int i1086;
+        int i1087;
+        int i1088;
+        int i1089;
+        int i1090;
+        int i1091;
+        int i1092;
+        int i1093;
+        int i1094;
+        int i1095;
+        int i1096;
+        int i1097;
+        int i1098;
+        int i1099;
+        int i1100;
+        int i1101;
+        int i1102;
+        int i1103;
+        int i1104;
+        int i1105;
+        int i1106;
+        int i1107;
+        int i1108;
+        int i1109;
+        int i1110;
+        int i1111;
+        int i1112;
+        int i1113;
+        int i1114;
+        int i1115;
+        int i1116;
+        int i1117;
+        int i1118;
+        int i1119;
+        int i1120;
+        int i1121;
+        int i1122;
+        int i1123;
+        int i1124;
+        int i1125;
+        int i1126;
+        int i1127;
+        int i1128;
+        int i1129;
+        int i1130;
+        int i1131;
+        int i1132;
+        int i1133;
+        int i1134;
+        int i1135;
+        int i1136;
+        int i1137;
+        int i1138;
+        int i1139;
+        int i1140;
+        int i1141;
+        int i1142;
+        int i1143;
+        int i1144;
+        int i1145;
+        int i1146;
+        int i1147;
+        int i1148;
+        int i1149;
+        int i1150;
+        int i1151;
+        int i1152;
+        int i1153;
+        int i1154;
+        int i1155;
+        int i1156;
+        int i1157;
+        int i1158;
+        int i1159;
+        int i1160;
+        int i1161;
+        int i1162;
+        int i1163;
+        int i1164;
+        int i1165;
+        int i1166;
+        int i1167;
+        int i1168;
+        int i1169;
+        int i1170;
+        int i1171;
+        int i1172;
+        int i1173;
+        int i1174;
+        int i1175;
+        int i1176;
+        int i1177;
+        int i1178;
+        int i1179;
+        int i1180;
+        int i1181;
+        int i1182;
+        int i1183;
+        int i1184;
+        int i1185;
+        int i1186;
+        int i1187;
+        int i1188;
+        int i1189;
+        int i1190;
+        int i1191;
+        int i1192;
+        int i1193;
+        int i1194;
+        int i1195;
+        int i1196;
+        int i1197;
+        int i1198;
+        int i1199;
+        int i1200;
+        int i1201;
+        int i1202;
+        int i1203;
+        int i1204;
+        int i1205;
+        int i1206;
+        int i1207;
+        int i1208;
+        int i1209;
+        int i1210;
+        int i1211;
+        int i1212;
+        int i1213;
+        int i1214;
+        int i1215;
+        int i1216;
+        int i1217;
+        int i1218;
+        int i1219;
+        int i1220;
+        int i1221;
+        int i1222;
+        int i1223;
+        int i1224;
+        int i1225;
+        int i1226;
+        int i1227;
+        int i1228;
+        int i1229;
+        int i1230;
+        int i1231;
+        int i1232;
+        int i1233;
+        int i1234;
+        int i1235;
+        int i1236;
+        int i1237;
+        int i1238;
+        int i1239;
+        int i1240;
+        int i1241;
+        int i1242;
+        int i1243;
+        int i1244;
+        int i1245;
+        int i1246;
+        int i1247;
+        int i1248;
+        int i1249;
+        int i1250;
+        int i1251;
+        int i1252;
+        int i1253;
+        int i1254;
+        int i1255;
+        int i1256;
+        int i1257;
+        int i1258;
+        int i1259;
+        int i1260;
+        int i1261;
+        int i1262;
+        int i1263;
+        int i1264;
+        int i1265;
+        int i1266;
+        int i1267;
+        int i1268;
+        int i1269;
+        int i1270;
+        int i1271;
+        int i1272;
+        int i1273;
+        int i1274;
+        int i1275;
+        int i1276;
+        int i1277;
+        int i1278;
+        int i1279;
+        int i1280;
+        int i1281;
+        int i1282;
+        int i1283;
+        int i1284;
+        int i1285;
+        int i1286;
+        int i1287;
+        int i1288;
+        int i1289;
+        int i1290;
+        int i1291;
+        int i1292;
+        int i1293;
+        int i1294;
+        int i1295;
+        int i1296;
+        int i1297;
+        int i1298;
+        int i1299;
+        int i1300;
+        int i1301;
+        int i1302;
+        int i1303;
+        int i1304;
+        int i1305;
+        int i1306;
+        int i1307;
+        int i1308;
+        int i1309;
+        int i1310;
+        int i1311;
+        int i1312;
+        int i1313;
+        int i1314;
+        int i1315;
+        int i1316;
+        int i1317;
+        int i1318;
+        int i1319;
+        int i1320;
+        int i1321;
+        int i1322;
+        int i1323;
+        int i1324;
+        int i1325;
+        int i1326;
+        int i1327;
+        int i1328;
+        int i1329;
+        int i1330;
+        int i1331;
+        int i1332;
+        int i1333;
+        int i1334;
+        int i1335;
+        int i1336;
+        int i1337;
+        int i1338;
+        int i1339;
+        int i1340;
+        int i1341;
+        int i1342;
+        int i1343;
+        int i1344;
+        int i1345;
+        int i1346;
+        int i1347;
+        int i1348;
+        int i1349;
+        int i1350;
+        int i1351;
+        int i1352;
+        int i1353;
+        int i1354;
+        int i1355;
+        int i1356;
+        int i1357;
+        int i1358;
+        int i1359;
+        int i1360;
+        int i1361;
+        int i1362;
+        int i1363;
+        int i1364;
+        int i1365;
+        int i1366;
+        int i1367;
+        int i1368;
+        int i1369;
+        int i1370;
+        int i1371;
+        int i1372;
+        int i1373;
+        int i1374;
+        int i1375;
+        int i1376;
+        int i1377;
+        int i1378;
+        int i1379;
+        int i1380;
+        int i1381;
+        int i1382;
+        int i1383;
+        int i1384;
+        int i1385;
+        int i1386;
+        int i1387;
+        int i1388;
+        int i1389;
+        int i1390;
+        int i1391;
+        int i1392;
+        int i1393;
+        int i1394;
+        int i1395;
+        int i1396;
+        int i1397;
+        int i1398;
+        int i1399;
+        int i1400;
+        int i1401;
+        int i1402;
+        int i1403;
+        int i1404;
+        int i1405;
+        int i1406;
+        int i1407;
+        int i1408;
+        int i1409;
+        int i1410;
+        int i1411;
+        int i1412;
+        int i1413;
+        int i1414;
+        int i1415;
+        int i1416;
+        int i1417;
+        int i1418;
+        int i1419;
+        int i1420;
+        int i1421;
+        int i1422;
+        int i1423;
+        int i1424;
+        int i1425;
+        int i1426;
+        int i1427;
+        int i1428;
+        int i1429;
+        int i1430;
+        int i1431;
+        int i1432;
+        int i1433;
+        int i1434;
+        int i1435;
+        int i1436;
+        int i1437;
+        int i1438;
+        int i1439;
+        int i1440;
+        int i1441;
+        int i1442;
+        int i1443;
+        int i1444;
+        int i1445;
+        int i1446;
+        int i1447;
+        int i1448;
+        int i1449;
+        int i1450;
+        int i1451;
+        int i1452;
+        int i1453;
+        int i1454;
+        int i1455;
+        int i1456;
+        int i1457;
+        int i1458;
+        int i1459;
+        int i1460;
+        int i1461;
+        int i1462;
+        int i1463;
+        int i1464;
+        int i1465;
+        int i1466;
+        int i1467;
+        int i1468;
+        int i1469;
+        int i1470;
+        int i1471;
+        int i1472;
+        int i1473;
+        int i1474;
+        int i1475;
+        int i1476;
+        int i1477;
+        int i1478;
+        int i1479;
+        int i1480;
+        int i1481;
+        int i1482;
+        int i1483;
+        int i1484;
+        int i1485;
+        int i1486;
+        int i1487;
+        int i1488;
+        int i1489;
+        int i1490;
+        int i1491;
+        int i1492;
+        int i1493;
+        int i1494;
+        int i1495;
+        int i1496;
+        int i1497;
+        int i1498;
+        int i1499;
+        int i1500;
+        int i1501;
+        int i1502;
+        int i1503;
+        int i1504;
+        int i1505;
+        int i1506;
+        int i1507;
+        int i1508;
+        int i1509;
+        int i1510;
+        int i1511;
+        int i1512;
+        int i1513;
+        int i1514;
+        int i1515;
+        int i1516;
+        int i1517;
+        int i1518;
+        int i1519;
+        int i1520;
+        int i1521;
+        int i1522;
+        int i1523;
+        int i1524;
+        int i1525;
+        int i1526;
+        int i1527;
+        int i1528;
+        int i1529;
+        int i1530;
+        int i1531;
+        int i1532;
+        int i1533;
+        int i1534;
+        int i1535;
+        int i1536;
+        int i1537;
+        int i1538;
+        int i1539;
+        int i1540;
+        int i1541;
+        int i1542;
+        int i1543;
+        int i1544;
+        int i1545;
+        int i1546;
+        int i1547;
+        int i1548;
+        int i1549;
+        int i1550;
+        int i1551;
+        int i1552;
+        int i1553;
+        int i1554;
+        int i1555;
+        int i1556;
+        int i1557;
+        int i1558;
+        int i1559;
+        int i1560;
+        int i1561;
+        int i1562;
+        int i1563;
+        int i1564;
+        int i1565;
+        int i1566;
+        int i1567;
+        int i1568;
+        int i1569;
+        int i1570;
+        int i1571;
+        int i1572;
+        int i1573;
+        int i1574;
+        int i1575;
+        int i1576;
+        int i1577;
+        int i1578;
+        int i1579;
+        int i1580;
+        int i1581;
+        int i1582;
+        int i1583;
+        int i1584;
+        int i1585;
+        int i1586;
+        int i1587;
+        int i1588;
+        int i1589;
+        int i1590;
+        int i1591;
+        int i1592;
+        int i1593;
+        int i1594;
+        int i1595;
+        int i1596;
+        int i1597;
+        int i1598;
+        int i1599;
+        int i1600;
+        int i1601;
+        int i1602;
+        int i1603;
+        int i1604;
+        int i1605;
+        int i1606;
+        int i1607;
+        int i1608;
+        int i1609;
+        int i1610;
+        int i1611;
+        int i1612;
+        int i1613;
+        int i1614;
+        int i1615;
+        int i1616;
+        int i1617;
+        int i1618;
+        int i1619;
+        int i1620;
+        int i1621;
+        int i1622;
+        int i1623;
+        int i1624;
+        int i1625;
+        int i1626;
+        int i1627;
+        int i1628;
+        int i1629;
+        int i1630;
+        int i1631;
+        int i1632;
+        int i1633;
+        int i1634;
+        int i1635;
+        int i1636;
+        int i1637;
+        int i1638;
+        int i1639;
+        int i1640;
+        int i1641;
+        int i1642;
+        int i1643;
+        int i1644;
+        int i1645;
+        int i1646;
+        int i1647;
+        int i1648;
+        int i1649;
+        int i1650;
+        int i1651;
+        int i1652;
+        int i1653;
+        int i1654;
+        int i1655;
+        int i1656;
+        int i1657;
+        int i1658;
+        int i1659;
+        int i1660;
+        int i1661;
+        int i1662;
+        int i1663;
+        int i1664;
+        int i1665;
+        int i1666;
+        int i1667;
+        int i1668;
+        int i1669;
+        int i1670;
+        int i1671;
+        int i1672;
+        int i1673;
+        int i1674;
+        int i1675;
+        int i1676;
+        int i1677;
+        int i1678;
+        int i1679;
+        int i1680;
+        int i1681;
+        int i1682;
+        int i1683;
+        int i1684;
+        int i1685;
+        int i1686;
+        int i1687;
+        int i1688;
+        int i1689;
+        int i1690;
+        int i1691;
+        int i1692;
+        int i1693;
+        int i1694;
+        int i1695;
+        int i1696;
+        int i1697;
+        int i1698;
+        int i1699;
+        int i1700;
+        int i1701;
+        int i1702;
+        int i1703;
+        int i1704;
+        int i1705;
+        int i1706;
+        int i1707;
+        int i1708;
+        int i1709;
+        int i1710;
+        int i1711;
+        int i1712;
+        int i1713;
+        int i1714;
+        int i1715;
+        int i1716;
+        int i1717;
+        int i1718;
+        int i1719;
+        int i1720;
+        int i1721;
+        int i1722;
+        int i1723;
+        int i1724;
+        int i1725;
+        int i1726;
+        int i1727;
+        int i1728;
+        int i1729;
+        int i1730;
+        int i1731;
+        int i1732;
+        int i1733;
+        int i1734;
+        int i1735;
+        int i1736;
+        int i1737;
+        int i1738;
+        int i1739;
+        int i1740;
+        int i1741;
+        int i1742;
+        int i1743;
+        int i1744;
+        int i1745;
+        int i1746;
+        int i1747;
+        int i1748;
+        int i1749;
+        int i1750;
+        int i1751;
+        int i1752;
+        int i1753;
+        int i1754;
+        int i1755;
+        int i1756;
+        int i1757;
+        int i1758;
+        int i1759;
+        int i1760;
+        int i1761;
+        int i1762;
+        int i1763;
+        int i1764;
+        int i1765;
+        int i1766;
+        int i1767;
+        int i1768;
+        int i1769;
+        int i1770;
+        int i1771;
+        int i1772;
+        int i1773;
+        int i1774;
+        int i1775;
+        int i1776;
+        int i1777;
+        int i1778;
+        int i1779;
+        int i1780;
+        int i1781;
+        int i1782;
+        int i1783;
+        int i1784;
+        int i1785;
+        int i1786;
+        int i1787;
+        int i1788;
+        int i1789;
+        int i1790;
+        int i1791;
+        int i1792;
+        int i1793;
+        int i1794;
+        int i1795;
+        int i1796;
+        int i1797;
+        int i1798;
+        int i1799;
+        int i1800;
+        int i1801;
+        int i1802;
+        int i1803;
+        int i1804;
+        int i1805;
+        int i1806;
+        int i1807;
+        int i1808;
+        int i1809;
+        int i1810;
+        int i1811;
+        int i1812;
+        int i1813;
+        int i1814;
+        int i1815;
+        int i1816;
+        int i1817;
+        int i1818;
+        int i1819;
+        int i1820;
+        int i1821;
+        int i1822;
+        int i1823;
+        int i1824;
+        int i1825;
+        int i1826;
+        int i1827;
+        int i1828;
+        int i1829;
+        int i1830;
+        int i1831;
+        int i1832;
+        int i1833;
+        int i1834;
+        int i1835;
+        int i1836;
+        int i1837;
+        int i1838;
+        int i1839;
+        int i1840;
+        int i1841;
+        int i1842;
+        int i1843;
+        int i1844;
+        int i1845;
+        int i1846;
+        int i1847;
+        int i1848;
+        int i1849;
+        int i1850;
+        int i1851;
+        int i1852;
+        int i1853;
+        int i1854;
+        int i1855;
+        int i1856;
+        int i1857;
+        int i1858;
+        int i1859;
+        int i1860;
+        int i1861;
+        int i1862;
+        int i1863;
+        int i1864;
+        int i1865;
+        int i1866;
+        int i1867;
+        int i1868;
+        int i1869;
+        int i1870;
+        int i1871;
+        int i1872;
+        int i1873;
+        int i1874;
+        int i1875;
+        int i1876;
+        int i1877;
+        int i1878;
+        int i1879;
+        int i1880;
+        int i1881;
+        int i1882;
+        int i1883;
+        int i1884;
+        int i1885;
+        int i1886;
+        int i1887;
+        int i1888;
+        int i1889;
+        int i1890;
+        int i1891;
+        int i1892;
+        int i1893;
+        int i1894;
+        int i1895;
+        int i1896;
+        int i1897;
+        int i1898;
+        int i1899;
+        int i1900;
+        int i1901;
+        int i1902;
+        int i1903;
+        int i1904;
+        int i1905;
+        int i1906;
+        int i1907;
+        int i1908;
+        int i1909;
+        int i1910;
+        int i1911;
+        int i1912;
+        int i1913;
+        int i1914;
+        int i1915;
+        int i1916;
+        int i1917;
+        int i1918;
+        int i1919;
+        int i1920;
+        int i1921;
+        int i1922;
+        int i1923;
+        int i1924;
+        int i1925;
+        int i1926;
+        int i1927;
+        int i1928;
+        int i1929;
+        int i1930;
+        int i1931;
+        int i1932;
+        int i1933;
+        int i1934;
+        int i1935;
+        int i1936;
+        int i1937;
+        int i1938;
+        int i1939;
+        int i1940;
+        int i1941;
+        int i1942;
+        int i1943;
+        int i1944;
+        int i1945;
+        int i1946;
+        int i1947;
+        int i1948;
+        int i1949;
+        int i1950;
+        int i1951;
+        int i1952;
+        int i1953;
+        int i1954;
+        int i1955;
+        int i1956;
+        int i1957;
+        int i1958;
+        int i1959;
+        int i1960;
+        int i1961;
+        int i1962;
+        int i1963;
+        int i1964;
+        int i1965;
+        int i1966;
+        int i1967;
+        int i1968;
+        int i1969;
+        int i1970;
+        int i1971;
+        int i1972;
+        int i1973;
+        int i1974;
+        int i1975;
+        int i1976;
+        int i1977;
+        int i1978;
+        int i1979;
+        int i1980;
+        int i1981;
+        int i1982;
+        int i1983;
+        int i1984;
+        int i1985;
+        int i1986;
+        int i1987;
+        int i1988;
+        int i1989;
+        int i1990;
+        int i1991;
+        int i1992;
+        int i1993;
+        int i1994;
+        int i1995;
+        int i1996;
+        int i1997;
+        int i1998;
+        int i1999;
+        int i2000;
+        int i2001;
+        int i2002;
+        int i2003;
+        int i2004;
+        int i2005;
+        int i2006;
+        int i2007;
+        int i2008;
+        int i2009;
+        int i2010;
+        int i2011;
+        int i2012;
+        int i2013;
+        int i2014;
+        int i2015;
+        int i2016;
+        int i2017;
+        int i2018;
+        int i2019;
+        int i2020;
+        int i2021;
+        int i2022;
+        int i2023;
+        int i2024;
+        int i2025;
+        int i2026;
+        int i2027;
+        int i2028;
+        int i2029;
+        int i2030;
+        int i2031;
+        int i2032;
+        int i2033;
+        int i2034;
+        int i2035;
+        int i2036;
+        int i2037;
+        int i2038;
+        int i2039;
+        int i2040;
+        int i2041;
+        int i2042;
+        int i2043;
+        int i2044;
+        int i2045;
+        int i2046;
+        int i2047;
+        int i2048;
+        int i2049;
+        int i2050;
+        int i2051;
+        int i2052;
+        int i2053;
+        int i2054;
+        int i2055;
+        int i2056;
+        int i2057;
+        int i2058;
+        int i2059;
+        int i2060;
+        int i2061;
+        int i2062;
+        int i2063;
+        int i2064;
+        int i2065;
+        int i2066;
+        int i2067;
+        int i2068;
+        int i2069;
+        int i2070;
+        int i2071;
+        int i2072;
+        int i2073;
+        int i2074;
+        int i2075;
+        int i2076;
+        int i2077;
+        int i2078;
+        int i2079;
+        int i2080;
+        int i2081;
+        int i2082;
+        int i2083;
+        int i2084;
+        int i2085;
+        int i2086;
+        int i2087;
+        int i2088;
+        int i2089;
+        int i2090;
+        int i2091;
+        int i2092;
+        int i2093;
+        int i2094;
+        int i2095;
+        int i2096;
+        int i2097;
+        int i2098;
+        int i2099;
+        int i2100;
+        int i2101;
+        int i2102;
+        int i2103;
+        int i2104;
+        int i2105;
+        int i2106;
+        int i2107;
+        int i2108;
+        int i2109;
+        int i2110;
+        int i2111;
+        int i2112;
+        int i2113;
+        int i2114;
+        int i2115;
+        int i2116;
+        int i2117;
+        int i2118;
+        int i2119;
+        int i2120;
+        int i2121;
+        int i2122;
+        int i2123;
+        int i2124;
+        int i2125;
+        int i2126;
+        int i2127;
+        int i2128;
+        int i2129;
+        int i2130;
+        int i2131;
+        int i2132;
+        int i2133;
+        int i2134;
+        int i2135;
+        int i2136;
+        int i2137;
+        int i2138;
+        int i2139;
+        int i2140;
+        int i2141;
+        int i2142;
+        int i2143;
+        int i2144;
+        int i2145;
+        int i2146;
+        int i2147;
+        int i2148;
+        int i2149;
+        int i2150;
+        int i2151;
+        int i2152;
+        int i2153;
+        int i2154;
+        int i2155;
+        int i2156;
+        int i2157;
+        int i2158;
+        int i2159;
+        int i2160;
+        int i2161;
+        int i2162;
+        int i2163;
+        int i2164;
+        int i2165;
+        int i2166;
+        int i2167;
+        int i2168;
+        int i2169;
+        int i2170;
+        int i2171;
+        int i2172;
+        int i2173;
+        int i2174;
+        int i2175;
+        int i2176;
+        int i2177;
+        int i2178;
+        int i2179;
+        int i2180;
+        int i2181;
+        int i2182;
+        int i2183;
+        int i2184;
+        int i2185;
+        int i2186;
+        int i2187;
+        int i2188;
+        int i2189;
+        int i2190;
+        int i2191;
+        int i2192;
+        int i2193;
+        int i2194;
+        int i2195;
+        int i2196;
+        int i2197;
+        int i2198;
+        int i2199;
+        int i2200;
+        int i2201;
+        int i2202;
+        int i2203;
+        int i2204;
+        int i2205;
+        int i2206;
+        int i2207;
+        int i2208;
+        int i2209;
+        int i2210;
+        int i2211;
+        int i2212;
+        int i2213;
+        int i2214;
+        int i2215;
+        int i2216;
+        int i2217;
+        int i2218;
+        int i2219;
+        int i2220;
+        int i2221;
+        int i2222;
+        int i2223;
+        int i2224;
+        int i2225;
+        int i2226;
+        int i2227;
+        int i2228;
+        int i2229;
+        int i2230;
+        int i2231;
+        int i2232;
+        int i2233;
+        int i2234;
+        int i2235;
+        int i2236;
+        int i2237;
+        int i2238;
+        int i2239;
+        int i2240;
+        int i2241;
+        int i2242;
+        int i2243;
+        int i2244;
+        int i2245;
+        int i2246;
+        int i2247;
+        int i2248;
+        int i2249;
+        int i2250;
+        int i2251;
+        int i2252;
+        int i2253;
+        int i2254;
+        int i2255;
+        int i2256;
+        int i2257;
+        int i2258;
+        int i2259;
+        int i2260;
+        int i2261;
+        int i2262;
+        int i2263;
+        int i2264;
+        int i2265;
+        int i2266;
+        int i2267;
+        int i2268;
+        int i2269;
+        int i2270;
+        int i2271;
+        int i2272;
+        int i2273;
+        int i2274;
+        int i2275;
+        int i2276;
+        int i2277;
+        int i2278;
+        int i2279;
+        int i2280;
+        int i2281;
+        int i2282;
+        int i2283;
+        int i2284;
+        int i2285;
+        int i2286;
+        int i2287;
+        int i2288;
+        int i2289;
+        int i2290;
+        int i2291;
+        int i2292;
+        int i2293;
+        int i2294;
+        int i2295;
+        int i2296;
+        int i2297;
+        int i2298;
+        int i2299;
+        int i2300;
+        int i2301;
+        int i2302;
+        int i2303;
+        int i2304;
+        int i2305;
+        int i2306;
+        int i2307;
+        int i2308;
+        int i2309;
+        int i2310;
+        int i2311;
+        int i2312;
+        int i2313;
+        int i2314;
+        int i2315;
+        int i2316;
+        int i2317;
+        int i2318;
+        int i2319;
+        int i2320;
+        int i2321;
+        int i2322;
+        int i2323;
+        int i2324;
+        int i2325;
+        int i2326;
+        int i2327;
+        int i2328;
+        int i2329;
+        int i2330;
+        int i2331;
+        int i2332;
+        int i2333;
+        int i2334;
+        int i2335;
+        int i2336;
+        int i2337;
+        int i2338;
+        int i2339;
+        int i2340;
+        int i2341;
+        int i2342;
+        int i2343;
+        int i2344;
+        int i2345;
+        int i2346;
+        int i2347;
+        int i2348;
+        int i2349;
+        int i2350;
+        int i2351;
+        int i2352;
+        int i2353;
+        int i2354;
+        int i2355;
+        int i2356;
+        int i2357;
+        int i2358;
+        int i2359;
+        int i2360;
+        int i2361;
+        int i2362;
+        int i2363;
+        int i2364;
+        int i2365;
+        int i2366;
+        int i2367;
+        int i2368;
+        int i2369;
+        int i2370;
+        int i2371;
+        int i2372;
+        int i2373;
+        int i2374;
+        int i2375;
+        int i2376;
+        int i2377;
+        int i2378;
+        int i2379;
+        int i2380;
+        int i2381;
+        int i2382;
+        int i2383;
+        int i2384;
+        int i2385;
+        int i2386;
+        int i2387;
+        int i2388;
+        int i2389;
+        int i2390;
+        int i2391;
+        int i2392;
+        int i2393;
+        int i2394;
+        int i2395;
+        int i2396;
+        int i2397;
+        int i2398;
+        int i2399;
+        int i2400;
+        int i2401;
+        int i2402;
+        int i2403;
+        int i2404;
+        int i2405;
+        int i2406;
+        int i2407;
+        int i2408;
+        int i2409;
+        int i2410;
+        int i2411;
+        int i2412;
+        int i2413;
+        int i2414;
+        int i2415;
+        int i2416;
+        int i2417;
+        int i2418;
+        int i2419;
+        int i2420;
+        int i2421;
+        int i2422;
+        int i2423;
+        int i2424;
+        int i2425;
+        int i2426;
+        int i2427;
+        int i2428;
+        int i2429;
+        int i2430;
+        int i2431;
+        int i2432;
+        int i2433;
+        int i2434;
+        int i2435;
+        int i2436;
+        int i2437;
+        int i2438;
+        int i2439;
+        int i2440;
+        int i2441;
+        int i2442;
+        int i2443;
+        int i2444;
+        int i2445;
+        int i2446;
+        int i2447;
+        int i2448;
+        int i2449;
+        int i2450;
+        int i2451;
+        int i2452;
+        int i2453;
+        int i2454;
+        int i2455;
+        int i2456;
+        int i2457;
+        int i2458;
+        int i2459;
+        int i2460;
+        int i2461;
+        int i2462;
+        int i2463;
+        int i2464;
+        int i2465;
+        int i2466;
+        int i2467;
+        int i2468;
+        int i2469;
+        int i2470;
+        int i2471;
+        int i2472;
+        int i2473;
+        int i2474;
+        int i2475;
+        int i2476;
+        int i2477;
+        int i2478;
+        int i2479;
+        int i2480;
+        int i2481;
+        int i2482;
+        int i2483;
+        int i2484;
+        int i2485;
+        int i2486;
+        int i2487;
+        int i2488;
+        int i2489;
+        int i2490;
+        int i2491;
+        int i2492;
+        int i2493;
+        int i2494;
+        int i2495;
+        int i2496;
+        int i2497;
+        int i2498;
+        int i2499;
+        int i2500;
+        int i2501;
+        int i2502;
+        int i2503;
+        int i2504;
+        int i2505;
+        int i2506;
+        int i2507;
+        int i2508;
+        int i2509;
+        int i2510;
+        int i2511;
+        int i2512;
+        int i2513;
+        int i2514;
+        int i2515;
+        int i2516;
+        int i2517;
+        int i2518;
+        int i2519;
+        int i2520;
+        int i2521;
+        int i2522;
+        int i2523;
+        int i2524;
+        int i2525;
+        int i2526;
+        int i2527;
+        int i2528;
+        int i2529;
+        int i2530;
+        int i2531;
+        int i2532;
+        int i2533;
+        int i2534;
+        int i2535;
+        int i2536;
+        int i2537;
+        int i2538;
+        int i2539;
+        int i2540;
+        int i2541;
+        int i2542;
+        int i2543;
+        int i2544;
+        int i2545;
+        int i2546;
+        int i2547;
+        int i2548;
+        int i2549;
+        int i2550;
+        int i2551;
+        int i2552;
+        int i2553;
+        int i2554;
+        int i2555;
+        int i2556;
+        int i2557;
+        int i2558;
+        int i2559;
+        int i2560;
+        int i2561;
+        int i2562;
+        int i2563;
+        int i2564;
+        int i2565;
+        int i2566;
+        int i2567;
+        int i2568;
+        int i2569;
+        int i2570;
+        int i2571;
+        int i2572;
+        int i2573;
+        int i2574;
+        int i2575;
+        int i2576;
+        int i2577;
+        int i2578;
+        int i2579;
+        int i2580;
+        int i2581;
+        int i2582;
+        int i2583;
+        int i2584;
+        int i2585;
+        int i2586;
+        int i2587;
+        int i2588;
+        int i2589;
+        int i2590;
+        int i2591;
+        int i2592;
+        int i2593;
+        int i2594;
+        int i2595;
+        int i2596;
+        int i2597;
+        int i2598;
+        int i2599;
+        int i2600;
+        int i2601;
+        int i2602;
+        int i2603;
+        int i2604;
+        int i2605;
+        int i2606;
+        int i2607;
+        int i2608;
+        int i2609;
+        int i2610;
+        int i2611;
+        int i2612;
+        int i2613;
+        int i2614;
+        int i2615;
+        int i2616;
+        int i2617;
+        int i2618;
+        int i2619;
+        int i2620;
+        int i2621;
+        int i2622;
+        int i2623;
+        int i2624;
+        int i2625;
+        int i2626;
+        int i2627;
+        int i2628;
+        int i2629;
+        int i2630;
+        int i2631;
+        int i2632;
+        int i2633;
+        int i2634;
+        int i2635;
+        int i2636;
+        int i2637;
+        int i2638;
+        int i2639;
+        int i2640;
+        int i2641;
+        int i2642;
+        int i2643;
+        int i2644;
+        int i2645;
+        int i2646;
+        int i2647;
+        int i2648;
+        int i2649;
+        int i2650;
+        int i2651;
+        int i2652;
+        int i2653;
+        int i2654;
+        int i2655;
+        int i2656;
+        int i2657;
+        int i2658;
+        int i2659;
+        int i2660;
+        int i2661;
+        int i2662;
+        int i2663;
+        int i2664;
+        int i2665;
+        int i2666;
+        int i2667;
+        int i2668;
+        int i2669;
+        int i2670;
+        int i2671;
+        int i2672;
+        int i2673;
+        int i2674;
+        int i2675;
+        int i2676;
+        int i2677;
+        int i2678;
+        int i2679;
+        int i2680;
+        int i2681;
+        int i2682;
+        int i2683;
+        int i2684;
+        int i2685;
+        int i2686;
+        int i2687;
+        int i2688;
+        int i2689;
+        int i2690;
+        int i2691;
+        int i2692;
+        int i2693;
+        int i2694;
+        int i2695;
+        int i2696;
+        int i2697;
+        int i2698;
+        int i2699;
+        int i2700;
+        int i2701;
+        int i2702;
+        int i2703;
+        int i2704;
+        int i2705;
+        int i2706;
+        int i2707;
+        int i2708;
+        int i2709;
+        int i2710;
+        int i2711;
+        int i2712;
+        int i2713;
+        int i2714;
+        int i2715;
+        int i2716;
+        int i2717;
+        int i2718;
+        int i2719;
+        int i2720;
+        int i2721;
+        int i2722;
+        int i2723;
+        int i2724;
+        int i2725;
+        int i2726;
+        int i2727;
+        int i2728;
+        int i2729;
+        int i2730;
+        int i2731;
+        int i2732;
+        int i2733;
+        int i2734;
+        int i2735;
+        int i2736;
+        int i2737;
+        int i2738;
+        int i2739;
+        int i2740;
+        int i2741;
+        int i2742;
+        int i2743;
+        int i2744;
+        int i2745;
+        int i2746;
+        int i2747;
+        int i2748;
+        int i2749;
+        int i2750;
+        int i2751;
+        int i2752;
+        int i2753;
+        int i2754;
+        int i2755;
+        int i2756;
+        int i2757;
+        int i2758;
+        int i2759;
+        int i2760;
+        int i2761;
+        int i2762;
+        int i2763;
+        int i2764;
+        int i2765;
+        int i2766;
+        int i2767;
+        int i2768;
+        int i2769;
+        int i2770;
+        int i2771;
+        int i2772;
+        int i2773;
+        int i2774;
+        int i2775;
+        int i2776;
+        int i2777;
+        int i2778;
+        int i2779;
+        int i2780;
+        int i2781;
+        int i2782;
+        int i2783;
+        int i2784;
+        int i2785;
+        int i2786;
+        int i2787;
+        int i2788;
+        int i2789;
+        int i2790;
+        int i2791;
+        int i2792;
+        int i2793;
+        int i2794;
+        int i2795;
+        int i2796;
+        int i2797;
+        int i2798;
+        int i2799;
+        int i2800;
+        int i2801;
+        int i2802;
+        int i2803;
+        int i2804;
+        int i2805;
+        int i2806;
+        int i2807;
+        int i2808;
+        int i2809;
+        int i2810;
+        int i2811;
+        int i2812;
+        int i2813;
+        int i2814;
+        int i2815;
+        int i2816;
+        int i2817;
+        int i2818;
+        int i2819;
+        int i2820;
+        int i2821;
+        int i2822;
+        int i2823;
+        int i2824;
+        int i2825;
+        int i2826;
+        int i2827;
+        int i2828;
+        int i2829;
+        int i2830;
+        int i2831;
+        int i2832;
+        int i2833;
+        int i2834;
+        int i2835;
+        int i2836;
+        int i2837;
+        int i2838;
+        int i2839;
+        int i2840;
+        int i2841;
+        int i2842;
+        int i2843;
+        int i2844;
+        int i2845;
+        int i2846;
+        int i2847;
+        int i2848;
+        int i2849;
+        int i2850;
+        int i2851;
+        int i2852;
+        int i2853;
+        int i2854;
+        int i2855;
+        int i2856;
+        int i2857;
+        int i2858;
+        int i2859;
+        int i2860;
+        int i2861;
+        int i2862;
+        int i2863;
+        int i2864;
+        int i2865;
+        int i2866;
+        int i2867;
+        int i2868;
+        int i2869;
+        int i2870;
+        int i2871;
+        int i2872;
+        int i2873;
+        int i2874;
+        int i2875;
+        int i2876;
+        int i2877;
+        int i2878;
+        int i2879;
+        int i2880;
+        int i2881;
+        int i2882;
+        int i2883;
+        int i2884;
+        int i2885;
+        int i2886;
+        int i2887;
+        int i2888;
+        int i2889;
+        int i2890;
+        int i2891;
+        int i2892;
+        int i2893;
+        int i2894;
+        int i2895;
+        int i2896;
+        int i2897;
+        int i2898;
+        int i2899;
+        int i2900;
+        int i2901;
+        int i2902;
+        int i2903;
+        int i2904;
+        int i2905;
+        int i2906;
+        int i2907;
+        int i2908;
+        int i2909;
+        int i2910;
+        int i2911;
+        int i2912;
+        int i2913;
+        int i2914;
+        int i2915;
+        int i2916;
+        int i2917;
+        int i2918;
+        int i2919;
+        int i2920;
+        int i2921;
+        int i2922;
+        int i2923;
+        int i2924;
+        int i2925;
+        int i2926;
+        int i2927;
+        int i2928;
+        int i2929;
+        int i2930;
+        int i2931;
+        int i2932;
+        int i2933;
+        int i2934;
+        int i2935;
+        int i2936;
+        int i2937;
+        int i2938;
+        int i2939;
+        int i2940;
+        int i2941;
+        int i2942;
+        int i2943;
+        int i2944;
+        int i2945;
+        int i2946;
+        int i2947;
+        int i2948;
+        int i2949;
+        int i2950;
+        int i2951;
+        int i2952;
+        int i2953;
+        int i2954;
+        int i2955;
+        int i2956;
+        int i2957;
+        int i2958;
+        int i2959;
+        int i2960;
+        int i2961;
+        int i2962;
+        int i2963;
+        int i2964;
+        int i2965;
+        int i2966;
+        int i2967;
+        int i2968;
+        int i2969;
+        int i2970;
+        int i2971;
+        int i2972;
+        int i2973;
+        int i2974;
+        int i2975;
+        int i2976;
+        int i2977;
+        int i2978;
+        int i2979;
+        int i2980;
+        int i2981;
+        int i2982;
+        int i2983;
+        int i2984;
+        int i2985;
+        int i2986;
+        int i2987;
+        int i2988;
+        int i2989;
+        int i2990;
+        int i2991;
+        int i2992;
+        int i2993;
+        int i2994;
+        int i2995;
+        int i2996;
+        int i2997;
+        int i2998;
+        int i2999;
+        int i3000;
+        int i3001;
+        int i3002;
+        int i3003;
+        int i3004;
+        int i3005;
+        int i3006;
+        int i3007;
+        int i3008;
+        int i3009;
+        int i3010;
+        int i3011;
+        int i3012;
+        int i3013;
+        int i3014;
+        int i3015;
+        int i3016;
+        int i3017;
+        int i3018;
+        int i3019;
+        int i3020;
+        int i3021;
+        int i3022;
+        int i3023;
+        int i3024;
+        int i3025;
+        int i3026;
+        int i3027;
+        int i3028;
+        int i3029;
+        int i3030;
+        int i3031;
+        int i3032;
+        int i3033;
+        int i3034;
+        int i3035;
+        int i3036;
+        int i3037;
+        int i3038;
+        int i3039;
+        int i3040;
+        int i3041;
+        int i3042;
+        int i3043;
+        int i3044;
+        int i3045;
+        int i3046;
+        int i3047;
+        int i3048;
+        int i3049;
+        int i3050;
+        int i3051;
+        int i3052;
+        int i3053;
+        int i3054;
+        int i3055;
+        int i3056;
+        int i3057;
+        int i3058;
+        int i3059;
+        int i3060;
+        int i3061;
+        int i3062;
+        int i3063;
+        int i3064;
+        int i3065;
+        int i3066;
+        int i3067;
+        int i3068;
+        int i3069;
+        int i3070;
+        int i3071;
+        int i3072;
+        int i3073;
+        int i3074;
+        int i3075;
+        int i3076;
+        int i3077;
+        int i3078;
+        int i3079;
+        int i3080;
+        int i3081;
+        int i3082;
+        int i3083;
+        int i3084;
+        int i3085;
+        int i3086;
+        int i3087;
+        int i3088;
+        int i3089;
+        int i3090;
+        int i3091;
+        int i3092;
+        int i3093;
+        int i3094;
+        int i3095;
+        int i3096;
+        int i3097;
+        int i3098;
+        int i3099;
+        int i3100;
+        int i3101;
+        int i3102;
+        int i3103;
+        int i3104;
+        int i3105;
+        int i3106;
+        int i3107;
+        int i3108;
+        int i3109;
+        int i3110;
+        int i3111;
+        int i3112;
+        int i3113;
+        int i3114;
+        int i3115;
+        int i3116;
+        int i3117;
+        int i3118;
+        int i3119;
+        int i3120;
+        int i3121;
+        int i3122;
+        int i3123;
+        int i3124;
+        int i3125;
+        int i3126;
+        int i3127;
+        int i3128;
+        int i3129;
+        int i3130;
+        int i3131;
+        int i3132;
+        int i3133;
+        int i3134;
+        int i3135;
+        int i3136;
+        int i3137;
+        int i3138;
+        int i3139;
+        int i3140;
+        int i3141;
+        int i3142;
+        int i3143;
+        int i3144;
+        int i3145;
+        int i3146;
+        int i3147;
+        int i3148;
+        int i3149;
+        int i3150;
+        int i3151;
+        int i3152;
+        int i3153;
+        int i3154;
+        int i3155;
+        int i3156;
+        int i3157;
+        int i3158;
+        int i3159;
+        int i3160;
+        int i3161;
+        int i3162;
+        int i3163;
+        int i3164;
+        int i3165;
+        int i3166;
+        int i3167;
+        int i3168;
+        int i3169;
+        int i3170;
+        int i3171;
+        int i3172;
+        int i3173;
+        int i3174;
+        int i3175;
+        int i3176;
+        int i3177;
+        int i3178;
+        int i3179;
+        int i3180;
+        int i3181;
+        int i3182;
+        int i3183;
+        int i3184;
+        int i3185;
+        int i3186;
+        int i3187;
+        int i3188;
+        int i3189;
+        int i3190;
+        int i3191;
+        int i3192;
+        int i3193;
+        int i3194;
+        int i3195;
+        int i3196;
+        int i3197;
+        int i3198;
+        int i3199;
+        int i3200;
+        int i3201;
+        int i3202;
+        int i3203;
+        int i3204;
+        int i3205;
+        int i3206;
+        int i3207;
+        int i3208;
+        int i3209;
+        int i3210;
+        int i3211;
+        int i3212;
+        int i3213;
+        int i3214;
+        int i3215;
+        int i3216;
+        int i3217;
+        int i3218;
+        int i3219;
+        int i3220;
+        int i3221;
+        int i3222;
+        int i3223;
+        int i3224;
+        int i3225;
+        int i3226;
+        int i3227;
+        int i3228;
+        int i3229;
+        int i3230;
+        int i3231;
+        int i3232;
+        int i3233;
+        int i3234;
+        int i3235;
+        int i3236;
+        int i3237;
+        int i3238;
+        int i3239;
+        int i3240;
+        int i3241;
+        int i3242;
+        int i3243;
+        int i3244;
+        int i3245;
+        int i3246;
+        int i3247;
+        int i3248;
+        int i3249;
+        int i3250;
+        int i3251;
+        int i3252;
+        int i3253;
+        int i3254;
+        int i3255;
+        int i3256;
+        int i3257;
+        int i3258;
+        int i3259;
+        int i3260;
+        int i3261;
+        int i3262;
+        int i3263;
+        int i3264;
+        int i3265;
+        int i3266;
+        int i3267;
+        int i3268;
+        int i3269;
+        int i3270;
+        int i3271;
+        int i3272;
+        int i3273;
+        int i3274;
+        int i3275;
+        int i3276;
+        int i3277;
+        int i3278;
+        int i3279;
+        int i3280;
+        int i3281;
+        int i3282;
+        int i3283;
+        int i3284;
+        int i3285;
+        int i3286;
+        int i3287;
+        int i3288;
+        int i3289;
+        int i3290;
+        int i3291;
+        int i3292;
+        int i3293;
+        int i3294;
+        int i3295;
+        int i3296;
+        int i3297;
+        int i3298;
+        int i3299;
+        int i3300;
+        int i3301;
+        int i3302;
+        int i3303;
+        int i3304;
+        int i3305;
+        int i3306;
+        int i3307;
+        int i3308;
+        int i3309;
+        int i3310;
+        int i3311;
+        int i3312;
+        int i3313;
+        int i3314;
+        int i3315;
+        int i3316;
+        int i3317;
+        int i3318;
+        int i3319;
+        int i3320;
+        int i3321;
+        int i3322;
+        int i3323;
+        int i3324;
+        int i3325;
+        int i3326;
+        int i3327;
+        int i3328;
+        int i3329;
+        int i3330;
+        int i3331;
+        int i3332;
+        int i3333;
+        int i3334;
+        int i3335;
+        int i3336;
+        int i3337;
+        int i3338;
+        int i3339;
+        int i3340;
+        int i3341;
+        int i3342;
+        int i3343;
+        int i3344;
+        int i3345;
+        int i3346;
+        int i3347;
+        int i3348;
+        int i3349;
+        int i3350;
+        int i3351;
+        int i3352;
+        int i3353;
+        int i3354;
+        int i3355;
+        int i3356;
+        int i3357;
+        int i3358;
+        int i3359;
+        int i3360;
+        int i3361;
+        int i3362;
+        int i3363;
+        int i3364;
+        int i3365;
+        int i3366;
+        int i3367;
+        int i3368;
+        int i3369;
+        int i3370;
+        int i3371;
+        int i3372;
+        int i3373;
+        int i3374;
+        int i3375;
+        int i3376;
+        int i3377;
+        int i3378;
+        int i3379;
+        int i3380;
+        int i3381;
+        int i3382;
+        int i3383;
+        int i3384;
+        int i3385;
+        int i3386;
+        int i3387;
+        int i3388;
+        int i3389;
+        int i3390;
+        int i3391;
+        int i3392;
+        int i3393;
+        int i3394;
+        int i3395;
+        int i3396;
+        int i3397;
+        int i3398;
+        int i3399;
+        int i3400;
+        int i3401;
+        int i3402;
+        int i3403;
+        int i3404;
+        int i3405;
+        int i3406;
+        int i3407;
+        int i3408;
+        int i3409;
+        int i3410;
+        int i3411;
+        int i3412;
+        int i3413;
+        int i3414;
+        int i3415;
+        int i3416;
+        int i3417;
+        int i3418;
+        int i3419;
+        int i3420;
+        int i3421;
+        int i3422;
+        int i3423;
+        int i3424;
+        int i3425;
+        int i3426;
+        int i3427;
+        int i3428;
+        int i3429;
+        int i3430;
+        int i3431;
+        int i3432;
+        int i3433;
+        int i3434;
+        int i3435;
+        int i3436;
+        int i3437;
+        int i3438;
+        int i3439;
+        int i3440;
+        int i3441;
+        int i3442;
+        int i3443;
+        int i3444;
+        int i3445;
+        int i3446;
+        int i3447;
+        int i3448;
+        int i3449;
+        int i3450;
+        int i3451;
+        int i3452;
+        int i3453;
+        int i3454;
+        int i3455;
+        int i3456;
+        int i3457;
+        int i3458;
+        int i3459;
+        int i3460;
+        int i3461;
+        int i3462;
+        int i3463;
+        int i3464;
+        int i3465;
+        int i3466;
+        int i3467;
+        int i3468;
+        int i3469;
+        int i3470;
+        int i3471;
+        int i3472;
+        int i3473;
+        int i3474;
+        int i3475;
+        int i3476;
+        int i3477;
+        int i3478;
+        int i3479;
+        int i3480;
+        int i3481;
+        int i3482;
+        int i3483;
+        int i3484;
+        int i3485;
+        int i3486;
+        int i3487;
+        int i3488;
+        int i3489;
+        int i3490;
+        int i3491;
+        int i3492;
+        int i3493;
+        int i3494;
+        int i3495;
+        int i3496;
+        int i3497;
+        int i3498;
+        int i3499;
+        int i3500;
+        int i3501;
+        int i3502;
+        int i3503;
+        int i3504;
+        int i3505;
+        int i3506;
+        int i3507;
+        int i3508;
+        int i3509;
+        int i3510;
+        int i3511;
+        int i3512;
+        int i3513;
+        int i3514;
+        int i3515;
+        int i3516;
+        int i3517;
+        int i3518;
+        int i3519;
+        int i3520;
+        int i3521;
+        int i3522;
+        int i3523;
+        int i3524;
+        int i3525;
+        int i3526;
+        int i3527;
+        int i3528;
+        int i3529;
+        int i3530;
+        int i3531;
+        int i3532;
+        int i3533;
+        int i3534;
+        int i3535;
+        int i3536;
+        int i3537;
+        int i3538;
+        int i3539;
+        int i3540;
+        int i3541;
+        int i3542;
+        int i3543;
+        int i3544;
+        int i3545;
+        int i3546;
+        int i3547;
+        int i3548;
+        int i3549;
+        int i3550;
+        int i3551;
+        int i3552;
+        int i3553;
+        int i3554;
+        int i3555;
+        int i3556;
+        int i3557;
+        int i3558;
+        int i3559;
+        int i3560;
+        int i3561;
+        int i3562;
+        int i3563;
+        int i3564;
+        int i3565;
+        int i3566;
+        int i3567;
+        int i3568;
+        int i3569;
+        int i3570;
+        int i3571;
+        int i3572;
+        int i3573;
+        int i3574;
+        int i3575;
+        int i3576;
+        int i3577;
+        int i3578;
+        int i3579;
+        int i3580;
+        int i3581;
+        int i3582;
+        int i3583;
+        int i3584;
+        int i3585;
+        int i3586;
+        int i3587;
+        int i3588;
+        int i3589;
+        int i3590;
+        int i3591;
+        int i3592;
+        int i3593;
+        int i3594;
+        int i3595;
+        int i3596;
+        int i3597;
+        int i3598;
+        int i3599;
+        int i3600;
+        int i3601;
+        int i3602;
+        int i3603;
+        int i3604;
+        int i3605;
+        int i3606;
+        int i3607;
+        int i3608;
+        int i3609;
+        int i3610;
+        int i3611;
+        int i3612;
+        int i3613;
+        int i3614;
+        int i3615;
+        int i3616;
+        int i3617;
+        int i3618;
+        int i3619;
+        int i3620;
+        int i3621;
+        int i3622;
+        int i3623;
+        int i3624;
+        int i3625;
+        int i3626;
+        int i3627;
+        int i3628;
+        int i3629;
+        int i3630;
+        int i3631;
+        int i3632;
+        int i3633;
+        int i3634;
+        int i3635;
+        int i3636;
+        int i3637;
+        int i3638;
+        int i3639;
+        int i3640;
+        int i3641;
+        int i3642;
+        int i3643;
+        int i3644;
+        int i3645;
+        int i3646;
+        int i3647;
+        int i3648;
+        int i3649;
+        int i3650;
+        int i3651;
+        int i3652;
+        int i3653;
+        int i3654;
+        int i3655;
+        int i3656;
+        int i3657;
+        int i3658;
+        int i3659;
+        int i3660;
+        int i3661;
+        int i3662;
+        int i3663;
+        int i3664;
+        int i3665;
+        int i3666;
+        int i3667;
+        int i3668;
+        int i3669;
+        int i3670;
+        int i3671;
+        int i3672;
+        int i3673;
+        int i3674;
+        int i3675;
+        int i3676;
+        int i3677;
+        int i3678;
+        int i3679;
+        int i3680;
+        int i3681;
+        int i3682;
+        int i3683;
+        int i3684;
+        int i3685;
+        int i3686;
+        int i3687;
+        int i3688;
+        int i3689;
+        int i3690;
+        int i3691;
+        int i3692;
+        int i3693;
+        int i3694;
+        int i3695;
+        int i3696;
+        int i3697;
+        int i3698;
+        int i3699;
+        int i3700;
+        int i3701;
+        int i3702;
+        int i3703;
+        int i3704;
+        int i3705;
+        int i3706;
+        int i3707;
+        int i3708;
+        int i3709;
+        int i3710;
+        int i3711;
+        int i3712;
+        int i3713;
+        int i3714;
+        int i3715;
+        int i3716;
+        int i3717;
+        int i3718;
+        int i3719;
+        int i3720;
+        int i3721;
+        int i3722;
+        int i3723;
+        int i3724;
+        int i3725;
+        int i3726;
+        int i3727;
+        int i3728;
+        int i3729;
+        int i3730;
+        int i3731;
+        int i3732;
+        int i3733;
+        int i3734;
+        int i3735;
+        int i3736;
+        int i3737;
+        int i3738;
+        int i3739;
+        int i3740;
+        int i3741;
+        int i3742;
+        int i3743;
+        int i3744;
+        int i3745;
+        int i3746;
+        int i3747;
+        int i3748;
+        int i3749;
+        int i3750;
+        int i3751;
+        int i3752;
+        int i3753;
+        int i3754;
+        int i3755;
+        int i3756;
+        int i3757;
+        int i3758;
+        int i3759;
+        int i3760;
+        int i3761;
+        int i3762;
+        int i3763;
+        int i3764;
+        int i3765;
+        int i3766;
+        int i3767;
+        int i3768;
+        int i3769;
+        int i3770;
+        int i3771;
+        int i3772;
+        int i3773;
+        int i3774;
+        int i3775;
+        int i3776;
+        int i3777;
+        int i3778;
+        int i3779;
+        int i3780;
+        int i3781;
+        int i3782;
+        int i3783;
+        int i3784;
+        int i3785;
+        int i3786;
+        int i3787;
+        int i3788;
+        int i3789;
+        int i3790;
+        int i3791;
+        int i3792;
+        int i3793;
+        int i3794;
+        int i3795;
+        int i3796;
+        int i3797;
+        int i3798;
+        int i3799;
+        int i3800;
+        int i3801;
+        int i3802;
+        int i3803;
+        int i3804;
+        int i3805;
+        int i3806;
+        int i3807;
+        int i3808;
+        int i3809;
+        int i3810;
+        int i3811;
+        int i3812;
+        int i3813;
+        int i3814;
+        int i3815;
+        int i3816;
+        int i3817;
+        int i3818;
+        int i3819;
+        int i3820;
+        int i3821;
+        int i3822;
+        int i3823;
+        int i3824;
+        int i3825;
+        int i3826;
+        int i3827;
+        int i3828;
+        int i3829;
+        int i3830;
+        int i3831;
+        int i3832;
+        int i3833;
+        int i3834;
+        int i3835;
+        int i3836;
+        int i3837;
+        int i3838;
+        int i3839;
+        int i3840;
+        int i3841;
+        int i3842;
+        int i3843;
+        int i3844;
+        int i3845;
+        int i3846;
+        int i3847;
+        int i3848;
+        int i3849;
+        int i3850;
+        int i3851;
+        int i3852;
+        int i3853;
+        int i3854;
+        int i3855;
+        int i3856;
+        int i3857;
+        int i3858;
+        int i3859;
+        int i3860;
+        int i3861;
+        int i3862;
+        int i3863;
+        int i3864;
+        int i3865;
+        int i3866;
+        int i3867;
+        int i3868;
+        int i3869;
+        int i3870;
+        int i3871;
+        int i3872;
+        int i3873;
+        int i3874;
+        int i3875;
+        int i3876;
+        int i3877;
+        int i3878;
+        int i3879;
+        int i3880;
+        int i3881;
+        int i3882;
+        int i3883;
+        int i3884;
+        int i3885;
+        int i3886;
+        int i3887;
+        int i3888;
+        int i3889;
+        int i3890;
+        int i3891;
+        int i3892;
+        int i3893;
+        int i3894;
+        int i3895;
+        int i3896;
+        int i3897;
+        int i3898;
+        int i3899;
+        int i3900;
+        int i3901;
+        int i3902;
+        int i3903;
+        int i3904;
+        int i3905;
+        int i3906;
+        int i3907;
+        int i3908;
+        int i3909;
+        int i3910;
+        int i3911;
+        int i3912;
+        int i3913;
+        int i3914;
+        int i3915;
+        int i3916;
+        int i3917;
+        int i3918;
+        int i3919;
+        int i3920;
+        int i3921;
+        int i3922;
+        int i3923;
+        int i3924;
+        int i3925;
+        int i3926;
+        int i3927;
+        int i3928;
+        int i3929;
+        int i3930;
+        int i3931;
+        int i3932;
+        int i3933;
+        int i3934;
+        int i3935;
+        int i3936;
+        int i3937;
+        int i3938;
+        int i3939;
+        int i3940;
+        int i3941;
+        int i3942;
+        int i3943;
+        int i3944;
+        int i3945;
+        int i3946;
+        int i3947;
+        int i3948;
+        int i3949;
+        int i3950;
+        int i3951;
+        int i3952;
+        int i3953;
+        int i3954;
+        int i3955;
+        int i3956;
+        int i3957;
+        int i3958;
+        int i3959;
+        int i3960;
+        int i3961;
+        int i3962;
+        int i3963;
+        int i3964;
+        int i3965;
+        int i3966;
+        int i3967;
+        int i3968;
+        int i3969;
+        int i3970;
+        int i3971;
+        int i3972;
+        int i3973;
+        int i3974;
+        int i3975;
+        int i3976;
+        int i3977;
+        int i3978;
+        int i3979;
+        int i3980;
+        int i3981;
+        int i3982;
+        int i3983;
+        int i3984;
+        int i3985;
+        int i3986;
+        int i3987;
+        int i3988;
+        int i3989;
+        int i3990;
+        int i3991;
+        int i3992;
+        int i3993;
+        int i3994;
+        int i3995;
+        int i3996;
+        int i3997;
+        int i3998;
+        int i3999;
+        int i4000;
+        int i4001;
+        int i4002;
+        int i4003;
+        int i4004;
+        int i4005;
+        int i4006;
+        int i4007;
+        int i4008;
+        int i4009;
+        int i4010;
+        int i4011;
+        int i4012;
+        int i4013;
+        int i4014;
+        int i4015;
+        int i4016;
+        int i4017;
+        int i4018;
+        int i4019;
+        int i4020;
+        int i4021;
+        int i4022;
+        int i4023;
+        int i4024;
+        int i4025;
+        int i4026;
+        int i4027;
+        int i4028;
+        int i4029;
+        int i4030;
+        int i4031;
+        int i4032;
+        int i4033;
+        int i4034;
+        int i4035;
+        int i4036;
+        int i4037;
+        int i4038;
+        int i4039;
+        int i4040;
+        int i4041;
+        int i4042;
+        int i4043;
+        int i4044;
+        int i4045;
+        int i4046;
+        int i4047;
+        int i4048;
+        int i4049;
+        int i4050;
+        int i4051;
+        int i4052;
+        int i4053;
+        int i4054;
+        int i4055;
+        int i4056;
+        int i4057;
+        int i4058;
+        int i4059;
+        int i4060;
+        int i4061;
+        int i4062;
+        int i4063;
+        int i4064;
+        int i4065;
+        int i4066;
+        int i4067;
+        int i4068;
+        int i4069;
+        int i4070;
+        int i4071;
+        int i4072;
+        int i4073;
+        int i4074;
+        int i4075;
+        int i4076;
+        int i4077;
+        int i4078;
+        int i4079;
+        int i4080;
+        int i4081;
+        int i4082;
+        int i4083;
+        int i4084;
+        int i4085;
+        int i4086;
+        int i4087;
+        int i4088;
+        int i4089;
+        int i4090;
+        int i4091;
+        int i4092;
+        int i4093;
+        int i4094;
+        int i4095;
+        int i4096;
+        int i4097;
+        int i4098;
+        int i4099;
+        int i4100;
+        int i4101;
+        int i4102;
+        int i4103;
+        int i4104;
+        int i4105;
+        int i4106;
+        int i4107;
+        int i4108;
+        int i4109;
+        int i4110;
+        int i4111;
+        int i4112;
+        int i4113;
+        int i4114;
+        int i4115;
+        int i4116;
+        int i4117;
+        int i4118;
+        int i4119;
+        int i4120;
+        int i4121;
+        int i4122;
+        int i4123;
+        int i4124;
+        int i4125;
+        int i4126;
+        int i4127;
+        int i4128;
+        int i4129;
+        int i4130;
+        int i4131;
+        int i4132;
+        int i4133;
+        int i4134;
+        int i4135;
+        int i4136;
+        int i4137;
+        int i4138;
+        int i4139;
+        int i4140;
+        int i4141;
+        int i4142;
+        int i4143;
+        int i4144;
+        int i4145;
+        int i4146;
+        int i4147;
+        int i4148;
+        int i4149;
+        int i4150;
+        int i4151;
+        int i4152;
+        int i4153;
+        int i4154;
+        int i4155;
+        int i4156;
+        int i4157;
+        int i4158;
+        int i4159;
+        int i4160;
+        int i4161;
+        int i4162;
+        int i4163;
+        int i4164;
+        int i4165;
+        int i4166;
+        int i4167;
+        int i4168;
+        int i4169;
+        int i4170;
+        int i4171;
+        int i4172;
+        int i4173;
+        int i4174;
+        int i4175;
+        int i4176;
+        int i4177;
+        int i4178;
+        int i4179;
+        int i4180;
+        int i4181;
+        int i4182;
+        int i4183;
+        int i4184;
+        int i4185;
+        int i4186;
+        int i4187;
+        int i4188;
+        int i4189;
+        int i4190;
+        int i4191;
+        int i4192;
+        int i4193;
+        int i4194;
+        int i4195;
+        int i4196;
+        int i4197;
+        int i4198;
+        int i4199;
+        int i4200;
+        int i4201;
+        int i4202;
+        int i4203;
+        int i4204;
+        int i4205;
+        int i4206;
+        int i4207;
+        int i4208;
+        int i4209;
+        int i4210;
+        int i4211;
+        int i4212;
+        int i4213;
+        int i4214;
+        int i4215;
+        int i4216;
+        int i4217;
+        int i4218;
+        int i4219;
+        int i4220;
+        int i4221;
+        int i4222;
+        int i4223;
+        int i4224;
+        int i4225;
+        int i4226;
+        int i4227;
+        int i4228;
+        int i4229;
+        int i4230;
+        int i4231;
+        int i4232;
+        int i4233;
+        int i4234;
+        int i4235;
+        int i4236;
+        int i4237;
+        int i4238;
+        int i4239;
+        int i4240;
+        int i4241;
+        int i4242;
+        int i4243;
+        int i4244;
+        int i4245;
+        int i4246;
+        int i4247;
+        int i4248;
+        int i4249;
+        int i4250;
+        int i4251;
+        int i4252;
+        int i4253;
+        int i4254;
+        int i4255;
+        int i4256;
+        int i4257;
+        int i4258;
+        int i4259;
+        int i4260;
+        int i4261;
+        int i4262;
+        int i4263;
+        int i4264;
+        int i4265;
+        int i4266;
+        int i4267;
+        int i4268;
+        int i4269;
+        int i4270;
+        int i4271;
+        int i4272;
+        int i4273;
+        int i4274;
+        int i4275;
+        int i4276;
+        int i4277;
+        int i4278;
+        int i4279;
+        int i4280;
+        int i4281;
+        int i4282;
+        int i4283;
+        int i4284;
+        int i4285;
+        int i4286;
+        int i4287;
+        int i4288;
+        int i4289;
+        int i4290;
+        int i4291;
+        int i4292;
+        int i4293;
+        int i4294;
+        int i4295;
+        int i4296;
+        int i4297;
+        int i4298;
+        int i4299;
+        int i4300;
+        int i4301;
+        int i4302;
+        int i4303;
+        int i4304;
+        int i4305;
+        int i4306;
+        int i4307;
+        int i4308;
+        int i4309;
+        int i4310;
+        int i4311;
+        int i4312;
+        int i4313;
+        int i4314;
+        int i4315;
+        int i4316;
+        int i4317;
+        int i4318;
+        int i4319;
+        int i4320;
+        int i4321;
+        int i4322;
+        int i4323;
+        int i4324;
+        int i4325;
+        int i4326;
+        int i4327;
+        int i4328;
+        int i4329;
+        int i4330;
+        int i4331;
+        int i4332;
+        int i4333;
+        int i4334;
+        int i4335;
+        int i4336;
+        int i4337;
+        int i4338;
+        int i4339;
+        int i4340;
+        int i4341;
+        int i4342;
+        int i4343;
+        int i4344;
+        int i4345;
+        int i4346;
+        int i4347;
+        int i4348;
+        int i4349;
+        int i4350;
+        int i4351;
+        int i4352;
+        int i4353;
+        int i4354;
+        int i4355;
+        int i4356;
+        int i4357;
+        int i4358;
+        int i4359;
+        int i4360;
+        int i4361;
+        int i4362;
+        int i4363;
+        int i4364;
+        int i4365;
+        int i4366;
+        int i4367;
+        int i4368;
+        int i4369;
+        int i4370;
+        int i4371;
+        int i4372;
+        int i4373;
+        int i4374;
+        int i4375;
+        int i4376;
+        int i4377;
+        int i4378;
+        int i4379;
+        int i4380;
+        int i4381;
+        int i4382;
+        int i4383;
+        int i4384;
+        int i4385;
+        int i4386;
+        int i4387;
+        int i4388;
+        int i4389;
+        int i4390;
+        int i4391;
+        int i4392;
+        int i4393;
+        int i4394;
+        int i4395;
+        int i4396;
+        int i4397;
+        int i4398;
+        int i4399;
+        int i4400;
+        int i4401;
+        int i4402;
+        int i4403;
+        int i4404;
+        int i4405;
+        int i4406;
+        int i4407;
+        int i4408;
+        int i4409;
+        int i4410;
+        int i4411;
+        int i4412;
+        int i4413;
+        int i4414;
+        int i4415;
+        int i4416;
+        int i4417;
+        int i4418;
+        int i4419;
+        int i4420;
+        int i4421;
+        int i4422;
+        int i4423;
+        int i4424;
+        int i4425;
+        int i4426;
+        int i4427;
+        int i4428;
+        int i4429;
+        int i4430;
+        int i4431;
+        int i4432;
+        int i4433;
+        int i4434;
+        int i4435;
+        int i4436;
+        int i4437;
+        int i4438;
+        int i4439;
+        int i4440;
+        int i4441;
+        int i4442;
+        int i4443;
+        int i4444;
+        int i4445;
+        int i4446;
+        int i4447;
+        int i4448;
+        int i4449;
+        int i4450;
+        int i4451;
+        int i4452;
+        int i4453;
+        int i4454;
+        int i4455;
+        int i4456;
+        int i4457;
+        int i4458;
+        int i4459;
+        int i4460;
+        int i4461;
+        int i4462;
+        int i4463;
+        int i4464;
+        int i4465;
+        int i4466;
+        int i4467;
+        int i4468;
+        int i4469;
+        int i4470;
+        int i4471;
+        int i4472;
+        int i4473;
+        int i4474;
+        int i4475;
+        int i4476;
+        int i4477;
+        int i4478;
+        int i4479;
+        int i4480;
+        int i4481;
+        int i4482;
+        int i4483;
+        int i4484;
+        int i4485;
+        int i4486;
+        int i4487;
+        int i4488;
+        int i4489;
+        int i4490;
+        int i4491;
+        int i4492;
+        int i4493;
+        int i4494;
+        int i4495;
+        int i4496;
+        int i4497;
+        int i4498;
+        int i4499;
+        int i4500;
+        int i4501;
+        int i4502;
+        int i4503;
+        int i4504;
+        int i4505;
+        int i4506;
+        int i4507;
+        int i4508;
+        int i4509;
+        int i4510;
+        int i4511;
+        int i4512;
+        int i4513;
+        int i4514;
+        int i4515;
+        int i4516;
+        int i4517;
+        int i4518;
+        int i4519;
+        int i4520;
+        int i4521;
+        int i4522;
+        int i4523;
+        int i4524;
+        int i4525;
+        int i4526;
+        int i4527;
+        int i4528;
+        int i4529;
+        int i4530;
+        int i4531;
+        int i4532;
+        int i4533;
+        int i4534;
+        int i4535;
+        int i4536;
+        int i4537;
+        int i4538;
+        int i4539;
+        int i4540;
+        int i4541;
+        int i4542;
+        int i4543;
+        int i4544;
+        int i4545;
+        int i4546;
+        int i4547;
+        int i4548;
+        int i4549;
+        int i4550;
+        int i4551;
+        int i4552;
+        int i4553;
+        int i4554;
+        int i4555;
+        int i4556;
+        int i4557;
+        int i4558;
+        int i4559;
+        int i4560;
+        int i4561;
+        int i4562;
+        int i4563;
+        int i4564;
+        int i4565;
+        int i4566;
+        int i4567;
+        int i4568;
+        int i4569;
+        int i4570;
+        int i4571;
+        int i4572;
+        int i4573;
+        int i4574;
+        int i4575;
+        int i4576;
+        int i4577;
+        int i4578;
+        int i4579;
+        int i4580;
+        int i4581;
+        int i4582;
+        int i4583;
+        int i4584;
+        int i4585;
+        int i4586;
+        int i4587;
+        int i4588;
+        int i4589;
+        int i4590;
+        int i4591;
+        int i4592;
+        int i4593;
+        int i4594;
+        int i4595;
+        int i4596;
+        int i4597;
+        int i4598;
+        int i4599;
+        int i4600;
+        int i4601;
+        int i4602;
+        int i4603;
+        int i4604;
+        int i4605;
+        int i4606;
+        int i4607;
+        int i4608;
+        int i4609;
+        int i4610;
+        int i4611;
+        int i4612;
+        int i4613;
+        int i4614;
+        int i4615;
+        int i4616;
+        int i4617;
+        int i4618;
+        int i4619;
+        int i4620;
+        int i4621;
+        int i4622;
+        int i4623;
+        int i4624;
+        int i4625;
+        int i4626;
+        int i4627;
+        int i4628;
+        int i4629;
+        int i4630;
+        int i4631;
+        int i4632;
+        int i4633;
+        int i4634;
+        int i4635;
+        int i4636;
+        int i4637;
+        int i4638;
+        int i4639;
+        int i4640;
+        int i4641;
+        int i4642;
+        int i4643;
+        int i4644;
+        int i4645;
+        int i4646;
+        int i4647;
+        int i4648;
+        int i4649;
+        int i4650;
+        int i4651;
+        int i4652;
+        int i4653;
+        int i4654;
+        int i4655;
+        int i4656;
+        int i4657;
+        int i4658;
+        int i4659;
+        int i4660;
+        int i4661;
+        int i4662;
+        int i4663;
+        int i4664;
+        int i4665;
+        int i4666;
+        int i4667;
+        int i4668;
+        int i4669;
+        int i4670;
+        int i4671;
+        int i4672;
+        int i4673;
+        int i4674;
+        int i4675;
+        int i4676;
+        int i4677;
+        int i4678;
+        int i4679;
+        int i4680;
+        int i4681;
+        int i4682;
+        int i4683;
+        int i4684;
+        int i4685;
+        int i4686;
+        int i4687;
+        int i4688;
+        int i4689;
+        int i4690;
+        int i4691;
+        int i4692;
+        int i4693;
+        int i4694;
+        int i4695;
+        int i4696;
+        int i4697;
+        int i4698;
+        int i4699;
+        int i4700;
+        int i4701;
+        int i4702;
+        int i4703;
+        int i4704;
+        int i4705;
+        int i4706;
+        int i4707;
+        int i4708;
+        int i4709;
+        int i4710;
+        int i4711;
+        int i4712;
+        int i4713;
+        int i4714;
+        int i4715;
+        int i4716;
+        int i4717;
+        int i4718;
+        int i4719;
+        int i4720;
+        int i4721;
+        int i4722;
+        int i4723;
+        int i4724;
+        int i4725;
+        int i4726;
+        int i4727;
+        int i4728;
+        int i4729;
+        int i4730;
+        int i4731;
+        int i4732;
+        int i4733;
+        int i4734;
+        int i4735;
+        int i4736;
+        int i4737;
+        int i4738;
+        int i4739;
+        int i4740;
+        int i4741;
+        int i4742;
+        int i4743;
+        int i4744;
+        int i4745;
+        int i4746;
+        int i4747;
+        int i4748;
+        int i4749;
+        int i4750;
+        int i4751;
+        int i4752;
+        int i4753;
+        int i4754;
+        int i4755;
+        int i4756;
+        int i4757;
+        int i4758;
+        int i4759;
+        int i4760;
+        int i4761;
+        int i4762;
+        int i4763;
+        int i4764;
+        int i4765;
+        int i4766;
+        int i4767;
+        int i4768;
+        int i4769;
+        int i4770;
+        int i4771;
+        int i4772;
+        int i4773;
+        int i4774;
+        int i4775;
+        int i4776;
+        int i4777;
+        int i4778;
+        int i4779;
+        int i4780;
+        int i4781;
+        int i4782;
+        int i4783;
+        int i4784;
+        int i4785;
+        int i4786;
+        int i4787;
+        int i4788;
+        int i4789;
+        int i4790;
+        int i4791;
+        int i4792;
+        int i4793;
+        int i4794;
+        int i4795;
+        int i4796;
+        int i4797;
+        int i4798;
+        int i4799;
+        int i4800;
+        int i4801;
+        int i4802;
+        int i4803;
+        int i4804;
+        int i4805;
+        int i4806;
+        int i4807;
+        int i4808;
+        int i4809;
+        int i4810;
+        int i4811;
+        int i4812;
+        int i4813;
+        int i4814;
+        int i4815;
+        int i4816;
+        int i4817;
+        int i4818;
+        int i4819;
+        int i4820;
+        int i4821;
+        int i4822;
+        int i4823;
+        int i4824;
+        int i4825;
+        int i4826;
+        int i4827;
+        int i4828;
+        int i4829;
+        int i4830;
+        int i4831;
+        int i4832;
+        int i4833;
+        int i4834;
+        int i4835;
+        int i4836;
+        int i4837;
+        int i4838;
+        int i4839;
+        int i4840;
+        int i4841;
+        int i4842;
+        int i4843;
+        int i4844;
+        int i4845;
+        int i4846;
+        int i4847;
+        int i4848;
+        int i4849;
+        int i4850;
+        int i4851;
+        int i4852;
+        int i4853;
+        int i4854;
+        int i4855;
+        int i4856;
+        int i4857;
+        int i4858;
+        int i4859;
+        int i4860;
+        int i4861;
+        int i4862;
+        int i4863;
+        int i4864;
+        int i4865;
+        int i4866;
+        int i4867;
+        int i4868;
+        int i4869;
+        int i4870;
+        int i4871;
+        int i4872;
+        int i4873;
+        int i4874;
+        int i4875;
+        int i4876;
+        int i4877;
+        int i4878;
+        int i4879;
+        int i4880;
+        int i4881;
+        int i4882;
+        int i4883;
+        int i4884;
+        int i4885;
+        int i4886;
+        int i4887;
+        int i4888;
+        int i4889;
+        int i4890;
+        int i4891;
+        int i4892;
+        int i4893;
+        int i4894;
+        int i4895;
+        int i4896;
+        int i4897;
+        int i4898;
+        int i4899;
+        int i4900;
+        int i4901;
+        int i4902;
+        int i4903;
+        int i4904;
+        int i4905;
+        int i4906;
+        int i4907;
+        int i4908;
+        int i4909;
+        int i4910;
+        int i4911;
+        int i4912;
+        int i4913;
+        int i4914;
+        int i4915;
+        int i4916;
+        int i4917;
+        int i4918;
+        int i4919;
+        int i4920;
+        int i4921;
+        int i4922;
+        int i4923;
+        int i4924;
+        int i4925;
+        int i4926;
+        int i4927;
+        int i4928;
+        int i4929;
+        int i4930;
+        int i4931;
+        int i4932;
+        int i4933;
+        int i4934;
+        int i4935;
+        int i4936;
+        int i4937;
+        int i4938;
+        int i4939;
+        int i4940;
+        int i4941;
+        int i4942;
+        int i4943;
+        int i4944;
+        int i4945;
+        int i4946;
+        int i4947;
+        int i4948;
+        int i4949;
+        int i4950;
+        int i4951;
+        int i4952;
+        int i4953;
+        int i4954;
+        int i4955;
+        int i4956;
+        int i4957;
+        int i4958;
+        int i4959;
+        int i4960;
+        int i4961;
+        int i4962;
+        int i4963;
+        int i4964;
+        int i4965;
+        int i4966;
+        int i4967;
+        int i4968;
+        int i4969;
+        int i4970;
+        int i4971;
+        int i4972;
+        int i4973;
+        int i4974;
+        int i4975;
+        int i4976;
+        int i4977;
+        int i4978;
+        int i4979;
+        int i4980;
+        int i4981;
+        int i4982;
+        int i4983;
+        int i4984;
+        int i4985;
+        int i4986;
+        int i4987;
+        int i4988;
+        int i4989;
+        int i4990;
+        int i4991;
+        int i4992;
+        int i4993;
+        int i4994;
+        int i4995;
+        int i4996;
+        int i4997;
+        int i4998;
+        int i4999;
+        int i5000;
+        int i5001;
+        int i5002;
+        int i5003;
+        int i5004;
+        int i5005;
+        int i5006;
+        int i5007;
+        int i5008;
+        int i5009;
+        int i5010;
+        int i5011;
+        int i5012;
+        int i5013;
+        int i5014;
+        int i5015;
+        int i5016;
+        int i5017;
+        int i5018;
+        int i5019;
+        int i5020;
+        int i5021;
+        int i5022;
+        int i5023;
+        int i5024;
+        int i5025;
+        int i5026;
+        int i5027;
+        int i5028;
+        int i5029;
+        int i5030;
+        int i5031;
+        int i5032;
+        int i5033;
+        int i5034;
+        int i5035;
+        int i5036;
+        int i5037;
+        int i5038;
+        int i5039;
+        int i5040;
+        int i5041;
+        int i5042;
+        int i5043;
+        int i5044;
+        int i5045;
+        int i5046;
+        int i5047;
+        int i5048;
+        int i5049;
+        int i5050;
+        int i5051;
+        int i5052;
+        int i5053;
+        int i5054;
+        int i5055;
+        int i5056;
+        int i5057;
+        int i5058;
+        int i5059;
+        int i5060;
+        int i5061;
+        int i5062;
+        int i5063;
+        int i5064;
+        int i5065;
+        int i5066;
+        int i5067;
+        int i5068;
+        int i5069;
+        int i5070;
+        int i5071;
+        int i5072;
+        int i5073;
+        int i5074;
+        int i5075;
+        int i5076;
+        int i5077;
+        int i5078;
+        int i5079;
+        int i5080;
+        int i5081;
+        int i5082;
+        int i5083;
+        int i5084;
+        int i5085;
+        int i5086;
+        int i5087;
+        int i5088;
+        int i5089;
+        int i5090;
+        int i5091;
+        int i5092;
+        int i5093;
+        int i5094;
+        int i5095;
+        int i5096;
+        int i5097;
+        int i5098;
+        int i5099;
+        int i5100;
+        int i5101;
+        int i5102;
+        int i5103;
+        int i5104;
+        int i5105;
+        int i5106;
+        int i5107;
+        int i5108;
+        int i5109;
+        int i5110;
+        int i5111;
+        int i5112;
+        int i5113;
+        int i5114;
+        int i5115;
+        int i5116;
+        int i5117;
+        int i5118;
+        int i5119;
+        int i5120;
+        int i5121;
+        int i5122;
+        int i5123;
+        int i5124;
+        int i5125;
+        int i5126;
+        int i5127;
+        int i5128;
+        int i5129;
+        int i5130;
+        int i5131;
+        int i5132;
+        int i5133;
+        int i5134;
+        int i5135;
+        int i5136;
+        int i5137;
+        int i5138;
+        int i5139;
+        int i5140;
+        int i5141;
+        int i5142;
+        int i5143;
+        int i5144;
+        int i5145;
+        int i5146;
+        int i5147;
+        int i5148;
+        int i5149;
+        int i5150;
+        int i5151;
+        int i5152;
+        int i5153;
+        int i5154;
+        int i5155;
+        int i5156;
+        int i5157;
+        int i5158;
+        int i5159;
+        int i5160;
+        int i5161;
+        int i5162;
+        int i5163;
+        int i5164;
+        int i5165;
+        int i5166;
+        int i5167;
+        int i5168;
+        int i5169;
+        int i5170;
+        int i5171;
+        int i5172;
+        int i5173;
+        int i5174;
+        int i5175;
+        int i5176;
+        int i5177;
+        int i5178;
+        int i5179;
+        int i5180;
+        int i5181;
+        int i5182;
+        int i5183;
+        int i5184;
+        int i5185;
+        int i5186;
+        int i5187;
+        int i5188;
+        int i5189;
+        int i5190;
+        int i5191;
+        int i5192;
+        int i5193;
+        int i5194;
+        int i5195;
+        int i5196;
+        int i5197;
+        int i5198;
+        int i5199;
+        int i5200;
+        int i5201;
+        int i5202;
+        int i5203;
+        int i5204;
+        int i5205;
+        int i5206;
+        int i5207;
+        int i5208;
+        int i5209;
+        int i5210;
+        int i5211;
+        int i5212;
+        int i5213;
+        int i5214;
+        int i5215;
+        int i5216;
+        int i5217;
+        int i5218;
+        int i5219;
+        int i5220;
+        int i5221;
+        int i5222;
+        int i5223;
+        int i5224;
+        int i5225;
+        int i5226;
+        int i5227;
+        int i5228;
+        int i5229;
+        int i5230;
+        int i5231;
+        int i5232;
+        int i5233;
+        int i5234;
+        int i5235;
+        int i5236;
+        int i5237;
+        int i5238;
+        int i5239;
+        int i5240;
+        int i5241;
+        int i5242;
+        int i5243;
+        int i5244;
+        int i5245;
+        int i5246;
+        int i5247;
+        int i5248;
+        int i5249;
+        int i5250;
+        int i5251;
+        int i5252;
+        int i5253;
+        int i5254;
+        int i5255;
+        int i5256;
+        int i5257;
+        int i5258;
+        int i5259;
+        int i5260;
+        int i5261;
+        int i5262;
+        int i5263;
+        int i5264;
+        int i5265;
+        int i5266;
+        int i5267;
+        int i5268;
+        int i5269;
+        int i5270;
+        int i5271;
+        int i5272;
+        int i5273;
+        int i5274;
+        int i5275;
+        int i5276;
+        int i5277;
+        int i5278;
+        int i5279;
+        int i5280;
+        int i5281;
+        int i5282;
+        int i5283;
+        int i5284;
+        int i5285;
+        int i5286;
+        int i5287;
+        int i5288;
+        int i5289;
+        int i5290;
+        int i5291;
+        int i5292;
+        int i5293;
+        int i5294;
+        int i5295;
+        int i5296;
+        int i5297;
+        int i5298;
+        int i5299;
+        int i5300;
+        int i5301;
+        int i5302;
+        int i5303;
+        int i5304;
+        int i5305;
+        int i5306;
+        int i5307;
+        int i5308;
+        int i5309;
+        int i5310;
+        int i5311;
+        int i5312;
+        int i5313;
+        int i5314;
+        int i5315;
+        int i5316;
+        int i5317;
+        int i5318;
+        int i5319;
+        int i5320;
+        int i5321;
+        int i5322;
+        int i5323;
+        int i5324;
+        int i5325;
+        int i5326;
+        int i5327;
+        int i5328;
+        int i5329;
+        int i5330;
+        int i5331;
+        int i5332;
+        int i5333;
+        int i5334;
+        int i5335;
+        int i5336;
+        int i5337;
+        int i5338;
+        int i5339;
+        int i5340;
+        int i5341;
+        int i5342;
+        int i5343;
+        int i5344;
+        int i5345;
+        int i5346;
+        int i5347;
+        int i5348;
+        int i5349;
+        int i5350;
+        int i5351;
+        int i5352;
+        int i5353;
+        int i5354;
+        int i5355;
+        int i5356;
+        int i5357;
+        int i5358;
+        int i5359;
+        int i5360;
+        int i5361;
+        int i5362;
+        int i5363;
+        int i5364;
+        int i5365;
+        int i5366;
+        int i5367;
+        int i5368;
+        int i5369;
+        int i5370;
+        int i5371;
+        int i5372;
+        int i5373;
+        int i5374;
+        int i5375;
+        int i5376;
+        int i5377;
+        int i5378;
+        int i5379;
+        int i5380;
+        int i5381;
+        int i5382;
+        int i5383;
+        int i5384;
+        int i5385;
+        int i5386;
+        int i5387;
+        int i5388;
+        int i5389;
+        int i5390;
+        int i5391;
+        int i5392;
+        int i5393;
+        int i5394;
+        int i5395;
+        int i5396;
+        int i5397;
+        int i5398;
+        int i5399;
+        int i5400;
+        int i5401;
+        int i5402;
+        int i5403;
+        int i5404;
+        int i5405;
+        int i5406;
+        int i5407;
+        int i5408;
+        int i5409;
+        int i5410;
+        int i5411;
+        int i5412;
+        int i5413;
+        int i5414;
+        int i5415;
+        int i5416;
+        int i5417;
+        int i5418;
+        int i5419;
+        int i5420;
+        int i5421;
+        int i5422;
+        int i5423;
+        int i5424;
+        int i5425;
+        int i5426;
+        int i5427;
+        int i5428;
+        int i5429;
+        int i5430;
+        int i5431;
+        int i5432;
+        int i5433;
+        int i5434;
+        int i5435;
+        int i5436;
+        int i5437;
+        int i5438;
+        int i5439;
+        int i5440;
+        int i5441;
+        int i5442;
+        int i5443;
+        int i5444;
+        int i5445;
+        int i5446;
+        int i5447;
+        int i5448;
+        int i5449;
+        int i5450;
+        int i5451;
+        int i5452;
+        int i5453;
+        int i5454;
+        int i5455;
+        int i5456;
+        int i5457;
+        int i5458;
+        int i5459;
+        int i5460;
+        int i5461;
+        int i5462;
+        int i5463;
+        int i5464;
+        int i5465;
+        int i5466;
+        int i5467;
+        int i5468;
+        int i5469;
+        int i5470;
+        int i5471;
+        int i5472;
+        int i5473;
+        int i5474;
+        int i5475;
+        int i5476;
+        int i5477;
+        int i5478;
+        int i5479;
+        int i5480;
+        int i5481;
+        int i5482;
+        int i5483;
+        int i5484;
+        int i5485;
+        int i5486;
+        int i5487;
+        int i5488;
+        int i5489;
+        int i5490;
+        int i5491;
+        int i5492;
+        int i5493;
+        int i5494;
+        int i5495;
+        int i5496;
+        int i5497;
+        int i5498;
+        int i5499;
+        int i5500;
+        int i5501;
+        int i5502;
+        int i5503;
+        int i5504;
+        int i5505;
+        int i5506;
+        int i5507;
+        int i5508;
+        int i5509;
+        int i5510;
+        int i5511;
+        int i5512;
+        int i5513;
+        int i5514;
+        int i5515;
+        int i5516;
+        int i5517;
+        int i5518;
+        int i5519;
+        int i5520;
+        int i5521;
+        int i5522;
+        int i5523;
+        int i5524;
+        int i5525;
+        int i5526;
+        int i5527;
+        int i5528;
+        int i5529;
+        int i5530;
+        int i5531;
+        int i5532;
+        int i5533;
+        int i5534;
+        int i5535;
+        int i5536;
+        int i5537;
+        int i5538;
+        int i5539;
+        int i5540;
+        int i5541;
+        int i5542;
+        int i5543;
+        int i5544;
+        int i5545;
+        int i5546;
+        int i5547;
+        int i5548;
+        int i5549;
+        int i5550;
+        int i5551;
+        int i5552;
+        int i5553;
+        int i5554;
+        int i5555;
+        int i5556;
+        int i5557;
+        int i5558;
+        int i5559;
+        int i5560;
+        int i5561;
+        int i5562;
+        int i5563;
+        int i5564;
+        int i5565;
+        int i5566;
+        int i5567;
+        int i5568;
+        int i5569;
+        int i5570;
+        int i5571;
+        int i5572;
+        int i5573;
+        int i5574;
+        int i5575;
+        int i5576;
+        int i5577;
+        int i5578;
+        int i5579;
+        int i5580;
+        int i5581;
+        int i5582;
+        int i5583;
+        int i5584;
+        int i5585;
+        int i5586;
+        int i5587;
+        int i5588;
+        int i5589;
+        int i5590;
+        int i5591;
+        int i5592;
+        int i5593;
+        int i5594;
+        int i5595;
+        int i5596;
+        int i5597;
+        int i5598;
+        int i5599;
+        int i5600;
+        int i5601;
+        int i5602;
+        int i5603;
+        int i5604;
+        int i5605;
+        int i5606;
+        int i5607;
+        int i5608;
+        int i5609;
+        int i5610;
+        int i5611;
+        int i5612;
+        int i5613;
+        int i5614;
+        int i5615;
+        int i5616;
+        int i5617;
+        int i5618;
+        int i5619;
+        int i5620;
+        int i5621;
+        int i5622;
+        int i5623;
+        int i5624;
+        int i5625;
+        int i5626;
+        int i5627;
+        int i5628;
+        int i5629;
+        int i5630;
+        int i5631;
+        int i5632;
+        int i5633;
+        int i5634;
+        int i5635;
+        int i5636;
+        int i5637;
+        int i5638;
+        int i5639;
+        int i5640;
+        int i5641;
+        int i5642;
+        int i5643;
+        int i5644;
+        int i5645;
+        int i5646;
+        int i5647;
+        int i5648;
+        int i5649;
+        int i5650;
+        int i5651;
+        int i5652;
+        int i5653;
+        int i5654;
+        int i5655;
+        int i5656;
+        int i5657;
+        int i5658;
+        int i5659;
+        int i5660;
+        int i5661;
+        int i5662;
+        int i5663;
+        int i5664;
+        int i5665;
+        int i5666;
+        int i5667;
+        int i5668;
+        int i5669;
+        int i5670;
+        int i5671;
+        int i5672;
+        int i5673;
+        int i5674;
+        int i5675;
+        int i5676;
+        int i5677;
+        int i5678;
+        int i5679;
+        int i5680;
+        int i5681;
+        int i5682;
+        int i5683;
+        int i5684;
+        int i5685;
+        int i5686;
+        int i5687;
+        int i5688;
+        int i5689;
+        int i5690;
+        int i5691;
+        int i5692;
+        int i5693;
+        int i5694;
+        int i5695;
+        int i5696;
+        int i5697;
+        int i5698;
+        int i5699;
+        int i5700;
+        int i5701;
+        int i5702;
+        int i5703;
+        int i5704;
+        int i5705;
+        int i5706;
+        int i5707;
+        int i5708;
+        int i5709;
+        int i5710;
+        int i5711;
+        int i5712;
+        int i5713;
+        int i5714;
+        int i5715;
+        int i5716;
+        int i5717;
+        int i5718;
+        int i5719;
+        int i5720;
+        int i5721;
+        int i5722;
+        int i5723;
+        int i5724;
+        int i5725;
+        int i5726;
+        int i5727;
+        int i5728;
+        int i5729;
+        int i5730;
+        int i5731;
+        int i5732;
+        int i5733;
+        int i5734;
+        int i5735;
+        int i5736;
+        int i5737;
+        int i5738;
+        int i5739;
+        int i5740;
+        int i5741;
+        int i5742;
+        int i5743;
+        int i5744;
+        int i5745;
+        int i5746;
+        int i5747;
+        int i5748;
+        int i5749;
+        int i5750;
+        int i5751;
+        int i5752;
+        int i5753;
+        int i5754;
+        int i5755;
+        int i5756;
+        int i5757;
+        int i5758;
+        int i5759;
+        int i5760;
+        int i5761;
+        int i5762;
+        int i5763;
+        int i5764;
+        int i5765;
+        int i5766;
+        int i5767;
+        int i5768;
+        int i5769;
+        int i5770;
+        int i5771;
+        int i5772;
+        int i5773;
+        int i5774;
+        int i5775;
+        int i5776;
+        int i5777;
+        int i5778;
+        int i5779;
+        int i5780;
+        int i5781;
+        int i5782;
+        int i5783;
+        int i5784;
+        int i5785;
+        int i5786;
+        int i5787;
+        int i5788;
+        int i5789;
+        int i5790;
+        int i5791;
+        int i5792;
+        int i5793;
+        int i5794;
+        int i5795;
+        int i5796;
+        int i5797;
+        int i5798;
+        int i5799;
+        int i5800;
+        int i5801;
+        int i5802;
+        int i5803;
+        int i5804;
+        int i5805;
+        int i5806;
+        int i5807;
+        int i5808;
+        int i5809;
+        int i5810;
+        int i5811;
+        int i5812;
+        int i5813;
+        int i5814;
+        int i5815;
+        int i5816;
+        int i5817;
+        int i5818;
+        int i5819;
+        int i5820;
+        int i5821;
+        int i5822;
+        int i5823;
+        int i5824;
+        int i5825;
+        int i5826;
+        int i5827;
+        int i5828;
+        int i5829;
+        int i5830;
+        int i5831;
+        int i5832;
+        int i5833;
+        int i5834;
+        int i5835;
+        int i5836;
+        int i5837;
+        int i5838;
+        int i5839;
+        int i5840;
+        int i5841;
+        int i5842;
+        int i5843;
+        int i5844;
+        int i5845;
+        int i5846;
+        int i5847;
+        int i5848;
+        int i5849;
+        int i5850;
+        int i5851;
+        int i5852;
+        int i5853;
+        int i5854;
+        int i5855;
+        int i5856;
+        int i5857;
+        int i5858;
+        int i5859;
+        int i5860;
+        int i5861;
+        int i5862;
+        int i5863;
+        int i5864;
+        int i5865;
+        int i5866;
+        int i5867;
+        int i5868;
+        int i5869;
+        int i5870;
+        int i5871;
+        int i5872;
+        int i5873;
+        int i5874;
+        int i5875;
+        int i5876;
+        int i5877;
+        int i5878;
+        int i5879;
+        int i5880;
+        int i5881;
+        int i5882;
+        int i5883;
+        int i5884;
+        int i5885;
+        int i5886;
+        int i5887;
+        int i5888;
+        int i5889;
+        int i5890;
+        int i5891;
+        int i5892;
+        int i5893;
+        int i5894;
+        int i5895;
+        int i5896;
+        int i5897;
+        int i5898;
+        int i5899;
+        int i5900;
+        int i5901;
+        int i5902;
+        int i5903;
+        int i5904;
+        int i5905;
+        int i5906;
+        int i5907;
+        int i5908;
+        int i5909;
+        int i5910;
+        int i5911;
+        int i5912;
+        int i5913;
+        int i5914;
+        int i5915;
+        int i5916;
+        int i5917;
+        int i5918;
+        int i5919;
+        int i5920;
+        int i5921;
+        int i5922;
+        int i5923;
+        int i5924;
+        int i5925;
+        int i5926;
+        int i5927;
+        int i5928;
+        int i5929;
+        int i5930;
+        int i5931;
+        int i5932;
+        int i5933;
+        int i5934;
+        int i5935;
+        int i5936;
+        int i5937;
+        int i5938;
+        int i5939;
+        int i5940;
+        int i5941;
+        int i5942;
+        int i5943;
+        int i5944;
+        int i5945;
+        int i5946;
+        int i5947;
+        int i5948;
+        int i5949;
+        int i5950;
+        int i5951;
+        int i5952;
+        int i5953;
+        int i5954;
+        int i5955;
+        int i5956;
+        int i5957;
+        int i5958;
+        int i5959;
+        int i5960;
+        int i5961;
+        int i5962;
+        int i5963;
+        int i5964;
+        int i5965;
+        int i5966;
+        int i5967;
+        int i5968;
+        int i5969;
+        int i5970;
+        int i5971;
+        int i5972;
+        int i5973;
+        int i5974;
+        int i5975;
+        int i5976;
+        int i5977;
+        int i5978;
+        int i5979;
+        int i5980;
+        int i5981;
+        int i5982;
+        int i5983;
+        int i5984;
+        int i5985;
+        int i5986;
+        int i5987;
+        int i5988;
+        int i5989;
+        int i5990;
+        int i5991;
+        int i5992;
+        int i5993;
+        int i5994;
+        int i5995;
+        int i5996;
+        int i5997;
+        int i5998;
+        int i5999;
+        int i6000;
+        int i6001;
+        int i6002;
+        int i6003;
+        int i6004;
+        int i6005;
+        int i6006;
+        int i6007;
+        int i6008;
+        int i6009;
+        int i6010;
+        int i6011;
+        int i6012;
+        int i6013;
+        int i6014;
+        int i6015;
+        int i6016;
+        int i6017;
+        int i6018;
+        int i6019;
+        int i6020;
+        int i6021;
+        int i6022;
+        int i6023;
+        int i6024;
+        int i6025;
+        int i6026;
+        int i6027;
+        int i6028;
+        int i6029;
+        int i6030;
+        int i6031;
+        int i6032;
+        int i6033;
+        int i6034;
+        int i6035;
+        int i6036;
+        int i6037;
+        int i6038;
+        int i6039;
+        int i6040;
+        int i6041;
+        int i6042;
+        int i6043;
+        int i6044;
+        int i6045;
+        int i6046;
+        int i6047;
+        int i6048;
+        int i6049;
+        int i6050;
+        int i6051;
+        int i6052;
+        int i6053;
+        int i6054;
+        int i6055;
+        int i6056;
+        int i6057;
+        int i6058;
+        int i6059;
+        int i6060;
+        int i6061;
+        int i6062;
+        int i6063;
+        int i6064;
+        int i6065;
+        int i6066;
+        int i6067;
+        int i6068;
+        int i6069;
+        int i6070;
+        int i6071;
+        int i6072;
+        int i6073;
+        int i6074;
+        int i6075;
+        int i6076;
+        int i6077;
+        int i6078;
+        int i6079;
+        int i6080;
+        int i6081;
+        int i6082;
+        int i6083;
+        int i6084;
+        int i6085;
+        int i6086;
+        int i6087;
+        int i6088;
+        int i6089;
+        int i6090;
+        int i6091;
+        int i6092;
+        int i6093;
+        int i6094;
+        int i6095;
+        int i6096;
+        int i6097;
+        int i6098;
+        int i6099;
+        int i6100;
+        int i6101;
+        int i6102;
+        int i6103;
+        int i6104;
+        int i6105;
+        int i6106;
+        int i6107;
+        int i6108;
+        int i6109;
+        int i6110;
+        int i6111;
+        int i6112;
+        int i6113;
+        int i6114;
+        int i6115;
+        int i6116;
+        int i6117;
+        int i6118;
+        int i6119;
+        int i6120;
+        int i6121;
+        int i6122;
+        int i6123;
+        int i6124;
+        int i6125;
+        int i6126;
+        int i6127;
+        int i6128;
+        int i6129;
+        int i6130;
+        int i6131;
+        int i6132;
+        int i6133;
+        int i6134;
+        int i6135;
+        int i6136;
+        int i6137;
+        int i6138;
+        int i6139;
+        int i6140;
+        int i6141;
+        int i6142;
+        int i6143;
+        int i6144;
+        int i6145;
+        int i6146;
+        int i6147;
+        int i6148;
+        int i6149;
+        int i6150;
+        int i6151;
+        int i6152;
+        int i6153;
+        int i6154;
+        int i6155;
+        int i6156;
+        int i6157;
+        int i6158;
+        int i6159;
+        int i6160;
+        int i6161;
+        int i6162;
+        int i6163;
+        int i6164;
+        int i6165;
+        int i6166;
+        int i6167;
+        int i6168;
+        int i6169;
+        int i6170;
+        int i6171;
+        int i6172;
+        int i6173;
+        int i6174;
+        int i6175;
+        int i6176;
+        int i6177;
+        int i6178;
+        int i6179;
+        int i6180;
+        int i6181;
+        int i6182;
+        int i6183;
+        int i6184;
+        int i6185;
+        int i6186;
+        int i6187;
+        int i6188;
+        int i6189;
+        int i6190;
+        int i6191;
+        int i6192;
+        int i6193;
+        int i6194;
+        int i6195;
+        int i6196;
+        int i6197;
+        int i6198;
+        int i6199;
+        int i6200;
+        int i6201;
+        int i6202;
+        int i6203;
+        int i6204;
+        int i6205;
+        int i6206;
+        int i6207;
+        int i6208;
+        int i6209;
+        int i6210;
+        int i6211;
+        int i6212;
+        int i6213;
+        int i6214;
+        int i6215;
+        int i6216;
+        int i6217;
+        int i6218;
+        int i6219;
+        int i6220;
+        int i6221;
+        int i6222;
+        int i6223;
+        int i6224;
+        int i6225;
+        int i6226;
+        int i6227;
+        int i6228;
+        int i6229;
+        int i6230;
+        int i6231;
+        int i6232;
+        int i6233;
+        int i6234;
+        int i6235;
+        int i6236;
+        int i6237;
+        int i6238;
+        int i6239;
+        int i6240;
+        int i6241;
+        int i6242;
+        int i6243;
+        int i6244;
+        int i6245;
+        int i6246;
+        int i6247;
+        int i6248;
+        int i6249;
+        int i6250;
+        int i6251;
+        int i6252;
+        int i6253;
+        int i6254;
+        int i6255;
+        int i6256;
+        int i6257;
+        int i6258;
+        int i6259;
+        int i6260;
+        int i6261;
+        int i6262;
+        int i6263;
+        int i6264;
+        int i6265;
+        int i6266;
+        int i6267;
+        int i6268;
+        int i6269;
+        int i6270;
+        int i6271;
+        int i6272;
+        int i6273;
+        int i6274;
+        int i6275;
+        int i6276;
+        int i6277;
+        int i6278;
+        int i6279;
+        int i6280;
+        int i6281;
+        int i6282;
+        int i6283;
+        int i6284;
+        int i6285;
+        int i6286;
+        int i6287;
+        int i6288;
+        int i6289;
+        int i6290;
+        int i6291;
+        int i6292;
+        int i6293;
+        int i6294;
+        int i6295;
+        int i6296;
+        int i6297;
+        int i6298;
+        int i6299;
+        int i6300;
+        int i6301;
+        int i6302;
+        int i6303;
+        int i6304;
+        int i6305;
+        int i6306;
+        int i6307;
+        int i6308;
+        int i6309;
+        int i6310;
+        int i6311;
+        int i6312;
+        int i6313;
+        int i6314;
+        int i6315;
+        int i6316;
+        int i6317;
+        int i6318;
+        int i6319;
+        int i6320;
+        int i6321;
+        int i6322;
+        int i6323;
+        int i6324;
+        int i6325;
+        int i6326;
+        int i6327;
+        int i6328;
+        int i6329;
+        int i6330;
+        int i6331;
+        int i6332;
+        int i6333;
+        int i6334;
+        int i6335;
+        int i6336;
+        int i6337;
+        int i6338;
+        int i6339;
+        int i6340;
+        int i6341;
+        int i6342;
+        int i6343;
+        int i6344;
+        int i6345;
+        int i6346;
+        int i6347;
+        int i6348;
+        int i6349;
+        int i6350;
+        int i6351;
+        int i6352;
+        int i6353;
+        int i6354;
+        int i6355;
+        int i6356;
+        int i6357;
+        int i6358;
+        int i6359;
+        int i6360;
+        int i6361;
+        int i6362;
+        int i6363;
+        int i6364;
+        int i6365;
+        int i6366;
+        int i6367;
+        int i6368;
+        int i6369;
+        int i6370;
+        int i6371;
+        int i6372;
+        int i6373;
+        int i6374;
+        int i6375;
+        int i6376;
+        int i6377;
+        int i6378;
+        int i6379;
+        int i6380;
+        int i6381;
+        int i6382;
+        int i6383;
+        int i6384;
+        int i6385;
+        int i6386;
+        int i6387;
+        int i6388;
+        int i6389;
+        int i6390;
+        int i6391;
+        int i6392;
+        int i6393;
+        int i6394;
+        int i6395;
+        int i6396;
+        int i6397;
+        int i6398;
+        int i6399;
+        int i6400;
+        int i6401;
+        int i6402;
+        int i6403;
+        int i6404;
+        int i6405;
+        int i6406;
+        int i6407;
+        int i6408;
+        int i6409;
+        int i6410;
+        int i6411;
+        int i6412;
+        int i6413;
+        int i6414;
+        int i6415;
+        int i6416;
+        int i6417;
+        int i6418;
+        int i6419;
+        int i6420;
+        int i6421;
+        int i6422;
+        int i6423;
+        int i6424;
+        int i6425;
+        int i6426;
+        int i6427;
+        int i6428;
+        int i6429;
+        int i6430;
+        int i6431;
+        int i6432;
+        int i6433;
+        int i6434;
+        int i6435;
+        int i6436;
+        int i6437;
+        int i6438;
+        int i6439;
+        int i6440;
+        int i6441;
+        int i6442;
+        int i6443;
+        int i6444;
+        int i6445;
+        int i6446;
+        int i6447;
+        int i6448;
+        int i6449;
+        int i6450;
+        int i6451;
+        int i6452;
+        int i6453;
+        int i6454;
+        int i6455;
+        int i6456;
+        int i6457;
+        int i6458;
+        int i6459;
+        int i6460;
+        int i6461;
+        int i6462;
+        int i6463;
+        int i6464;
+        int i6465;
+        int i6466;
+        int i6467;
+        int i6468;
+        int i6469;
+        int i6470;
+        int i6471;
+        int i6472;
+        int i6473;
+        int i6474;
+        int i6475;
+        int i6476;
+        int i6477;
+        int i6478;
+        int i6479;
+        int i6480;
+        int i6481;
+        int i6482;
+        int i6483;
+        int i6484;
+        int i6485;
+        int i6486;
+        int i6487;
+        int i6488;
+        int i6489;
+        int i6490;
+        int i6491;
+        int i6492;
+        int i6493;
+        int i6494;
+        int i6495;
+        int i6496;
+        int i6497;
+        int i6498;
+        int i6499;
+        int i6500;
+        int i6501;
+        int i6502;
+        int i6503;
+        int i6504;
+        int i6505;
+        int i6506;
+        int i6507;
+        int i6508;
+        int i6509;
+        int i6510;
+        int i6511;
+        int i6512;
+        int i6513;
+        int i6514;
+        int i6515;
+        int i6516;
+        int i6517;
+        int i6518;
+        int i6519;
+        int i6520;
+        int i6521;
+        int i6522;
+        int i6523;
+        int i6524;
+        int i6525;
+        int i6526;
+        int i6527;
+        int i6528;
+        int i6529;
+        int i6530;
+        int i6531;
+        int i6532;
+        int i6533;
+        int i6534;
+        int i6535;
+        int i6536;
+        int i6537;
+        int i6538;
+        int i6539;
+        int i6540;
+        int i6541;
+        int i6542;
+        int i6543;
+        int i6544;
+        int i6545;
+        int i6546;
+        int i6547;
+        int i6548;
+        int i6549;
+        int i6550;
+        int i6551;
+        int i6552;
+        int i6553;
+        int i6554;
+        int i6555;
+        int i6556;
+        int i6557;
+        int i6558;
+        int i6559;
+        int i6560;
+        int i6561;
+        int i6562;
+        int i6563;
+        int i6564;
+        int i6565;
+        int i6566;
+        int i6567;
+        int i6568;
+        int i6569;
+        int i6570;
+        int i6571;
+        int i6572;
+        int i6573;
+        int i6574;
+        int i6575;
+        int i6576;
+        int i6577;
+        int i6578;
+        int i6579;
+        int i6580;
+        int i6581;
+        int i6582;
+        int i6583;
+        int i6584;
+        int i6585;
+        int i6586;
+        int i6587;
+        int i6588;
+        int i6589;
+        int i6590;
+        int i6591;
+        int i6592;
+        int i6593;
+        int i6594;
+        int i6595;
+        int i6596;
+        int i6597;
+        int i6598;
+        int i6599;
+        int i6600;
+        int i6601;
+        int i6602;
+        int i6603;
+        int i6604;
+        int i6605;
+        int i6606;
+        int i6607;
+        int i6608;
+        int i6609;
+        int i6610;
+        int i6611;
+        int i6612;
+        int i6613;
+        int i6614;
+        int i6615;
+        int i6616;
+        int i6617;
+        int i6618;
+        int i6619;
+        int i6620;
+        int i6621;
+        int i6622;
+        int i6623;
+        int i6624;
+        int i6625;
+        int i6626;
+        int i6627;
+        int i6628;
+        int i6629;
+        int i6630;
+        int i6631;
+        int i6632;
+        int i6633;
+        int i6634;
+        int i6635;
+        int i6636;
+        int i6637;
+        int i6638;
+        int i6639;
+        int i6640;
+        int i6641;
+        int i6642;
+        int i6643;
+        int i6644;
+        int i6645;
+        int i6646;
+        int i6647;
+        int i6648;
+        int i6649;
+        int i6650;
+        int i6651;
+        int i6652;
+        int i6653;
+        int i6654;
+        int i6655;
+        int i6656;
+        int i6657;
+        int i6658;
+        int i6659;
+        int i6660;
+        int i6661;
+        int i6662;
+        int i6663;
+        int i6664;
+        int i6665;
+        int i6666;
+        int i6667;
+        int i6668;
+        int i6669;
+        int i6670;
+        int i6671;
+        int i6672;
+        int i6673;
+        int i6674;
+        int i6675;
+        int i6676;
+        int i6677;
+        int i6678;
+        int i6679;
+        int i6680;
+        int i6681;
+        int i6682;
+        int i6683;
+        int i6684;
+        int i6685;
+        int i6686;
+        int i6687;
+        int i6688;
+        int i6689;
+        int i6690;
+        int i6691;
+        int i6692;
+        int i6693;
+        int i6694;
+        int i6695;
+        int i6696;
+        int i6697;
+        int i6698;
+        int i6699;
+        int i6700;
+        int i6701;
+        int i6702;
+        int i6703;
+        int i6704;
+        int i6705;
+        int i6706;
+        int i6707;
+        int i6708;
+        int i6709;
+        int i6710;
+        int i6711;
+        int i6712;
+        int i6713;
+        int i6714;
+        int i6715;
+        int i6716;
+        int i6717;
+        int i6718;
+        int i6719;
+        int i6720;
+        int i6721;
+        int i6722;
+        int i6723;
+        int i6724;
+        int i6725;
+        int i6726;
+        int i6727;
+        int i6728;
+        int i6729;
+        int i6730;
+        int i6731;
+        int i6732;
+        int i6733;
+        int i6734;
+        int i6735;
+        int i6736;
+        int i6737;
+        int i6738;
+        int i6739;
+        int i6740;
+        int i6741;
+        int i6742;
+        int i6743;
+        int i6744;
+        int i6745;
+        int i6746;
+        int i6747;
+        int i6748;
+        int i6749;
+        int i6750;
+        int i6751;
+        int i6752;
+        int i6753;
+        int i6754;
+        int i6755;
+        int i6756;
+        int i6757;
+        int i6758;
+        int i6759;
+        int i6760;
+        int i6761;
+        int i6762;
+        int i6763;
+        int i6764;
+        int i6765;
+        int i6766;
+        int i6767;
+        int i6768;
+        int i6769;
+        int i6770;
+        int i6771;
+        int i6772;
+        int i6773;
+        int i6774;
+        int i6775;
+        int i6776;
+        int i6777;
+        int i6778;
+        int i6779;
+        int i6780;
+        int i6781;
+        int i6782;
+        int i6783;
+        int i6784;
+        int i6785;
+        int i6786;
+        int i6787;
+        int i6788;
+        int i6789;
+        int i6790;
+        int i6791;
+        int i6792;
+        int i6793;
+        int i6794;
+        int i6795;
+        int i6796;
+        int i6797;
+        int i6798;
+        int i6799;
+        int i6800;
+        int i6801;
+        int i6802;
+        int i6803;
+        int i6804;
+        int i6805;
+        int i6806;
+        int i6807;
+        int i6808;
+        int i6809;
+        int i6810;
+        int i6811;
+        int i6812;
+        int i6813;
+        int i6814;
+        int i6815;
+        int i6816;
+        int i6817;
+        int i6818;
+        int i6819;
+        int i6820;
+        int i6821;
+        int i6822;
+        int i6823;
+        int i6824;
+        int i6825;
+        int i6826;
+        int i6827;
+        int i6828;
+        int i6829;
+        int i6830;
+        int i6831;
+        int i6832;
+        int i6833;
+        int i6834;
+        int i6835;
+        int i6836;
+        int i6837;
+        int i6838;
+        int i6839;
+        int i6840;
+        int i6841;
+        int i6842;
+        int i6843;
+        int i6844;
+        int i6845;
+        int i6846;
+        int i6847;
+        int i6848;
+        int i6849;
+        int i6850;
+        int i6851;
+        int i6852;
+        int i6853;
+        int i6854;
+        int i6855;
+        int i6856;
+        int i6857;
+        int i6858;
+        int i6859;
+        int i6860;
+        int i6861;
+        int i6862;
+        int i6863;
+        int i6864;
+        int i6865;
+        int i6866;
+        int i6867;
+        int i6868;
+        int i6869;
+        int i6870;
+        int i6871;
+        int i6872;
+        int i6873;
+        int i6874;
+        int i6875;
+        int i6876;
+        int i6877;
+        int i6878;
+        int i6879;
+        int i6880;
+        int i6881;
+        int i6882;
+        int i6883;
+        int i6884;
+        int i6885;
+        int i6886;
+        int i6887;
+        int i6888;
+        int i6889;
+        int i6890;
+        int i6891;
+        int i6892;
+        int i6893;
+        int i6894;
+        int i6895;
+        int i6896;
+        int i6897;
+        int i6898;
+        int i6899;
+        int i6900;
+        int i6901;
+        int i6902;
+        int i6903;
+        int i6904;
+        int i6905;
+        int i6906;
+        int i6907;
+        int i6908;
+        int i6909;
+        int i6910;
+        int i6911;
+        int i6912;
+        int i6913;
+        int i6914;
+        int i6915;
+        int i6916;
+        int i6917;
+        int i6918;
+        int i6919;
+        int i6920;
+        int i6921;
+        int i6922;
+        int i6923;
+        int i6924;
+        int i6925;
+        int i6926;
+        int i6927;
+        int i6928;
+        int i6929;
+        int i6930;
+        int i6931;
+        int i6932;
+        int i6933;
+        int i6934;
+        int i6935;
+        int i6936;
+        int i6937;
+        int i6938;
+        int i6939;
+        int i6940;
+        int i6941;
+        int i6942;
+        int i6943;
+        int i6944;
+        int i6945;
+        int i6946;
+        int i6947;
+        int i6948;
+        int i6949;
+        int i6950;
+        int i6951;
+        int i6952;
+        int i6953;
+        int i6954;
+        int i6955;
+        int i6956;
+        int i6957;
+        int i6958;
+        int i6959;
+        int i6960;
+        int i6961;
+        int i6962;
+        int i6963;
+        int i6964;
+        int i6965;
+        int i6966;
+        int i6967;
+        int i6968;
+        int i6969;
+        int i6970;
+        int i6971;
+        int i6972;
+        int i6973;
+        int i6974;
+        int i6975;
+        int i6976;
+        int i6977;
+        int i6978;
+        int i6979;
+        int i6980;
+        int i6981;
+        int i6982;
+        int i6983;
+        int i6984;
+        int i6985;
+        int i6986;
+        int i6987;
+        int i6988;
+        int i6989;
+        int i6990;
+        int i6991;
+        int i6992;
+        int i6993;
+        int i6994;
+        int i6995;
+        int i6996;
+        int i6997;
+        int i6998;
+        int i6999;
+        int i7000;
+        int i7001;
+        int i7002;
+        int i7003;
+        int i7004;
+        int i7005;
+        int i7006;
+        int i7007;
+        int i7008;
+        int i7009;
+        int i7010;
+        int i7011;
+        int i7012;
+        int i7013;
+        int i7014;
+        int i7015;
+        int i7016;
+        int i7017;
+        int i7018;
+        int i7019;
+        int i7020;
+        int i7021;
+        int i7022;
+        int i7023;
+        int i7024;
+        int i7025;
+        int i7026;
+        int i7027;
+        int i7028;
+        int i7029;
+        int i7030;
+        int i7031;
+        int i7032;
+        int i7033;
+        int i7034;
+        int i7035;
+        int i7036;
+        int i7037;
+        int i7038;
+        int i7039;
+        int i7040;
+        int i7041;
+        int i7042;
+        int i7043;
+        int i7044;
+        int i7045;
+        int i7046;
+        int i7047;
+        int i7048;
+        int i7049;
+        int i7050;
+        int i7051;
+        int i7052;
+        int i7053;
+        int i7054;
+        int i7055;
+        int i7056;
+        int i7057;
+        int i7058;
+        int i7059;
+        int i7060;
+        int i7061;
+        int i7062;
+        int i7063;
+        int i7064;
+        int i7065;
+        int i7066;
+        int i7067;
+        int i7068;
+        int i7069;
+        int i7070;
+        int i7071;
+        int i7072;
+        int i7073;
+        int i7074;
+        int i7075;
+        int i7076;
+        int i7077;
+        int i7078;
+        int i7079;
+        int i7080;
+        int i7081;
+        int i7082;
+        int i7083;
+        int i7084;
+        int i7085;
+        int i7086;
+        int i7087;
+        int i7088;
+        int i7089;
+        int i7090;
+        int i7091;
+        int i7092;
+        int i7093;
+        int i7094;
+        int i7095;
+        int i7096;
+        int i7097;
+        int i7098;
+        int i7099;
+        int i7100;
+        int i7101;
+        int i7102;
+        int i7103;
+        int i7104;
+        int i7105;
+        int i7106;
+        int i7107;
+        int i7108;
+        int i7109;
+        int i7110;
+        int i7111;
+        int i7112;
+        int i7113;
+        int i7114;
+        int i7115;
+        int i7116;
+        int i7117;
+        int i7118;
+        int i7119;
+        int i7120;
+        int i7121;
+        int i7122;
+        int i7123;
+        int i7124;
+        int i7125;
+        int i7126;
+        int i7127;
+        int i7128;
+        int i7129;
+        int i7130;
+        int i7131;
+        int i7132;
+        int i7133;
+        int i7134;
+        int i7135;
+        int i7136;
+        int i7137;
+        int i7138;
+        int i7139;
+        int i7140;
+        int i7141;
+        int i7142;
+        int i7143;
+        int i7144;
+        int i7145;
+        int i7146;
+        int i7147;
+        int i7148;
+        int i7149;
+        int i7150;
+        int i7151;
+        int i7152;
+        int i7153;
+        int i7154;
+        int i7155;
+        int i7156;
+        int i7157;
+        int i7158;
+        int i7159;
+        int i7160;
+        int i7161;
+        int i7162;
+        int i7163;
+        int i7164;
+        int i7165;
+        int i7166;
+        int i7167;
+        int i7168;
+        int i7169;
+        int i7170;
+        int i7171;
+        int i7172;
+        int i7173;
+        int i7174;
+        int i7175;
+        int i7176;
+        int i7177;
+        int i7178;
+        int i7179;
+        int i7180;
+        int i7181;
+        int i7182;
+        int i7183;
+        int i7184;
+        int i7185;
+        int i7186;
+        int i7187;
+        int i7188;
+        int i7189;
+        int i7190;
+        int i7191;
+        int i7192;
+        int i7193;
+        int i7194;
+        int i7195;
+        int i7196;
+        int i7197;
+        int i7198;
+        int i7199;
+        int i7200;
+        int i7201;
+        int i7202;
+        int i7203;
+        int i7204;
+        int i7205;
+        int i7206;
+        int i7207;
+        int i7208;
+        int i7209;
+        int i7210;
+        int i7211;
+        int i7212;
+        int i7213;
+        int i7214;
+        int i7215;
+        int i7216;
+        int i7217;
+        int i7218;
+        int i7219;
+        int i7220;
+        int i7221;
+        int i7222;
+        int i7223;
+        int i7224;
+        int i7225;
+        int i7226;
+        int i7227;
+        int i7228;
+        int i7229;
+        int i7230;
+        int i7231;
+        int i7232;
+        int i7233;
+        int i7234;
+        int i7235;
+        int i7236;
+        int i7237;
+        int i7238;
+        int i7239;
+        int i7240;
+        int i7241;
+        int i7242;
+        int i7243;
+        int i7244;
+        int i7245;
+        int i7246;
+        int i7247;
+        int i7248;
+        int i7249;
+        int i7250;
+        int i7251;
+        int i7252;
+        int i7253;
+        int i7254;
+        int i7255;
+        int i7256;
+        int i7257;
+        int i7258;
+        int i7259;
+        int i7260;
+        int i7261;
+        int i7262;
+        int i7263;
+        int i7264;
+        int i7265;
+        int i7266;
+        int i7267;
+        int i7268;
+        int i7269;
+        int i7270;
+        int i7271;
+        int i7272;
+        int i7273;
+        int i7274;
+        int i7275;
+        int i7276;
+        int i7277;
+        int i7278;
+        int i7279;
+        int i7280;
+        int i7281;
+        int i7282;
+        int i7283;
+        int i7284;
+        int i7285;
+        int i7286;
+        int i7287;
+        int i7288;
+        int i7289;
+        int i7290;
+        int i7291;
+        int i7292;
+        int i7293;
+        int i7294;
+        int i7295;
+        int i7296;
+        int i7297;
+        int i7298;
+        int i7299;
+        int i7300;
+        int i7301;
+        int i7302;
+        int i7303;
+        int i7304;
+        int i7305;
+        int i7306;
+        int i7307;
+        int i7308;
+        int i7309;
+        int i7310;
+        int i7311;
+        int i7312;
+        int i7313;
+        int i7314;
+        int i7315;
+        int i7316;
+        int i7317;
+        int i7318;
+        int i7319;
+        int i7320;
+        int i7321;
+        int i7322;
+        int i7323;
+        int i7324;
+        int i7325;
+        int i7326;
+        int i7327;
+        int i7328;
+        int i7329;
+        int i7330;
+        int i7331;
+        int i7332;
+        int i7333;
+        int i7334;
+        int i7335;
+        int i7336;
+        int i7337;
+        int i7338;
+        int i7339;
+        int i7340;
+        int i7341;
+        int i7342;
+        int i7343;
+        int i7344;
+        int i7345;
+        int i7346;
+        int i7347;
+        int i7348;
+        int i7349;
+        int i7350;
+        int i7351;
+        int i7352;
+        int i7353;
+        int i7354;
+        int i7355;
+        int i7356;
+        int i7357;
+        int i7358;
+        int i7359;
+        int i7360;
+        int i7361;
+        int i7362;
+        int i7363;
+        int i7364;
+        int i7365;
+        int i7366;
+        int i7367;
+        int i7368;
+        int i7369;
+        int i7370;
+        int i7371;
+        int i7372;
+        int i7373;
+        int i7374;
+        int i7375;
+        int i7376;
+        int i7377;
+        int i7378;
+        int i7379;
+        int i7380;
+        int i7381;
+        int i7382;
+        int i7383;
+        int i7384;
+        int i7385;
+        int i7386;
+        int i7387;
+        int i7388;
+        int i7389;
+        int i7390;
+        int i7391;
+        int i7392;
+        int i7393;
+        int i7394;
+        int i7395;
+        int i7396;
+        int i7397;
+        int i7398;
+        int i7399;
+        int i7400;
+        int i7401;
+        int i7402;
+        int i7403;
+        int i7404;
+        int i7405;
+        int i7406;
+        int i7407;
+        int i7408;
+        int i7409;
+        int i7410;
+        int i7411;
+        int i7412;
+        int i7413;
+        int i7414;
+        int i7415;
+        int i7416;
+        int i7417;
+        int i7418;
+        int i7419;
+        int i7420;
+        int i7421;
+        int i7422;
+        int i7423;
+        int i7424;
+        int i7425;
+        int i7426;
+        int i7427;
+        int i7428;
+        int i7429;
+        int i7430;
+        int i7431;
+        int i7432;
+        int i7433;
+        int i7434;
+        int i7435;
+        int i7436;
+        int i7437;
+        int i7438;
+        int i7439;
+        int i7440;
+        int i7441;
+        int i7442;
+        int i7443;
+        int i7444;
+        int i7445;
+        int i7446;
+        int i7447;
+        int i7448;
+        int i7449;
+        int i7450;
+        int i7451;
+        int i7452;
+        int i7453;
+        int i7454;
+        int i7455;
+        int i7456;
+        int i7457;
+        int i7458;
+        int i7459;
+        int i7460;
+        int i7461;
+        int i7462;
+        int i7463;
+        int i7464;
+        int i7465;
+        int i7466;
+        int i7467;
+        int i7468;
+        int i7469;
+        int i7470;
+        int i7471;
+        int i7472;
+        int i7473;
+        int i7474;
+        int i7475;
+        int i7476;
+        int i7477;
+        int i7478;
+        int i7479;
+        int i7480;
+        int i7481;
+        int i7482;
+        int i7483;
+        int i7484;
+        int i7485;
+        int i7486;
+        int i7487;
+        int i7488;
+        int i7489;
+        int i7490;
+        int i7491;
+        int i7492;
+        int i7493;
+        int i7494;
+        int i7495;
+        int i7496;
+        int i7497;
+        int i7498;
+        int i7499;
+        int i7500;
+        int i7501;
+        int i7502;
+        int i7503;
+        int i7504;
+        int i7505;
+        int i7506;
+        int i7507;
+        int i7508;
+        int i7509;
+        int i7510;
+        int i7511;
+        int i7512;
+        int i7513;
+        int i7514;
+        int i7515;
+        int i7516;
+        int i7517;
+        int i7518;
+        int i7519;
+        int i7520;
+        int i7521;
+        int i7522;
+        int i7523;
+        int i7524;
+        int i7525;
+        int i7526;
+        int i7527;
+        int i7528;
+        int i7529;
+        int i7530;
+        int i7531;
+        int i7532;
+        int i7533;
+        int i7534;
+        int i7535;
+        int i7536;
+        int i7537;
+        int i7538;
+        int i7539;
+        int i7540;
+        int i7541;
+        int i7542;
+        int i7543;
+        int i7544;
+        int i7545;
+        int i7546;
+        int i7547;
+        int i7548;
+        int i7549;
+        int i7550;
+        int i7551;
+        int i7552;
+        int i7553;
+        int i7554;
+        int i7555;
+        int i7556;
+        int i7557;
+        int i7558;
+        int i7559;
+        int i7560;
+        int i7561;
+        int i7562;
+        int i7563;
+        int i7564;
+        int i7565;
+        int i7566;
+        int i7567;
+        int i7568;
+        int i7569;
+        int i7570;
+        int i7571;
+        int i7572;
+        int i7573;
+        int i7574;
+        int i7575;
+        int i7576;
+        int i7577;
+        int i7578;
+        int i7579;
+        int i7580;
+        int i7581;
+        int i7582;
+        int i7583;
+        int i7584;
+        int i7585;
+        int i7586;
+        int i7587;
+        int i7588;
+        int i7589;
+        int i7590;
+        int i7591;
+        int i7592;
+        int i7593;
+        int i7594;
+        int i7595;
+        int i7596;
+        int i7597;
+        int i7598;
+        int i7599;
+        int i7600;
+        int i7601;
+        int i7602;
+        int i7603;
+        int i7604;
+        int i7605;
+        int i7606;
+        int i7607;
+        int i7608;
+        int i7609;
+        int i7610;
+        int i7611;
+        int i7612;
+        int i7613;
+        int i7614;
+        int i7615;
+        int i7616;
+        int i7617;
+        int i7618;
+        int i7619;
+        int i7620;
+        int i7621;
+        int i7622;
+        int i7623;
+        int i7624;
+        int i7625;
+        int i7626;
+        int i7627;
+        int i7628;
+        int i7629;
+        int i7630;
+        int i7631;
+        int i7632;
+        int i7633;
+        int i7634;
+        int i7635;
+        int i7636;
+        int i7637;
+        int i7638;
+        int i7639;
+        int i7640;
+        int i7641;
+        int i7642;
+        int i7643;
+        int i7644;
+        int i7645;
+        int i7646;
+        int i7647;
+        int i7648;
+        int i7649;
+        int i7650;
+        int i7651;
+        int i7652;
+        int i7653;
+        int i7654;
+        int i7655;
+        int i7656;
+        int i7657;
+        int i7658;
+        int i7659;
+        int i7660;
+        int i7661;
+        int i7662;
+        int i7663;
+        int i7664;
+        int i7665;
+        int i7666;
+        int i7667;
+        int i7668;
+        int i7669;
+        int i7670;
+        int i7671;
+        int i7672;
+        int i7673;
+        int i7674;
+        int i7675;
+        int i7676;
+        int i7677;
+        int i7678;
+        int i7679;
+        int i7680;
+        int i7681;
+        int i7682;
+        int i7683;
+        int i7684;
+        int i7685;
+        int i7686;
+        int i7687;
+        int i7688;
+        int i7689;
+        int i7690;
+        int i7691;
+        int i7692;
+        int i7693;
+        int i7694;
+        int i7695;
+        int i7696;
+        int i7697;
+        int i7698;
+        int i7699;
+        int i7700;
+        int i7701;
+        int i7702;
+        int i7703;
+        int i7704;
+        int i7705;
+        int i7706;
+        int i7707;
+        int i7708;
+        int i7709;
+        int i7710;
+        int i7711;
+        int i7712;
+        int i7713;
+        int i7714;
+        int i7715;
+        int i7716;
+        int i7717;
+        int i7718;
+        int i7719;
+        int i7720;
+        int i7721;
+        int i7722;
+        int i7723;
+        int i7724;
+        int i7725;
+        int i7726;
+        int i7727;
+        int i7728;
+        int i7729;
+        int i7730;
+        int i7731;
+        int i7732;
+        int i7733;
+        int i7734;
+        int i7735;
+        int i7736;
+        int i7737;
+        int i7738;
+        int i7739;
+        int i7740;
+        int i7741;
+        int i7742;
+        int i7743;
+        int i7744;
+        int i7745;
+        int i7746;
+        int i7747;
+        int i7748;
+        int i7749;
+        int i7750;
+        int i7751;
+        int i7752;
+        int i7753;
+        int i7754;
+        int i7755;
+        int i7756;
+        int i7757;
+        int i7758;
+        int i7759;
+        int i7760;
+        int i7761;
+        int i7762;
+        int i7763;
+        int i7764;
+        int i7765;
+        int i7766;
+        int i7767;
+        int i7768;
+        int i7769;
+        int i7770;
+        int i7771;
+        int i7772;
+        int i7773;
+        int i7774;
+        int i7775;
+        int i7776;
+        int i7777;
+        int i7778;
+        int i7779;
+        int i7780;
+        int i7781;
+        int i7782;
+        int i7783;
+        int i7784;
+        int i7785;
+        int i7786;
+        int i7787;
+        int i7788;
+        int i7789;
+        int i7790;
+        int i7791;
+        int i7792;
+        int i7793;
+        int i7794;
+        int i7795;
+        int i7796;
+        int i7797;
+        int i7798;
+        int i7799;
+        int i7800;
+        int i7801;
+        int i7802;
+        int i7803;
+        int i7804;
+        int i7805;
+        int i7806;
+        int i7807;
+        int i7808;
+        int i7809;
+        int i7810;
+        int i7811;
+        int i7812;
+        int i7813;
+        int i7814;
+        int i7815;
+        int i7816;
+        int i7817;
+        int i7818;
+        int i7819;
+        int i7820;
+        int i7821;
+        int i7822;
+        int i7823;
+        int i7824;
+        int i7825;
+        int i7826;
+        int i7827;
+        int i7828;
+        int i7829;
+        int i7830;
+        int i7831;
+        int i7832;
+        int i7833;
+        int i7834;
+        int i7835;
+        int i7836;
+        int i7837;
+        int i7838;
+        int i7839;
+        int i7840;
+        int i7841;
+        int i7842;
+        int i7843;
+        int i7844;
+        int i7845;
+        int i7846;
+        int i7847;
+        int i7848;
+        int i7849;
+        int i7850;
+        int i7851;
+        int i7852;
+        int i7853;
+        int i7854;
+        int i7855;
+        int i7856;
+        int i7857;
+        int i7858;
+        int i7859;
+        int i7860;
+        int i7861;
+        int i7862;
+        int i7863;
+        int i7864;
+        int i7865;
+        int i7866;
+        int i7867;
+        int i7868;
+        int i7869;
+        int i7870;
+        int i7871;
+        int i7872;
+        int i7873;
+        int i7874;
+        int i7875;
+        int i7876;
+        int i7877;
+        int i7878;
+        int i7879;
+        int i7880;
+        int i7881;
+        int i7882;
+        int i7883;
+        int i7884;
+        int i7885;
+        int i7886;
+        int i7887;
+        int i7888;
+        int i7889;
+        int i7890;
+        int i7891;
+        int i7892;
+        int i7893;
+        int i7894;
+        int i7895;
+        int i7896;
+        int i7897;
+        int i7898;
+        int i7899;
+        int i7900;
+        int i7901;
+        int i7902;
+        int i7903;
+        int i7904;
+        int i7905;
+        int i7906;
+        int i7907;
+        int i7908;
+        int i7909;
+        int i7910;
+        int i7911;
+        int i7912;
+        int i7913;
+        int i7914;
+        int i7915;
+        int i7916;
+        int i7917;
+        int i7918;
+        int i7919;
+        int i7920;
+        int i7921;
+        int i7922;
+        int i7923;
+        int i7924;
+        int i7925;
+        int i7926;
+        int i7927;
+        int i7928;
+        int i7929;
+        int i7930;
+        int i7931;
+        int i7932;
+        int i7933;
+        int i7934;
+        int i7935;
+        int i7936;
+        int i7937;
+        int i7938;
+        int i7939;
+        int i7940;
+        int i7941;
+        int i7942;
+        int i7943;
+        int i7944;
+        int i7945;
+        int i7946;
+        int i7947;
+        int i7948;
+        int i7949;
+        int i7950;
+        int i7951;
+        int i7952;
+        int i7953;
+        int i7954;
+        int i7955;
+        int i7956;
+        int i7957;
+        int i7958;
+        int i7959;
+        int i7960;
+        int i7961;
+        int i7962;
+        int i7963;
+        int i7964;
+        int i7965;
+        int i7966;
+        int i7967;
+        int i7968;
+        int i7969;
+        int i7970;
+        int i7971;
+        int i7972;
+        int i7973;
+        int i7974;
+        int i7975;
+        int i7976;
+        int i7977;
+        int i7978;
+        int i7979;
+        int i7980;
+        int i7981;
+        int i7982;
+        int i7983;
+        int i7984;
+        int i7985;
+        int i7986;
+        int i7987;
+        int i7988;
+        int i7989;
+        int i7990;
+        int i7991;
+        int i7992;
+        int i7993;
+        int i7994;
+        int i7995;
+        int i7996;
+        int i7997;
+        int i7998;
+        int i7999;
+        int i8000;
+        int i8001;
+        int i8002;
+        int i8003;
+        int i8004;
+        int i8005;
+        int i8006;
+        int i8007;
+        int i8008;
+        int i8009;
+        int i8010;
+        int i8011;
+        int i8012;
+        int i8013;
+        int i8014;
+        int i8015;
+        int i8016;
+        int i8017;
+        int i8018;
+        int i8019;
+        int i8020;
+        int i8021;
+        int i8022;
+        int i8023;
+        int i8024;
+        int i8025;
+        int i8026;
+        int i8027;
+        int i8028;
+        int i8029;
+        int i8030;
+        int i8031;
+        int i8032;
+        int i8033;
+        int i8034;
+        int i8035;
+        int i8036;
+        int i8037;
+        int i8038;
+        int i8039;
+        int i8040;
+        int i8041;
+        int i8042;
+        int i8043;
+        int i8044;
+        int i8045;
+        int i8046;
+        int i8047;
+        int i8048;
+        int i8049;
+        int i8050;
+        int i8051;
+        int i8052;
+        int i8053;
+        int i8054;
+        int i8055;
+        int i8056;
+        int i8057;
+        int i8058;
+        int i8059;
+        int i8060;
+        int i8061;
+        int i8062;
+        int i8063;
+        int i8064;
+        int i8065;
+        int i8066;
+        int i8067;
+        int i8068;
+        int i8069;
+        int i8070;
+        int i8071;
+        int i8072;
+        int i8073;
+        int i8074;
+        int i8075;
+        int i8076;
+        int i8077;
+        int i8078;
+        int i8079;
+        int i8080;
+        int i8081;
+        int i8082;
+        int i8083;
+        int i8084;
+        int i8085;
+        int i8086;
+        int i8087;
+        int i8088;
+        int i8089;
+        int i8090;
+        int i8091;
+        int i8092;
+        int i8093;
+        int i8094;
+        int i8095;
+        int i8096;
+        int i8097;
+        int i8098;
+        int i8099;
+        int i8100;
+        int i8101;
+        int i8102;
+        int i8103;
+        int i8104;
+        int i8105;
+        int i8106;
+        int i8107;
+        int i8108;
+        int i8109;
+        int i8110;
+        int i8111;
+        int i8112;
+        int i8113;
+        int i8114;
+        int i8115;
+        int i8116;
+        int i8117;
+        int i8118;
+        int i8119;
+        int i8120;
+        int i8121;
+        int i8122;
+        int i8123;
+        int i8124;
+        int i8125;
+        int i8126;
+        int i8127;
+        int i8128;
+        int i8129;
+        int i8130;
+        int i8131;
+        int i8132;
+        int i8133;
+        int i8134;
+        int i8135;
+        int i8136;
+        int i8137;
+        int i8138;
+        int i8139;
+        int i8140;
+        int i8141;
+        int i8142;
+        int i8143;
+        int i8144;
+        int i8145;
+        int i8146;
+        int i8147;
+        int i8148;
+        int i8149;
+        int i8150;
+        int i8151;
+        int i8152;
+        int i8153;
+        int i8154;
+        int i8155;
+        int i8156;
+        int i8157;
+        int i8158;
+        int i8159;
+        int i8160;
+        int i8161;
+        int i8162;
+        int i8163;
+        int i8164;
+        int i8165;
+        int i8166;
+        int i8167;
+        int i8168;
+        int i8169;
+        int i8170;
+        int i8171;
+        int i8172;
+        int i8173;
+        int i8174;
+        int i8175;
+        int i8176;
+        int i8177;
+        int i8178;
+        int i8179;
+        int i8180;
+        int i8181;
+        int i8182;
+        int i8183;
+        int i8184;
+        int i8185;
+        int i8186;
+        int i8187;
+        int i8188;
+        int i8189;
+        int i8190;
+        int i8191;
+        int i8192;
+        int i8193;
+        int i8194;
+        int i8195;
+        int i8196;
+        int i8197;
+        int i8198;
+        int i8199;
+        int i8200;
+        int i8201;
+        int i8202;
+        int i8203;
+        int i8204;
+        int i8205;
+        int i8206;
+        int i8207;
+        int i8208;
+        int i8209;
+        int i8210;
+        int i8211;
+        int i8212;
+        int i8213;
+        int i8214;
+        int i8215;
+        int i8216;
+        int i8217;
+        int i8218;
+        int i8219;
+        int i8220;
+        int i8221;
+        int i8222;
+        int i8223;
+        int i8224;
+        int i8225;
+        int i8226;
+        int i8227;
+        int i8228;
+        int i8229;
+        int i8230;
+        int i8231;
+        int i8232;
+        int i8233;
+        int i8234;
+        int i8235;
+        int i8236;
+        int i8237;
+        int i8238;
+        int i8239;
+        int i8240;
+        int i8241;
+        int i8242;
+        int i8243;
+        int i8244;
+        int i8245;
+        int i8246;
+        int i8247;
+        int i8248;
+        int i8249;
+        int i8250;
+        int i8251;
+        int i8252;
+        int i8253;
+        int i8254;
+        int i8255;
+        int i8256;
+        int i8257;
+        int i8258;
+        int i8259;
+        int i8260;
+        int i8261;
+        int i8262;
+        int i8263;
+        int i8264;
+        int i8265;
+        int i8266;
+        int i8267;
+        int i8268;
+        int i8269;
+        int i8270;
+        int i8271;
+        int i8272;
+        int i8273;
+        int i8274;
+        int i8275;
+        int i8276;
+        int i8277;
+        int i8278;
+        int i8279;
+        int i8280;
+        int i8281;
+        int i8282;
+        int i8283;
+        int i8284;
+        int i8285;
+        int i8286;
+        int i8287;
+        int i8288;
+        int i8289;
+        int i8290;
+        int i8291;
+        int i8292;
+        int i8293;
+        int i8294;
+        int i8295;
+        int i8296;
+        int i8297;
+        int i8298;
+        int i8299;
+        int i8300;
+        int i8301;
+        int i8302;
+        int i8303;
+        int i8304;
+        int i8305;
+        int i8306;
+        int i8307;
+        int i8308;
+        int i8309;
+        int i8310;
+        int i8311;
+        int i8312;
+        int i8313;
+        int i8314;
+        int i8315;
+        int i8316;
+        int i8317;
+        int i8318;
+        int i8319;
+        int i8320;
+        int i8321;
+        int i8322;
+        int i8323;
+        int i8324;
+        int i8325;
+        int i8326;
+        int i8327;
+        int i8328;
+        int i8329;
+        int i8330;
+        int i8331;
+        int i8332;
+        int i8333;
+        int i8334;
+        int i8335;
+        int i8336;
+        int i8337;
+        int i8338;
+        int i8339;
+        int i8340;
+        int i8341;
+        int i8342;
+        int i8343;
+        int i8344;
+        int i8345;
+        int i8346;
+        int i8347;
+        int i8348;
+        int i8349;
+        int i8350;
+        int i8351;
+        int i8352;
+        int i8353;
+        int i8354;
+        int i8355;
+        int i8356;
+        int i8357;
+        int i8358;
+        int i8359;
+        int i8360;
+        int i8361;
+        int i8362;
+        int i8363;
+        int i8364;
+        int i8365;
+        int i8366;
+        int i8367;
+        int i8368;
+        int i8369;
+        int i8370;
+        int i8371;
+        int i8372;
+        int i8373;
+        int i8374;
+        int i8375;
+        int i8376;
+        int i8377;
+        int i8378;
+        int i8379;
+        int i8380;
+        int i8381;
+        int i8382;
+        int i8383;
+        int i8384;
+        int i8385;
+        int i8386;
+        int i8387;
+        int i8388;
+        int i8389;
+        int i8390;
+        int i8391;
+        int i8392;
+        int i8393;
+        int i8394;
+        int i8395;
+        int i8396;
+        int i8397;
+        int i8398;
+        int i8399;
+        int i8400;
+        int i8401;
+        int i8402;
+        int i8403;
+        int i8404;
+        int i8405;
+        int i8406;
+        int i8407;
+        int i8408;
+        int i8409;
+        int i8410;
+        int i8411;
+        int i8412;
+        int i8413;
+        int i8414;
+        int i8415;
+        int i8416;
+        int i8417;
+        int i8418;
+        int i8419;
+        int i8420;
+        int i8421;
+        int i8422;
+        int i8423;
+        int i8424;
+        int i8425;
+        int i8426;
+        int i8427;
+        int i8428;
+        int i8429;
+        int i8430;
+        int i8431;
+        int i8432;
+        int i8433;
+        int i8434;
+        int i8435;
+        int i8436;
+        int i8437;
+        int i8438;
+        int i8439;
+        int i8440;
+        int i8441;
+        int i8442;
+        int i8443;
+        int i8444;
+        int i8445;
+        int i8446;
+        int i8447;
+        int i8448;
+        int i8449;
+        int i8450;
+        int i8451;
+        int i8452;
+        int i8453;
+        int i8454;
+        int i8455;
+        int i8456;
+        int i8457;
+        int i8458;
+        int i8459;
+        int i8460;
+        int i8461;
+        int i8462;
+        int i8463;
+        int i8464;
+        int i8465;
+        int i8466;
+        int i8467;
+        int i8468;
+        int i8469;
+        int i8470;
+        int i8471;
+        int i8472;
+        int i8473;
+        int i8474;
+        int i8475;
+        int i8476;
+        int i8477;
+        int i8478;
+        int i8479;
+        int i8480;
+        int i8481;
+        int i8482;
+        int i8483;
+        int i8484;
+        int i8485;
+        int i8486;
+        int i8487;
+        int i8488;
+        int i8489;
+        int i8490;
+        int i8491;
+        int i8492;
+        int i8493;
+        int i8494;
+        int i8495;
+        int i8496;
+        int i8497;
+        int i8498;
+        int i8499;
+        int i8500;
+        int i8501;
+        int i8502;
+        int i8503;
+        int i8504;
+        int i8505;
+        int i8506;
+        int i8507;
+        int i8508;
+        int i8509;
+        int i8510;
+        int i8511;
+        int i8512;
+        int i8513;
+        int i8514;
+        int i8515;
+        int i8516;
+        int i8517;
+        int i8518;
+        int i8519;
+        int i8520;
+        int i8521;
+        int i8522;
+        int i8523;
+        int i8524;
+        int i8525;
+        int i8526;
+        int i8527;
+        int i8528;
+        int i8529;
+        int i8530;
+        int i8531;
+        int i8532;
+        int i8533;
+        int i8534;
+        int i8535;
+        int i8536;
+        int i8537;
+        int i8538;
+        int i8539;
+        int i8540;
+        int i8541;
+        int i8542;
+        int i8543;
+        int i8544;
+        int i8545;
+        int i8546;
+        int i8547;
+        int i8548;
+        int i8549;
+        int i8550;
+        int i8551;
+        int i8552;
+        int i8553;
+        int i8554;
+        int i8555;
+        int i8556;
+        int i8557;
+        int i8558;
+        int i8559;
+        int i8560;
+        int i8561;
+        int i8562;
+        int i8563;
+        int i8564;
+        int i8565;
+        int i8566;
+        int i8567;
+        int i8568;
+        int i8569;
+        int i8570;
+        int i8571;
+        int i8572;
+        int i8573;
+        int i8574;
+        int i8575;
+        int i8576;
+        int i8577;
+        int i8578;
+        int i8579;
+        int i8580;
+        int i8581;
+        int i8582;
+        int i8583;
+        int i8584;
+        int i8585;
+        int i8586;
+        int i8587;
+        int i8588;
+        int i8589;
+        int i8590;
+        int i8591;
+        int i8592;
+        int i8593;
+        int i8594;
+        int i8595;
+        int i8596;
+        int i8597;
+        int i8598;
+        int i8599;
+        int i8600;
+        int i8601;
+        int i8602;
+        int i8603;
+        int i8604;
+        int i8605;
+        int i8606;
+        int i8607;
+        int i8608;
+        int i8609;
+        int i8610;
+        int i8611;
+        int i8612;
+        int i8613;
+        int i8614;
+        int i8615;
+        int i8616;
+        int i8617;
+        int i8618;
+        int i8619;
+        int i8620;
+        int i8621;
+        int i8622;
+        int i8623;
+        int i8624;
+        int i8625;
+        int i8626;
+        int i8627;
+        int i8628;
+        int i8629;
+        int i8630;
+        int i8631;
+        int i8632;
+        int i8633;
+        int i8634;
+        int i8635;
+        int i8636;
+        int i8637;
+        int i8638;
+        int i8639;
+        int i8640;
+        int i8641;
+        int i8642;
+        int i8643;
+        int i8644;
+        int i8645;
+        int i8646;
+        int i8647;
+        int i8648;
+        int i8649;
+        int i8650;
+        int i8651;
+        int i8652;
+        int i8653;
+        int i8654;
+        int i8655;
+        int i8656;
+        int i8657;
+        int i8658;
+        int i8659;
+        int i8660;
+        int i8661;
+        int i8662;
+        int i8663;
+        int i8664;
+        int i8665;
+        int i8666;
+        int i8667;
+        int i8668;
+        int i8669;
+        int i8670;
+        int i8671;
+        int i8672;
+        int i8673;
+        int i8674;
+        int i8675;
+        int i8676;
+        int i8677;
+        int i8678;
+        int i8679;
+        int i8680;
+        int i8681;
+        int i8682;
+        int i8683;
+        int i8684;
+        int i8685;
+        int i8686;
+        int i8687;
+        int i8688;
+        int i8689;
+        int i8690;
+        int i8691;
+        int i8692;
+        int i8693;
+        int i8694;
+        int i8695;
+        int i8696;
+        int i8697;
+        int i8698;
+        int i8699;
+        int i8700;
+        int i8701;
+        int i8702;
+        int i8703;
+        int i8704;
+        int i8705;
+        int i8706;
+        int i8707;
+        int i8708;
+        int i8709;
+        int i8710;
+        int i8711;
+        int i8712;
+        int i8713;
+        int i8714;
+        int i8715;
+        int i8716;
+        int i8717;
+        int i8718;
+        int i8719;
+        int i8720;
+        int i8721;
+        int i8722;
+        int i8723;
+        int i8724;
+        int i8725;
+        int i8726;
+        int i8727;
+        int i8728;
+        int i8729;
+        int i8730;
+        int i8731;
+        int i8732;
+        int i8733;
+        int i8734;
+        int i8735;
+        int i8736;
+        int i8737;
+        int i8738;
+        int i8739;
+        int i8740;
+        int i8741;
+        int i8742;
+        int i8743;
+        int i8744;
+        int i8745;
+        int i8746;
+        int i8747;
+        int i8748;
+        int i8749;
+        int i8750;
+        int i8751;
+        int i8752;
+        int i8753;
+        int i8754;
+        int i8755;
+        int i8756;
+        int i8757;
+        int i8758;
+        int i8759;
+        int i8760;
+        int i8761;
+        int i8762;
+        int i8763;
+        int i8764;
+        int i8765;
+        int i8766;
+        int i8767;
+        int i8768;
+        int i8769;
+        int i8770;
+        int i8771;
+        int i8772;
+        int i8773;
+        int i8774;
+        int i8775;
+        int i8776;
+        int i8777;
+        int i8778;
+        int i8779;
+        int i8780;
+        int i8781;
+        int i8782;
+        int i8783;
+        int i8784;
+        int i8785;
+        int i8786;
+        int i8787;
+        int i8788;
+        int i8789;
+        int i8790;
+        int i8791;
+        int i8792;
+        int i8793;
+        int i8794;
+        int i8795;
+        int i8796;
+        int i8797;
+        int i8798;
+        int i8799;
+        int i8800;
+        int i8801;
+        int i8802;
+        int i8803;
+        int i8804;
+        int i8805;
+        int i8806;
+        int i8807;
+        int i8808;
+        int i8809;
+        int i8810;
+        int i8811;
+        int i8812;
+        int i8813;
+        int i8814;
+        int i8815;
+        int i8816;
+        int i8817;
+        int i8818;
+        int i8819;
+        int i8820;
+        int i8821;
+        int i8822;
+        int i8823;
+        int i8824;
+        int i8825;
+        int i8826;
+        int i8827;
+        int i8828;
+        int i8829;
+        int i8830;
+        int i8831;
+        int i8832;
+        int i8833;
+        int i8834;
+        int i8835;
+        int i8836;
+        int i8837;
+        int i8838;
+        int i8839;
+        int i8840;
+        int i8841;
+        int i8842;
+        int i8843;
+        int i8844;
+        int i8845;
+        int i8846;
+        int i8847;
+        int i8848;
+        int i8849;
+        int i8850;
+        int i8851;
+        int i8852;
+        int i8853;
+        int i8854;
+        int i8855;
+        int i8856;
+        int i8857;
+        int i8858;
+        int i8859;
+        int i8860;
+        int i8861;
+        int i8862;
+        int i8863;
+        int i8864;
+        int i8865;
+        int i8866;
+        int i8867;
+        int i8868;
+        int i8869;
+        int i8870;
+        int i8871;
+        int i8872;
+        int i8873;
+        int i8874;
+        int i8875;
+        int i8876;
+        int i8877;
+        int i8878;
+        int i8879;
+        int i8880;
+        int i8881;
+        int i8882;
+        int i8883;
+        int i8884;
+        int i8885;
+        int i8886;
+        int i8887;
+        int i8888;
+        int i8889;
+        int i8890;
+        int i8891;
+        int i8892;
+        int i8893;
+        int i8894;
+        int i8895;
+        int i8896;
+        int i8897;
+        int i8898;
+        int i8899;
+        int i8900;
+        int i8901;
+        int i8902;
+        int i8903;
+        int i8904;
+        int i8905;
+        int i8906;
+        int i8907;
+        int i8908;
+        int i8909;
+        int i8910;
+        int i8911;
+        int i8912;
+        int i8913;
+        int i8914;
+        int i8915;
+        int i8916;
+        int i8917;
+        int i8918;
+        int i8919;
+        int i8920;
+        int i8921;
+        int i8922;
+        int i8923;
+        int i8924;
+        int i8925;
+        int i8926;
+        int i8927;
+        int i8928;
+        int i8929;
+        int i8930;
+        int i8931;
+        int i8932;
+        int i8933;
+        int i8934;
+        int i8935;
+        int i8936;
+        int i8937;
+        int i8938;
+        int i8939;
+        int i8940;
+        int i8941;
+        int i8942;
+        int i8943;
+        int i8944;
+        int i8945;
+        int i8946;
+        int i8947;
+        int i8948;
+        int i8949;
+        int i8950;
+        int i8951;
+        int i8952;
+        int i8953;
+        int i8954;
+        int i8955;
+        int i8956;
+        int i8957;
+        int i8958;
+        int i8959;
+        int i8960;
+        int i8961;
+        int i8962;
+        int i8963;
+        int i8964;
+        int i8965;
+        int i8966;
+        int i8967;
+        int i8968;
+        int i8969;
+        int i8970;
+        int i8971;
+        int i8972;
+        int i8973;
+        int i8974;
+        int i8975;
+        int i8976;
+        int i8977;
+        int i8978;
+        int i8979;
+        int i8980;
+        int i8981;
+        int i8982;
+        int i8983;
+        int i8984;
+        int i8985;
+        int i8986;
+        int i8987;
+        int i8988;
+        int i8989;
+        int i8990;
+        int i8991;
+        int i8992;
+        int i8993;
+        int i8994;
+        int i8995;
+        int i8996;
+        int i8997;
+        int i8998;
+        int i8999;
+        int i9000;
+        int i9001;
+        int i9002;
+        int i9003;
+        int i9004;
+        int i9005;
+        int i9006;
+        int i9007;
+        int i9008;
+        int i9009;
+        int i9010;
+        int i9011;
+        int i9012;
+        int i9013;
+        int i9014;
+        int i9015;
+        int i9016;
+        int i9017;
+        int i9018;
+        int i9019;
+        int i9020;
+        int i9021;
+        int i9022;
+        int i9023;
+        int i9024;
+        int i9025;
+        int i9026;
+        int i9027;
+        int i9028;
+        int i9029;
+        int i9030;
+        int i9031;
+        int i9032;
+        int i9033;
+        int i9034;
+        int i9035;
+        int i9036;
+        int i9037;
+        int i9038;
+        int i9039;
+        int i9040;
+        int i9041;
+        int i9042;
+        int i9043;
+        int i9044;
+        int i9045;
+        int i9046;
+        int i9047;
+        int i9048;
+        int i9049;
+        int i9050;
+        int i9051;
+        int i9052;
+        int i9053;
+        int i9054;
+        int i9055;
+        int i9056;
+        int i9057;
+        int i9058;
+        int i9059;
+        int i9060;
+        int i9061;
+        int i9062;
+        int i9063;
+        int i9064;
+        int i9065;
+        int i9066;
+        int i9067;
+        int i9068;
+        int i9069;
+        int i9070;
+        int i9071;
+        int i9072;
+        int i9073;
+        int i9074;
+        int i9075;
+        int i9076;
+        int i9077;
+        int i9078;
+        int i9079;
+        int i9080;
+        int i9081;
+        int i9082;
+        int i9083;
+        int i9084;
+        int i9085;
+        int i9086;
+        int i9087;
+        int i9088;
+        int i9089;
+        int i9090;
+        int i9091;
+        int i9092;
+        int i9093;
+        int i9094;
+        int i9095;
+        int i9096;
+        int i9097;
+        int i9098;
+        int i9099;
+        int i9100;
+        int i9101;
+        int i9102;
+        int i9103;
+        int i9104;
+        int i9105;
+        int i9106;
+        int i9107;
+        int i9108;
+        int i9109;
+        int i9110;
+        int i9111;
+        int i9112;
+        int i9113;
+        int i9114;
+        int i9115;
+        int i9116;
+        int i9117;
+        int i9118;
+        int i9119;
+        int i9120;
+        int i9121;
+        int i9122;
+        int i9123;
+        int i9124;
+        int i9125;
+        int i9126;
+        int i9127;
+        int i9128;
+        int i9129;
+        int i9130;
+        int i9131;
+        int i9132;
+        int i9133;
+        int i9134;
+        int i9135;
+        int i9136;
+        int i9137;
+        int i9138;
+        int i9139;
+        int i9140;
+        int i9141;
+        int i9142;
+        int i9143;
+        int i9144;
+        int i9145;
+        int i9146;
+        int i9147;
+        int i9148;
+        int i9149;
+        int i9150;
+        int i9151;
+        int i9152;
+        int i9153;
+        int i9154;
+        int i9155;
+        int i9156;
+        int i9157;
+        int i9158;
+        int i9159;
+        int i9160;
+        int i9161;
+        int i9162;
+        int i9163;
+        int i9164;
+        int i9165;
+        int i9166;
+        int i9167;
+        int i9168;
+        int i9169;
+        int i9170;
+        int i9171;
+        int i9172;
+        int i9173;
+        int i9174;
+        int i9175;
+        int i9176;
+        int i9177;
+        int i9178;
+        int i9179;
+        int i9180;
+        int i9181;
+        int i9182;
+        int i9183;
+        int i9184;
+        int i9185;
+        int i9186;
+        int i9187;
+        int i9188;
+        int i9189;
+        int i9190;
+        int i9191;
+        int i9192;
+        int i9193;
+        int i9194;
+        int i9195;
+        int i9196;
+        int i9197;
+        int i9198;
+        int i9199;
+        int i9200;
+        int i9201;
+        int i9202;
+        int i9203;
+        int i9204;
+        int i9205;
+        int i9206;
+        int i9207;
+        int i9208;
+        int i9209;
+        int i9210;
+        int i9211;
+        int i9212;
+        int i9213;
+        int i9214;
+        int i9215;
+        int i9216;
+        int i9217;
+        int i9218;
+        int i9219;
+        int i9220;
+        int i9221;
+        int i9222;
+        int i9223;
+        int i9224;
+        int i9225;
+        int i9226;
+        int i9227;
+        int i9228;
+        int i9229;
+        int i9230;
+        int i9231;
+        int i9232;
+        int i9233;
+        int i9234;
+        int i9235;
+        int i9236;
+        int i9237;
+        int i9238;
+        int i9239;
+        int i9240;
+        int i9241;
+        int i9242;
+        int i9243;
+        int i9244;
+        int i9245;
+        int i9246;
+        int i9247;
+        int i9248;
+        int i9249;
+        int i9250;
+        int i9251;
+        int i9252;
+        int i9253;
+        int i9254;
+        int i9255;
+        int i9256;
+        int i9257;
+        int i9258;
+        int i9259;
+        int i9260;
+        int i9261;
+        int i9262;
+        int i9263;
+        int i9264;
+        int i9265;
+        int i9266;
+        int i9267;
+        int i9268;
+        int i9269;
+        int i9270;
+        int i9271;
+        int i9272;
+        int i9273;
+        int i9274;
+        int i9275;
+        int i9276;
+        int i9277;
+        int i9278;
+        int i9279;
+        int i9280;
+        int i9281;
+        int i9282;
+        int i9283;
+        int i9284;
+        int i9285;
+        int i9286;
+        int i9287;
+        int i9288;
+        int i9289;
+        int i9290;
+        int i9291;
+        int i9292;
+        int i9293;
+        int i9294;
+        int i9295;
+        int i9296;
+        int i9297;
+        int i9298;
+        int i9299;
+        int i9300;
+        int i9301;
+        int i9302;
+        int i9303;
+        int i9304;
+        int i9305;
+        int i9306;
+        int i9307;
+        int i9308;
+        int i9309;
+        int i9310;
+        int i9311;
+        int i9312;
+        int i9313;
+        int i9314;
+        int i9315;
+        int i9316;
+        int i9317;
+        int i9318;
+        int i9319;
+        int i9320;
+        int i9321;
+        int i9322;
+        int i9323;
+        int i9324;
+        int i9325;
+        int i9326;
+        int i9327;
+        int i9328;
+        int i9329;
+        int i9330;
+        int i9331;
+        int i9332;
+        int i9333;
+        int i9334;
+        int i9335;
+        int i9336;
+        int i9337;
+        int i9338;
+        int i9339;
+        int i9340;
+        int i9341;
+        int i9342;
+        int i9343;
+        int i9344;
+        int i9345;
+        int i9346;
+        int i9347;
+        int i9348;
+        int i9349;
+        int i9350;
+        int i9351;
+        int i9352;
+        int i9353;
+        int i9354;
+        int i9355;
+        int i9356;
+        int i9357;
+        int i9358;
+        int i9359;
+        int i9360;
+        int i9361;
+        int i9362;
+        int i9363;
+        int i9364;
+        int i9365;
+        int i9366;
+        int i9367;
+        int i9368;
+        int i9369;
+        int i9370;
+        int i9371;
+        int i9372;
+        int i9373;
+        int i9374;
+        int i9375;
+        int i9376;
+        int i9377;
+        int i9378;
+        int i9379;
+        int i9380;
+        int i9381;
+        int i9382;
+        int i9383;
+        int i9384;
+        int i9385;
+        int i9386;
+        int i9387;
+        int i9388;
+        int i9389;
+        int i9390;
+        int i9391;
+        int i9392;
+        int i9393;
+        int i9394;
+        int i9395;
+        int i9396;
+        int i9397;
+        int i9398;
+        int i9399;
+        int i9400;
+        int i9401;
+        int i9402;
+        int i9403;
+        int i9404;
+        int i9405;
+        int i9406;
+        int i9407;
+        int i9408;
+        int i9409;
+        int i9410;
+        int i9411;
+        int i9412;
+        int i9413;
+        int i9414;
+        int i9415;
+        int i9416;
+        int i9417;
+        int i9418;
+        int i9419;
+        int i9420;
+        int i9421;
+        int i9422;
+        int i9423;
+        int i9424;
+        int i9425;
+        int i9426;
+        int i9427;
+        int i9428;
+        int i9429;
+        int i9430;
+        int i9431;
+        int i9432;
+        int i9433;
+        int i9434;
+        int i9435;
+        int i9436;
+        int i9437;
+        int i9438;
+        int i9439;
+        int i9440;
+        int i9441;
+        int i9442;
+        int i9443;
+        int i9444;
+        int i9445;
+        int i9446;
+        int i9447;
+        int i9448;
+        int i9449;
+        int i9450;
+        int i9451;
+        int i9452;
+        int i9453;
+        int i9454;
+        int i9455;
+        int i9456;
+        int i9457;
+        int i9458;
+        int i9459;
+        int i9460;
+        int i9461;
+        int i9462;
+        int i9463;
+        int i9464;
+        int i9465;
+        int i9466;
+        int i9467;
+        int i9468;
+        int i9469;
+        int i9470;
+        int i9471;
+        int i9472;
+        int i9473;
+        int i9474;
+        int i9475;
+        int i9476;
+        int i9477;
+        int i9478;
+        int i9479;
+        int i9480;
+        int i9481;
+        int i9482;
+        int i9483;
+        int i9484;
+        int i9485;
+        int i9486;
+        int i9487;
+        int i9488;
+        int i9489;
+        int i9490;
+        int i9491;
+        int i9492;
+        int i9493;
+        int i9494;
+        int i9495;
+        int i9496;
+        int i9497;
+        int i9498;
+        int i9499;
+        int i9500;
+        int i9501;
+        int i9502;
+        int i9503;
+        int i9504;
+        int i9505;
+        int i9506;
+        int i9507;
+        int i9508;
+        int i9509;
+        int i9510;
+        int i9511;
+        int i9512;
+        int i9513;
+        int i9514;
+        int i9515;
+        int i9516;
+        int i9517;
+        int i9518;
+        int i9519;
+        int i9520;
+        int i9521;
+        int i9522;
+        int i9523;
+        int i9524;
+        int i9525;
+        int i9526;
+        int i9527;
+        int i9528;
+        int i9529;
+        int i9530;
+        int i9531;
+        int i9532;
+        int i9533;
+        int i9534;
+        int i9535;
+        int i9536;
+        int i9537;
+        int i9538;
+        int i9539;
+        int i9540;
+        int i9541;
+        int i9542;
+        int i9543;
+        int i9544;
+        int i9545;
+        int i9546;
+        int i9547;
+        int i9548;
+        int i9549;
+        int i9550;
+        int i9551;
+        int i9552;
+        int i9553;
+        int i9554;
+        int i9555;
+        int i9556;
+        int i9557;
+        int i9558;
+        int i9559;
+        int i9560;
+        int i9561;
+        int i9562;
+        int i9563;
+        int i9564;
+        int i9565;
+        int i9566;
+        int i9567;
+        int i9568;
+        int i9569;
+        int i9570;
+        int i9571;
+        int i9572;
+        int i9573;
+        int i9574;
+        int i9575;
+        int i9576;
+        int i9577;
+        int i9578;
+        int i9579;
+        int i9580;
+        int i9581;
+        int i9582;
+        int i9583;
+        int i9584;
+        int i9585;
+        int i9586;
+        int i9587;
+        int i9588;
+        int i9589;
+        int i9590;
+        int i9591;
+        int i9592;
+        int i9593;
+        int i9594;
+        int i9595;
+        int i9596;
+        int i9597;
+        int i9598;
+        int i9599;
+        int i9600;
+        int i9601;
+        int i9602;
+        int i9603;
+        int i9604;
+        int i9605;
+        int i9606;
+        int i9607;
+        int i9608;
+        int i9609;
+        int i9610;
+        int i9611;
+        int i9612;
+        int i9613;
+        int i9614;
+        int i9615;
+        int i9616;
+        int i9617;
+        int i9618;
+        int i9619;
+        int i9620;
+        int i9621;
+        int i9622;
+        int i9623;
+        int i9624;
+        int i9625;
+        int i9626;
+        int i9627;
+        int i9628;
+        int i9629;
+        int i9630;
+        int i9631;
+        int i9632;
+        int i9633;
+        int i9634;
+        int i9635;
+        int i9636;
+        int i9637;
+        int i9638;
+        int i9639;
+        int i9640;
+        int i9641;
+        int i9642;
+        int i9643;
+        int i9644;
+        int i9645;
+        int i9646;
+        int i9647;
+        int i9648;
+        int i9649;
+        int i9650;
+        int i9651;
+        int i9652;
+        int i9653;
+        int i9654;
+        int i9655;
+        int i9656;
+        int i9657;
+        int i9658;
+        int i9659;
+        int i9660;
+        int i9661;
+        int i9662;
+        int i9663;
+        int i9664;
+        int i9665;
+        int i9666;
+        int i9667;
+        int i9668;
+        int i9669;
+        int i9670;
+        int i9671;
+        int i9672;
+        int i9673;
+        int i9674;
+        int i9675;
+        int i9676;
+        int i9677;
+        int i9678;
+        int i9679;
+        int i9680;
+        int i9681;
+        int i9682;
+        int i9683;
+        int i9684;
+        int i9685;
+        int i9686;
+        int i9687;
+        int i9688;
+        int i9689;
+        int i9690;
+        int i9691;
+        int i9692;
+        int i9693;
+        int i9694;
+        int i9695;
+        int i9696;
+        int i9697;
+        int i9698;
+        int i9699;
+        int i9700;
+        int i9701;
+        int i9702;
+        int i9703;
+        int i9704;
+        int i9705;
+        int i9706;
+        int i9707;
+        int i9708;
+        int i9709;
+        int i9710;
+        int i9711;
+        int i9712;
+        int i9713;
+        int i9714;
+        int i9715;
+        int i9716;
+        int i9717;
+        int i9718;
+        int i9719;
+        int i9720;
+        int i9721;
+        int i9722;
+        int i9723;
+        int i9724;
+        int i9725;
+        int i9726;
+        int i9727;
+        int i9728;
+        int i9729;
+        int i9730;
+        int i9731;
+        int i9732;
+        int i9733;
+        int i9734;
+        int i9735;
+        int i9736;
+        int i9737;
+        int i9738;
+        int i9739;
+        int i9740;
+        int i9741;
+        int i9742;
+        int i9743;
+        int i9744;
+        int i9745;
+        int i9746;
+        int i9747;
+        int i9748;
+        int i9749;
+        int i9750;
+        int i9751;
+        int i9752;
+        int i9753;
+        int i9754;
+        int i9755;
+        int i9756;
+        int i9757;
+        int i9758;
+        int i9759;
+        int i9760;
+        int i9761;
+        int i9762;
+        int i9763;
+        int i9764;
+        int i9765;
+        int i9766;
+        int i9767;
+        int i9768;
+        int i9769;
+        int i9770;
+        int i9771;
+        int i9772;
+        int i9773;
+        int i9774;
+        int i9775;
+        int i9776;
+        int i9777;
+        int i9778;
+        int i9779;
+        int i9780;
+        int i9781;
+        int i9782;
+        int i9783;
+        int i9784;
+        int i9785;
+        int i9786;
+        int i9787;
+        int i9788;
+        int i9789;
+        int i9790;
+        int i9791;
+        int i9792;
+        int i9793;
+        int i9794;
+        int i9795;
+        int i9796;
+        int i9797;
+        int i9798;
+        int i9799;
+        int i9800;
+        int i9801;
+        int i9802;
+        int i9803;
+        int i9804;
+        int i9805;
+        int i9806;
+        int i9807;
+        int i9808;
+        int i9809;
+        int i9810;
+        int i9811;
+        int i9812;
+        int i9813;
+        int i9814;
+        int i9815;
+        int i9816;
+        int i9817;
+        int i9818;
+        int i9819;
+        int i9820;
+        int i9821;
+        int i9822;
+        int i9823;
+        int i9824;
+        int i9825;
+        int i9826;
+        int i9827;
+        int i9828;
+        int i9829;
+        int i9830;
+        int i9831;
+        int i9832;
+        int i9833;
+        int i9834;
+        int i9835;
+        int i9836;
+        int i9837;
+        int i9838;
+        int i9839;
+        int i9840;
+        int i9841;
+        int i9842;
+        int i9843;
+        int i9844;
+        int i9845;
+        int i9846;
+        int i9847;
+        int i9848;
+        int i9849;
+        int i9850;
+        int i9851;
+        int i9852;
+        int i9853;
+        int i9854;
+        int i9855;
+        int i9856;
+        int i9857;
+        int i9858;
+        int i9859;
+        int i9860;
+        int i9861;
+        int i9862;
+        int i9863;
+        int i9864;
+        int i9865;
+        int i9866;
+        int i9867;
+        int i9868;
+        int i9869;
+        int i9870;
+        int i9871;
+        int i9872;
+        int i9873;
+        int i9874;
+        int i9875;
+        int i9876;
+        int i9877;
+        int i9878;
+        int i9879;
+        int i9880;
+        int i9881;
+        int i9882;
+        int i9883;
+        int i9884;
+        int i9885;
+        int i9886;
+        int i9887;
+        int i9888;
+        int i9889;
+        int i9890;
+        int i9891;
+        int i9892;
+        int i9893;
+        int i9894;
+        int i9895;
+        int i9896;
+        int i9897;
+        int i9898;
+        int i9899;
+        int i9900;
+        int i9901;
+        int i9902;
+        int i9903;
+        int i9904;
+        int i9905;
+        int i9906;
+        int i9907;
+        int i9908;
+        int i9909;
+        int i9910;
+        int i9911;
+        int i9912;
+        int i9913;
+        int i9914;
+        int i9915;
+        int i9916;
+        int i9917;
+        int i9918;
+        int i9919;
+        int i9920;
+        int i9921;
+        int i9922;
+        int i9923;
+        int i9924;
+        int i9925;
+        int i9926;
+        int i9927;
+        int i9928;
+        int i9929;
+        int i9930;
+        int i9931;
+        int i9932;
+        int i9933;
+        int i9934;
+        int i9935;
+        int i9936;
+        int i9937;
+        int i9938;
+        int i9939;
+        int i9940;
+        int i9941;
+        int i9942;
+        int i9943;
+        int i9944;
+        int i9945;
+        int i9946;
+        int i9947;
+        int i9948;
+        int i9949;
+        int i9950;
+        int i9951;
+        int i9952;
+        int i9953;
+        int i9954;
+        int i9955;
+        int i9956;
+        int i9957;
+        int i9958;
+        int i9959;
+        int i9960;
+        int i9961;
+        int i9962;
+        int i9963;
+        int i9964;
+        int i9965;
+        int i9966;
+        int i9967;
+        int i9968;
+        int i9969;
+        int i9970;
+        int i9971;
+        int i9972;
+        int i9973;
+        int i9974;
+        int i9975;
+        int i9976;
+        int i9977;
+        int i9978;
+        int i9979;
+        int i9980;
+        int i9981;
+        int i9982;
+        int i9983;
+        int i9984;
+        int i9985;
+        int i9986;
+        int i9987;
+        int i9988;
+        int i9989;
+        int i9990;
+        int i9991;
+        int i9992;
+        int i9993;
+        int i9994;
+        int i9995;
+        int i9996;
+        int i9997;
+        int i9998;
+        int i9999;
+        int i10000;
+        int i10001;
+        int i10002;
+        int i10003;
+        int i10004;
+        int i10005;
+        int i10006;
+        int i10007;
+        int i10008;
+        int i10009;
+        int i10010;
+        int i10011;
+        int i10012;
+        int i10013;
+        int i10014;
+        int i10015;
+        int i10016;
+        int i10017;
+        int i10018;
+        int i10019;
+        int i10020;
+        int i10021;
+        int i10022;
+        int i10023;
+        int i10024;
+        int i10025;
+        int i10026;
+        int i10027;
+        int i10028;
+        int i10029;
+        int i10030;
+        int i10031;
+        int i10032;
+        int i10033;
+        int i10034;
+        int i10035;
+        int i10036;
+        int i10037;
+        int i10038;
+        int i10039;
+        int i10040;
+        int i10041;
+        int i10042;
+        int i10043;
+        int i10044;
+        int i10045;
+        int i10046;
+        int i10047;
+        int i10048;
+        int i10049;
+        int i10050;
+        int i10051;
+        int i10052;
+        int i10053;
+        int i10054;
+        int i10055;
+        int i10056;
+        int i10057;
+        int i10058;
+        int i10059;
+        int i10060;
+        int i10061;
+        int i10062;
+        int i10063;
+        int i10064;
+        int i10065;
+        int i10066;
+        int i10067;
+        int i10068;
+        int i10069;
+        int i10070;
+        int i10071;
+        int i10072;
+        int i10073;
+        int i10074;
+        int i10075;
+        int i10076;
+        int i10077;
+        int i10078;
+        int i10079;
+        int i10080;
+        int i10081;
+        int i10082;
+        int i10083;
+        int i10084;
+        int i10085;
+        int i10086;
+        int i10087;
+        int i10088;
+        int i10089;
+        int i10090;
+        int i10091;
+        int i10092;
+        int i10093;
+        int i10094;
+        int i10095;
+        int i10096;
+        int i10097;
+        int i10098;
+        int i10099;
+        int i10100;
+        int i10101;
+        int i10102;
+        int i10103;
+        int i10104;
+        int i10105;
+        int i10106;
+        int i10107;
+        int i10108;
+        int i10109;
+        int i10110;
+        int i10111;
+        int i10112;
+        int i10113;
+        int i10114;
+        int i10115;
+        int i10116;
+        int i10117;
+        int i10118;
+        int i10119;
+        int i10120;
+        int i10121;
+        int i10122;
+        int i10123;
+        int i10124;
+        int i10125;
+        int i10126;
+        int i10127;
+        int i10128;
+        int i10129;
+        int i10130;
+        int i10131;
+        int i10132;
+        int i10133;
+        int i10134;
+        int i10135;
+        int i10136;
+        int i10137;
+        int i10138;
+        int i10139;
+        int i10140;
+        int i10141;
+        int i10142;
+        int i10143;
+        int i10144;
+        int i10145;
+        int i10146;
+        int i10147;
+        int i10148;
+        int i10149;
+        int i10150;
+        int i10151;
+        int i10152;
+        int i10153;
+        int i10154;
+        int i10155;
+        int i10156;
+        int i10157;
+        int i10158;
+        int i10159;
+        int i10160;
+        int i10161;
+        int i10162;
+        int i10163;
+        int i10164;
+        int i10165;
+        int i10166;
+        int i10167;
+        int i10168;
+        int i10169;
+        int i10170;
+        int i10171;
+        int i10172;
+        int i10173;
+        int i10174;
+        int i10175;
+        int i10176;
+        int i10177;
+        int i10178;
+        int i10179;
+        int i10180;
+        int i10181;
+        int i10182;
+        int i10183;
+        int i10184;
+        int i10185;
+        int i10186;
+        int i10187;
+        int i10188;
+        int i10189;
+        int i10190;
+        int i10191;
+        int i10192;
+        int i10193;
+        int i10194;
+        int i10195;
+        int i10196;
+        int i10197;
+        int i10198;
+        int i10199;
+        int i10200;
+        int i10201;
+        int i10202;
+        int i10203;
+        int i10204;
+        int i10205;
+        int i10206;
+        int i10207;
+        int i10208;
+        int i10209;
+        int i10210;
+        int i10211;
+        int i10212;
+        int i10213;
+        int i10214;
+        int i10215;
+        int i10216;
+        int i10217;
+        int i10218;
+        int i10219;
+        int i10220;
+        int i10221;
+        int i10222;
+        int i10223;
+        int i10224;
+        int i10225;
+        int i10226;
+        int i10227;
+        int i10228;
+        int i10229;
+        int i10230;
+        int i10231;
+        int i10232;
+        int i10233;
+        int i10234;
+        int i10235;
+        int i10236;
+        int i10237;
+        int i10238;
+        int i10239;
+        int i10240;
+        int i10241;
+        int i10242;
+        int i10243;
+        int i10244;
+        int i10245;
+        int i10246;
+        int i10247;
+        int i10248;
+        int i10249;
+        int i10250;
+        int i10251;
+        int i10252;
+        int i10253;
+        int i10254;
+        int i10255;
+        int i10256;
+        int i10257;
+        int i10258;
+        int i10259;
+        int i10260;
+        int i10261;
+        int i10262;
+        int i10263;
+        int i10264;
+        int i10265;
+        int i10266;
+        int i10267;
+        int i10268;
+        int i10269;
+        int i10270;
+        int i10271;
+        int i10272;
+        int i10273;
+        int i10274;
+        int i10275;
+        int i10276;
+        int i10277;
+        int i10278;
+        int i10279;
+        int i10280;
+        int i10281;
+        int i10282;
+        int i10283;
+        int i10284;
+        int i10285;
+        int i10286;
+        int i10287;
+        int i10288;
+        int i10289;
+        int i10290;
+        int i10291;
+        int i10292;
+        int i10293;
+        int i10294;
+        int i10295;
+        int i10296;
+        int i10297;
+        int i10298;
+        int i10299;
+        int i10300;
+        int i10301;
+        int i10302;
+        int i10303;
+        int i10304;
+        int i10305;
+        int i10306;
+        int i10307;
+        int i10308;
+        int i10309;
+        int i10310;
+        int i10311;
+        int i10312;
+        int i10313;
+        int i10314;
+        int i10315;
+        int i10316;
+        int i10317;
+        int i10318;
+        int i10319;
+        int i10320;
+        int i10321;
+        int i10322;
+        int i10323;
+        int i10324;
+        int i10325;
+        int i10326;
+        int i10327;
+        int i10328;
+        int i10329;
+        int i10330;
+        int i10331;
+        int i10332;
+        int i10333;
+        int i10334;
+        int i10335;
+        int i10336;
+        int i10337;
+        int i10338;
+        int i10339;
+        int i10340;
+        int i10341;
+        int i10342;
+        int i10343;
+        int i10344;
+        int i10345;
+        int i10346;
+        int i10347;
+        int i10348;
+        int i10349;
+        int i10350;
+        int i10351;
+        int i10352;
+        int i10353;
+        int i10354;
+        int i10355;
+        int i10356;
+        int i10357;
+        int i10358;
+        int i10359;
+        int i10360;
+        int i10361;
+        int i10362;
+        int i10363;
+        int i10364;
+        int i10365;
+        int i10366;
+        int i10367;
+        int i10368;
+        int i10369;
+        int i10370;
+        int i10371;
+        int i10372;
+        int i10373;
+        int i10374;
+        int i10375;
+        int i10376;
+        int i10377;
+        int i10378;
+        int i10379;
+        int i10380;
+        int i10381;
+        int i10382;
+        int i10383;
+        int i10384;
+        int i10385;
+        int i10386;
+        int i10387;
+        int i10388;
+        int i10389;
+        int i10390;
+        int i10391;
+        int i10392;
+        int i10393;
+        int i10394;
+        int i10395;
+        int i10396;
+        int i10397;
+        int i10398;
+        int i10399;
+        int i10400;
+        int i10401;
+        int i10402;
+        int i10403;
+        int i10404;
+        int i10405;
+        int i10406;
+        int i10407;
+        int i10408;
+        int i10409;
+        int i10410;
+        int i10411;
+        int i10412;
+        int i10413;
+        int i10414;
+        int i10415;
+        int i10416;
+        int i10417;
+        int i10418;
+        int i10419;
+        int i10420;
+        int i10421;
+        int i10422;
+        int i10423;
+        int i10424;
+        int i10425;
+        int i10426;
+        int i10427;
+        int i10428;
+        int i10429;
+        int i10430;
+        int i10431;
+        int i10432;
+        int i10433;
+        int i10434;
+        int i10435;
+        int i10436;
+        int i10437;
+        int i10438;
+        int i10439;
+        int i10440;
+        int i10441;
+        int i10442;
+        int i10443;
+        int i10444;
+        int i10445;
+        int i10446;
+        int i10447;
+        int i10448;
+        int i10449;
+        int i10450;
+        int i10451;
+        int i10452;
+        int i10453;
+        int i10454;
+        int i10455;
+        int i10456;
+        int i10457;
+        int i10458;
+        int i10459;
+        int i10460;
+        int i10461;
+        int i10462;
+        int i10463;
+        int i10464;
+        int i10465;
+        int i10466;
+        int i10467;
+        int i10468;
+        int i10469;
+        int i10470;
+        int i10471;
+        int i10472;
+        int i10473;
+        int i10474;
+        int i10475;
+        int i10476;
+        int i10477;
+        int i10478;
+        int i10479;
+        int i10480;
+        int i10481;
+        int i10482;
+        int i10483;
+        int i10484;
+        int i10485;
+        int i10486;
+        int i10487;
+        int i10488;
+        int i10489;
+        int i10490;
+        int i10491;
+        int i10492;
+        int i10493;
+        int i10494;
+        int i10495;
+        int i10496;
+        int i10497;
+        int i10498;
+        int i10499;
+        int i10500;
+        int i10501;
+        int i10502;
+        int i10503;
+        int i10504;
+        int i10505;
+        int i10506;
+        int i10507;
+        int i10508;
+        int i10509;
+        int i10510;
+        int i10511;
+        int i10512;
+        int i10513;
+        int i10514;
+        int i10515;
+        int i10516;
+        int i10517;
+        int i10518;
+        int i10519;
+        int i10520;
+        int i10521;
+        int i10522;
+        int i10523;
+        int i10524;
+        int i10525;
+        int i10526;
+        int i10527;
+        int i10528;
+        int i10529;
+        int i10530;
+        int i10531;
+        int i10532;
+        int i10533;
+        int i10534;
+        int i10535;
+        int i10536;
+        int i10537;
+        int i10538;
+        int i10539;
+        int i10540;
+        int i10541;
+        int i10542;
+        int i10543;
+        int i10544;
+        int i10545;
+        int i10546;
+        int i10547;
+        int i10548;
+        int i10549;
+        int i10550;
+        int i10551;
+        int i10552;
+        int i10553;
+        int i10554;
+        int i10555;
+        int i10556;
+        int i10557;
+        int i10558;
+        int i10559;
+        int i10560;
+        int i10561;
+        int i10562;
+        int i10563;
+        int i10564;
+        int i10565;
+        int i10566;
+        int i10567;
+        int i10568;
+        int i10569;
+        int i10570;
+        int i10571;
+        int i10572;
+        int i10573;
+        int i10574;
+        int i10575;
+        int i10576;
+        int i10577;
+        int i10578;
+        int i10579;
+        int i10580;
+        int i10581;
+        int i10582;
+        int i10583;
+        int i10584;
+        int i10585;
+        int i10586;
+        int i10587;
+        int i10588;
+        int i10589;
+        int i10590;
+        int i10591;
+        int i10592;
+        int i10593;
+        int i10594;
+        int i10595;
+        int i10596;
+        int i10597;
+        int i10598;
+        int i10599;
+        int i10600;
+        int i10601;
+        int i10602;
+        int i10603;
+        int i10604;
+        int i10605;
+        int i10606;
+        int i10607;
+        int i10608;
+        int i10609;
+        int i10610;
+        int i10611;
+        int i10612;
+        int i10613;
+        int i10614;
+        int i10615;
+        int i10616;
+        int i10617;
+        int i10618;
+        int i10619;
+        int i10620;
+        int i10621;
+        int i10622;
+        int i10623;
+        int i10624;
+        int i10625;
+        int i10626;
+        int i10627;
+        int i10628;
+        int i10629;
+        int i10630;
+        int i10631;
+        int i10632;
+        int i10633;
+        int i10634;
+        int i10635;
+        int i10636;
+        int i10637;
+        int i10638;
+        int i10639;
+        int i10640;
+        int i10641;
+        int i10642;
+        int i10643;
+        int i10644;
+        int i10645;
+        int i10646;
+        int i10647;
+        int i10648;
+        int i10649;
+        int i10650;
+        int i10651;
+        int i10652;
+        int i10653;
+        int i10654;
+        int i10655;
+        int i10656;
+        int i10657;
+        int i10658;
+        int i10659;
+        int i10660;
+        int i10661;
+        int i10662;
+        int i10663;
+        int i10664;
+        int i10665;
+        int i10666;
+        int i10667;
+        int i10668;
+        int i10669;
+        int i10670;
+        int i10671;
+        int i10672;
+        int i10673;
+        int i10674;
+        int i10675;
+        int i10676;
+        int i10677;
+        int i10678;
+        int i10679;
+        int i10680;
+        int i10681;
+        int i10682;
+        int i10683;
+        int i10684;
+        int i10685;
+        int i10686;
+        int i10687;
+        int i10688;
+        int i10689;
+        int i10690;
+        int i10691;
+        int i10692;
+        int i10693;
+        int i10694;
+        int i10695;
+        int i10696;
+        int i10697;
+        int i10698;
+        int i10699;
+        int i10700;
+        int i10701;
+        int i10702;
+        int i10703;
+        int i10704;
+        int i10705;
+        int i10706;
+        int i10707;
+        int i10708;
+        int i10709;
+        int i10710;
+        int i10711;
+        int i10712;
+        int i10713;
+        int i10714;
+        int i10715;
+        int i10716;
+        int i10717;
+        int i10718;
+        int i10719;
+        int i10720;
+        int i10721;
+        int i10722;
+        int i10723;
+        int i10724;
+        int i10725;
+        int i10726;
+        int i10727;
+        int i10728;
+        int i10729;
+        int i10730;
+        int i10731;
+        int i10732;
+        int i10733;
+        int i10734;
+        int i10735;
+        int i10736;
+        int i10737;
+        int i10738;
+        int i10739;
+        int i10740;
+        int i10741;
+        int i10742;
+        int i10743;
+        int i10744;
+        int i10745;
+        int i10746;
+        int i10747;
+        int i10748;
+        int i10749;
+        int i10750;
+        int i10751;
+        int i10752;
+        int i10753;
+        int i10754;
+        int i10755;
+        int i10756;
+        int i10757;
+        int i10758;
+        int i10759;
+        int i10760;
+        int i10761;
+        int i10762;
+        int i10763;
+        int i10764;
+        int i10765;
+        int i10766;
+        int i10767;
+        int i10768;
+        int i10769;
+        int i10770;
+        int i10771;
+        int i10772;
+        int i10773;
+        int i10774;
+        int i10775;
+        int i10776;
+        int i10777;
+        int i10778;
+        int i10779;
+        int i10780;
+        int i10781;
+        int i10782;
+        int i10783;
+        int i10784;
+        int i10785;
+        int i10786;
+        int i10787;
+        int i10788;
+        int i10789;
+        int i10790;
+        int i10791;
+        int i10792;
+        int i10793;
+        int i10794;
+        int i10795;
+        int i10796;
+        int i10797;
+        int i10798;
+        int i10799;
+
+        if (unlikely) {
+            // Since Foo is not loaded this will turn into an uncommon trap
+            Class c = Foo.class;
+
+            StringBuilder sb = new StringBuilder();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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);
+    }
+}
--- a/jaxp/.hgtags	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/.hgtags	Mon Nov 11 16:20:48 2013 +0100
@@ -235,3 +235,5 @@
 17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111
 c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112
 0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113
+1b1e12117fe2840e5d21ae9a4b309e4f981f3ea8 jdk8-b114
+f610fd46463e6b0533dd92bce11a1e7d84984e64 jdk8-b115
--- a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jaxws/.hgtags	Mon Nov 11 16:20:48 2013 +0100
@@ -235,3 +235,5 @@
 32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111
 dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112
 9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113
+9ad289610fc6effe9076280b7920d0f16470709f jdk8-b114
+e126d8eca69b83a1cc159c2375b7c33140346d2b jdk8-b115
--- a/jdk/.hgtags	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/.hgtags	Mon Nov 11 16:20:48 2013 +0100
@@ -235,3 +235,5 @@
 719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111
 f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112
 5b4261b4b72af53e8e178933ef6bc6c7f8cdbc60 jdk8-b113
+f26a0c8071bde1e3b923713c75156e4a58955623 jdk8-b114
+f82b730c798b6bf38946baaba8a7d80fd5efaa70 jdk8-b115
--- a/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -618,6 +618,11 @@
         // remove ROC, which is not supported in j.u.tz
         builtZones.remove("ROC");
         links.remove("ROC");
+        // remove EST, HST and MST. They are supported via
+        // the short-id mapping
+        builtZones.remove("EST");
+        builtZones.remove("HST");
+        builtZones.remove("MST");
     }
 
     /**
--- a/jdk/makefiles/CompileDemos.gmk	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/makefiles/CompileDemos.gmk	Mon Nov 11 16:20:48 2013 +0100
@@ -157,8 +157,8 @@
 
 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services
 
-$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html XYZApp.java))
-$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html ThreeD.java))
+$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java))
+$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html *.java))
 $(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
 $(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
 $(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
--- a/jdk/makefiles/Setup.gmk	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/makefiles/Setup.gmk	Mon Nov 11 16:20:48 2013 +0100
@@ -27,7 +27,7 @@
 
 # To build with all warnings enabled, do the following:
 # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
-JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,classfile,dep-ann,divzero,varargs -Werror
+JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,classfile,dep-ann,divzero,empty,try,varargs -Werror
 
 # Any java code executed during a JDK build to build other parts of the JDK must be 
 # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this 
--- a/jdk/makefiles/SignJars.gmk	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/makefiles/SignJars.gmk	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -48,8 +48,10 @@
 # be built, signed, and then the resulting jar files MUST BE CHECKED
 # INTO THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT
 # BE FORGOTTEN*, otherwise a bug fixed in the source code will not be
-# reflected in the shipped binaries. The "sign-jars" target in the top
-# level Makefile should be used to generate the required files.
+# reflected in the shipped binaries.
+#
+# Please consult with Release Engineering, which is responsible for
+# creating the final JCE builds suitable for checkin.
 #
 
 # Default target
@@ -58,7 +60,7 @@
 ifndef OPENJDK
 
 README-MAKEFILE_WARNING := \
-    "\nPlease read makefiles/SignJars.gmk for further build instructions.\n"
+    "\nPlease read jdk/makefiles/SignJars.gmk for further build instructions.\n"
 
 #
 # Location for JCE codesigning key.
@@ -84,20 +86,34 @@
 	    $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
 	@$(PRINTF) "\nJar codesigning finished.\n"
 
-JAR_LIST := jce.jar \
+JAR_LIST := \
+    jce.jar \
     local_policy.jar \
     sunec.jar \
     sunjce_provider.jar \
     sunpkcs11.jar \
-    US_export_policy.jar
+    US_export_policy.jar \
+    sunmscapi.jar \
+    ucrypto.jar \
+    #
 
-SIGNED_JARS := $(addprefix $(JCE_OUTPUTDIR)/,$(JAR_LIST))
+UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/unsigned/, $(JAR_LIST)))
+
+ifeq ($(UNSIGNED_JARS), )
+  $(error No jars found in $(JDK_OUTPUTDIR)/unsigned/)
+endif
+
+SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/unsigned/%,$(JCE_OUTPUTDIR)/%, $(UNSIGNED_JARS))
 
 $(SIGNED_JARS): check-keystore
 
 all: $(SIGNED_JARS)
-	@$(PRINTF) "\n***The jar files built by the 'jar-sign' target must***"
-	@$(PRINTF) "\n***still be checked into the closed workspace!***"
+	@$(PRINTF) "\n*** The jar files built by the 'sign-jars' target are developer      ***"
+	@$(PRINTF) "\n*** builds only and *MUST NOT* be checked into the closed workspace. ***"
+	@$(PRINTF) "\n***                                                                  ***"
+	@$(PRINTF) "\n*** Please consult with Release Engineering: they will generate      ***"
+	@$(PRINTF) "\n*** the proper binaries for the closed workspace.                    ***"
+	@$(PRINTF) "\n"
 	@$(PRINTF) $(README-MAKEFILE_WARNING)
 
 endif # !OPENJDK
--- a/jdk/makefiles/mapfiles/libjava/mapfile-vers	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/makefiles/mapfiles/libjava/mapfile-vers	Mon Nov 11 16:20:48 2013 +0100
@@ -267,7 +267,8 @@
 		Java_sun_misc_GC_maxObjectInspectionAge;
 		Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0;
 		Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
-		Java_sun_reflect_Reflection_getCallerClass;
+		Java_sun_reflect_Reflection_getCallerClass__;
+		Java_sun_reflect_Reflection_getCallerClass__I;
 		Java_sun_reflect_Reflection_getClassAccessFlags;
                 Java_sun_misc_Version_getJdkVersionInfo;
                 Java_sun_misc_Version_getJdkSpecialVersion;
--- a/jdk/makefiles/mapfiles/libjava/reorder-sparc	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/makefiles/mapfiles/libjava/reorder-sparc	Mon Nov 11 16:20:48 2013 +0100
@@ -27,7 +27,8 @@
 text: .text%Java_java_io_FileDescriptor_initIDs;
 text: .text%Java_java_io_FileOutputStream_initIDs;
 text: .text%Java_java_lang_System_setIn0;
-text: .text%Java_sun_reflect_Reflection_getCallerClass;
+text: .text%Java_sun_reflect_Reflection_getCallerClass__;
+text: .text%Java_sun_reflect_Reflection_getCallerClass__I;
 text: .text%Java_java_lang_Class_forName0;
 text: .text%Java_java_lang_Object_getClass;
 text: .text%Java_sun_reflect_Reflection_getClassAccessFlags;
--- a/jdk/makefiles/mapfiles/libjava/reorder-sparcv9	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/makefiles/mapfiles/libjava/reorder-sparcv9	Mon Nov 11 16:20:48 2013 +0100
@@ -26,7 +26,8 @@
 text: .text%Java_java_io_FileDescriptor_initIDs;
 text: .text%Java_java_io_FileOutputStream_initIDs;
 text: .text%Java_java_lang_System_setIn0;
-text: .text%Java_sun_reflect_Reflection_getCallerClass;
+text: .text%Java_sun_reflect_Reflection_getCallerClass__;
+text: .text%Java_sun_reflect_Reflection_getCallerClass__I;
 text: .text%Java_java_lang_Class_forName0;
 text: .text%Java_java_lang_String_intern;
 text: .text%Java_java_lang_Float_floatToIntBits;
--- a/jdk/makefiles/mapfiles/libjava/reorder-x86	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/makefiles/mapfiles/libjava/reorder-x86	Mon Nov 11 16:20:48 2013 +0100
@@ -28,7 +28,8 @@
 text: .text%Java_java_io_FileDescriptor_initIDs;
 text: .text%Java_java_io_FileOutputStream_initIDs;
 text: .text%Java_java_lang_System_setIn0;
-text: .text%Java_sun_reflect_Reflection_getCallerClass;
+text: .text%Java_sun_reflect_Reflection_getCallerClass__;
+text: .text%Java_sun_reflect_Reflection_getCallerClass__I;
 text: .text%Java_java_lang_Class_forName0;
 text: .text%Java_java_lang_String_intern;
 text: .text%Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0;
--- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/com/apple/eawt/event/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/com/apple/eawt/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/java/net/DefaultInterface.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/font/CFontManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Mon Nov 11 16:20:48 2013 +0100
@@ -97,6 +97,6 @@
                     setVisible(true);
                 }
             }, this);
-        } catch (InterruptedException | InvocationTargetException ex) {}
+        } catch (InvocationTargetException ex) {}
     }
 }
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/native/sun/awt/AWTView.m	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/native/sun/awt/AWTWindow.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/native/sun/awt/CPrinterJob.m	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/native/sun/awt/CTextPipe.m	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/native/sun/awt/CWrapper.m	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/native/sun/awt/awt.m	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m	Mon Nov 11 16:20:48 2013 +0100
@@ -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/ThreadGroupReferenceImpl.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/back/ThreadGroupReferenceImpl.c	Mon Nov 11 16:20:48 2013 +0100
@@ -47,7 +47,7 @@
 
         (void)memset(&info, 0, sizeof(info));
         threadGroupInfo(group, &info);
-        (void)outStream_writeString(out, info.name);
+        (void)outStream_writeString(out, info.name == NULL ? "" : info.name);
         if ( info.name != NULL )
             jvmtiDeallocate(info.name);
 
--- a/jdk/src/share/back/commonRef.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/back/commonRef.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/back/eventFilter.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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/outStream.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/back/outStream.c	Mon Nov 11 16:20:48 2013 +0100
@@ -298,17 +298,15 @@
 outStream_writeString(PacketOutputStream *stream, char *string)
 {
     jdwpError error;
-    jint      length;
+    jint      length = string != NULL ? (int)strlen(string) : 0;
 
     /* Options utf8=y/n controls if we want Standard UTF-8 or Modified */
     if ( gdata->modifiedUtf8 ) {
-        length = (int)strlen(string);
         (void)outStream_writeInt(stream, length);
         error = writeBytes(stream, (jbyte *)string, length);
     } else {
         jint      new_length;
 
-        length = (int)strlen(string);
         new_length = (gdata->npt->utf8mToUtf8sLength)
                             (gdata->npt->utf, (jbyte*)string, length);
         if ( new_length == length ) {
--- a/jdk/src/share/back/util.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/back/util.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 @@
  *     &lt;int&gt;456&lt;/int&gt;
  * &lt;/array&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,7 +37,7 @@
  *     &lt;string&gt;true&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,7 +37,7 @@
  *     &lt;string&gt;127&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -33,7 +33,7 @@
  * For example:<pre>
  * &lt;char&gt;X&lt;/char&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -36,7 +36,7 @@
  *     &lt;string&gt;java.lang.Class&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,7 +37,7 @@
  *     &lt;string&gt;1.23e45&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -31,7 +31,7 @@
  * For example:<pre>
  * &lt;false/&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,7 +43,7 @@
  * For example:<pre>
  * &lt;field name="id"&gt;&lt;int&gt;0&lt;/int&gt;&lt;/field&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,7 +37,7 @@
  *     &lt;string&gt;-1.23&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,7 +37,7 @@
  *     &lt;string&gt;-1&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,7 +37,7 @@
  *     &lt;string&gt;0xFFFF&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,7 +43,7 @@
  *     &lt;string&gt;10&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,7 +43,7 @@
  *     &lt;string&gt;10&lt;/string&gt;
  * &lt;/new&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -31,7 +31,7 @@
  * For example:<pre>
  * &lt;null/&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -33,7 +33,7 @@
  * This element looks like &lt;void&gt; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -63,7 +63,7 @@
  *     &lt;int&gt;0&lt;/int&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,7 +37,7 @@
  *     &lt;string&gt;200&lt;/string&gt;
  * &lt;/method&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -40,7 +40,7 @@
  * &lt;string&gt;
  *     &lt;true&gt;
  * &lt;/string&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -31,7 +31,7 @@
  * For example:<pre>
  * &lt;true/&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -30,7 +30,7 @@
  * For example:<pre>
  * &lt;var id="id1" idref="id2"/&gt;</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -29,7 +29,7 @@
  * This element looks like &lt;object&gt; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/common/StandardMetadataFormat.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/gtk/resources/gtk_de.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -41,7 +41,7 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen
 FileChooser.pathLabel.textAndMnemonic=Aus&wahl:
 FileChooser.filterLabel.textAndMnemonic=Filter:
-FileChooser.foldersLabel.textAndMnemonic=Or&dner
+FileChooser.foldersLabel.textAndMnemonic=O&rdner
 FileChooser.filesLabel.textAndMnemonic=&Dateien
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen.
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/SnmpString.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java	Mon Nov 11 16:20:48 2013 +0100
@@ -130,7 +130,7 @@
      * @return The value.
      */
     public byte[] byteValue() {
-        return value ;
+        return value.clone() ;
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/SnmpMib.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java	Mon Nov 11 16:20:48 2013 +0100
@@ -476,8 +476,7 @@
                 rootOid[i++]= val.longValue();
             }
         }
-        return rootOid;
-
+        return rootOid.clone();
     }
 
     // --------------------------------------------------------------------
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/CommunicatorServer.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1248,7 +1248,7 @@
                      "of this CommunicatorServer instance has changed.");
         }
 
-        return notifInfos;
+        return notifInfos.clone();
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java	Mon Nov 11 16:20:48 2013 +0100
@@ -33,7 +33,7 @@
  * {@link java.lang.String},{@link java.util.List}&lt;{@link java.lang.String}&gt;&gt;.
  * The keys are case-insensitive Strings representing the header names and
  * the value associated with each key is a {@link List}&lt;{@link String}&gt; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/rowset/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/AWTEventMulticaster.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/AlphaComposite.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/BasicStroke.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/BorderLayout.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Choice.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Component.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Container.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Dialog.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Event.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&nbsp;1.0 event model. In Java&nbsp;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&nbsp;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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/EventQueue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Font.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Graphics.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Graphics2D.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&trade; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/GridBagLayout.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/KeyEventDispatcher.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/LinearGradientPaint.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/List.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/MediaTracker.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/MenuComponent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Polygon.java	Mon Nov 11 16:20:48 2013 +0100
@@ -246,7 +246,7 @@
     }
 
     /*
-     * Resizes the bounding box to accomodate the specified coordinates.
+     * Resizes the bounding box to accommodate the specified coordinates.
      * @param x,&nbsp;y the specified coordinates
      */
     void updateBounds(int x, int y) {
--- a/jdk/src/share/classes/java/awt/PopupMenu.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/PopupMenu.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/RadialGradientPaint.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/RenderingHints.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/ScrollPane.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Shape.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/TextComponent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;= 0
+         * @return the index into the text of the end of the selection &gt;= 0
          */
         public int getSelectionEnd() {
             return TextComponent.this.getSelectionEnd();
--- a/jdk/src/share/classes/java/awt/TextField.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/TextField.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Toolkit.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Window.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/color/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/datatransfer/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/dnd/DropTarget.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/dnd/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/doc-files/AWTThreadIssues.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;A is enqueued
+           <dl><dd> That is, if <code>AWTEvent</code>&nbsp;A is enqueued
 	        to the <code>EventQueue</code> before
 		<code>AWTEvent</code>&nbsp;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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/doc-files/DesktopProperties.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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&lt;Object&gt; */
      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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/doc-files/Modality.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &#151; its root can be found as
+      Every window belongs to some document &mdash; 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 &#151; in that case the last requirement 
+          Z-order in an arbitrary way &mdash; 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 &#151; in other words
+      to a top-level window in the Java programming language &mdash; 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 &#151; if F is from the SB
+      All the visible modal dialogs are looked through &mdash; 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 &#151; if M is from the SB of one of them,
+      through &mdash; 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 &#151;
+      All the visible toolkit-modal dialogs are looked through &mdash;
       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&#151; however, the actual behavior is unspecified
+      minimize the blocked window&mdash; however, the actual behavior is unspecified
       and platform-dependent. In any case, the user can't close the blocked window
-      interactively&#151; but it can be closed programmatically by calling the
+      interactively&mdash; 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&#151;
+      with the blocking modal dialog which would then become the active window&mdash;
       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> &#151; it's in the same document<br>
+          <li>F becomes blocked by D<sub>i</sub> &mdash; 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> &#151; it's in the
+          <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash; 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> &#151; it's in the same document<br>
+         <li>F becomes blocked by D<sub>i</sub> &mdash; 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> &#151;
+         <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash;
 	     it's in the same document<br>
          <li>D<sub>i</sub> is hidden<br>
-         <li>F becomes blocked by D<sub>ii</sub> &#151; it's in the same document<br>
+         <li>F becomes blocked by D<sub>ii</sub> &mdash; 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> &#151; it's in the same document<br>
+          <li>F becomes blocked by D<sub>ii</sub> &mdash; 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> &#151;
+          <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> &mdash;
 	      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> &#151; it's its owner<br>
-          <li>D<sub>iii</sub> remains unblocked &#151; it blocks D<sub>ii</sub> and 
+          <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash; it's its owner<br>
+          <li>D<sub>iii</sub> remains unblocked &mdash; 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> &#151; it's in the same document<br>
+          <li>F becomes blocked by D<sub>ii</sub> &mdash; 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> &#151; it's in the
+          <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> &mdash; 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> &#151; D<sub>i</sub>
+          <li>D<sub>iii</sub> becomes blocked by D<sub>i</sub> &mdash; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/event/ActionEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/event/InvocationEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/event/KeyEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/event/WindowEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/event/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/FontRenderContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/GlyphMetrics.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/GlyphVector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/LineBreakMeasurer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/MultipleMaster.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&rarr;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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/NumericShaper.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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() &amp; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/OpenType.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/TextLayout.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/TransformAttribute.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/font/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/geom/AffineTransform.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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
      * {&nbsp;m00&nbsp;m10&nbsp;m01&nbsp;m11&nbsp;[m02&nbsp;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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/geom/Line2D.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/geom/Path2D.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/geom/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/im/InputContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/im/InputMethodRequests.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/BandedSampleModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/BufferStrategy.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/ComponentColorModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/ImageConsumer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/IndexColorModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImage.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/image/renderable/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/awt/print/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/AppletInitializer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/EventHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/PropertyEditorSupport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedListener.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/ByteArrayInputStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/ByteArrayInputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -275,7 +275,6 @@
      * Closing a <tt>ByteArrayInputStream</tt> has no effect. The methods in
      * this class can be called after the stream has been closed without
      * generating an <tt>IOException</tt>.
-     * <p>
      */
     public void close() throws IOException {
     }
--- a/jdk/src/share/classes/java/io/ByteArrayOutputStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/ByteArrayOutputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -263,8 +263,6 @@
      * Closing a <tt>ByteArrayOutputStream</tt> has no effect. The methods in
      * this class can be called after the stream has been closed without
      * generating an <tt>IOException</tt>.
-     * <p>
-     *
      */
     public void close() throws IOException {
     }
--- a/jdk/src/share/classes/java/io/Closeable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/Closeable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -34,7 +34,6 @@
  *
  * @since 1.5
  */
-@FunctionalInterface
 public interface Closeable extends AutoCloseable {
 
     /**
--- a/jdk/src/share/classes/java/io/DataInput.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/DataInput.java	Mon Nov 11 16:20:48 2013 +0100
@@ -155,7 +155,7 @@
      * to the length of {@code b}.
      * <p>
      * This method blocks until one of the
-     * following conditions occurs:<p>
+     * following conditions occurs:
      * <ul>
      * <li>{@code b.length}
      * bytes of input data are available, in which
@@ -197,7 +197,7 @@
      * <p>
      * This method
      * blocks until one of the following conditions
-     * occurs:<p>
+     * occurs:
      * <ul>
      * <li>{@code len} bytes
      * of input data are available, in which case
@@ -316,8 +316,8 @@
      * be the second byte. The value
      * returned
      * is:
-     * <p><pre><code>(short)((a &lt;&lt; 8) | (b &amp; 0xff))
-     * </code></pre>
+     * <pre>{@code (short)((a << 8) | (b & 0xff))
+     * }</pre>
      * This method
      * is suitable for reading the bytes written
      * by the {@code writeShort} method of
@@ -337,8 +337,8 @@
      * be the first byte read and
      * {@code b}
      * be the second byte. The value returned is:
-     * <p><pre><code>(((a &amp; 0xff) &lt;&lt; 8) | (b &amp; 0xff))
-     * </code></pre>
+     * <pre>{@code (((a & 0xff) << 8) | (b & 0xff))
+     * }</pre>
      * This method is suitable for reading the bytes
      * written by the {@code writeShort} method
      * of interface {@code DataOutput}  if
@@ -359,8 +359,8 @@
      * be the first byte read and {@code b}
      * be the second byte. The value
      * returned is:
-     * <p><pre><code>(char)((a &lt;&lt; 8) | (b &amp; 0xff))
-     * </code></pre>
+     * <pre>{@code (char)((a << 8) | (b & 0xff))
+     * }</pre>
      * This method
      * is suitable for reading bytes written by
      * the {@code writeChar} method of interface
@@ -377,10 +377,10 @@
      * Reads four input bytes and returns an
      * {@code int} value. Let {@code a-d}
      * be the first through fourth bytes read. The value returned is:
-     * <p><pre><code>
-     * (((a &amp; 0xff) &lt;&lt; 24) | ((b &amp; 0xff) &lt;&lt; 16) |
-     * &#32;((c &amp; 0xff) &lt;&lt; 8) | (d &amp; 0xff))
-     * </code></pre>
+     * <pre>{@code
+     * (((a & 0xff) << 24) | ((b & 0xff) << 16) |
+     *  ((c & 0xff) <<  8) | (d & 0xff))
+     * }</pre>
      * This method is suitable
      * for reading bytes written by the {@code writeInt}
      * method of interface {@code DataOutput}.
@@ -397,16 +397,16 @@
      * a {@code long} value. Let {@code a-h}
      * be the first through eighth bytes read.
      * The value returned is:
-     * <p><pre><code>
-     * (((long)(a &amp; 0xff) &lt;&lt; 56) |
-     *  ((long)(b &amp; 0xff) &lt;&lt; 48) |
-     *  ((long)(c &amp; 0xff) &lt;&lt; 40) |
-     *  ((long)(d &amp; 0xff) &lt;&lt; 32) |
-     *  ((long)(e &amp; 0xff) &lt;&lt; 24) |
-     *  ((long)(f &amp; 0xff) &lt;&lt; 16) |
-     *  ((long)(g &amp; 0xff) &lt;&lt;  8) |
-     *  ((long)(h &amp; 0xff)))
-     * </code></pre>
+     * <pre>{@code
+     * (((long)(a & 0xff) << 56) |
+     *  ((long)(b & 0xff) << 48) |
+     *  ((long)(c & 0xff) << 40) |
+     *  ((long)(d & 0xff) << 32) |
+     *  ((long)(e & 0xff) << 24) |
+     *  ((long)(f & 0xff) << 16) |
+     *  ((long)(g & 0xff) <<  8) |
+     *  ((long)(h & 0xff)))
+     * }</pre>
      * <p>
      * This method is suitable
      * for reading bytes written by the {@code writeLong}
@@ -540,9 +540,9 @@
      * not match the bit pattern {@code 10xxxxxx},
      * then a {@code UTFDataFormatException}
      * is thrown. Otherwise, the group is converted
-     * to the character:<p>
-     * <pre><code>(char)(((a&amp; 0x1F) &lt;&lt; 6) | (b &amp; 0x3F))
-     * </code></pre>
+     * to the character:
+     * <pre>{@code (char)(((a & 0x1F) << 6) | (b & 0x3F))
+     * }</pre>
      * If the first byte of a group
      * matches the bit pattern {@code 1110xxxx},
      * then the group consists of that byte {@code a}
@@ -554,10 +554,10 @@
      * does not match the bit pattern {@code 10xxxxxx},
      * then a {@code UTFDataFormatException}
      * is thrown. Otherwise, the group is converted
-     * to the character:<p>
-     * <pre><code>
-     * (char)(((a &amp; 0x0F) &lt;&lt; 12) | ((b &amp; 0x3F) &lt;&lt; 6) | (c &amp; 0x3F))
-     * </code></pre>
+     * to the character:
+     * <pre>{@code
+     * (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F))
+     * }</pre>
      * If the first byte of a group matches the
      * pattern {@code 1111xxxx} or the pattern
      * {@code 10xxxxxx}, then a {@code UTFDataFormatException}
--- a/jdk/src/share/classes/java/io/DataOutput.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/DataOutput.java	Mon Nov 11 16:20:48 2013 +0100
@@ -134,11 +134,11 @@
      * Writes two bytes to the output
      * stream to represent the value of the argument.
      * The byte values to be written, in the  order
-     * shown, are: <p>
-     * <pre><code>
-     * (byte)(0xff &amp; (v &gt;&gt; 8))
-     * (byte)(0xff &amp; v)
-     * </code> </pre> <p>
+     * shown, are:
+     * <pre>{@code
+     * (byte)(0xff & (v >> 8))
+     * (byte)(0xff & v)
+     * }</pre> <p>
      * The bytes written by this method may be
      * read by the <code>readShort</code> method
      * of interface <code>DataInput</code> , which
@@ -156,10 +156,10 @@
      * output stream.
      * The byte values to be written, in the  order
      * shown, are:
-     * <p><pre><code>
-     * (byte)(0xff &amp; (v &gt;&gt; 8))
-     * (byte)(0xff &amp; v)
-     * </code></pre><p>
+     * <pre>{@code
+     * (byte)(0xff & (v >> 8))
+     * (byte)(0xff & v)
+     * }</pre><p>
      * The bytes written by this method may be
      * read by the <code>readChar</code> method
      * of interface <code>DataInput</code> , which
@@ -176,12 +176,12 @@
      * comprised of four bytes, to the output stream.
      * The byte values to be written, in the  order
      * shown, are:
-     * <p><pre><code>
-     * (byte)(0xff &amp; (v &gt;&gt; 24))
-     * (byte)(0xff &amp; (v &gt;&gt; 16))
-     * (byte)(0xff &amp; (v &gt;&gt; &#32; &#32;8))
-     * (byte)(0xff &amp; v)
-     * </code></pre><p>
+     * <pre>{@code
+     * (byte)(0xff & (v >> 24))
+     * (byte)(0xff & (v >> 16))
+     * (byte)(0xff & (v >>  8))
+     * (byte)(0xff & v)
+     * }</pre><p>
      * The bytes written by this method may be read
      * by the <code>readInt</code> method of interface
      * <code>DataInput</code> , which will then
@@ -197,16 +197,16 @@
      * comprised of eight bytes, to the output stream.
      * The byte values to be written, in the  order
      * shown, are:
-     * <p><pre><code>
-     * (byte)(0xff &amp; (v &gt;&gt; 56))
-     * (byte)(0xff &amp; (v &gt;&gt; 48))
-     * (byte)(0xff &amp; (v &gt;&gt; 40))
-     * (byte)(0xff &amp; (v &gt;&gt; 32))
-     * (byte)(0xff &amp; (v &gt;&gt; 24))
-     * (byte)(0xff &amp; (v &gt;&gt; 16))
-     * (byte)(0xff &amp; (v &gt;&gt;  8))
-     * (byte)(0xff &amp; v)
-     * </code></pre><p>
+     * <pre>{@code
+     * (byte)(0xff & (v >> 56))
+     * (byte)(0xff & (v >> 48))
+     * (byte)(0xff & (v >> 40))
+     * (byte)(0xff & (v >> 32))
+     * (byte)(0xff & (v >> 24))
+     * (byte)(0xff & (v >> 16))
+     * (byte)(0xff & (v >>  8))
+     * (byte)(0xff & v)
+     * }</pre><p>
      * The bytes written by this method may be
      * read by the <code>readLong</code> method
      * of interface <code>DataInput</code> , which
@@ -314,24 +314,24 @@
      * If a character <code>c</code>
      * is in the range <code>&#92;u0001</code> through
      * <code>&#92;u007f</code>, it is represented
-     * by one byte:<p>
+     * by one byte:
      * <pre>(byte)c </pre>  <p>
      * If a character <code>c</code> is <code>&#92;u0000</code>
      * or is in the range <code>&#92;u0080</code>
      * through <code>&#92;u07ff</code>, then it is
      * represented by two bytes, to be written
-     * in the order shown:<p> <pre><code>
-     * (byte)(0xc0 | (0x1f &amp; (c &gt;&gt; 6)))
-     * (byte)(0x80 | (0x3f &amp; c))
-     *  </code></pre>  <p> If a character
+     * in the order shown: <pre>{@code
+     * (byte)(0xc0 | (0x1f & (c >> 6)))
+     * (byte)(0x80 | (0x3f & c))
+     * }</pre> <p> If a character
      * <code>c</code> is in the range <code>&#92;u0800</code>
      * through <code>uffff</code>, then it is
      * represented by three bytes, to be written
-     * in the order shown:<p> <pre><code>
-     * (byte)(0xe0 | (0x0f &amp; (c &gt;&gt; 12)))
-     * (byte)(0x80 | (0x3f &amp; (c &gt;&gt;  6)))
-     * (byte)(0x80 | (0x3f &amp; c))
-     *  </code></pre>  <p> First,
+     * in the order shown: <pre>{@code
+     * (byte)(0xe0 | (0x0f & (c >> 12)))
+     * (byte)(0x80 | (0x3f & (c >>  6)))
+     * (byte)(0x80 | (0x3f & c))
+     * }</pre>  <p> First,
      * the total number of bytes needed to represent
      * all the characters of <code>s</code> is
      * calculated. If this number is larger than
--- a/jdk/src/share/classes/java/io/File.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/File.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/FilePermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/FilePermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -55,7 +55,7 @@
  * a list of one or more comma-separated keywords. The possible keywords are
  * "read", "write", "execute", "delete", and "readlink". Their meaning is
  * defined as follows:
- * <P>
+ *
  * <DL>
  *    <DT> read <DD> read permission
  *    <DT> write <DD> write permission
@@ -297,11 +297,11 @@
     /**
      * Checks if this FilePermission object "implies" the specified permission.
      * <P>
-     * More specifically, this method returns true if:<p>
+     * More specifically, this method returns true if:
      * <ul>
-     * <li> <i>p</i> is an instanceof FilePermission,<p>
+     * <li> <i>p</i> is an instanceof FilePermission,
      * <li> <i>p</i>'s actions are a proper subset of this
-     * object's actions, and <p>
+     * object's actions, and
      * <li> <i>p</i>'s pathname is implied by this object's
      *      pathname. For example, "/tmp/*" implies "/tmp/foo", since
      *      "/tmp/*" encompasses all files in the "/tmp" directory,
--- a/jdk/src/share/classes/java/io/Flushable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/Flushable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -34,7 +34,6 @@
  *
  * @since 1.5
  */
-@FunctionalInterface
 public interface Flushable {
 
     /**
--- a/jdk/src/share/classes/java/io/InputStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/InputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -306,8 +306,7 @@
      *
      * <p> The general contract of <code>reset</code> is:
      *
-     * <p><ul>
-     *
+     * <ul>
      * <li> If the method <code>markSupported</code> returns
      * <code>true</code>, then:
      *
--- a/jdk/src/share/classes/java/io/ObjectInputStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/ObjectInputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -109,7 +109,7 @@
  *
  * <p>Serializable classes that require special handling during the
  * serialization and deserialization process should implement the following
- * methods:<p>
+ * methods:
  *
  * <pre>
  * private void writeObject(java.io.ObjectOutputStream stream)
--- a/jdk/src/share/classes/java/io/ObjectStreamConstants.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/ObjectStreamConstants.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/PipedInputStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/PipedInputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -172,15 +172,14 @@
      * unconnected piped output stream and <code>snk</code>
      * is an unconnected piped input stream, they
      * may be connected by either the call:
-     * <p>
+     *
      * <pre><code>snk.connect(src)</code> </pre>
      * <p>
      * or the call:
-     * <p>
+     *
      * <pre><code>src.connect(snk)</code> </pre>
      * <p>
-     * The two
-     * calls have the same effect.
+     * The two calls have the same effect.
      *
      * @param      src   The piped output stream to connect to.
      * @exception  IOException  if an I/O error occurs.
--- a/jdk/src/share/classes/java/io/PipedReader.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/PipedReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -145,15 +145,14 @@
      * unconnected piped writer and <code>snk</code>
      * is an unconnected piped reader, they
      * may be connected by either the call:
-     * <p>
+     *
      * <pre><code>snk.connect(src)</code> </pre>
      * <p>
      * or the call:
-     * <p>
+     *
      * <pre><code>src.connect(snk)</code> </pre>
      * <p>
-     * The two
-     * calls have the same effect.
+     * The two calls have the same effect.
      *
      * @param      src   The piped writer to connect to.
      * @exception  IOException  if an I/O error occurs.
--- a/jdk/src/share/classes/java/io/PrintStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/PrintStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/io/RandomAccessFile.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/RandomAccessFile.java	Mon Nov 11 16:20:48 2013 +0100
@@ -784,7 +784,7 @@
      * </pre></blockquote>
      * <p>
      * then the result is equal to:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      *     ((long)b1 &lt;&lt; 56) + ((long)b2 &lt;&lt; 48)
      *     + ((long)b3 &lt;&lt; 40) + ((long)b4 &lt;&lt; 32)
      *     + ((long)b5 &lt;&lt; 24) + ((long)b6 &lt;&lt; 16)
--- a/jdk/src/share/classes/java/io/Serializable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/Serializable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -55,7 +55,7 @@
  *
  * Classes that require special handling during the serialization and
  * deserialization process must implement special methods with these exact
- * signatures: <p>
+ * signatures:
  *
  * <PRE>
  * private void writeObject(java.io.ObjectOutputStream out)
@@ -101,7 +101,7 @@
  *
  * <p>Serializable classes that need to designate an alternative object to be
  * used when writing an object to the stream should implement this
- * special method with the exact signature: <p>
+ * special method with the exact signature:
  *
  * <PRE>
  * ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException;
@@ -115,7 +115,7 @@
  *
  * Classes that need to designate a replacement when an instance of it
  * is read from the stream should implement this special method with the
- * exact signature.<p>
+ * exact signature.
  *
  * <PRE>
  * ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException;
@@ -133,7 +133,7 @@
  * deserialization will result in an {@link InvalidClassException}.  A
  * serializable class can declare its own serialVersionUID explicitly by
  * declaring a field named <code>"serialVersionUID"</code> that must be static,
- * final, and of type <code>long</code>:<p>
+ * final, and of type <code>long</code>:
  *
  * <PRE>
  * ANY-ACCESS-MODIFIER static final long serialVersionUID = 42L;
--- a/jdk/src/share/classes/java/io/SerializablePermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/io/SerializablePermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,7 +43,6 @@
  * The following table lists all the possible SerializablePermission target names,
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
- * <P>
  *
  * <table border=1 cellpadding=5 summary="Permission target name, what the permission allows, and associated risks">
  * <tr>
--- a/jdk/src/share/classes/java/lang/AbstractStringBuilder.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/AbstractStringBuilder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -330,9 +330,9 @@
      * characters to be copied is {@code srcEnd-srcBegin}. The
      * characters are copied into the subarray of {@code dst} starting
      * at index {@code dstBegin} and ending at index:
-     * <p><blockquote><pre>
+     * <pre>{@code
      * dstbegin + (srcEnd-srcBegin) - 1
-     * </pre></blockquote>
+     * }</pre>
      *
      * @param      srcBegin   start copying at this offset.
      * @param      srcEnd     stop copying at this offset.
@@ -859,16 +859,16 @@
      *
      * <p> An invocation of this method of the form
      *
-     * <blockquote><pre>
-     * sb.subSequence(begin,&nbsp;end)</pre></blockquote>
+     * <pre>{@code
+     * sb.subSequence(begin,&nbsp;end)}</pre>
      *
      * behaves in exactly the same way as the invocation
      *
-     * <blockquote><pre>
-     * sb.substring(begin,&nbsp;end)</pre></blockquote>
+     * <pre>{@code
+     * sb.substring(begin,&nbsp;end)}</pre>
      *
      * This method is provided so that this class can
-     * implement the {@link CharSequence} interface. </p>
+     * implement the {@link CharSequence} interface.
      *
      * @param      start   the start index, inclusive.
      * @param      end     the end index, exclusive.
@@ -1287,9 +1287,9 @@
      * Returns the index within this string of the first occurrence of the
      * specified substring. The integer returned is the smallest value
      * <i>k</i> such that:
-     * <blockquote><pre>
+     * <pre>{@code
      * this.toString().startsWith(str, <i>k</i>)
-     * </pre></blockquote>
+     * }</pre>
      * is {@code true}.
      *
      * @param   str   any string.
@@ -1306,10 +1306,10 @@
      * Returns the index within this string of the first occurrence of the
      * specified substring, starting at the specified index.  The integer
      * returned is the smallest value {@code k} for which:
-     * <blockquote><pre>
+     * <pre>{@code
      *     k >= Math.min(fromIndex, this.length()) &&
      *                   this.toString().startsWith(str, k)
-     * </pre></blockquote>
+     * }</pre>
      * If no such value of <i>k</i> exists, then -1 is returned.
      *
      * @param   str         the substring for which to search.
@@ -1326,9 +1326,9 @@
      * of the specified substring.  The rightmost empty string "" is
      * considered to occur at the index value {@code this.length()}.
      * The returned index is the largest value <i>k</i> such that
-     * <blockquote><pre>
+     * <pre>{@code
      * this.toString().startsWith(str, k)
-     * </pre></blockquote>
+     * }</pre>
      * is true.
      *
      * @param   str   the substring to search for.
@@ -1345,10 +1345,10 @@
      * Returns the index within this string of the last occurrence of the
      * specified substring. The integer returned is the largest value <i>k</i>
      * such that:
-     * <blockquote><pre>
+     * <pre>{@code
      *     k <= Math.min(fromIndex, this.length()) &&
      *                   this.toString().startsWith(str, k)
-     * </pre></blockquote>
+     * }</pre>
      * If no such value of <i>k</i> exists, then -1 is returned.
      *
      * @param   str         the substring to search for.
--- a/jdk/src/share/classes/java/lang/ArrayStoreException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/ArrayStoreException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -29,7 +29,7 @@
  * Thrown to indicate that an attempt has been made to store the
  * wrong type of object into an array of objects. For example, the
  * following code generates an <code>ArrayStoreException</code>:
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *     Object x[] = new String[3];
  *     x[0] = new Integer(0);
  * </pre></blockquote>
--- a/jdk/src/share/classes/java/lang/AutoCloseable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/AutoCloseable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -48,7 +48,6 @@
  * @author Josh Bloch
  * @since 1.7
  */
-@FunctionalInterface
 public interface AutoCloseable {
     /**
      * Closes this resource, relinquishing any underlying resources.
--- a/jdk/src/share/classes/java/lang/Byte.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Byte.java	Mon Nov 11 16:20:48 2013 +0100
@@ -244,7 +244,7 @@
      * <dd><i>Sign<sub>opt</sub></i> {@code 0X} <i>HexDigits</i>
      * <dd><i>Sign<sub>opt</sub></i> {@code #} <i>HexDigits</i>
      * <dd><i>Sign<sub>opt</sub></i> {@code 0} <i>OctalDigits</i>
-     * <p>
+     *
      * <dt><i>Sign:</i>
      * <dd>{@code -}
      * <dd>{@code +}
--- a/jdk/src/share/classes/java/lang/Character.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Character.java	Mon Nov 11 16:20:48 2013 +0100
@@ -5394,7 +5394,7 @@
      * Other_Lowercase as defined by the Unicode Standard.
      * <p>
      * The following are examples of lowercase characters:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      * a b c d e f g h i j k l m n o p q r s t u v w x y z
      * '&#92;u00DF' '&#92;u00E0' '&#92;u00E1' '&#92;u00E2' '&#92;u00E3' '&#92;u00E4' '&#92;u00E5' '&#92;u00E6'
      * '&#92;u00E7' '&#92;u00E8' '&#92;u00E9' '&#92;u00EA' '&#92;u00EB' '&#92;u00EC' '&#92;u00ED' '&#92;u00EE'
@@ -5430,7 +5430,7 @@
      * Other_Lowercase as defined by the Unicode Standard.
      * <p>
      * The following are examples of lowercase characters:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      * a b c d e f g h i j k l m n o p q r s t u v w x y z
      * '&#92;u00DF' '&#92;u00E0' '&#92;u00E1' '&#92;u00E2' '&#92;u00E3' '&#92;u00E4' '&#92;u00E5' '&#92;u00E6'
      * '&#92;u00E7' '&#92;u00E8' '&#92;u00E9' '&#92;u00EA' '&#92;u00EB' '&#92;u00EC' '&#92;u00ED' '&#92;u00EE'
@@ -5461,14 +5461,14 @@
      * or it has contributory property Other_Uppercase as defined by the Unicode Standard.
      * <p>
      * The following are examples of uppercase characters:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      * A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
      * '&#92;u00C0' '&#92;u00C1' '&#92;u00C2' '&#92;u00C3' '&#92;u00C4' '&#92;u00C5' '&#92;u00C6' '&#92;u00C7'
      * '&#92;u00C8' '&#92;u00C9' '&#92;u00CA' '&#92;u00CB' '&#92;u00CC' '&#92;u00CD' '&#92;u00CE' '&#92;u00CF'
      * '&#92;u00D0' '&#92;u00D1' '&#92;u00D2' '&#92;u00D3' '&#92;u00D4' '&#92;u00D5' '&#92;u00D6' '&#92;u00D8'
      * '&#92;u00D9' '&#92;u00DA' '&#92;u00DB' '&#92;u00DC' '&#92;u00DD' '&#92;u00DE'
      * </pre></blockquote>
-     * <p> Many other Unicode characters are uppercase too.<p>
+     * <p> Many other Unicode characters are uppercase too.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -5496,7 +5496,7 @@
      * or it has contributory property Other_Uppercase as defined by the Unicode Standard.
      * <p>
      * The following are examples of uppercase characters:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      * A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
      * '&#92;u00C0' '&#92;u00C1' '&#92;u00C2' '&#92;u00C3' '&#92;u00C4' '&#92;u00C5' '&#92;u00C6' '&#92;u00C7'
      * '&#92;u00C8' '&#92;u00C9' '&#92;u00CA' '&#92;u00CB' '&#92;u00CC' '&#92;u00CD' '&#92;u00CE' '&#92;u00CF'
@@ -5540,7 +5540,7 @@
      * <li>{@code LATIN CAPITAL LETTER N WITH SMALL LETTER J}
      * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z}
      * </ul>
-     * <p> Many other Unicode characters are titlecase too.<p>
+     * <p> Many other Unicode characters are titlecase too.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
--- a/jdk/src/share/classes/java/lang/Class.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Class.java	Mon Nov 11 16:20:48 2013 +0100
@@ -91,7 +91,7 @@
  * <p> The following example uses a {@code Class} object to print the
  * class name of an object:
  *
- * <p> <blockquote><pre>
+ * <blockquote><pre>
  *     void printClassName(Object obj) {
  *         System.out.println("The class of " + obj +
  *                            " is " + obj.getClass().getName());
@@ -103,7 +103,7 @@
  * <cite>The Java&trade; Language Specification</cite>.
  * For example:
  *
- * <p> <blockquote>
+ * <blockquote>
  *     {@code System.out.println("The name of class Foo is: "+Foo.class.getName());}
  * </blockquote>
  *
@@ -1571,6 +1571,10 @@
      * <p> If this {@code Class} object represents a primitive type or void,
      * then the returned array has length 0.
      *
+     * <p> Static methods declared in superinterfaces of the class or interface
+     * represented by this {@code Class} object are not considered members of
+     * the class or interface.
+     *
      * <p> The elements in the returned array are not sorted and are not in any
      * particular order.
      *
@@ -1729,6 +1733,10 @@
      * <p> If this {@code Class} object represents an array type, then this
      * method does not find the {@code clone()} method.
      *
+     * <p> Static methods declared in superinterfaces of the class or interface
+     * represented by this {@code Class} object are not considered members of
+     * the class or interface.
+     *
      * @param name the name of the method
      * @param parameterTypes the list of parameters
      * @return the {@code Method} object that matches the specified
@@ -1752,7 +1760,7 @@
     public Method getMethod(String name, Class<?>... parameterTypes)
         throws NoSuchMethodException, SecurityException {
         checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true);
-        Method method = getMethod0(name, parameterTypes);
+        Method method = getMethod0(name, parameterTypes, true);
         if (method == null) {
             throw new NoSuchMethodException(getName() + "." + name + argumentTypesToString(parameterTypes));
         }
@@ -2727,6 +2735,14 @@
             }
         }
 
+        void addAllNonStatic(Method[] methods) {
+            for (Method candidate : methods) {
+                if (!Modifier.isStatic(candidate.getModifiers())) {
+                    add(candidate);
+                }
+            }
+        }
+
         int length() {
             return length;
         }
@@ -2797,7 +2813,7 @@
         MethodArray inheritedMethods = new MethodArray();
         Class<?>[] interfaces = getInterfaces();
         for (int i = 0; i < interfaces.length; i++) {
-            inheritedMethods.addAll(interfaces[i].privateGetPublicMethods());
+            inheritedMethods.addAllNonStatic(interfaces[i].privateGetPublicMethods());
         }
         if (!isInterface()) {
             Class<?> c = getSuperclass();
@@ -2900,7 +2916,7 @@
     }
 
 
-    private Method getMethod0(String name, Class<?>[] parameterTypes) {
+    private Method getMethod0(String name, Class<?>[] parameterTypes, boolean includeStaticMethods) {
         // Note: the intent is that the search algorithm this routine
         // uses be equivalent to the ordering imposed by
         // privateGetPublicMethods(). It fetches only the declared
@@ -2913,25 +2929,23 @@
         if ((res = searchMethods(privateGetDeclaredMethods(true),
                                  name,
                                  parameterTypes)) != null) {
-            return res;
+            if (includeStaticMethods || !Modifier.isStatic(res.getModifiers()))
+                return res;
         }
         // Search superclass's methods
         if (!isInterface()) {
             Class<? super T> c = getSuperclass();
             if (c != null) {
-                if ((res = c.getMethod0(name, parameterTypes)) != null) {
+                if ((res = c.getMethod0(name, parameterTypes, true)) != null) {
                     return res;
                 }
             }
         }
         // Search superinterfaces' methods
         Class<?>[] interfaces = getInterfaces();
-        for (int i = 0; i < interfaces.length; i++) {
-            Class<?> c = interfaces[i];
-            if ((res = c.getMethod0(name, parameterTypes)) != null) {
+        for (Class<?> c : interfaces)
+            if ((res = c.getMethod0(name, parameterTypes, false)) != null)
                 return res;
-            }
-        }
         // Not found
         return null;
     }
@@ -3300,7 +3314,10 @@
     public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
-        return AnnotationSupport.getMultipleAnnotations(annotationData().annotations, annotationClass);
+        AnnotationData annotationData = annotationData();
+        return AnnotationSupport.getAssociatedAnnotations(annotationData.declaredAnnotations,
+                                                          this,
+                                                          annotationClass);
     }
 
     /**
@@ -3330,7 +3347,8 @@
     public <A extends Annotation> A[] getDeclaredAnnotationsByType(Class<A> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
-        return AnnotationSupport.getMultipleAnnotations(annotationData().declaredAnnotations, annotationClass);
+        return AnnotationSupport.getDirectlyAndIndirectlyPresent(annotationData().declaredAnnotations,
+                                                                 annotationClass);
     }
 
     /**
@@ -3424,6 +3442,10 @@
         return annotationType;
     }
 
+    Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap() {
+        return annotationData().declaredAnnotations;
+    }
+
     /* Backing store of user-defined values pertaining to this class.
      * Maintained by the ClassValue class.
      */
--- a/jdk/src/share/classes/java/lang/ClassCastException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/ClassCastException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -29,7 +29,7 @@
  * Thrown to indicate that the code has attempted to cast an object
  * to a subclass of which it is not an instance. For example, the
  * following code generates a <code>ClassCastException</code>:
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *     Object x = new Integer(0);
  *     System.out.println((String)x);
  * </pre></blockquote>
--- a/jdk/src/share/classes/java/lang/ClassLoader.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/ClassLoader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -362,7 +362,7 @@
      * default implementation of this method searches for classes in the
      * following order:
      *
-     * <p><ol>
+     * <ol>
      *
      *   <li><p> Invoke {@link #findLoadedClass(String)} to check if the class
      *   has already been loaded.  </p></li>
@@ -488,7 +488,7 @@
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             if (ReflectUtil.isNonPublicProxyClass(cls)) {
-                for (Class intf: cls.getInterfaces()) {
+                for (Class<?> intf: cls.getInterfaces()) {
                     checkPackageAccess(intf, pd);
                 }
                 return;
--- a/jdk/src/share/classes/java/lang/ClassValue.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/ClassValue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -692,7 +692,7 @@
 
         /** Remove all stale entries, everywhere. */
         private void removeStaleEntries() {
-            Entry[] cache = getCache();
+            Entry<?>[] cache = getCache();
             removeStaleEntries(cache, 0, cache.length + PROBE_LIMIT - 1);
         }
 
--- a/jdk/src/share/classes/java/lang/Comparable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Comparable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -93,7 +93,6 @@
  * @see java.util.Comparator
  * @since 1.2
  */
-@FunctionalInterface
 public interface Comparable<T> {
     /**
      * Compares this object with the specified object for order.  Returns a
--- a/jdk/src/share/classes/java/lang/ConditionalSpecialCasing.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/ConditionalSpecialCasing.java	Mon Nov 11 16:20:48 2013 +0100
@@ -74,7 +74,6 @@
         new Entry(0x00CC, new char[]{0x0069, 0x0307, 0x0300}, new char[]{0x00CC}, "lt", 0), // # LATIN CAPITAL LETTER I WITH GRAVE
         new Entry(0x00CD, new char[]{0x0069, 0x0307, 0x0301}, new char[]{0x00CD}, "lt", 0), // # LATIN CAPITAL LETTER I WITH ACUTE
         new Entry(0x0128, new char[]{0x0069, 0x0307, 0x0303}, new char[]{0x0128}, "lt", 0), // # LATIN CAPITAL LETTER I WITH TILDE
-        new Entry(0x0130, new char[]{0x0069, 0x0307}, new char[]{0x0130}, "lt", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
 
         //# ================================================================================
         //# Turkish and Azeri
@@ -85,10 +84,7 @@
         new Entry(0x0049, new char[]{0x0131}, new char[]{0x0049}, "tr", NOT_BEFORE_DOT), // # LATIN CAPITAL LETTER I
         new Entry(0x0049, new char[]{0x0131}, new char[]{0x0049}, "az", NOT_BEFORE_DOT), // # LATIN CAPITAL LETTER I
         new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "tr", 0), // # LATIN SMALL LETTER I
-        new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "az", 0), // # LATIN SMALL LETTER I
-        //# ================================================================================
-        //# Other
-        new Entry(0x0130, new char[]{0x0069, 0x0307}, new char[]{0x0130}, "en", 0), // # LATIN CAPITALLETTER I WITH DOT ABOVE
+        new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "az", 0)  // # LATIN SMALL LETTER I
     };
 
     // A hash table that contains the above entries
--- a/jdk/src/share/classes/java/lang/Double.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Double.java	Mon Nov 11 16:20:48 2013 +0100
@@ -361,15 +361,11 @@
      * <dd><i>SignedInteger</i>
      * </dl>
      *
-     * <p>
-     *
      * <dl>
      * <dt><i>HexFloatingPointLiteral</i>:
      * <dd> <i>HexSignificand BinaryExponent FloatTypeSuffix<sub>opt</sub></i>
      * </dl>
      *
-     * <p>
-     *
      * <dl>
      * <dt><i>HexSignificand:</i>
      * <dd><i>HexNumeral</i>
@@ -380,15 +376,11 @@
      *     </i>{@code .} <i>HexDigits</i>
      * </dl>
      *
-     * <p>
-     *
      * <dl>
      * <dt><i>BinaryExponent:</i>
      * <dd><i>BinaryExponentIndicator SignedInteger</i>
      * </dl>
      *
-     * <p>
-     *
      * <dl>
      * <dt><i>BinaryExponentIndicator:</i>
      * <dd>{@code p}
--- a/jdk/src/share/classes/java/lang/Float.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Float.java	Mon Nov 11 16:20:48 2013 +0100
@@ -321,15 +321,11 @@
      * <dd><i>SignedInteger</i>
      * </dl>
      *
-     * <p>
-     *
      * <dl>
      * <dt><i>HexFloatingPointLiteral</i>:
      * <dd> <i>HexSignificand BinaryExponent FloatTypeSuffix<sub>opt</sub></i>
      * </dl>
      *
-     * <p>
-     *
      * <dl>
      * <dt><i>HexSignificand:</i>
      * <dd><i>HexNumeral</i>
@@ -340,15 +336,11 @@
      *     </i>{@code .} <i>HexDigits</i>
      * </dl>
      *
-     * <p>
-     *
      * <dl>
      * <dt><i>BinaryExponent:</i>
      * <dd><i>BinaryExponentIndicator SignedInteger</i>
      * </dl>
      *
-     * <p>
-     *
      * <dl>
      * <dt><i>BinaryExponentIndicator:</i>
      * <dd>{@code p}
--- a/jdk/src/share/classes/java/lang/Integer.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Integer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1123,7 +1123,7 @@
      * <dd><i>Sign<sub>opt</sub></i> {@code 0X} <i>HexDigits</i>
      * <dd><i>Sign<sub>opt</sub></i> {@code #} <i>HexDigits</i>
      * <dd><i>Sign<sub>opt</sub></i> {@code 0} <i>OctalDigits</i>
-     * <p>
+     *
      * <dt><i>Sign:</i>
      * <dd>{@code -}
      * <dd>{@code +}
--- a/jdk/src/share/classes/java/lang/Iterable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Iterable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -42,7 +42,6 @@
  * @since 1.5
  * @jls 14.14.2 The enhanced for statement
  */
-@FunctionalInterface
 public interface Iterable<T> {
     /**
      * Returns an iterator over elements of type {@code T}.
@@ -52,10 +51,12 @@
     Iterator<T> iterator();
 
     /**
-     * Performs the given action on the contents of the {@code Iterable}, in the
-     * order elements occur when iterating, until all elements have been
-     * processed or the action throws an exception.  Errors or runtime
-     * exceptions thrown by the action are relayed to the caller.
+     * Performs the given action for each element of the {@code Iterable}
+     * until all elements have been processed or the action throws an
+     * exception.  Unless otherwise specified by the implementing class,
+     * actions are performed in the order of iteration (if an iteration order
+     * is specified).  Exceptions thrown by the action are relayed to the
+     * caller.
      *
      * @implSpec
      * <p>The default implementation behaves as if:
@@ -100,4 +101,3 @@
         return Spliterators.spliteratorUnknownSize(iterator(), 0);
     }
 }
-
--- a/jdk/src/share/classes/java/lang/Long.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Long.java	Mon Nov 11 16:20:48 2013 +0100
@@ -853,7 +853,7 @@
      * <dd><i>Sign<sub>opt</sub></i> {@code 0X} <i>HexDigits</i>
      * <dd><i>Sign<sub>opt</sub></i> {@code #} <i>HexDigits</i>
      * <dd><i>Sign<sub>opt</sub></i> {@code 0} <i>OctalDigits</i>
-     * <p>
+     *
      * <dt><i>Sign:</i>
      * <dd>{@code -}
      * <dd>{@code +}
--- a/jdk/src/share/classes/java/lang/Readable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Readable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -34,7 +34,6 @@
  *
  * @since 1.5
  */
-@FunctionalInterface
 public interface Readable {
 
     /**
--- a/jdk/src/share/classes/java/lang/RuntimePermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/RuntimePermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -47,7 +47,6 @@
  * The following table lists all the possible RuntimePermission target names,
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
- * <P>
  *
  * <table border=1 cellpadding=5 summary="permission target name,
  *  what the target allows,and associated risks">
--- a/jdk/src/share/classes/java/lang/SecurityManager.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/SecurityManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -56,7 +56,7 @@
  * are called by various methods in the Java libraries before those
  * methods perform certain potentially sensitive operations. The
  * invocation of such a <code>check</code> method typically looks like this:
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *     SecurityManager security = System.getSecurityManager();
  *     if (security != null) {
  *         security.check<i>XXX</i>(argument, &nbsp;.&nbsp;.&nbsp;.&nbsp;);
@@ -323,7 +323,7 @@
      * by {@link ClassLoader#getSystemClassLoader}) or one of its ancestors.
      * <p>
      * This method will return
-     * <code>null</code> in the following three cases:<p>
+     * <code>null</code> in the following three cases:
      * <ol>
      *   <li>All methods on the execution stack are from classes
      *   defined using the system class loader or one of its ancestors.
@@ -370,7 +370,7 @@
      * by {@link ClassLoader#getSystemClassLoader}) or one of its ancestors.
      * <p>
      * This method will return
-     * <code>null</code> in the following three cases:<p>
+     * <code>null</code> in the following three cases:
      * <ol>
      *   <li>All methods on the execution stack are from classes
      *   defined using the system class loader or one of its ancestors.
@@ -429,7 +429,7 @@
      * by {@link ClassLoader#getSystemClassLoader}) or one of its ancestors.
      * <p>
      * This method will return
-     * -1 in the following three cases:<p>
+     * -1 in the following three cases:
      * <ol>
      *   <li>All methods on the execution stack are from classes
      *   defined using the system class loader or one of its ancestors.
@@ -1281,7 +1281,6 @@
      * This method calls <code>checkPermission</code> with the
      * <code>PropertyPermission(key, "read")</code> permission.
      * <p>
-     * <p>
      * If you override this method, then you should make a call to
      * <code>super.checkPropertyAccess</code>
      * at the point the overridden method would normally throw an
@@ -1714,7 +1713,7 @@
             throw new NullPointerException("class can't be null");
         }
         if (which != Member.PUBLIC) {
-            Class stack[] = getClassContext();
+            Class<?> stack[] = getClassContext();
             /*
              * stack depth of 4 should be the caller of one of the
              * methods in java.lang.Class that invoke checkMember
--- a/jdk/src/share/classes/java/lang/Short.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Short.java	Mon Nov 11 16:20:48 2013 +0100
@@ -249,7 +249,7 @@
      * <dd><i>Sign<sub>opt</sub></i> {@code 0X} <i>HexDigits</i>
      * <dd><i>Sign<sub>opt</sub></i> {@code #} <i>HexDigits</i>
      * <dd><i>Sign<sub>opt</sub></i> {@code 0} <i>OctalDigits</i>
-     * <p>
+     *
      * <dt><i>Sign:</i>
      * <dd>{@code -}
      * <dd>{@code +}
--- a/jdk/src/share/classes/java/lang/String.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/String.java	Mon Nov 11 16:20:48 2013 +0100
@@ -47,16 +47,16 @@
  * Strings are constant; their values cannot be changed after they
  * are created. String buffers support mutable strings.
  * Because String objects are immutable they can be shared. For example:
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *     String str = "abc";
  * </pre></blockquote><p>
  * is equivalent to:
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *     char data[] = {'a', 'b', 'c'};
  *     String str = new String(data);
  * </pre></blockquote><p>
  * Here are some more examples of how strings can be used:
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *     System.out.println("abc");
  *     String cde = "cde";
  *     System.out.println("abc" + cde);
@@ -786,7 +786,7 @@
      * {@code srcEnd-srcBegin}). The characters are copied into the
      * subarray of {@code dst} starting at index {@code dstBegin}
      * and ending at index:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      *     dstbegin + (srcEnd-srcBegin) - 1
      * </pre></blockquote>
      *
@@ -2598,21 +2598,14 @@
             }
             if (localeDependent || srcChar == '\u03A3') { // GREEK CAPITAL LETTER SIGMA
                 lowerChar = ConditionalSpecialCasing.toLowerCaseEx(this, i, locale);
-            } else if (srcChar == '\u0130') { // LATIN CAPITAL LETTER I DOT
-                lowerChar = Character.ERROR;
             } else {
                 lowerChar = Character.toLowerCase(srcChar);
             }
             if ((lowerChar == Character.ERROR)
                     || (lowerChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) {
                 if (lowerChar == Character.ERROR) {
-                    if (!localeDependent && srcChar == '\u0130') {
-                        lowerCharArray =
-                                ConditionalSpecialCasing.toLowerCaseCharArray(this, i, Locale.ENGLISH);
-                    } else {
-                        lowerCharArray =
-                                ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale);
-                    }
+                    lowerCharArray =
+                            ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale);
                 } else if (srcCount == 2) {
                     resultOffset += Character.toChars(lowerChar, result, i + resultOffset) - srcCount;
                     continue;
@@ -2669,7 +2662,7 @@
      * {@code String} may be a different length than the original {@code String}.
      * <p>
      * Examples of locale-sensitive and 1:M case mappings are in the following table.
-     * <p>
+     *
      * <table border="1" summary="Examples of locale-sensitive and 1:M case mappings. Shows Language code of locale, lower case, upper case, and description.">
      * <tr>
      *   <th>Language Code of Locale</th>
--- a/jdk/src/share/classes/java/lang/System.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/System.java	Mon Nov 11 16:20:48 2013 +0100
@@ -26,10 +26,12 @@
 
 import java.io.*;
 import java.lang.reflect.Executable;
+import java.lang.annotation.Annotation;
 import java.security.AccessControlContext;
 import java.util.Properties;
 import java.util.PropertyPermission;
 import java.util.StringTokenizer;
+import java.util.Map;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.AllPermission;
@@ -1227,6 +1229,9 @@
             public AnnotationType getAnnotationType(Class<?> klass) {
                 return klass.getAnnotationType();
             }
+            public Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass) {
+                return klass.getDeclaredAnnotationMap();
+            }
             public byte[] getRawClassAnnotations(Class<?> klass) {
                 return klass.getRawAnnotations();
             }
--- a/jdk/src/share/classes/java/lang/Thread.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Thread.java	Mon Nov 11 16:20:48 2013 +0100
@@ -76,7 +76,7 @@
  * <code>Thread</code>. An instance of the subclass can then be
  * allocated and started. For example, a thread that computes primes
  * larger than a stated value could be written as follows:
- * <p><hr><blockquote><pre>
+ * <hr><blockquote><pre>
  *     class PrimeThread extends Thread {
  *         long minPrime;
  *         PrimeThread(long minPrime) {
@@ -91,7 +91,7 @@
  * </pre></blockquote><hr>
  * <p>
  * The following code would then create a thread and start it running:
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *     PrimeThread p = new PrimeThread(143);
  *     p.start();
  * </pre></blockquote>
@@ -102,7 +102,7 @@
  * then be allocated, passed as an argument when creating
  * <code>Thread</code>, and started. The same example in this other
  * style looks like the following:
- * <p><hr><blockquote><pre>
+ * <hr><blockquote><pre>
  *     class PrimeRun implements Runnable {
  *         long minPrime;
  *         PrimeRun(long minPrime) {
@@ -117,7 +117,7 @@
  * </pre></blockquote><hr>
  * <p>
  * The following code would then create a thread and start it running:
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *     PrimeRun p = new PrimeRun(143);
  *     new Thread(p).start();
  * </pre></blockquote>
--- a/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -101,7 +101,6 @@
      *                       should implement.
      * @param additionalBridges Method types for additional signatures to be
      *                          bridged to the implementation method
-     * @throws ReflectiveOperationException
      * @throws LambdaConversionException If any of the meta-factory protocol
      * invariants are violated
      */
@@ -114,7 +113,7 @@
                                        boolean isSerializable,
                                        Class<?>[] markerInterfaces,
                                        MethodType[] additionalBridges)
-            throws ReflectiveOperationException, LambdaConversionException {
+            throws LambdaConversionException {
         this.targetClass = caller.lookupClass();
         this.invokedType = invokedType;
 
@@ -160,7 +159,7 @@
      * @throws ReflectiveOperationException
      */
     abstract CallSite buildCallSite()
-            throws ReflectiveOperationException, LambdaConversionException;
+            throws LambdaConversionException;
 
     /**
      * Check the meta-factory arguments for errors
--- a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -26,16 +26,19 @@
 package java.lang.invoke;
 
 import jdk.internal.org.objectweb.asm.*;
+import sun.invoke.util.BytecodeDescriptor;
 import sun.misc.Unsafe;
 import sun.security.action.GetPropertyAction;
 
 import java.io.FilePermission;
+import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.security.ProtectionDomain;
+import java.util.LinkedHashSet;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.PropertyPermission;
+import java.util.Set;
 
 import static jdk.internal.org.objectweb.asm.Opcodes.*;
 
@@ -50,14 +53,19 @@
 
     private static final int CLASSFILE_VERSION = 51;
     private static final String METHOD_DESCRIPTOR_VOID = Type.getMethodDescriptor(Type.VOID_TYPE);
-    private static final String NAME_MAGIC_ACCESSOR_IMPL = "java/lang/invoke/MagicLambdaImpl";
+    private static final String JAVA_LANG_OBJECT = "java/lang/Object";
     private static final String NAME_CTOR = "<init>";
+    private static final String NAME_FACTORY = "get$Lambda";
 
     //Serialization support
     private static final String NAME_SERIALIZED_LAMBDA = "java/lang/invoke/SerializedLambda";
+    private static final String NAME_NOT_SERIALIZABLE_EXCEPTION = "java/io/NotSerializableException";
     private static final String DESCR_METHOD_WRITE_REPLACE = "()Ljava/lang/Object;";
+    private static final String DESCR_METHOD_WRITE_OBJECT = "(Ljava/io/ObjectOutputStream;)V";
+    private static final String DESCR_METHOD_READ_OBJECT = "(Ljava/io/ObjectInputStream;)V";
     private static final String NAME_METHOD_WRITE_REPLACE = "writeReplace";
-    private static final String NAME_OBJECT = "java/lang/Object";
+    private static final String NAME_METHOD_READ_OBJECT = "readObject";
+    private static final String NAME_METHOD_WRITE_OBJECT = "writeObject";
     private static final String DESCR_CTOR_SERIALIZED_LAMBDA
             = MethodType.methodType(void.class,
                                     Class.class,
@@ -65,6 +73,12 @@
                                     int.class, String.class, String.class, String.class,
                                     String.class,
                                     Object[].class).toMethodDescriptorString();
+    private static final String DESCR_CTOR_NOT_SERIALIZABLE_EXCEPTION
+            = MethodType.methodType(void.class, String.class).toMethodDescriptorString();
+    private static final String[] SER_HOSTILE_EXCEPTIONS = new String[] {NAME_NOT_SERIALIZABLE_EXCEPTION};
+
+
+    private static final String[] EMPTY_STRING_ARRAY = new String[0];
 
     // Used to ensure that each spun class name is unique
     private static final AtomicInteger counter = new AtomicInteger(0);
@@ -84,15 +98,12 @@
     private final String implMethodClassName;        // Name of type containing implementation "CC"
     private final String implMethodName;             // Name of implementation method "impl"
     private final String implMethodDesc;             // Type descriptor for implementation methods "(I)Ljava/lang/String;"
-    private final Type[] implMethodArgumentTypes;    // ASM types for implementation method parameters
-    private final Type implMethodReturnType;         // ASM type for implementation method return type "Ljava/lang/String;"
+    private final Class<?> implMethodReturnClass;    // class for implementaion method return type "Ljava/lang/String;"
     private final MethodType constructorType;        // Generated class constructor type "(CC)void"
-    private final String constructorDesc;            // Type descriptor for constructor "(LCC;)V"
     private final ClassWriter cw;                    // ASM class writer
-    private final Type[] argTypes;                   // ASM types for the constructor arguments
     private final String[] argNames;                 // Generated names for the constructor arguments
+    private final String[] argDescs;                 // Type descriptors for the constructor arguments
     private final String lambdaClassName;            // Generated name for the generated class "X$$Lambda$1"
-    private final Type[] instantiatedArgumentTypes;  // ASM types for the functional interface arguments
 
     /**
      * General meta-factory constructor, supporting both standard cases and
@@ -128,7 +139,6 @@
      *                       should implement.
      * @param additionalBridges Method types for additional signatures to be
      *                          bridged to the implementation method
-     * @throws ReflectiveOperationException
      * @throws LambdaConversionException If any of the meta-factory protocol
      * invariants are violated
      */
@@ -141,29 +151,30 @@
                                        boolean isSerializable,
                                        Class<?>[] markerInterfaces,
                                        MethodType[] additionalBridges)
-            throws ReflectiveOperationException, LambdaConversionException {
+            throws LambdaConversionException {
         super(caller, invokedType, samMethodName, samMethodType,
               implMethod, instantiatedMethodType,
               isSerializable, markerInterfaces, additionalBridges);
         implMethodClassName = implDefiningClass.getName().replace('.', '/');
         implMethodName = implInfo.getName();
         implMethodDesc = implMethodType.toMethodDescriptorString();
-        Type implMethodAsmType = Type.getMethodType(implMethodDesc);
-        implMethodArgumentTypes = implMethodAsmType.getArgumentTypes();
-        implMethodReturnType = (implKind == MethodHandleInfo.REF_newInvokeSpecial)
-                ? Type.getObjectType(implMethodClassName)
-                : implMethodAsmType.getReturnType();
+        implMethodReturnClass = (implKind == MethodHandleInfo.REF_newInvokeSpecial)
+                ? implDefiningClass
+                : implMethodType.returnType();
         constructorType = invokedType.changeReturnType(Void.TYPE);
-        constructorDesc = constructorType.toMethodDescriptorString();
         lambdaClassName = targetClass.getName().replace('.', '/') + "$$Lambda$" + counter.incrementAndGet();
         cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
-        argTypes = Type.getArgumentTypes(constructorDesc);
-        argNames = new String[argTypes.length];
-        for (int i = 0; i < argTypes.length; i++) {
-            argNames[i] = "arg$" + (i + 1);
+        int parameterCount = invokedType.parameterCount();
+        if (parameterCount > 0) {
+            argNames = new String[parameterCount];
+            argDescs = new String[parameterCount];
+            for (int i = 0; i < parameterCount; i++) {
+                argNames[i] = "arg$" + (i + 1);
+                argDescs[i] = BytecodeDescriptor.unparse(invokedType.parameterType(i));
+            }
+        } else {
+            argNames = argDescs = EMPTY_STRING_ARRAY;
         }
-        instantiatedArgumentTypes = Type.getArgumentTypes(
-                instantiatedMethodType.toMethodDescriptorString());
     }
 
     /**
@@ -179,36 +190,44 @@
      * is not found
      */
     @Override
-    CallSite buildCallSite() throws ReflectiveOperationException, LambdaConversionException {
+    CallSite buildCallSite() throws LambdaConversionException {
         final Class<?> innerClass = spinInnerClass();
         if (invokedType.parameterCount() == 0) {
             final Constructor[] ctrs = AccessController.doPrivileged(
                     new PrivilegedAction<Constructor[]>() {
                 @Override
                 public Constructor[] run() {
-                    return innerClass.getDeclaredConstructors();
+                    Constructor<?>[] ctrs = innerClass.getDeclaredConstructors();
+                    if (ctrs.length == 1) {
+                        // The lambda implementing inner class constructor is private, set
+                        // it accessible (by us) before creating the constant sole instance
+                        ctrs[0].setAccessible(true);
+                    }
+                    return ctrs;
                 }
-            });
+                    });
             if (ctrs.length != 1) {
-                throw new ReflectiveOperationException("Expected one lambda constructor for "
+                throw new LambdaConversionException("Expected one lambda constructor for "
                         + innerClass.getCanonicalName() + ", got " + ctrs.length);
             }
-            // The lambda implementing inner class constructor is private, set
-            // it accessible (by us) before creating the constant sole instance
-            AccessController.doPrivileged(new PrivilegedAction<Void>() {
-                @Override
-                public Void run() {
-                    ctrs[0].setAccessible(true);
-                    return null;
-                }
-            });
-            Object inst = ctrs[0].newInstance();
-            return new ConstantCallSite(MethodHandles.constant(samBase, inst));
+
+            try {
+                Object inst = ctrs[0].newInstance();
+                return new ConstantCallSite(MethodHandles.constant(samBase, inst));
+            }
+            catch (ReflectiveOperationException e) {
+                throw new LambdaConversionException("Exception instantiating lambda object", e);
+            }
         } else {
-            return new ConstantCallSite(
-                    MethodHandles.Lookup.IMPL_LOOKUP
-                         .findConstructor(innerClass, constructorType)
-                         .asType(constructorType.changeReturnType(samBase)));
+            try {
+                UNSAFE.ensureClassInitialized(innerClass);
+                return new ConstantCallSite(
+                        MethodHandles.Lookup.IMPL_LOOKUP
+                             .findStatic(innerClass, NAME_FACTORY, invokedType));
+            }
+            catch (ReflectiveOperationException e) {
+                throw new LambdaConversionException("Exception finding constructor", e);
+            }
         }
     }
 
@@ -228,44 +247,59 @@
      * is not found
      */
     private Class<?> spinInnerClass() throws LambdaConversionException {
-        String[] interfaces = new String[markerInterfaces.length + 1];
-        interfaces[0] = samBase.getName().replace('.', '/');
-        for (int i=0; i<markerInterfaces.length; i++) {
-            interfaces[i+1] = markerInterfaces[i].getName().replace('.', '/');
+        String[] interfaces;
+        String samIntf = samBase.getName().replace('.', '/');
+        boolean accidentallySerializable = !isSerializable && Serializable.class.isAssignableFrom(samBase);
+        if (markerInterfaces.length == 0) {
+            interfaces = new String[]{samIntf};
+        } else {
+            // Assure no duplicate interfaces (ClassFormatError)
+            Set<String> itfs = new LinkedHashSet<>(markerInterfaces.length + 1);
+            itfs.add(samIntf);
+            for (Class<?> markerInterface : markerInterfaces) {
+                itfs.add(markerInterface.getName().replace('.', '/'));
+                accidentallySerializable |= !isSerializable && Serializable.class.isAssignableFrom(markerInterface);
+            }
+            interfaces = itfs.toArray(new String[itfs.size()]);
         }
+
         cw.visit(CLASSFILE_VERSION, ACC_SUPER + ACC_FINAL + ACC_SYNTHETIC,
                  lambdaClassName, null,
-                 NAME_MAGIC_ACCESSOR_IMPL, interfaces);
+                 JAVA_LANG_OBJECT, interfaces);
 
         // Generate final fields to be filled in by constructor
-        for (int i = 0; i < argTypes.length; i++) {
+        for (int i = 0; i < argDescs.length; i++) {
             FieldVisitor fv = cw.visitField(ACC_PRIVATE + ACC_FINAL,
                                             argNames[i],
-                                            argTypes[i].getDescriptor(),
+                                            argDescs[i],
                                             null, null);
             fv.visitEnd();
         }
 
         generateConstructor();
 
+        if (invokedType.parameterCount() != 0) {
+            generateFactory();
+        }
+
         // Forward the SAM method
-        String methodDescriptor = samMethodType.toMethodDescriptorString();
         MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, samMethodName,
-                                          methodDescriptor, null, null);
-        new ForwardingMethodGenerator(mv).generate(methodDescriptor);
+                                          samMethodType.toMethodDescriptorString(), null, null);
+        new ForwardingMethodGenerator(mv).generate(samMethodType);
 
         // Forward the bridges
         if (additionalBridges != null) {
             for (MethodType mt : additionalBridges) {
-                methodDescriptor = mt.toMethodDescriptorString();
                 mv = cw.visitMethod(ACC_PUBLIC|ACC_BRIDGE, samMethodName,
-                                    methodDescriptor, null, null);
-                new ForwardingMethodGenerator(mv).generate(methodDescriptor);
+                                    mt.toMethodDescriptorString(), null, null);
+                new ForwardingMethodGenerator(mv).generate(mt);
             }
         }
 
         if (isSerializable)
-            generateWriteReplace();
+            generateSerializationFriendlyMethods();
+        else if (accidentallySerializable)
+            generateSerializationHostileMethods();
 
         cw.visitEnd();
 
@@ -287,21 +321,27 @@
             new PropertyPermission("user.dir", "read"));
         }
 
-        ClassLoader loader = targetClass.getClassLoader();
-        ProtectionDomain pd = (loader == null)
-                              ? null
-                              : AccessController.doPrivileged(
-                                      new PrivilegedAction<ProtectionDomain>() {
-                                          @Override
-                                          public ProtectionDomain run() {
-                                              return targetClass.getProtectionDomain();
-                                          }
-                                      }
-                              );
+        return UNSAFE.defineAnonymousClass(targetClass, classBytes, null);
+    }
 
-        return UNSAFE.defineClass(lambdaClassName,
-                                  classBytes, 0, classBytes.length,
-                                  loader, pd);
+    /**
+     * Generate the factory method for the class
+     */
+    private void generateFactory() {
+        MethodVisitor m = cw.visitMethod(ACC_PRIVATE | ACC_STATIC, NAME_FACTORY, invokedType.toMethodDescriptorString(), null, null);
+        m.visitCode();
+        m.visitTypeInsn(NEW, lambdaClassName);
+        m.visitInsn(Opcodes.DUP);
+        int parameterCount = invokedType.parameterCount();
+        for (int typeIndex = 0, varIndex = 0; typeIndex < parameterCount; typeIndex++) {
+            Class<?> argType = invokedType.parameterType(typeIndex);
+            m.visitVarInsn(getLoadOpcode(argType), varIndex);
+            varIndex += getParameterSize(argType);
+        }
+        m.visitMethodInsn(INVOKESPECIAL, lambdaClassName, NAME_CTOR, constructorType.toMethodDescriptorString());
+        m.visitInsn(ARETURN);
+        m.visitMaxs(-1, -1);
+        m.visitEnd();
     }
 
     /**
@@ -310,18 +350,18 @@
     private void generateConstructor() {
         // Generate constructor
         MethodVisitor ctor = cw.visitMethod(ACC_PRIVATE, NAME_CTOR,
-                                            constructorDesc, null, null);
+                                            constructorType.toMethodDescriptorString(), null, null);
         ctor.visitCode();
         ctor.visitVarInsn(ALOAD, 0);
-        ctor.visitMethodInsn(INVOKESPECIAL, NAME_MAGIC_ACCESSOR_IMPL, NAME_CTOR,
+        ctor.visitMethodInsn(INVOKESPECIAL, JAVA_LANG_OBJECT, NAME_CTOR,
                              METHOD_DESCRIPTOR_VOID);
-        int lvIndex = 0;
-        for (int i = 0; i < argTypes.length; i++) {
+        int parameterCount = invokedType.parameterCount();
+        for (int i = 0, lvIndex = 0; i < parameterCount; i++) {
             ctor.visitVarInsn(ALOAD, 0);
-            ctor.visitVarInsn(argTypes[i].getOpcode(ILOAD), lvIndex + 1);
-            lvIndex += argTypes[i].getSize();
-            ctor.visitFieldInsn(PUTFIELD, lambdaClassName, argNames[i],
-                                argTypes[i].getDescriptor());
+            Class<?> argType = invokedType.parameterType(i);
+            ctor.visitVarInsn(getLoadOpcode(argType), lvIndex + 1);
+            lvIndex += getParameterSize(argType);
+            ctor.visitFieldInsn(PUTFIELD, lambdaClassName, argNames[i], argDescs[i]);
         }
         ctor.visitInsn(RETURN);
         // Maxs computed by ClassWriter.COMPUTE_MAXS, these arguments ignored
@@ -330,9 +370,9 @@
     }
 
     /**
-     * Generate the writeReplace method (if needed for serialization)
+     * Generate a writeReplace method that supports serialization
      */
-    private void generateWriteReplace() {
+    private void generateSerializationFriendlyMethods() {
         TypeConvertingMethodAdapter mv
                 = new TypeConvertingMethodAdapter(
                     cw.visitMethod(ACC_PRIVATE + ACC_FINAL,
@@ -351,16 +391,14 @@
         mv.visitLdcInsn(implInfo.getName());
         mv.visitLdcInsn(implInfo.getMethodType().toMethodDescriptorString());
         mv.visitLdcInsn(instantiatedMethodType.toMethodDescriptorString());
-
-        mv.iconst(argTypes.length);
-        mv.visitTypeInsn(ANEWARRAY, NAME_OBJECT);
-        for (int i = 0; i < argTypes.length; i++) {
+        mv.iconst(argDescs.length);
+        mv.visitTypeInsn(ANEWARRAY, JAVA_LANG_OBJECT);
+        for (int i = 0; i < argDescs.length; i++) {
             mv.visitInsn(DUP);
             mv.iconst(i);
             mv.visitVarInsn(ALOAD, 0);
-            mv.visitFieldInsn(GETFIELD, lambdaClassName, argNames[i],
-                              argTypes[i].getDescriptor());
-            mv.boxIfTypePrimitive(argTypes[i]);
+            mv.visitFieldInsn(GETFIELD, lambdaClassName, argNames[i], argDescs[i]);
+            mv.boxIfTypePrimitive(Type.getType(argDescs[i]));
             mv.visitInsn(AASTORE);
         }
         mv.visitMethodInsn(INVOKESPECIAL, NAME_SERIALIZED_LAMBDA, NAME_CTOR,
@@ -372,6 +410,37 @@
     }
 
     /**
+     * Generate a readObject/writeObject method that is hostile to serialization
+     */
+    private void generateSerializationHostileMethods() {
+        MethodVisitor mv = cw.visitMethod(ACC_PRIVATE + ACC_FINAL,
+                                          NAME_METHOD_WRITE_OBJECT, DESCR_METHOD_WRITE_OBJECT,
+                                          null, SER_HOSTILE_EXCEPTIONS);
+        mv.visitCode();
+        mv.visitTypeInsn(NEW, NAME_NOT_SERIALIZABLE_EXCEPTION);
+        mv.visitInsn(DUP);
+        mv.visitLdcInsn("Non-serializable lambda");
+        mv.visitMethodInsn(INVOKESPECIAL, NAME_NOT_SERIALIZABLE_EXCEPTION, NAME_CTOR,
+                           DESCR_CTOR_NOT_SERIALIZABLE_EXCEPTION);
+        mv.visitInsn(ATHROW);
+        mv.visitMaxs(-1, -1);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(ACC_PRIVATE + ACC_FINAL,
+                            NAME_METHOD_READ_OBJECT, DESCR_METHOD_READ_OBJECT,
+                            null, SER_HOSTILE_EXCEPTIONS);
+        mv.visitCode();
+        mv.visitTypeInsn(NEW, NAME_NOT_SERIALIZABLE_EXCEPTION);
+        mv.visitInsn(DUP);
+        mv.visitLdcInsn("Non-serializable lambda");
+        mv.visitMethodInsn(INVOKESPECIAL, NAME_NOT_SERIALIZABLE_EXCEPTION, NAME_CTOR,
+                           DESCR_CTOR_NOT_SERIALIZABLE_EXCEPTION);
+        mv.visitInsn(ATHROW);
+        mv.visitMaxs(-1, -1);
+        mv.visitEnd();
+    }
+
+    /**
      * This class generates a method body which calls the lambda implementation
      * method, converting arguments, as needed.
      */
@@ -381,20 +450,19 @@
             super(mv);
         }
 
-        void generate(String methodDescriptor) {
+        void generate(MethodType methodType) {
             visitCode();
 
             if (implKind == MethodHandleInfo.REF_newInvokeSpecial) {
                 visitTypeInsn(NEW, implMethodClassName);
                 visitInsn(DUP);
             }
-            for (int i = 0; i < argTypes.length; i++) {
+            for (int i = 0; i < argNames.length; i++) {
                 visitVarInsn(ALOAD, 0);
-                visitFieldInsn(GETFIELD, lambdaClassName, argNames[i],
-                               argTypes[i].getDescriptor());
+                visitFieldInsn(GETFIELD, lambdaClassName, argNames[i], argDescs[i]);
             }
 
-            convertArgumentTypes(Type.getArgumentTypes(methodDescriptor));
+            convertArgumentTypes(methodType);
 
             // Invoke the method we want to forward to
             visitMethodInsn(invocationOpcode(), implMethodClassName, implMethodName, implMethodDesc);
@@ -402,46 +470,36 @@
             // Convert the return value (if any) and return it
             // Note: if adapting from non-void to void, the 'return'
             // instruction will pop the unneeded result
-            Type samReturnType = Type.getReturnType(methodDescriptor);
-            convertType(implMethodReturnType, samReturnType, samReturnType);
-            visitInsn(samReturnType.getOpcode(Opcodes.IRETURN));
+            Class<?> samReturnClass = methodType.returnType();
+            convertType(implMethodReturnClass, samReturnClass, samReturnClass);
+            visitInsn(getReturnOpcode(samReturnClass));
             // Maxs computed by ClassWriter.COMPUTE_MAXS,these arguments ignored
             visitMaxs(-1, -1);
             visitEnd();
         }
 
-        private void convertArgumentTypes(Type[] samArgumentTypes) {
+        private void convertArgumentTypes(MethodType samType) {
             int lvIndex = 0;
             boolean samIncludesReceiver = implIsInstanceMethod &&
-                                                   argTypes.length == 0;
+                                                   invokedType.parameterCount() == 0;
             int samReceiverLength = samIncludesReceiver ? 1 : 0;
             if (samIncludesReceiver) {
                 // push receiver
-                Type rcvrType = samArgumentTypes[0];
-                Type instantiatedRcvrType = instantiatedArgumentTypes[0];
-
-                visitVarInsn(rcvrType.getOpcode(ILOAD), lvIndex + 1);
-                lvIndex += rcvrType.getSize();
-                convertType(rcvrType, Type.getType(implDefiningClass), instantiatedRcvrType);
+                Class<?> rcvrType = samType.parameterType(0);
+                visitVarInsn(getLoadOpcode(rcvrType), lvIndex + 1);
+                lvIndex += getParameterSize(rcvrType);
+                convertType(rcvrType, implDefiningClass, instantiatedMethodType.parameterType(0));
             }
-            int argOffset = implMethodArgumentTypes.length - samArgumentTypes.length;
-            for (int i = samReceiverLength; i < samArgumentTypes.length; i++) {
-                Type argType = samArgumentTypes[i];
-                Type targetType = implMethodArgumentTypes[argOffset + i];
-                Type instantiatedArgType = instantiatedArgumentTypes[i];
-
-                visitVarInsn(argType.getOpcode(ILOAD), lvIndex + 1);
-                lvIndex += argType.getSize();
-                convertType(argType, targetType, instantiatedArgType);
+            int samParametersLength = samType.parameterCount();
+            int argOffset = implMethodType.parameterCount() - samParametersLength;
+            for (int i = samReceiverLength; i < samParametersLength; i++) {
+                Class<?> argType = samType.parameterType(i);
+                visitVarInsn(getLoadOpcode(argType), lvIndex + 1);
+                lvIndex += getParameterSize(argType);
+                convertType(argType, implMethodType.parameterType(argOffset + i), instantiatedMethodType.parameterType(i));
             }
         }
 
-        private void convertType(Type argType, Type targetType, Type functionalType) {
-            convertType(argType.getDescriptor(),
-                        targetType.getDescriptor(),
-                        functionalType.getDescriptor());
-        }
-
         private int invocationOpcode() throws InternalError {
             switch (implKind) {
                 case MethodHandleInfo.REF_invokeStatic:
@@ -459,4 +517,43 @@
             }
         }
     }
+
+    static int getParameterSize(Class<?> c) {
+        if (c == Void.TYPE) {
+            return 0;
+        } else if (c == Long.TYPE || c == Double.TYPE) {
+            return 2;
+        }
+        return 1;
+    }
+
+    static int getLoadOpcode(Class<?> c) {
+        if(c == Void.TYPE) {
+            throw new InternalError("Unexpected void type of load opcode");
+        }
+        return ILOAD + getOpcodeOffset(c);
+    }
+
+    static int getReturnOpcode(Class<?> c) {
+        if(c == Void.TYPE) {
+            return RETURN;
+        }
+        return IRETURN + getOpcodeOffset(c);
+    }
+
+    private static int getOpcodeOffset(Class<?> c) {
+        if (c.isPrimitive()) {
+            if (c == Long.TYPE) {
+                return 1;
+            } else if (c == Float.TYPE) {
+                return 2;
+            } else if (c == Double.TYPE) {
+                return 3;
+            }
+            return 0;
+        } else {
+            return 4;
+        }
+    }
+
 }
--- a/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -29,88 +29,128 @@
 import java.util.Arrays;
 
 /**
- * <p>Bootstrap methods for converting lambda expressions and method references to functional interface objects.</p>
- *
- * <p>For every lambda expressions or method reference in the source code, there is a target type which is a
- * functional interface. Evaluating a lambda expression produces an object of its target type. The mechanism for
- * evaluating lambda expressions is to invoke an invokedynamic call site, which takes arguments describing the sole
- * method of the functional interface and the implementation method, and returns an object (the lambda object) that
- * implements the target type. Methods of the lambda object invoke the implementation method. For method
- * references, the implementation method is simply the referenced method; for lambda expressions, the
- * implementation method is produced by the compiler based on the body of the lambda expression. The methods in
- * this file are the bootstrap methods for those invokedynamic call sites, called lambda factories, and the
- * bootstrap methods responsible for linking the lambda factories are called lambda meta-factories.
- *
- * <p>The bootstrap methods in this class take the information about the functional interface, the implementation
- * method, and the static types of the captured lambda arguments, and link a call site which, when invoked,
- * produces the lambda object.
- *
- * <p>When parameterized types are used, the instantiated type of the functional interface method may be different
- * from that in the functional interface. For example, consider
- * {@code interface I<T> { int m(T x); }} if this functional interface type is used in a lambda
- * {@code I<Byte>; v = ...}, we need both the actual functional interface method which has the signature
- * {@code (Object)int} and the erased instantiated type of the functional interface method (or simply
- * <I>instantiated method type</I>), which has signature
- * {@code (Byte)int}.
+ * <p>Methods to facilitate the creation of simple "function objects" that
+ * implement one or more interfaces by delegation to a provided {@link MethodHandle},
+ * possibly after type adaptation and partial evaluation of arguments.  These
+ * methods are typically used as <em>bootstrap methods</em> for {@code invokedynamic}
+ * call sites, to support the <em>lambda expression</em> and <em>method
+ * reference expression</em> features of the Java Programming Language.
  *
- * <p>The argument list of the implementation method and the argument list of the functional interface method(s)
- * may differ in several ways.  The implementation methods may have additional arguments to accommodate arguments
- * captured by the lambda expression; there may also be differences resulting from permitted adaptations of
- * arguments, such as casting, boxing, unboxing, and primitive widening. They may also differ because of var-args,
- * but this is expected to be handled by the compiler.
- *
- * <p>Invokedynamic call sites have two argument lists: a static argument list and a dynamic argument list.  The
- * static argument list lives in the constant pool; the dynamic argument list lives on the operand stack at
- * invocation time.  The bootstrap method has access to the entire static argument list (which in this case,
- * contains method handles describing the implementation method and the canonical functional interface method),
- * as well as a method signature describing the number and static types (but not the values) of the dynamic
- * arguments, and the static return type of the invokedynamic site.
+ * <p>Indirect access to the behavior specified by the provided {@code MethodHandle}
+ * proceeds in order through three phases:
+ * <ul>
+ *     <li><em>Linkage</em> occurs when the methods in this class are invoked.
+ *     They take as arguments an interface to be implemented (typically a
+ *     <em>functional interface</em>, one with a single abstract method), a
+ *     name and signature of a method from that interface to be implemented, a
+ *     method handle describing the desired implementation behavior
+ *     for that method, and possibly other additional metadata, and produce a
+ *     {@link CallSite} whose target can be used to create suitable function
+ *     objects.  Linkage may involve dynamically loading a new class that
+ *     implements the target interface. The {@code CallSite} can be considered a
+ *     "factory" for function objects and so these linkage methods are referred
+ *     to as "metafactories".</li>
  *
- * <p>The implementation method is described with a method handle. In theory, any method handle could be used.
- * Currently supported are method handles representing invocation of virtual, interface, constructor and static
- * methods.
+ *     <li><em>Capture</em> occurs when the {@code CallSite}'s target is
+ *     invoked, typically through an {@code invokedynamic} call site,
+ *     producing a function object.  This may occur many times for
+ *     a single factory {@code CallSite}.  Capture may involve allocation of a
+ *     new function object, or may return an existing function object.  The
+ *     behavior {@code MethodHandle} may have additional parameters beyond those
+ *     of the specified interface method; these are referred to as <em>captured
+ *     parameters</em>, which must be provided as arguments to the
+ *     {@code CallSite} target, and which may be early-bound to the behavior
+ *     {@code MethodHandle}.  The number of captured parameters and their types
+ *     are determined during linkage.</li>
  *
- * <p>Assume:
- * <ul>
- *      <li>the functional interface method has N arguments, of types (U1, U2, ... Un) and return type Ru</li>
- *      <li>then the instantiated method type also has N arguments, of types (T1, T2, ... Tn) and return type Rt</li>
- *      <li>the implementation method has M arguments, of types (A1..Am) and return type Ra,</li>
- *      <li>the dynamic argument list has K arguments of types (D1..Dk), and the invokedynamic return site has
- *          type Rd</li>
- *      <li>the functional interface type is F</li>
+ *     <li><em>Invocation</em> occurs when an implemented interface method
+ *     is invoked on a function object.  This may occur many times for a single
+ *     function object.  The method referenced by the behavior {@code MethodHandle}
+ *     is invoked with the captured arguments and any additional arguments
+ *     provided on invocation, as if by {@link MethodHandle#invoke(Object...)}.</li>
  * </ul>
  *
- * <p>The following signature invariants must hold:
+ * <p>It is sometimes useful to restrict the set of inputs or results permitted
+ * at invocation.  For example, when the generic interface {@code Predicate<T>}
+ * is parameterized as {@code Predicate<String>}, the input must be a
+ * {@code String}, even though the method to implement allows any {@code Object}.
+ * At linkage time, an additional {@link MethodType} parameter describes the
+ * "instantiated" method type; on invocation, the arguments and eventual result
+ * are checked against this {@code MethodType}.
+ *
+ * <p>This class provides two forms of linkage methods: a standard version
+ * ({@link #metafactory(MethodHandles.Lookup, String, MethodType, MethodType, MethodHandle, MethodType)})
+ * using an optimized protocol, and an alternate version
+ * {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)}).
+ * The alternate version is a generalization of the standard version, providing
+ * additional control over the behavior of the generated function objects via
+ * flags and additional arguments.  The alternate version adds the ability to
+ * manage the following attributes of function objects:
+ *
  * <ul>
- *     <li>Rd is a subtype of F</li>
- *     <li>For i=1..N, Ti is a subtype of Ui</li>
- *     <li>Either Rt and Ru are primitive and are the same type, or both are reference types and
- *         Rt is a subtype of Ru</li>
- *     <li>If the implementation method is a static method:
- *     <ul>
- *         <li>K + N = M</li>
- *         <li>For i=1..K, Di = Ai</li>
- *         <li>For i=1..N, Ti is adaptable to Aj, where j=i+k</li>
- *     </ul></li>
- *     <li>If the implementation method is an instance method:
- *     <ul>
- *         <li>K + N = M + 1</li>
- *         <li>D1 must be a subtype of the enclosing class for the implementation method</li>
- *         <li>For i=2..K, Di = Aj, where j=i-1</li>
- *         <li>For i=1..N, Ti is adaptable to Aj, where j=i+k-1</li>
- *     </ul></li>
- *     <li>The return type Rt is void, or the return type Ra is not void and is adaptable to Rt</li>
+ *     <li><em>Bridging.</em>  It is sometimes useful to implement multiple
+ *     variations of the method signature, involving argument or return type
+ *     adaptation.  This occurs when multiple distinct VM signatures for a method
+ *     are logically considered to be the same method by the language.  The
+ *     flag {@code FLAG_BRIDGES} indicates that a list of additional
+ *     {@code MethodType}s will be provided, each of which will be implemented
+ *     by the resulting function object.  These methods will share the same
+ *     name and instantiated type.</li>
+ *
+ *     <li><em>Multiple interfaces.</em>  If needed, more than one interface
+ *     can be implemented by the function object.  (These additional interfaces
+ *     are typically marker interfaces with no methods.)  The flag {@code FLAG_MARKERS}
+ *     indicates that a list of additional interfaces will be provided, each of
+ *     which should be implemented by the resulting function object.</li>
+ *
+ *     <li><em>Serializability.</em>  The generated function objects do not
+ *     generally support serialization.  If desired, {@code FLAG_SERIALIZABLE}
+ *     can be used to indicate that the function objects should be serializable.
+ *     Serializable function objects will use, as their serialized form,
+ *     instances of the class {@code SerializedLambda}, which requires additional
+ *     assistance from the capturing class (the class described by the
+ *     {@link MethodHandles.Lookup} parameter {@code caller}); see
+ *     {@link SerializedLambda} for details.</li>
  * </ul>
  *
- * <p>Note that the potentially parameterized implementation return type provides the value for the SAM. Whereas
- * the completely known instantiated return type is adapted to the implementation arguments. Because the
- * instantiated type of the implementation method is not available, the adaptability of return types cannot be
- * checked as precisely at link-time as the arguments can be checked. Thus a loose version of link-time checking is
- * done on return type, while a strict version is applied to arguments.
+ * <p>Assume the linkage arguments are as follows:
+ * <ul>
+ *      <li>{@code invokedType} (describing the {@code CallSite} signature) has
+ *      K parameters of types (D1..Dk) and return type Rd;</li>
+ *      <li>{@code samMethodType} (describing the implemented method type) has N
+ *      parameters, of types (U1..Un) and return type Ru;</li>
+ *      <li>{@code implMethod} (the {@code MethodHandle} providing the
+ *      implementation has M parameters, of types (A1..Am) and return type Ra
+ *      (if the method describes an instance method, the method type of this
+ *      method handle already includes an extra first argument corresponding to
+ *      the receiver);</li>
+ *      <li>{@code instantiatedMethodType} (allowing restrictions on invocation)
+ *      has N parameters, of types (T1..Tn) and return type Rt.</li>
+ * </ul>
+ *
+ * <p>Then the following linkage invariants must hold:
+ * <ul>
+ *     <li>Rd is an interface</li>
+ *     <li>{@code implMethod} is a <em>direct method handle</em></li>
+ *     <li>{@code samMethodType} and {@code instantiatedMethodType} have the same
+ *     arity N, and for i=1..N, Ti and Ui are the same type, or Ti and Ui are
+ *     both reference types and Ti is a subtype of Ui</li>
+ *     <li>Either Rt and Ru are the same type, or both are reference types and
+ *     Rt is a subtype of Ru</li>
+ *     <li>K + N = M</li>
+ *     <li>For i=1..K, Di = Ai</li>
+ *     <li>For i=1..N, Ti is adaptable to Aj, where j=i+k</li>
+ *     <li>The return type Rt is void, or the return type Ra is not void and is
+ *     adaptable to Rt</li>
+ * </ul>
+ *
+ * <p>Further, at capture time, if {@code implMethod} corresponds to an instance
+ * method, and there are any capture arguments ({@code K > 0}), then the first
+ * capture argument (corresponding to the receiver) must be non-null.
  *
  * <p>A type Q is considered adaptable to S as follows:
  * <table summary="adaptable types">
- *     <tr><th>Q</th><th>S</th><th>Link-time checks</th><th>Capture-time checks</th></tr>
+ *     <tr><th>Q</th><th>S</th><th>Link-time checks</th><th>Invocation-time checks</th></tr>
  *     <tr>
  *         <td>Primitive</td><td>Primitive</td>
  *         <td>Q can be converted to S via a primitive widening conversion</td>
@@ -123,27 +163,59 @@
  *     </tr>
  *     <tr>
  *         <td>Reference</td><td>Primitive</td>
- *         <td>strict: Q is a primitive wrapper and Primitive(Q) can be widened to S
- *         <br>loose: If Q is a primitive wrapper, check that Primitive(Q) can be widened to S</td>
- *         <td>If Q is not a primitive wrapper, cast Q to the base Wrapper(S); for example Number for numeric types</td>
+ *         <td>for parameter types: Q is a primitive wrapper and Primitive(Q)
+ *         can be widened to S
+ *         <br>for return types: If Q is a primitive wrapper, check that
+ *         Primitive(Q) can be widened to S</td>
+ *         <td>If Q is not a primitive wrapper, cast Q to the base Wrapper(S);
+ *         for example Number for numeric types</td>
  *     </tr>
  *     <tr>
  *         <td>Reference</td><td>Reference</td>
- *         <td>strict: S is a supertype of Q
- *         <br>loose: none</td>
+ *         <td>for parameter types: S is a supertype of Q
+ *         <br>for return types: none</td>
  *         <td>Cast from Q to S</td>
  *     </tr>
  * </table>
  *
- * The default bootstrap ({@link #metafactory}) represents the common cases and uses an optimized protocol.
- * Alternate bootstraps (e.g., {@link #altMetafactory}) exist to support uncommon cases such as serialization
- * or additional marker superinterfaces.
+ * @apiNote These linkage methods are designed to support the evaluation
+ * of <em>lambda expressions</em> and <em>method references</em> in the Java
+ * Language.  For every lambda expressions or method reference in the source code,
+ * there is a target type which is a functional interface.  Evaluating a lambda
+ * expression produces an object of its target type. The recommended mechanism
+ * for evaluating lambda expressions is to desugar the lambda body to a method,
+ * invoke an invokedynamic call site whose static argument list describes the
+ * sole method of the functional interface and the desugared implementation
+ * method, and returns an object (the lambda object) that implements the target
+ * type. (For method references, the implementation method is simply the
+ * referenced method; no desugaring is needed.)
  *
+ * <p>The argument list of the implementation method and the argument list of
+ * the interface method(s) may differ in several ways.  The implementation
+ * methods may have additional arguments to accommodate arguments captured by
+ * the lambda expression; there may also be differences resulting from permitted
+ * adaptations of arguments, such as casting, boxing, unboxing, and primitive
+ * widening. (Varargs adaptations are not handled by the metafactories; these are
+ * expected to be handled by the caller.)
+ *
+ * <p>Invokedynamic call sites have two argument lists: a static argument list
+ * and a dynamic argument list.  The static argument list is stored in the
+ * constant pool; the dynamic argument is pushed on the operand stack at capture
+ * time.  The bootstrap method has access to the entire static argument list
+ * (which in this case, includes information describing the implementation method,
+ * the target interface, and the target interface method(s)), as well as a
+ * method signature describing the number and static types (but not the values)
+ * of the dynamic arguments and the static return type of the invokedynamic site.
+ *
+ * @implNote The implementation method is described with a method handle. In
+ * theory, any method handle could be used. Currently supported are direct method
+ * handles representing invocation of virtual, interface, constructor and static
+ * methods.
  */
 public class LambdaMetafactory {
 
-    /** Flag for alternate metafactories indicating the lambda object is
-     * must to be serializable */
+    /** Flag for alternate metafactories indicating the lambda object
+     * must be serializable */
     public static final int FLAG_SERIALIZABLE = 1 << 0;
 
     /**
@@ -163,41 +235,58 @@
     private static final MethodType[] EMPTY_MT_ARRAY = new MethodType[0];
 
     /**
-     * Standard meta-factory for conversion of lambda expressions or method
-     * references to functional interfaces.
+     * Facilitates the creation of simple "function objects" that implement one
+     * or more interfaces by delegation to a provided {@link MethodHandle},
+     * after appropriate type adaptation and partial evaluation of arguments.
+     * Typically used as a <em>bootstrap method</em> for {@code invokedynamic}
+     * call sites, to support the <em>lambda expression</em> and <em>method
+     * reference expression</em> features of the Java Programming Language.
+     *
+     * <p>This is the standard, streamlined metafactory; additional flexibility
+     * is provided by {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)}.
+     * A general description of the behavior of this method is provided
+     * {@link LambdaMetafactory above}.
      *
-     * @param caller Stacked automatically by VM; represents a lookup context
-     *                   with the accessibility privileges of the caller.
-     * @param invokedName Stacked automatically by VM; the name of the invoked
-     *                    method as it appears at the call site.
-     *                    Used as the name of the functional interface method
-     *                    to which the lambda or method reference is being
-     *                    converted.
-     * @param invokedType Stacked automatically by VM; the signature of the
-     *                    invoked method, which includes the expected static
-     *                    type of the returned lambda object, and the static
-     *                    types of the captured arguments for the lambda.
+     * <p>When the target of the {@code CallSite} returned from this method is
+     * invoked, the resulting function objects are instances of a class which
+     * implements the interface named by the return type of {@code invokedType},
+     * declares a method with the name given by {@code invokedName} and the
+     * signature given by {@code samMethodType}.  It may also override additional
+     * methods from {@code Object}.
+     *
+     * @param caller Represents a lookup context with the accessibility
+     *               privileges of the caller.  When used with {@code invokedynamic},
+     *               this is stacked automatically by the VM.
+     * @param invokedName The name of the method to implement.  When used with
+     *                    {@code invokedynamic}, this is provided by the
+     *                    {@code NameAndType} of the {@code InvokeDynamic}
+     *                    structure and is stacked automatically by the VM.
+     * @param invokedType The expected signature of the {@code CallSite}.  The
+     *                    parameter types represent the types of capture variables;
+     *                    the return type is the interface to implement.   When
+     *                    used with {@code invokedynamic}, this is provided by
+     *                    the {@code NameAndType} of the {@code InvokeDynamic}
+     *                    structure and is stacked automatically by the VM.
      *                    In the event that the implementation method is an
-     *                    instance method, the first argument in the invocation
-     *                    signature will correspond to the receiver.
-     * @param samMethodType MethodType of the method in the functional interface
-     *                      to which the lambda or method reference is being
-     *                      converted, represented as a MethodType.
-     * @param implMethod The implementation method which should be called
-     *                   (with suitable adaptation of argument types, return
-     *                   types, and adjustment for captured arguments) when
-     *                   methods of the resulting functional interface instance
-     *                   are invoked.
-     * @param instantiatedMethodType The signature of the primary functional
-     *                               interface method after type variables
-     *                               are substituted with their instantiation
-     *                               from the capture site
-     * @return a CallSite, which, when invoked, will return an instance of the
-     * functional interface
-     * @throws ReflectiveOperationException if the caller is not able to
-     * reconstruct one of the method handles
-     * @throws LambdaConversionException If any of the meta-factory protocol
-     * invariants are violated
+     *                    instance method and this signature has any parameters,
+     *                    the first parameter in the invocation signature must
+     *                    correspond to the receiver.
+     * @param samMethodType Signature and return type of method to be implemented
+     *                      by the function object.
+     * @param implMethod A direct method handle describing the implementation
+     *                   method which should be called (with suitable adaptation
+     *                   of argument types, return types, and with captured
+     *                   arguments prepended to the invocation arguments) at
+     *                   invocation time.
+     * @param instantiatedMethodType The signature and return type that should
+     *                               be enforced dynamically at invocation time.
+     *                               This may be the same as {@code samMethodType},
+     *                               or may be a specialization of it.
+     * @return a CallSite whose target can be used to perform capture, generating
+     *         instances of the interface named by {@code invokedType}
+     * @throws LambdaConversionException If any of the linkage invariants
+     *                                   described {@link LambdaMetafactory above}
+     *                                   are violated
      */
     public static CallSite metafactory(MethodHandles.Lookup caller,
                                        String invokedName,
@@ -205,7 +294,7 @@
                                        MethodType samMethodType,
                                        MethodHandle implMethod,
                                        MethodType instantiatedMethodType)
-                   throws ReflectiveOperationException, LambdaConversionException {
+            throws LambdaConversionException {
         AbstractValidatingLambdaMetafactory mf;
         mf = new InnerClassLambdaMetafactory(caller, invokedType,
                                              invokedName, samMethodType,
@@ -216,60 +305,128 @@
     }
 
     /**
-     * Alternate meta-factory for conversion of lambda expressions or method
-     * references to functional interfaces, which supports serialization and
-     * other uncommon options.
+     * Facilitates the creation of simple "function objects" that implement one
+     * or more interfaces by delegation to a provided {@link MethodHandle},
+     * after appropriate type adaptation and partial evaluation of arguments.
+     * Typically used as a <em>bootstrap method</em> for {@code invokedynamic}
+     * call sites, to support the <em>lambda expression</em> and <em>method
+     * reference expression</em> features of the Java Programming Language.
      *
-     * The declared argument list for this method is:
+     * <p>This is the general, more flexible metafactory; a streamlined version
+     * is provided by {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)}.
+     * A general description of the behavior of this method is provided
+     * {@link LambdaMetafactory above}.
      *
+     * <p>The argument list for this method includes three fixed parameters,
+     * corresponding to the parameters automatically stacked by the VM for the
+     * bootstrap method in an {@code invokedynamic} invocation, and an {@code Object[]}
+     * parameter that contains additional parameters.  The declared argument
+     * list for this method is:
+     *
+     * <pre>{@code
      *  CallSite altMetafactory(MethodHandles.Lookup caller,
      *                          String invokedName,
      *                          MethodType invokedType,
      *                          Object... args)
+     * }</pre>
      *
-     * but it behaves as if the argument list is:
+     * <p>but it behaves as if the argument list is as follows:
      *
+     * <pre>{@code
      *  CallSite altMetafactory(MethodHandles.Lookup caller,
      *                          String invokedName,
      *                          MethodType invokedType,
-     *                          MethodType samMethodType
+     *                          MethodType samMethodType,
      *                          MethodHandle implMethod,
      *                          MethodType instantiatedMethodType,
      *                          int flags,
-     *                          int markerInterfaceCount, // IF flags has MARKERS set
-     *                          Class... markerInterfaces // IF flags has MARKERS set
-     *                          int bridgeCount,          // IF flags has BRIDGES set
-     *                          MethodType... bridges     // IF flags has BRIDGES set
+     *                          int markerInterfaceCount,  // IF flags has MARKERS set
+     *                          Class... markerInterfaces, // IF flags has MARKERS set
+     *                          int bridgeCount,           // IF flags has BRIDGES set
+     *                          MethodType... bridges      // IF flags has BRIDGES set
      *                          )
+     * }</pre>
      *
+     * <p>Arguments that appear in the argument list for
+     * {@link #metafactory(MethodHandles.Lookup, String, MethodType, MethodType, MethodHandle, MethodType)}
+     * have the same specification as in that method.  The additional arguments
+     * are interpreted as follows:
+     * <ul>
+     *     <li>{@code flags} indicates additional options; this is a bitwise
+     *     OR of desired flags.  Defined flags are {@link #FLAG_BRIDGES},
+     *     {@link #FLAG_MARKERS}, and {@link #FLAG_SERIALIZABLE}.</li>
+     *     <li>{@code markerInterfaceCount} is the number of additional interfaces
+     *     the function object should implement, and is present if and only if the
+     *     {@code FLAG_MARKERS} flag is set.</li>
+     *     <li>{@code markerInterfaces} is a variable-length list of additional
+     *     interfaces to implement, whose length equals {@code markerInterfaceCount},
+     *     and is present if and only if the {@code FLAG_MARKERS} flag is set.</li>
+     *     <li>{@code bridgeCount} is the number of additional method signatures
+     *     the function object should implement, and is present if and only if
+     *     the {@code FLAG_BRIDGES} flag is set.</li>
+     *     <li>{@code bridges} is a variable-length list of additional
+     *     methods signatures to implement, whose length equals {@code bridgeCount},
+     *     and is present if and only if the {@code FLAG_BRIDGES} flag is set.</li>
+     * </ul>
+     *
+     * <p>Each class named by {@code markerInterfaces} is subject to the same
+     * restrictions as {@code Rd}, the return type of {@code invokedType},
+     * as described {@link LambdaMetafactory above}.  Each {@code MethodType}
+     * named by {@code bridges} is subject to the same restrictions as
+     * {@code samMethodType}, as described {@link LambdaMetafactory above}.
+     *
+     * <p>When FLAG_SERIALIZABLE is set in {@code flags}, the function objects
+     * will implement {@code Serializable}, and will have a {@code writeReplace}
+     * method that returns an appropriate {@link SerializedLambda}.  The
+     * {@code caller} class must have an appropriate {@code $deserializeLambda$}
+     * method, as described in {@link SerializedLambda}.
      *
-     * @param caller Stacked automatically by VM; represents a lookup context
-     *               with the accessibility privileges of the caller.
-     * @param invokedName Stacked automatically by VM; the name of the invoked
-     *                    method as it appears at the call site.
-     *                    Used as the name of the functional interface method
-     *                    to which the lambda or method reference is being
-     *                    converted.
-     * @param invokedType Stacked automatically by VM; the signature of the
-     *                    invoked method, which includes the expected static
-     *                    type of the returned lambda object, and the static
-     *                    types of the captured arguments for the lambda.
+     * <p>When the target of the {@code CallSite} returned from this method is
+     * invoked, the resulting function objects are instances of a class with
+     * the following properties:
+     * <ul>
+     *     <li>The class implements the interface named by the return type
+     *     of {@code invokedType} and any interfaces named by {@code markerInterfaces}</li>
+     *     <li>The class declares methods with the name given by {@code invokedName},
+     *     and the signature given by {@code samMethodType} and additional signatures
+     *     given by {@code bridges}</li>
+     *     <li>The class may override methods from {@code Object}, and may
+     *     implement methods related to serialization.</li>
+     * </ul>
+     *
+     * @param caller Represents a lookup context with the accessibility
+     *               privileges of the caller.  When used with {@code invokedynamic},
+     *               this is stacked automatically by the VM.
+     * @param invokedName The name of the method to implement.  When used with
+     *                    {@code invokedynamic}, this is provided by the
+     *                    {@code NameAndType} of the {@code InvokeDynamic}
+     *                    structure and is stacked automatically by the VM.
+     * @param invokedType The expected signature of the {@code CallSite}.  The
+     *                    parameter types represent the types of capture variables;
+     *                    the return type is the interface to implement.   When
+     *                    used with {@code invokedynamic}, this is provided by
+     *                    the {@code NameAndType} of the {@code InvokeDynamic}
+     *                    structure and is stacked automatically by the VM.
      *                    In the event that the implementation method is an
-     *                    instance method, the first argument in the invocation
-     *                    signature will correspond to the receiver.
-     * @param  args       flags and optional arguments, as described above
-     * @return a CallSite, which, when invoked, will return an instance of the
-     * functional interface
-     * @throws ReflectiveOperationException if the caller is not able to
-     * reconstruct one of the method handles
-     * @throws LambdaConversionException If any of the meta-factory protocol
-     * invariants are violated
+     *                    instance method and this signature has any parameters,
+     *                    the first parameter in the invocation signature must
+     *                    correspond to the receiver.
+     * @param  args       An {@code Object[]} array containing the required
+     *                    arguments {@code samMethodType}, {@code implMethod},
+     *                    {@code instantiatedMethodType}, {@code flags}, and any
+     *                    optional arguments, as described
+     *                    {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)} above}
+     * @return a CallSite whose target can be used to perform capture, generating
+     *         instances of the interface named by {@code invokedType}
+     * @throws LambdaConversionException If any of the linkage invariants
+     *                                   described {@link LambdaMetafactory above}
+     *                                   are violated
      */
     public static CallSite altMetafactory(MethodHandles.Lookup caller,
                                           String invokedName,
                                           MethodType invokedType,
                                           Object... args)
-            throws ReflectiveOperationException, LambdaConversionException {
+            throws LambdaConversionException {
         MethodType samMethodType = (MethodType)args[0];
         MethodHandle implMethod = (MethodHandle)args[1];
         MethodType instantiatedMethodType = (MethodType)args[2];
@@ -294,15 +451,15 @@
         else
             bridges = EMPTY_MT_ARRAY;
 
-        boolean foundSerializableSupertype = Serializable.class.isAssignableFrom(invokedType.returnType());
-        for (Class<?> c : markerInterfaces)
-            foundSerializableSupertype |= Serializable.class.isAssignableFrom(c);
-        boolean isSerializable = ((flags & LambdaMetafactory.FLAG_SERIALIZABLE) != 0)
-                                 || foundSerializableSupertype;
-
-        if (isSerializable && !foundSerializableSupertype) {
-            markerInterfaces = Arrays.copyOf(markerInterfaces, markerInterfaces.length + 1);
-            markerInterfaces[markerInterfaces.length-1] = Serializable.class;
+        boolean isSerializable = ((flags & FLAG_SERIALIZABLE) != 0);
+        if (isSerializable) {
+            boolean foundSerializableSupertype = Serializable.class.isAssignableFrom(invokedType.returnType());
+            for (Class<?> c : markerInterfaces)
+                foundSerializableSupertype |= Serializable.class.isAssignableFrom(c);
+            if (!foundSerializableSupertype) {
+                markerInterfaces = Arrays.copyOf(markerInterfaces, markerInterfaces.length + 1);
+                markerInterfaces[markerInterfaces.length-1] = Serializable.class;
+            }
         }
 
         AbstractValidatingLambdaMetafactory mf
--- a/jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.lang.invoke;
-
-/** <P> MagicLambdaImpl (named for similarity to MagicAccessorImpl and
- others, not because it actually implements an interface) is a
- marker class in the hierarchy. All subclasses of this class are
- "magically" granted access by the VM to otherwise inaccessible
- fields and methods of other classes. It is distinct from MagicAccessorImpl
- because, while we want to bypass accessibility checks, we do not want to
- bypass verification.</P>
-
- <P> Do not change the name of this class without also changing the
- VM's code. </P> */
-
-class MagicLambdaImpl {
-}
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Mon Nov 11 16:20:48 2013 +0100
@@ -441,8 +441,13 @@
             assert(refKindIsValid(refKind));
             return lookup.linkMethodHandleConstant((byte) refKind, defc, name, type);
         } catch (IllegalAccessException ex) {
-            Error err = new IllegalAccessError(ex.getMessage());
-            throw initCauseFrom(err, ex);
+            Throwable cause = ex.getCause();
+            if (cause instanceof AbstractMethodError) {
+                throw (AbstractMethodError) cause;
+            } else {
+                Error err = new IllegalAccessError(ex.getMessage());
+                throw initCauseFrom(err, ex);
+            }
         } catch (NoSuchMethodException ex) {
             Error err = new NoSuchMethodError(ex.getMessage());
             throw initCauseFrom(err, ex);
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1716,6 +1716,13 @@
                 checkSymbolicClass(defc);
                 return mh;
             }
+            // Treat MethodHandle.invoke and invokeExact specially.
+            if (defc == MethodHandle.class && refKind == REF_invokeVirtual) {
+                mh = findVirtualForMH(member.getName(), member.getMethodType());
+                if (mh != null) {
+                    return mh;
+                }
+            }
             MemberName resolved = resolveOrFail(refKind, member);
             mh = getDirectMethodForConstant(refKind, defc, resolved);
             if (mh instanceof DirectMethodHandle
@@ -1768,12 +1775,6 @@
             if (MethodHandleNatives.refKindIsField(refKind)) {
                 return getDirectFieldNoSecurityManager(refKind, defc, member);
             } else if (MethodHandleNatives.refKindIsMethod(refKind)) {
-                if (defc == MethodHandle.class && refKind == REF_invokeVirtual) {
-                    MethodHandle mh = findVirtualForMH(member.getName(), member.getMethodType());
-                    if (mh != null) {
-                        return mh;
-                    }
-                }
                 return getDirectMethodNoSecurityManager(refKind, defc, member, lookupClass);
             } else if (refKind == REF_newInvokeSpecial) {
                 return getDirectConstructorNoSecurityManager(defc, member);
--- a/jdk/src/share/classes/java/lang/invoke/MethodType.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/MethodType.java	Mon Nov 11 16:20:48 2013 +0100
@@ -813,7 +813,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
      */
@@ -844,7 +844,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
@@ -862,7 +862,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.
@@ -882,7 +882,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
@@ -912,7 +912,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/invoke/SerializedLambda.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java	Mon Nov 11 16:20:48 2013 +0100
@@ -32,9 +32,26 @@
 import java.util.Objects;
 
 /**
- * Serialized form of a lambda expression.  The properties of this class represent the information that is present
- * at the lambda factory site, including the identity of the primary functional interface method, the identity of the
- * implementation method, and any variables captured from the local environment at the time of lambda capture.
+ * Serialized form of a lambda expression.  The properties of this class
+ * represent the information that is present at the lambda factory site, including
+ * static metafactory arguments such as the identity of the primary functional
+ * interface method and the identity of the implementation method, as well as
+ * dynamic metafactory arguments such as values captured from the lexical scope
+ * at the time of lambda capture.
+ *
+ * <p>Implementors of serializable lambdas, such as compilers or language
+ * runtime libraries, are expected to ensure that instances deserialize properly.
+ * One means to do so is to ensure that the {@code writeReplace} method returns
+ * an instance of {@code SerializedLambda}, rather than allowing default
+ * serialization to proceed.
+ *
+ * <p>{@code SerializedLambda} has a {@code readResolve} method that looks for
+ * a (possibly private) static method called
+ * {@code $deserializeLambda$(SerializedLambda)} in the capturing class, invokes
+ * that with itself as the first argument, and returns the result.  Lambda classes
+ * implementing {@code $deserializeLambda$} are responsible for validating
+ * that the properties of the {@code SerializedLambda} are consistent with a
+ * lambda actually captured by that class.
  *
  * @see LambdaMetafactory
  */
--- a/jdk/src/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -28,6 +28,7 @@
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.org.objectweb.asm.Opcodes;
 import jdk.internal.org.objectweb.asm.Type;
+import sun.invoke.util.BytecodeDescriptor;
 import sun.invoke.util.Wrapper;
 import static sun.invoke.util.Wrapper.*;
 
@@ -204,27 +205,27 @@
     }
 
     /**
-     * Convert an argument of type 'argType' to be passed to 'targetType' assuring that it is 'functionalType'.
+     * Convert an argument of type 'arg' to be passed to 'target' assuring that it is 'functional'.
      * Insert the needed conversion instructions in the method code.
-     * @param argType
-     * @param targetType
-     * @param functionalType
+     * @param arg
+     * @param target
+     * @param functional
      */
-    void convertType(String dArg, String dTarget, String dFunctional) {
-        if (dArg.equals(dTarget)) {
+    void convertType(Class<?> arg, Class<?> target, Class<?> functional) {
+        if (arg.equals(target)) {
             return;
         }
-        Wrapper wArg = toWrapper(dArg);
-        Wrapper wTarget = toWrapper(dTarget);
-        if (wArg == VOID || wTarget == VOID) {
+        if (arg == Void.TYPE || target == Void.TYPE) {
             return;
         }
-        if (isPrimitive(wArg)) {
-            if (isPrimitive(wTarget)) {
+        if (arg.isPrimitive()) {
+            Wrapper wArg = Wrapper.forPrimitiveType(arg);
+            if (target.isPrimitive()) {
                 // Both primitives: widening
-                widen(wArg, wTarget);
+                widen(wArg, Wrapper.forPrimitiveType(target));
             } else {
                 // Primitive argument to reference target
+                String dTarget = BytecodeDescriptor.unparse(target);
                 Wrapper wPrimTarget = wrapperOrNullFromDescriptor(dTarget);
                 if (wPrimTarget != null) {
                     // The target is a boxed primitive type, widen to get there before boxing
@@ -237,16 +238,18 @@
                 }
             }
         } else {
+            String dArg = BytecodeDescriptor.unparse(arg);
             String dSrc;
-            Wrapper wFunctional = toWrapper(dFunctional);
-            if (isPrimitive(wFunctional)) {
+            if (functional.isPrimitive()) {
                 dSrc = dArg;
             } else {
                 // Cast to convert to possibly more specific type, and generate CCE for invalid arg
-                dSrc = dFunctional;
-                cast(dArg, dFunctional);
+                dSrc = BytecodeDescriptor.unparse(functional);
+                cast(dArg, dSrc);
             }
-            if (isPrimitive(wTarget)) {
+            String dTarget = BytecodeDescriptor.unparse(target);
+            if (target.isPrimitive()) {
+                Wrapper wTarget = toWrapper(dTarget);
                 // Reference argument to primitive target
                 Wrapper wps = wrapperOrNullFromDescriptor(dSrc);
                 if (wps != null) {
--- a/jdk/src/share/classes/java/lang/management/CompilationMXBean.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/CompilationMXBean.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/ManagementFactory.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/ManagementFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -60,7 +60,7 @@
  * one or more <i>platform MXBeans</i> representing
  * the management interface of a component of the Java virtual
  * machine.
- * <p>
+ *
  * <h3><a name="MXBean">Platform MXBeans</a></h3>
  * <p>
  * A platform MXBean is a <i>managed bean</i> that
--- a/jdk/src/share/classes/java/lang/management/ManagementPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/ManagementPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -33,10 +33,8 @@
  * The following table
  * provides a summary description of what the permission allows,
  * and discusses the risks of granting code the permission.
- * <P>
  *
- * <table border=1 cellpadding=5 summary="Table shows permission target name, wh
-at the permission allows, and associated risks">
+ * <table border=1 cellpadding=5 summary="Table shows permission target name, what the permission allows, and associated risks">
  * <tr>
  * <th>Permission Target Name</th>
  * <th>What the Permission Allows</th>
--- a/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/MemoryUsage.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/MemoryUsage.java	Mon Nov 11 16:20:48 2013 +0100
@@ -79,7 +79,7 @@
  * </table>
  *
  * Below is a picture showing an example of a memory pool:
- * <p>
+ *
  * <pre>
  *        +----------------------------------------------+
  *        +////////////////           |                  +
@@ -250,7 +250,7 @@
      * Returns a <tt>MemoryUsage</tt> object represented by the
      * given <tt>CompositeData</tt>. The given <tt>CompositeData</tt>
      * must contain the following attributes:
-     * <p>
+     *
      * <blockquote>
      * <table border summary="The attributes and the types the given CompositeData contains">
      * <tr>
--- a/jdk/src/share/classes/java/lang/management/ThreadInfo.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/ThreadInfo.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/lang/management/package.html	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -82,7 +82,7 @@
 <b>1. Direct access to an MXBean interface</b>
 <p>
 <ul>
-<li>Get an MXBean instance locally in the running Java virtual machine:<p>
+<li>Get an MXBean instance locally in the running Java virtual machine:
 <pre>
    RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
 
@@ -103,7 +103,7 @@
 <p>
 </li>
 <li>Construct an MXBean proxy instance that forwards the
-    method calls to a given MBeanServer:<p>
+    method calls to a given MBeanServer:
 <pre>
    MBeanServerConnection mbs;
 
--- a/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java	Mon Nov 11 16:20:48 2013 +0100
@@ -27,6 +27,15 @@
 
 import java.lang.annotation.Annotation;
 import java.lang.annotation.AnnotationFormatError;
+import java.lang.annotation.Repeatable;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import sun.reflect.annotation.AnnotationSupport;
+import sun.reflect.annotation.AnnotationType;
 
 /**
  * Represents an annotated element of the program currently running in this
@@ -222,6 +231,18 @@
      * The caller of this method is free to modify the returned array; it will
      * have no effect on the arrays returned to other callers.
      *
+     * @implSpec The default implementation first calls {@link
+     * #getDeclaredAnnotationsByType(Class)} passing {@code
+     * annotationClass} as the argument. If the returned array has
+     * length greater than zero, the array is returned. If the returned
+     * array is zero-length and this {@code AnnotatedElement} is a
+     * class and the argument type is an inheritable annotation type,
+     * and the superclass of this {@code AnnotatedElement} is non-null,
+     * then the returned result is the result of calling {@link
+     * #getAnnotationsByType(Class)} on the superclass with {@code
+     * annotationClass} as the argument. Otherwise, a zero-length
+     * array is returned.
+     *
      * @param <T> the type of the annotation to query for and return if present
      * @param annotationClass the Class object corresponding to the
      *        annotation type
@@ -230,7 +251,29 @@
      * @throws NullPointerException if the given annotation class is null
      * @since 1.8
      */
-    <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass);
+    default <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
+         /*
+          * Definition of associated: directly or indirectly present OR
+          * neither directly nor indirectly present AND the element is
+          * a Class, the annotation type is inheritable, and the
+          * annotation type is associated with the superclass of the
+          * element.
+          */
+         T[] result = getDeclaredAnnotationsByType(annotationClass);
+
+         if (result.length == 0 && // Neither directly nor indirectly present
+             this instanceof Class && // the element is a class
+             AnnotationType.getInstance(annotationClass).isInherited()) { // Inheritable
+             Class<?> superClass = ((Class<?>) this).getSuperclass();
+             if (superClass != null) {
+                 // Determine if the annotation is associated with the
+                 // superclass
+                 result = superClass.getAnnotationsByType(annotationClass);
+             }
+         }
+
+         return result;
+     }
 
     /**
      * Returns this element's annotation for the specified type if
@@ -239,6 +282,11 @@
      * This method ignores inherited annotations. (Returns null if no
      * annotations are directly present on this element.)
      *
+     * @implSpec The default implementation first performs a null check
+     * and then loops over the results of {@link
+     * #getDeclaredAnnotations} returning the first annotation whose
+     * annotation type matches the argument type.
+     *
      * @param <T> the type of the annotation to query for and return if directly present
      * @param annotationClass the Class object corresponding to the
      *        annotation type
@@ -247,7 +295,18 @@
      * @throws NullPointerException if the given annotation class is null
      * @since 1.8
      */
-    <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass);
+    default <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) {
+         Objects.requireNonNull(annotationClass);
+         // Loop over all directly-present annotations looking for a matching one
+         for (Annotation annotation : getDeclaredAnnotations()) {
+             if (annotationClass.equals(annotation.annotationType())) {
+                 // More robust to do a dynamic cast at runtime instead
+                 // of compile-time only.
+                 return annotationClass.cast(annotation);
+             }
+         }
+         return null;
+     }
 
     /**
      * Returns this element's annotation(s) for the specified type if
@@ -268,6 +327,22 @@
      * The caller of this method is free to modify the returned array; it will
      * have no effect on the arrays returned to other callers.
      *
+     * @implSpec The default implementation may call {@link
+     * #getDeclaredAnnotation(Class)} one or more times to find a
+     * directly present annotation and, if the annotation type is
+     * repeatable, to find a container annotation. If annotations of
+     * the annotation type {@code annotationClass} are found to be both
+     * directly and indirectly present, then {@link
+     * #getDeclaredAnnotations()} will get called to determine the
+     * order of the elements in the returned array.
+     *
+     * <p>Alternatively, the default implementation may call {@link
+     * #getDeclaredAnnotations()} a single time and the returned array
+     * examined for both directly and indirectly present
+     * annotations. The results of calling {@link
+     * #getDeclaredAnnotations()} are assumed to be consistent with the
+     * results of calling {@link #getDeclaredAnnotation(Class)}.
+     *
      * @param <T> the type of the annotation to query for and return
      * if directly or indirectly present
      * @param annotationClass the Class object corresponding to the
@@ -277,7 +352,16 @@
      * @throws NullPointerException if the given annotation class is null
      * @since 1.8
      */
-    <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass);
+    default <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) {
+        Objects.requireNonNull(annotationClass);
+        return AnnotationSupport.
+            getDirectlyAndIndirectlyPresent(Arrays.stream(getDeclaredAnnotations()).
+                                            collect(Collectors.toMap(Annotation::annotationType,
+                                                                     Function.identity(),
+                                                                     ((first,second) -> first),
+                                                                     LinkedHashMap::new)),
+                                            annotationClass);
+    }
 
     /**
      * Returns annotations that are <em>directly present</em> on this element.
--- a/jdk/src/share/classes/java/lang/reflect/Constructor.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Constructor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -28,6 +28,8 @@
 import sun.reflect.CallerSensitive;
 import sun.reflect.ConstructorAccessor;
 import sun.reflect.Reflection;
+import sun.reflect.annotation.TypeAnnotation;
+import sun.reflect.annotation.TypeAnnotationParser;
 import sun.reflect.generics.repository.ConstructorRepository;
 import sun.reflect.generics.factory.CoreReflectionFactory;
 import sun.reflect.generics.factory.GenericsFactory;
@@ -534,4 +536,22 @@
     public AnnotatedType getAnnotatedReturnType() {
         return getAnnotatedReturnType0(getDeclaringClass());
     }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.8
+     */
+    @Override
+    public AnnotatedType getAnnotatedReceiverType() {
+        if (getDeclaringClass().getEnclosingClass() == null)
+            return super.getAnnotatedReceiverType();
+
+        return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
+                sun.misc.SharedSecrets.getJavaLangAccess().
+                        getConstantPool(getDeclaringClass()),
+                this,
+                getDeclaringClass(),
+                getDeclaringClass().getEnclosingClass(),
+                TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER);
+    }
 }
--- a/jdk/src/share/classes/java/lang/reflect/Executable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Executable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -383,7 +383,7 @@
     private transient volatile Parameter[] parameters;
 
     private native Parameter[] getParameters0();
-    private native byte[] getTypeAnnotationBytes0();
+    native byte[] getTypeAnnotationBytes0();
 
     // Needed by reflectaccess
     byte[] getTypeAnnotationBytes() {
@@ -527,7 +527,7 @@
     public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
-        return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass);
+        return AnnotationSupport.getDirectlyAndIndirectlyPresent(declaredAnnotations(), annotationClass);
     }
 
     /**
--- a/jdk/src/share/classes/java/lang/reflect/Field.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Field.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1123,7 +1123,7 @@
     public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
-        return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass);
+        return AnnotationSupport.getDirectlyAndIndirectlyPresent(declaredAnnotations(), annotationClass);
     }
 
     /**
--- a/jdk/src/share/classes/java/lang/reflect/Parameter.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Parameter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -295,7 +295,7 @@
     public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
 
-        return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass);
+        return AnnotationSupport.getDirectlyAndIndirectlyPresent(declaredAnnotations(), annotationClass);
     }
 
     /**
--- a/jdk/src/share/classes/java/lang/reflect/ReflectPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/ReflectPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -31,7 +31,6 @@
  * The following table
  * provides a summary description of what the permission allows,
  * and discusses the risks of granting code the permission.
- * <P>
  *
  * <table border=1 cellpadding=5 summary="Table shows permission target name, what the permission allows, and associated risks">
  * <tr>
--- a/jdk/src/share/classes/java/math/BigInteger.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/math/BigInteger.java	Mon Nov 11 16:20:48 2013 +0100
@@ -97,6 +97,21 @@
  * {@code NullPointerException} when passed
  * a null object reference for any input parameter.
  *
+ * BigInteger must support values in the range
+ * -2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive) to
+ * +2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive)
+ * and may support values outside of that range.
+ *
+ * The range of probable prime values is limited and may be less than
+ * the full supported positive range of {@code BigInteger}.
+ * The range must be at least 1 to 2<sup>500000000</sup>.
+ *
+ * @implNote
+ * BigInteger constructors and operations throw {@code ArithmeticException} when
+ * the result is out of the supported range of
+ * -2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive) to
+ * +2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive).
+ *
  * @see     BigDecimal
  * @author  Josh Bloch
  * @author  Michael McCloskey
@@ -183,6 +198,18 @@
     final static long LONG_MASK = 0xffffffffL;
 
     /**
+     * This constant limits {@code mag.length} of BigIntegers to the supported
+     * range.
+     */
+    private static final int MAX_MAG_LENGTH = Integer.MAX_VALUE / Integer.SIZE + 1; // (1 << 26)
+
+    /**
+     * Bit lengths larger than this constant can cause overflow in searchLen
+     * calculation and in BitSieve.singleSearch method.
+     */
+    private static final  int PRIME_SEARCH_BIT_LENGTH_LIMIT = 500000000;
+
+    /**
      * The threshold value for using Karatsuba multiplication.  If the number
      * of ints in both mag arrays are greater than this number, then
      * Karatsuba multiplication will be used.   This value is found
@@ -256,6 +283,9 @@
             mag = stripLeadingZeroBytes(val);
             signum = (mag.length == 0 ? 0 : 1);
         }
+        if (mag.length >= MAX_MAG_LENGTH) {
+            checkRange();
+        }
     }
 
     /**
@@ -275,6 +305,9 @@
             mag = trustedStripLeadingZeroInts(val);
             signum = (mag.length == 0 ? 0 : 1);
         }
+        if (mag.length >= MAX_MAG_LENGTH) {
+            checkRange();
+        }
     }
 
     /**
@@ -306,6 +339,9 @@
                 throw(new NumberFormatException("signum-magnitude mismatch"));
             this.signum = signum;
         }
+        if (mag.length >= MAX_MAG_LENGTH) {
+            checkRange();
+        }
     }
 
     /**
@@ -327,6 +363,9 @@
                 throw(new NumberFormatException("signum-magnitude mismatch"));
             this.signum = signum;
         }
+        if (mag.length >= MAX_MAG_LENGTH) {
+            checkRange();
+        }
     }
 
     /**
@@ -359,17 +398,20 @@
         int sign = 1;
         int index1 = val.lastIndexOf('-');
         int index2 = val.lastIndexOf('+');
-        if ((index1 + index2) <= -1) {
-            // No leading sign character or at most one leading sign character
-            if (index1 == 0 || index2 == 0) {
-                cursor = 1;
-                if (len == 1)
-                    throw new NumberFormatException("Zero length BigInteger");
+        if (index1 >= 0) {
+            if (index1 != 0 || index2 >= 0) {
+                throw new NumberFormatException("Illegal embedded sign character");
             }
-            if (index1 == 0)
-                sign = -1;
-        } else
-            throw new NumberFormatException("Illegal embedded sign character");
+            sign = -1;
+            cursor = 1;
+        } else if (index2 >= 0) {
+            if (index2 != 0) {
+                throw new NumberFormatException("Illegal embedded sign character");
+            }
+            cursor = 1;
+        }
+        if (cursor == len)
+            throw new NumberFormatException("Zero length BigInteger");
 
         // Skip leading zeros and compute number of digits in magnitude
         while (cursor < len &&
@@ -388,8 +430,11 @@
 
         // Pre-allocate array of expected size. May be too large but can
         // never be too small. Typically exact.
-        int numBits = (int)(((numDigits * bitsPerDigit[radix]) >>> 10) + 1);
-        int numWords = (numBits + 31) >>> 5;
+        long numBits = ((numDigits * bitsPerDigit[radix]) >>> 10) + 1;
+        if (numBits + 31 >= (1L << 32)) {
+            reportOverflow();
+        }
+        int numWords = (int) (numBits + 31) >>> 5;
         int[] magnitude = new int[numWords];
 
         // Process first (potentially short) digit group
@@ -413,6 +458,9 @@
         }
         // Required for cases where the array was overallocated.
         mag = trustedStripLeadingZeroInts(magnitude);
+        if (mag.length >= MAX_MAG_LENGTH) {
+            checkRange();
+        }
     }
 
     /*
@@ -439,8 +487,11 @@
         if (len < 10) {
             numWords = 1;
         } else {
-            int numBits = (int)(((numDigits * bitsPerDigit[10]) >>> 10) + 1);
-            numWords = (numBits + 31) >>> 5;
+            long numBits = ((numDigits * bitsPerDigit[10]) >>> 10) + 1;
+            if (numBits + 31 >= (1L << 32)) {
+                reportOverflow();
+            }
+            numWords = (int) (numBits + 31) >>> 5;
         }
         int[] magnitude = new int[numWords];
 
@@ -456,6 +507,9 @@
             destructiveMulAdd(magnitude, intRadix[10], groupVal);
         }
         mag = trustedStripLeadingZeroInts(magnitude);
+        if (mag.length >= MAX_MAG_LENGTH) {
+            checkRange();
+        }
     }
 
     // Create an integer with the digits between the two indexes
@@ -575,7 +629,7 @@
      *         this constructor is proportional to the value of this parameter.
      * @param  rnd source of random bits used to select candidates to be
      *         tested for primality.
-     * @throws ArithmeticException {@code bitLength < 2}.
+     * @throws ArithmeticException {@code bitLength < 2} or {@code bitLength} is too large.
      * @see    #bitLength()
      */
     public BigInteger(int bitLength, int certainty, Random rnd) {
@@ -607,7 +661,7 @@
      * @param  rnd source of random bits used to select candidates to be
      *         tested for primality.
      * @return a BigInteger of {@code bitLength} bits that is probably prime
-     * @throws ArithmeticException {@code bitLength < 2}.
+     * @throws ArithmeticException {@code bitLength < 2} or {@code bitLength} is too large.
      * @see    #bitLength()
      * @since 1.4
      */
@@ -677,7 +731,7 @@
         p.mag[p.mag.length-1] &= 0xfffffffe;
 
         // Use a sieve length likely to contain the next prime number
-        int searchLen = (bitLength / 20) * 64;
+        int searchLen = getPrimeSearchLen(bitLength);
         BitSieve searchSieve = new BitSieve(p, searchLen);
         BigInteger candidate = searchSieve.retrieve(p, certainty, rnd);
 
@@ -701,7 +755,7 @@
     *
     * @return the first integer greater than this {@code BigInteger} that
     *         is probably prime.
-    * @throws ArithmeticException {@code this < 0}.
+    * @throws ArithmeticException {@code this < 0} or {@code this} is too large.
     * @since 1.5
     */
     public BigInteger nextProbablePrime() {
@@ -750,7 +804,7 @@
             result = result.subtract(ONE);
 
         // Looking for the next large prime
-        int searchLen = (result.bitLength() / 20) * 64;
+        int searchLen = getPrimeSearchLen(result.bitLength());
 
         while (true) {
            BitSieve searchSieve = new BitSieve(result, searchLen);
@@ -762,6 +816,13 @@
         }
     }
 
+    private static int getPrimeSearchLen(int bitLength) {
+        if (bitLength > PRIME_SEARCH_BIT_LENGTH_LIMIT + 1) {
+            throw new ArithmeticException("Prime search implementation restriction on bitLength");
+        }
+        return bitLength / 20 * 64;
+    }
+
     /**
      * Returns {@code true} if this BigInteger is probably prime,
      * {@code false} if it's definitely composite.
@@ -965,6 +1026,9 @@
     BigInteger(int[] magnitude, int signum) {
         this.signum = (magnitude.length == 0 ? 0 : signum);
         this.mag = magnitude;
+        if (mag.length >= MAX_MAG_LENGTH) {
+            checkRange();
+        }
     }
 
     /**
@@ -974,6 +1038,25 @@
     private BigInteger(byte[] magnitude, int signum) {
         this.signum = (magnitude.length == 0 ? 0 : signum);
         this.mag = stripLeadingZeroBytes(magnitude);
+        if (mag.length >= MAX_MAG_LENGTH) {
+            checkRange();
+        }
+    }
+
+    /**
+     * Throws an {@code ArithmeticException} if the {@code BigInteger} would be
+     * out of the supported range.
+     *
+     * @throws ArithmeticException if {@code this} exceeds the supported range.
+     */
+    private void checkRange() {
+        if (mag.length > MAX_MAG_LENGTH || mag.length == MAX_MAG_LENGTH && mag[0] < 0) {
+            reportOverflow();
+        }
+    }
+
+    private static void reportOverflow() {
+        throw new ArithmeticException("BigInteger would overflow supported range");
     }
 
     //Static Factory Methods
@@ -2073,6 +2156,10 @@
         // The remaining part can then be exponentiated faster.  The
         // powers of two will be multiplied back at the end.
         int powersOfTwo = partToSquare.getLowestSetBit();
+        long bitsToShift = (long)powersOfTwo * exponent;
+        if (bitsToShift > Integer.MAX_VALUE) {
+            reportOverflow();
+        }
 
         int remainingBits;
 
@@ -2126,11 +2213,10 @@
 
             // Multiply back the powers of two (quickly, by shifting left)
             if (powersOfTwo > 0) {
-                int bitsToShift = powersOfTwo*exponent;
                 if (bitsToShift + scaleFactor <= 62) { // Fits in long?
                     return valueOf((result << bitsToShift) * newSign);
                 } else {
-                    return valueOf(result*newSign).shiftLeft(bitsToShift);
+                    return valueOf(result*newSign).shiftLeft((int) bitsToShift);
                 }
             }
             else {
@@ -2375,8 +2461,17 @@
             BigInteger y1 = m2.modInverse(m1);
             BigInteger y2 = m1.modInverse(m2);
 
-            result = a1.multiply(m2).multiply(y1).add
-                     (a2.multiply(m1).multiply(y2)).mod(m);
+            if (m.mag.length < MAX_MAG_LENGTH / 2) {
+                result = a1.multiply(m2).multiply(y1).add(a2.multiply(m1).multiply(y2)).mod(m);
+            } else {
+                MutableBigInteger t1 = new MutableBigInteger();
+                new MutableBigInteger(a1.multiply(m2)).multiply(new MutableBigInteger(y1), t1);
+                MutableBigInteger t2 = new MutableBigInteger();
+                new MutableBigInteger(a2.multiply(m1)).multiply(new MutableBigInteger(y2), t2);
+                t1.add(t2);
+                MutableBigInteger q = new MutableBigInteger();
+                result = t1.divide(new MutableBigInteger(m), q).toBigInteger();
+            }
         }
 
         return (invertResult ? result.modInverse(m) : result);
@@ -2797,27 +2892,31 @@
      *
      * @param  n shift distance, in bits.
      * @return {@code this << n}
-     * @throws ArithmeticException if the shift distance is {@code
-     *         Integer.MIN_VALUE}.
      * @see #shiftRight
      */
     public BigInteger shiftLeft(int n) {
         if (signum == 0)
             return ZERO;
-        if (n == 0)
+        if (n > 0) {
+            return new BigInteger(shiftLeft(mag, n), signum);
+        } else if (n == 0) {
             return this;
-        if (n < 0) {
-            if (n == Integer.MIN_VALUE) {
-                throw new ArithmeticException("Shift distance of Integer.MIN_VALUE not supported.");
-            } else {
-                return shiftRight(-n);
-            }
+        } else {
+            // Possible int overflow in (-n) is not a trouble,
+            // because shiftRightImpl considers its argument unsigned
+            return shiftRightImpl(-n);
         }
-        int[] newMag = shiftLeft(mag, n);
-
-        return new BigInteger(newMag, signum);
     }
 
+    /**
+     * Returns a magnitude array whose value is {@code (mag << n)}.
+     * The shift distance, {@code n}, is considered unnsigned.
+     * (Computes <tt>this * 2<sup>n</sup></tt>.)
+     *
+     * @param mag magnitude, the most-significant int ({@code mag[0]}) must be non-zero.
+     * @param  n unsigned shift distance, in bits.
+     * @return {@code mag << n}
+     */
     private static int[] shiftLeft(int[] mag, int n) {
         int nInts = n >>> 5;
         int nBits = n & 0x1f;
@@ -2853,21 +2952,31 @@
      *
      * @param  n shift distance, in bits.
      * @return {@code this >> n}
-     * @throws ArithmeticException if the shift distance is {@code
-     *         Integer.MIN_VALUE}.
      * @see #shiftLeft
      */
     public BigInteger shiftRight(int n) {
-        if (n == 0)
+        if (signum == 0)
+            return ZERO;
+        if (n > 0) {
+            return shiftRightImpl(n);
+        } else if (n == 0) {
             return this;
-        if (n < 0) {
-            if (n == Integer.MIN_VALUE) {
-                throw new ArithmeticException("Shift distance of Integer.MIN_VALUE not supported.");
-            } else {
-                return shiftLeft(-n);
-            }
+        } else {
+            // Possible int overflow in {@code -n} is not a trouble,
+            // because shiftLeft considers its argument unsigned
+            return new BigInteger(shiftLeft(mag, -n), signum);
         }
-
+    }
+
+    /**
+     * Returns a BigInteger whose value is {@code (this >> n)}. The shift
+     * distance, {@code n}, is considered unsigned.
+     * (Computes <tt>floor(this * 2<sup>-n</sup>)</tt>.)
+     *
+     * @param  n unsigned shift distance, in bits.
+     * @return {@code this >> n}
+     */
+    private BigInteger shiftRightImpl(int n) {
         int nInts = n >>> 5;
         int nBits = n & 0x1f;
         int magLen = mag.length;
@@ -3899,7 +4008,7 @@
             ;
 
         int extraByte = (k == byteLength) ? 1 : 0;
-        int intLength = ((byteLength - keep + extraByte) + 3)/4;
+        int intLength = ((byteLength - keep + extraByte) + 3) >>> 2;
         int result[] = new int[intLength];
 
         /* Copy one's complement of input into output, leaving extra
@@ -4135,7 +4244,8 @@
                 message = "BigInteger: Signum not present in stream";
             throw new java.io.StreamCorruptedException(message);
         }
-        if ((magnitude.length == 0) != (sign == 0)) {
+        int[] mag = stripLeadingZeroBytes(magnitude);
+        if ((mag.length == 0) != (sign == 0)) {
             String message = "BigInteger: signum-magnitude mismatch";
             if (fields.defaulted("magnitude"))
                 message = "BigInteger: Magnitude not present in stream";
@@ -4146,7 +4256,14 @@
         UnsafeHolder.putSign(this, sign);
 
         // Calculate mag field from magnitude and discard magnitude
-        UnsafeHolder.putMag(this, stripLeadingZeroBytes(magnitude));
+        UnsafeHolder.putMag(this, mag);
+        if (mag.length >= MAX_MAG_LENGTH) {
+            try {
+                checkRange();
+            } catch (ArithmeticException e) {
+                throw new java.io.StreamCorruptedException("BigInteger: Out of the supported range");
+            }
+        }
     }
 
     // Support for resetting final fields while deserializing
--- a/jdk/src/share/classes/java/math/MutableBigInteger.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/math/MutableBigInteger.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1257,14 +1257,14 @@
 
             int j = (s+m-1) / m;      // step 2a: j = ceil(s/m)
             int n = j * m;            // step 2b: block length in 32-bit units
-            int n32 = 32 * n;         // block length in bits
-            int sigma = Math.max(0, n32 - b.bitLength());   // step 3: sigma = max{T | (2^T)*B < beta^n}
+            long n32 = 32L * n;         // block length in bits
+            int sigma = (int) Math.max(0, n32 - b.bitLength());   // step 3: sigma = max{T | (2^T)*B < beta^n}
             MutableBigInteger bShifted = new MutableBigInteger(b);
             bShifted.safeLeftShift(sigma);   // step 4a: shift b so its length is a multiple of n
             safeLeftShift(sigma);     // step 4b: shift this by the same amount
 
             // step 5: t is the number of blocks needed to accommodate this plus one additional bit
-            int t = (bitLength()+n32) / n32;
+            int t = (int) ((bitLength()+n32) / n32);
             if (t < 2) {
                 t = 2;
             }
@@ -1421,10 +1421,10 @@
     }
 
     /** @see BigInteger#bitLength() */
-    int bitLength() {
+    long bitLength() {
         if (intLen == 0)
             return 0;
-        return intLen*32 - Integer.numberOfLeadingZeros(value[offset]);
+        return intLen*32L - Integer.numberOfLeadingZeros(value[offset]);
     }
 
     /**
--- a/jdk/src/share/classes/java/net/Authenticator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/Authenticator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/CookieManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/CookieStore.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/DatagramSocket.java	Mon Nov 11 16:20:48 2013 +0100
@@ -196,7 +196,7 @@
      * socket address.
      * <p>
      * If, if the address is {@code null}, creates an unbound socket.
-     * <p>
+     *
      * <p>If there is a security manager,
      * its {@code checkListen} method is first called
      * with the port from the socket address
@@ -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) {
@@ -1109,7 +1109,7 @@
      * represent the value of the TOS octet in IP packets sent by
      * the socket.
      * RFC 1349 defines the TOS values as follows:
-     * <p>
+     *
      * <UL>
      * <LI><CODE>IPTOS_LOWCOST (0x02)</CODE></LI>
      * <LI><CODE>IPTOS_RELIABILITY (0x04)</CODE></LI>
--- a/jdk/src/share/classes/java/net/HttpCookie.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/HttpCookie.java	Mon Nov 11 16:20:48 2013 +0100
@@ -761,7 +761,7 @@
     // from RFC 2068, token special case characters
     //
     // private static final String tspecials = "()<>@,;:\\\"/[]?={} \t";
-    private static final String tspecials = ",;";
+    private static final String tspecials = ",; ";  // deliberately includes space
 
     /*
      * Tests a string and returns true if the string counts as a token.
--- a/jdk/src/share/classes/java/net/Inet6Address.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/Inet6Address.java	Mon Nov 11 16:20:48 2013 +0100
@@ -133,7 +133,7 @@
  *         representation. However, it will be converted into an IPv4
  *         address.</td></tr>
  * </table></blockquote>
- * <p>
+ *
  * <h4><A NAME="scoped">Textual representation of IPv6 scoped addresses</a></h4>
  *
  * <p> The textual representation of IPv6 addresses as described above can be
@@ -150,11 +150,11 @@
  *
  * <p> The general format for specifying the <i>scope_id</i> is the following:
  *
- * <p><blockquote><i>IPv6-address</i>%<i>scope_id</i></blockquote>
+ * <blockquote><i>IPv6-address</i>%<i>scope_id</i></blockquote>
  * <p> The IPv6-address is a literal IPv6 address as described above.
  * The <i>scope_id</i> refers to an interface on the local system, and it can be
  * specified in two ways.
- * <p><ol><li><i>As a numeric identifier.</i> This must be a positive integer
+ * <ol><li><i>As a numeric identifier.</i> This must be a positive integer
  * that identifies the particular interface and scope as understood by the
  * system. Usually, the numeric values can be determined through administration
  * tools on the system. Each interface may have multiple values, one for each
--- a/jdk/src/share/classes/java/net/InetSocketAddress.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/InetSocketAddress.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/InterfaceAddress.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/JarURLConnection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/MulticastSocket.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/MulticastSocket.java	Mon Nov 11 16:20:48 2013 +0100
@@ -140,7 +140,7 @@
      * Create a MulticastSocket bound to the specified socket address.
      * <p>
      * Or, if the address is {@code null}, create an unbound socket.
-     * <p>
+     *
      * <p>If there is a security manager,
      * its {@code checkListen} method is first called
      * with the SocketAddress port as its argument to ensure the operation is allowed.
--- a/jdk/src/share/classes/java/net/NetPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/NetPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -46,7 +46,6 @@
  * The following table lists all the possible NetPermission target names,
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
- * <P>
  *
  * <table border=1 cellpadding=5 summary="Permission target name, what the permission allows, and associated risks">
  * <tr>
--- a/jdk/src/share/classes/java/net/Proxy.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/Proxy.java	Mon Nov 11 16:20:48 2013 +0100
@@ -66,8 +66,8 @@
      * Used, for instance, to create sockets bypassing any other global
      * proxy settings (like SOCKS):
      * <P>
-     * {@code Socket s = new Socket(Proxy.NO_PROXY);}<br>
-     * <P>
+     * {@code Socket s = new Socket(Proxy.NO_PROXY);}
+     *
      */
     public final static Proxy NO_PROXY = new Proxy();
 
--- a/jdk/src/share/classes/java/net/ServerSocket.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/ServerSocket.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/Socket.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/Socket.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1230,13 +1230,13 @@
      * Generally, the window size can be modified at any time when a socket is
      * connected. However, if a receive window larger than 64K is required then
      * this must be requested <B>before</B> the socket is connected to the
-     * remote peer. There are two cases to be aware of:<p>
+     * remote peer. There are two cases to be aware of:
      * <ol>
      * <li>For sockets accepted from a ServerSocket, this must be done by calling
      * {@link ServerSocket#setReceiveBufferSize(int)} before the ServerSocket
      * is bound to a local address.<p></li>
      * <li>For client sockets, setReceiveBufferSize() must be called before
-     * connecting the socket to its remote peer.<p></li></ol>
+     * connecting the socket to its remote peer.</li></ol>
      * @param size the size to which to set the receive buffer
      * size. This value must be greater than 0.
      *
@@ -1329,7 +1329,7 @@
      * represent the value of the TOS octet in IP packets sent by
      * the socket.
      * RFC 1349 defines the TOS values as follows:
-     * <p>
+     *
      * <UL>
      * <LI><CODE>IPTOS_LOWCOST (0x02)</CODE></LI>
      * <LI><CODE>IPTOS_RELIABILITY (0x04)</CODE></LI>
--- a/jdk/src/share/classes/java/net/SocketOptions.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/SocketOptions.java	Mon Nov 11 16:20:48 2013 +0100
@@ -134,7 +134,7 @@
      * previously written data.
      *<P>
      * Valid for TCP only: SocketImpl.
-     * <P>
+     *
      * @see Socket#setTcpNoDelay
      * @see Socket#getTcpNoDelay
      */
@@ -155,7 +155,7 @@
      * This option <B>must</B> be specified in the constructor.
      * <P>
      * Valid for: SocketImpl, DatagramSocketImpl
-     * <P>
+     *
      * @see Socket#getLocalAddress
      * @see DatagramSocket#getLocalAddress
      */
@@ -186,7 +186,7 @@
      * want to use other than the system default.  Takes/returns an InetAddress.
      * <P>
      * Valid for Multicast: DatagramSocketImpl
-     * <P>
+     *
      * @see MulticastSocket#setInterface(InetAddress)
      * @see MulticastSocket#getInterface()
      */
--- a/jdk/src/share/classes/java/net/SocketPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/SocketPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -779,27 +779,27 @@
      * specified permission.
      * <P>
      * More specifically, this method first ensures that all of the following
-     * are true (and returns false if any of them are not):<p>
+     * are true (and returns false if any of them are not):
      * <ul>
-     * <li> <i>p</i> is an instanceof SocketPermission,<p>
+     * <li> <i>p</i> is an instanceof SocketPermission,
      * <li> <i>p</i>'s actions are a proper subset of this
-     * object's actions, and<p>
+     * object's actions, and
      * <li> <i>p</i>'s port range is included in this port range. Note:
-     * port range is ignored when p only contains the action, 'resolve'.<p>
+     * port range is ignored when p only contains the action, 'resolve'.
      * </ul>
      *
      * Then {@code implies} checks each of the following, in order,
-     * and for each returns true if the stated condition is true:<p>
+     * and for each returns true if the stated condition is true:
      * <ul>
      * <li> If this object was initialized with a single IP address and one of <i>p</i>'s
-     * IP addresses is equal to this object's IP address.<p>
+     * IP addresses is equal to this object's IP address.
      * <li>If this object is a wildcard domain (such as *.sun.com), and
      * <i>p</i>'s canonical name (the name without any preceding *)
      * ends with this object's canonical host name. For example, *.sun.com
-     * implies *.eng.sun.com..<p>
+     * implies *.eng.sun.com.
      * <li>If this object was not initialized with a single IP address, and one of this
-     * object's IP addresses equals one of <i>p</i>'s IP addresses.<p>
-     * <li>If this canonical name equals <i>p</i>'s canonical name.<p>
+     * object's IP addresses equals one of <i>p</i>'s IP addresses.
+     * <li>If this canonical name equals <i>p</i>'s canonical name.
      * </ul>
      *
      * If none of the above are true, {@code implies} returns false.
--- a/jdk/src/share/classes/java/net/SocksSocketImpl.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/SocksSocketImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/StandardSocketOptions.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/URI.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/URI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -389,20 +389,20 @@
  * colon following a host name but no port (as in
  * {@code http://java.sun.com:}&nbsp;), and that does not encode characters
  * except those that must be quoted, the following identities also hold:
- * <p><pre>
+ * <pre>
  *     new URI(<i>u</i>.getScheme(),
  *             <i>u</i>.getSchemeSpecificPart(),
  *             <i>u</i>.getFragment())
  *     .equals(<i>u</i>)</pre>
  * in all cases,
- * <p><pre>
+ * <pre>
  *     new URI(<i>u</i>.getScheme(),
  *             <i>u</i>.getUserInfo(), <i>u</i>.getAuthority(),
  *             <i>u</i>.getPath(), <i>u</i>.getQuery(),
  *             <i>u</i>.getFragment())
  *     .equals(<i>u</i>)</pre>
  * if <i>u</i> is hierarchical, and
- * <p><pre>
+ * <pre>
  *     new URI(<i>u</i>.getScheme(),
  *             <i>u</i>.getUserInfo(), <i>u</i>.getHost(), <i>u</i>.getPort(),
  *             <i>u</i>.getPath(), <i>u</i>.getQuery(),
--- a/jdk/src/share/classes/java/net/URL.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/URL.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &quot;..&quot; and &quot;.&quot;.
+     * changes made by occurrences of &quot;..&quot; and &quot;.&quot;.
      * <p>
      * For a more detailed description of URL parsing, refer to RFC2396.
      *
--- a/jdk/src/share/classes/java/net/URLClassLoader.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/URLClassLoader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -25,21 +25,30 @@
 
 package java.net;
 
-import java.io.*;
-import java.util.*;
-import java.util.jar.Manifest;
-import java.util.jar.JarFile;
-import java.util.jar.Attributes;
-import java.util.jar.Attributes.Name;
+import java.io.Closeable;
+import java.io.File;
+import java.io.FilePermission;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.AccessControlContext;
+import java.security.AccessController;
 import java.security.CodeSigner;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-import java.security.AccessController;
-import java.security.AccessControlContext;
-import java.security.SecureClassLoader;
 import java.security.CodeSource;
 import java.security.Permission;
 import java.security.PermissionCollection;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
+import java.security.SecureClassLoader;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+import java.util.WeakHashMap;
+import java.util.jar.Attributes;
+import java.util.jar.Attributes.Name;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
 import sun.misc.Resource;
 import sun.misc.URLClassPath;
 import sun.net.www.ParseUtil;
@@ -84,6 +93,7 @@
      * @exception  SecurityException  if a security manager exists and its
      *             {@code checkCreateClassLoader} method doesn't allow
      *             creation of a class loader.
+     * @exception  NullPointerException if {@code urls} is {@code null}.
      * @see SecurityManager#checkCreateClassLoader
      */
     public URLClassLoader(URL[] urls, ClassLoader parent) {
@@ -127,6 +137,7 @@
      * @exception  SecurityException  if a security manager exists and its
      *             {@code checkCreateClassLoader} method doesn't allow
      *             creation of a class loader.
+     * @exception  NullPointerException if {@code urls} is {@code null}.
      * @see SecurityManager#checkCreateClassLoader
      */
     public URLClassLoader(URL[] urls) {
@@ -169,6 +180,7 @@
      * @exception  SecurityException  if a security manager exists and its
      *             {@code checkCreateClassLoader} method doesn't allow
      *             creation of a class loader.
+     * @exception  NullPointerException if {@code urls} is {@code null}.
      * @see SecurityManager#checkCreateClassLoader
      */
     public URLClassLoader(URL[] urls, ClassLoader parent,
@@ -260,13 +272,13 @@
     * and errors are not caught. Calling close on an already closed
     * loader has no effect.
     * <p>
-    * @throws IOException if closing any file opened by this class loader
+    * @exception IOException if closing any file opened by this class loader
     * resulted in an IOException. Any such exceptions are caught internally.
     * If only one is caught, then it is re-thrown. If more than one exception
     * is caught, then the second and following exceptions are added
     * as suppressed exceptions of the first one caught, which is then re-thrown.
     *
-    * @throws SecurityException if a security manager is set, and it denies
+    * @exception SecurityException if a security manager is set, and it denies
     *   {@link RuntimePermission}{@code ("closeClassLoader")}
     *
     * @since 1.7
@@ -339,6 +351,7 @@
      * @return the resulting class
      * @exception ClassNotFoundException if the class could not be found,
      *            or if the loader is closed.
+     * @exception NullPointerException if {@code name} is {@code null}.
      */
     protected Class<?> findClass(final String name)
          throws ClassNotFoundException
@@ -621,6 +634,7 @@
      * If the protocol is not "file", then permission
      * to connect to and accept connections from the URL's host is granted.
      * @param codesource the codesource
+     * @exception NullPointerException if {@code codesource} is {@code null}.
      * @return the permissions granted to the codesource
      */
     protected PermissionCollection getPermissions(CodeSource codesource)
@@ -700,6 +714,7 @@
      *
      * @param urls the URLs to search for classes and resources
      * @param parent the parent class loader for delegation
+     * @exception  NullPointerException if {@code urls} is {@code null}.
      * @return the resulting class loader
      */
     public static URLClassLoader newInstance(final URL[] urls,
@@ -725,6 +740,7 @@
      * loading the class.
      *
      * @param urls the URLs to search for classes and resources
+     * @exception  NullPointerException if {@code urls} is {@code null}.
      * @return the resulting class loader
      */
     public static URLClassLoader newInstance(final URL[] urls) {
--- a/jdk/src/share/classes/java/net/URLConnection.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/URLConnection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -45,7 +45,7 @@
  * application and a URL. Instances of this class can be used both to
  * read from and to write to the resource referenced by the URL. In
  * general, creating a connection to a URL is a multistep process:
- * <p>
+ *
  * <center><table border=2 summary="Describes the process of creating a connection to a URL: openConnection() and connect() over time.">
  * <tr><th>{@code openConnection()}</th>
  *     <th>{@code connect()}</th></tr>
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/URLDecoder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,7 +43,7 @@
  * as the start of a special escaped sequence.
  * <p>
  * The following rules are applied in the conversion:
- * <p>
+ *
  * <ul>
  * <li>The alphanumeric characters &quot;{@code a}&quot; through
  *     &quot;{@code z}&quot;, &quot;{@code A}&quot; through
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/URLEncoder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -49,7 +49,6 @@
  * <p>
  * When encoding a String, the following rules apply:
  *
- * <p>
  * <ul>
  * <li>The alphanumeric characters &quot;{@code a}&quot; through
  *     &quot;{@code z}&quot;, &quot;{@code A}&quot; through
@@ -186,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/net/URLPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/URLPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -45,7 +45,7 @@
  * </pre>
  * <i>scheme</i> will typically be http or https, but is not restricted by this
  * class.
- * <i>authority</i> is specified as:<p>
+ * <i>authority</i> is specified as:
  * <pre>
  *     authority = hostrange [ : portrange ]
  *     portrange = portnumber | -portnumber | portnumber-[portnumber] | *
@@ -223,7 +223,7 @@
      * Checks if this URLPermission implies the given permission.
      * Specifically, the following checks are done as if in the
      * following sequence:
-     * <p><ul>
+     * <ul>
      * <li>if 'p' is not an instance of URLPermission return false</li>
      * <li>if any of p's methods are not in this's method list, and if
      *     this's method list is not equal to "*", then return false.</li>
@@ -242,7 +242,7 @@
      * <li>otherwise, return false</li>
      * </ul>
      * <p>Some examples of how paths are matched are shown below:
-     * <p><table border>
+     * <table border>
      * <caption>Examples of Path Matching</caption>
      * <tr><th>this's path</th><th>p's path</th><th>match</th></tr>
      * <tr><td>/a/b</td><td>/a/b</td><td>yes</td></tr>
@@ -353,7 +353,7 @@
         return getActions().hashCode()
             + scheme.hashCode()
             + authority.hashCode()
-            + path == null ? 0 : path.hashCode();
+            + (path == null ? 0 : path.hashCode());
     }
 
 
--- a/jdk/src/share/classes/java/net/package-info.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/net/package-info.java	Mon Nov 11 16:20:48 2013 +0100
@@ -127,9 +127,9 @@
  *    resources, then convert it into a {@link java.net.URL} when it is time to
  *    access the resource. From that URL, you can either get the
  *    {@link java.net.URLConnection} for fine control, or get directly the
- *    InputStream.<p>
+ *    InputStream.
  * <p>Here is an example:</p>
- * <p><pre>
+ * <pre>
  * URI uri = new URI("http://java.sun.com/");
  * URL url = uri.toURL();
  * InputStream in = url.openStream();
@@ -147,7 +147,7 @@
  *    the {@code java.protocol.handler.pkgs} system property. For instance if
  *    it is set to {@code myapp.protocols}, then the URL code will try, in the
  *    case of http, first to load {@code myapp.protocols.http.Handler}, then,
- *    if this fails, {@code http.Handler} from the default location.<p>
+ *    if this fails, {@code http.Handler} from the default location.
  * <p>Note that the Handler class <b>has to</b> be a subclass of the abstract
  *    class {@link java.net.URLStreamHandler}.</p>
  * <h2>Additional Specification</h2>
--- a/jdk/src/share/classes/java/nio/X-Buffer.java.template	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/nio/X-Buffer.java.template	Mon Nov 11 16:20:48 2013 +0100
@@ -1129,7 +1129,7 @@
      *
      * <p> Two $type$ buffers are equal if, and only if,
      *
-     * <p><ol>
+     * <ol>
      *
      *   <li><p> They have the same element type,  </p></li>
      *
--- a/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/nio/channels/DatagramChannel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/nio/channels/MembershipKey.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/nio/channels/package-info.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/nio/charset/Charset.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/FileSystem.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/nio/file/FileSystem.java	Mon Nov 11 16:20:48 2013 +0100
@@ -355,7 +355,7 @@
      *
      * <p> The following rules are used to interpret glob patterns:
      *
-     * <p> <ul>
+     * <ul>
      *   <li><p> The {@code *} character matches zero or more {@link Character
      *   characters} of a {@link Path#getName(int) name} component without
      *   crossing directory boundaries. </p></li>
--- a/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/MarshalledObject.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/rmi/RMISecurityManager.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/RMISecurityManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,35 +28,38 @@
 import java.security.*;
 
 /**
- * A subclass of {@link SecurityManager} used by RMI applications that use
- * downloaded code.  RMI's class loader will not download any classes from
- * remote locations if no security manager has been set.
- * <code>RMISecurityManager</code> does not apply to applets, which run
- * under the protection of their browser's security manager.
+ * {@code RMISecurityManager} implements a policy identical to the policy
+ * implemented by {@link SecurityManager}. RMI applications
+ * should use the {@code SecurityManager} class or another appropriate
+ * {@code SecurityManager} implementation instead of this class. RMI's class
+ * loader will download classes from remote locations only if a security
+ * manager has been set.
  *
- * <code>RMISecurityManager</code> implements a policy that
- * is no different than the policy implemented by {@link SecurityManager}.
- * Therefore an RMI application should use the <code>SecurityManager</code>
- * class or another application-specific <code>SecurityManager</code>
- * implementation instead of this class.
+ * @implNote
+ * <p>Applets typically run in a container that already has a security
+ * manager, so there is generally no need for applets to set a security
+ * manager. If you have a standalone application, you might need to set a
+ * {@code SecurityManager} in order to enable class downloading. This can be
+ * done by adding the following to your code. (It needs to be executed before
+ * RMI can download code from remote hosts, so it most likely needs to appear
+ * in the {@code main} method of your application.)
  *
- * <p>To use a <code>SecurityManager</code> in your application, add
- * the following statement to your code (it needs to be executed before RMI
- * can download code from remote hosts, so it most likely needs to appear
- * in the <code>main</code> method of your application):
- *
- * <pre>
- * System.setSecurityManager(new SecurityManager());
- * </pre>
+ * <pre>{@code
+ *    if (System.getSecurityManager() == null) {
+ *        System.setSecurityManager(new SecurityManager());
+ *    }
+ * }</pre>
  *
  * @author  Roger Riggs
  * @author  Peter Jones
  * @since JDK1.1
- **/
+ * @deprecated Use {@link SecurityManager} instead.
+ */
+@Deprecated
 public class RMISecurityManager extends SecurityManager {
 
     /**
-     * Constructs a new <code>RMISecurityManager</code>.
+     * Constructs a new {@code RMISecurityManager}.
      * @since JDK1.1
      */
     public RMISecurityManager() {
--- a/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java	Mon Nov 11 16:20:48 2013 +0100
@@ -74,7 +74,7 @@
  * <code>ActivationGroup</code> will override the system properties
  * with the properties requested when its
  * <code>ActivationGroupDesc</code> was created, and will set a
- * <code>java.rmi.RMISecurityManager</code> as the default system
+ * {@link SecurityManager} as the default system
  * security manager.  If your application requires specific properties
  * to be set when objects are activated in the group, the application
  * should create a special <code>Properties</code> object containing
@@ -84,7 +84,7 @@
  * <code>ActivationDesc</code>s (before the default
  * <code>ActivationGroupDesc</code> is created).  If your application
  * requires the use of a security manager other than
- * <code>java.rmi.RMISecurityManager</code>, in the
+ * {@link SecurityManager}, in the
  * ActivativationGroupDescriptor properties list you can set
  * <code>java.security.manager</code> property to the name of the security
  * manager you would like to install.
@@ -154,21 +154,21 @@
      * active). If the object does not call
      * <code>Activatable.inactive</code> when it deactivates, the
      * object will never be garbage collected since the group keeps
-     * strong references to the objects it creates. <p>
+     * strong references to the objects it creates.
      *
      * <p>The group's <code>inactiveObject</code> method unexports the
      * remote object from the RMI runtime so that the object can no
      * longer receive incoming RMI calls. An object will only be unexported
      * if the object has no pending or executing calls.
      * The subclass of <code>ActivationGroup</code> must override this
-     * method and unexport the object. <p>
+     * method and unexport the object.
      *
      * <p>After removing the object from the RMI runtime, the group
      * must inform its <code>ActivationMonitor</code> (via the monitor's
      * <code>inactiveObject</code> method) that the remote object is
      * not currently active so that the remote object will be
      * re-activated by the activator upon a subsequent activation
-     * request.<p>
+     * request.
      *
      * <p>This method simply informs the group's monitor that the object
      * is inactive.  It is up to the concrete subclass of ActivationGroup
@@ -235,7 +235,7 @@
      * <p>Note that if your application creates its own custom
      * activation group, a security manager must be set for that
      * group.  Otherwise objects cannot be activated in the group.
-     * <code>java.rmi.RMISecurityManager</code> is set by default.
+     * {@link SecurityManager} is set by default.
      *
      * <p>If a security manager is already set in the group VM, this
      * method first calls the security manager's
--- a/jdk/src/share/classes/java/rmi/dgc/VMID.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/dgc/VMID.java	Mon Nov 11 16:20:48 2013 +0100
@@ -67,7 +67,7 @@
      * conditions: a) the conditions for uniqueness for objects of
      * the class <code>java.rmi.server.UID</code> are satisfied, and b) an
      * address can be obtained for this host that is unique and constant
-     * for the lifetime of this object.  <p>
+     * for the lifetime of this object.
      */
     public VMID() {
         addr = randomBytes;
--- a/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -41,7 +41,15 @@
  * (due to a firewall), the runtime uses HTTP with the explicit port
  * number of the server.  If the firewall does not allow this type of
  * communication, then HTTP to a cgi-bin script on the server is used
- * to POST the RMI call.
+ * to POST the RMI call. The HTTP tunneling mechanisms are disabled by
+ * default. This behavior is controlled by the {@code java.rmi.server.disableHttp}
+ * property, whose default value is {@code true}. Setting this property's
+ * value to {@code false} will enable the HTTP tunneling mechanisms.
+ *
+ * <p><strong>Deprecated: HTTP Tunneling.</strong> <em>The HTTP tunneling mechanisms
+ * described above, specifically HTTP with an explicit port and HTTP to a
+ * cgi-bin script, are deprecated. These HTTP tunneling mechanisms are
+ * subject to removal in a future release of the platform.</em>
  *
  * <p>The default socket factory implementation creates server sockets that
  * are bound to the wildcard address, which accepts requests from all network
--- a/jdk/src/share/classes/java/rmi/server/RemoteStub.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/server/RemoteStub.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,8 @@
 package java.rmi.server;
 
 /**
- * The <code>RemoteStub</code> class is the common superclass to client
+ * The {@code RemoteStub} class is the common superclass of
+ * statically generated client
  * stubs and provides the framework to support a wide range of remote
  * reference semantics.  Stub objects are surrogates that support
  * exactly the same set of remote interfaces defined by the actual
@@ -33,21 +34,26 @@
  *
  * @author  Ann Wollrath
  * @since   JDK1.1
+ *
+ * @deprecated Statically generated stubs are deprecated, since
+ * stubs are generated dynamically. See {@link UnicastRemoteObject}
+ * for information about dynamic stub generation.
  */
+@Deprecated
 abstract public class RemoteStub extends RemoteObject {
 
     /** indicate compatibility with JDK 1.1.x version of class */
     private static final long serialVersionUID = -1585587260594494182L;
 
     /**
-     * Constructs a <code>RemoteStub</code>.
+     * Constructs a {@code RemoteStub}.
      */
     protected RemoteStub() {
         super();
     }
 
     /**
-     * Constructs a <code>RemoteStub</code>, with the specified remote
+     * Constructs a {@code RemoteStub} with the specified remote
      * reference.
      *
      * @param ref the remote reference
@@ -58,14 +64,17 @@
     }
 
     /**
-     * Sets the remote reference inside the remote stub.
+     * Throws {@link UnsupportedOperationException}.
      *
      * @param stub the remote stub
      * @param ref the remote reference
+     * @throws UnsupportedOperationException always
      * @since JDK1.1
-     * @deprecated no replacement.  The <code>setRef</code> method
-     * is not needed since <code>RemoteStub</code>s can be created with
-     * the <code>RemoteStub(RemoteRef)</code> constructor.
+     * @deprecated No replacement.  The {@code setRef} method
+     * was intended for setting the remote reference of a remote
+     * stub. This is unnecessary, since {@code RemoteStub}s can be created
+     * and initialized with a remote reference through use of
+     * the {@link #RemoteStub(RemoteRef)} constructor.
      */
     @Deprecated
     protected static void setRef(RemoteStub stub, RemoteRef ref) {
--- a/jdk/src/share/classes/java/rmi/server/ServerRef.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/server/ServerRef.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,9 @@
  *
  * @author  Ann Wollrath
  * @since   JDK1.1
+ * @deprecated No replacement. This interface is unused and is obsolete.
  */
+@Deprecated
 public interface ServerRef extends RemoteRef {
 
     /** indicate compatibility with JDK 1.1.x version of class. */
--- a/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,9 @@
  *
  * @author  Ann Wollrath
  * @since   JDK1.1
- **/
+ * @deprecated This class is obsolete. Use {@link ExportException} instead.
+ */
+@Deprecated
 public class SocketSecurityException extends ExportException {
 
     /* indicate compatibility with JDK 1.1.x version of class */
--- a/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java	Mon Nov 11 16:20:48 2013 +0100
@@ -30,52 +30,88 @@
 
 /**
  * Used for exporting a remote object with JRMP and obtaining a stub
- * that communicates to the remote object.
+ * that communicates to the remote object. Stubs are either generated
+ * at runtime using dynamic proxy objects, or they are generated statically
+ * at build time, typically using the {@code rmic} tool.
+ *
+ * <p><strong>Deprecated: Static Stubs.</strong> <em>Support for statically
+ * generated stubs is deprecated. This includes the API in this class that
+ * requires the use of static stubs, as well as the runtime support for
+ * loading static stubs.  Generating stubs dynamically is preferred, using one
+ * of the five non-deprecated ways of exporting objects as listed below. Do
+ * not run {@code rmic} to generate static stub classes. It is unnecessary, and
+ * it is also deprecated.</em>
  *
- * <p>For the constructors and static <code>exportObject</code> methods
- * below, the stub for a remote object being exported is obtained as
- * follows:
+ * <p>There are six ways to export remote objects:
+ *
+ * <ol>
+ *
+ * <li>Subclassing {@code UnicastRemoteObject} and calling the
+ * {@link #UnicastRemoteObject()} constructor.
+ *
+ * <li>Subclassing {@code UnicastRemoteObject} and calling the
+ * {@link #UnicastRemoteObject(int) UnicastRemoteObject(port)} constructor.
+ *
+ * <li>Subclassing {@code UnicastRemoteObject} and calling the
+ * {@link #UnicastRemoteObject(int, RMIClientSocketFactory, RMIServerSocketFactory)
+ * UnicastRemoteObject(port, csf, ssf)} constructor.
  *
- * <p><ul>
+ * <li>Calling the
+ * {@link #exportObject(Remote) exportObject(Remote)} method.
+ * <strong>Deprecated.</strong>
+ *
+ * <li>Calling the
+ * {@link #exportObject(Remote, int) exportObject(Remote, port)} method.
+ *
+ * <li>Calling the
+ * {@link #exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)
+ * exportObject(Remote, port, csf, ssf)} method.
+ *
+ * </ol>
  *
- * <li>If the remote object is exported using the {@link
- * #exportObject(Remote) UnicastRemoteObject.exportObject(Remote)} method,
- * a stub class (typically pregenerated from the remote object's class
- * using the <code>rmic</code> tool) is loaded and an instance of that stub
- * class is constructed as follows.
+ * <p>The fourth technique, {@link #exportObject(Remote)},
+ * always uses statically generated stubs and is deprecated.
+ *
+ * <p>The other five techniques all use the following approach: if the
+ * {@code java.rmi.server.ignoreStubClasses} property is {@code true}
+ * (case insensitive) or if a static stub cannot be found, stubs are generated
+ * dynamically using {@link java.lang.reflect.Proxy Proxy} objects. Otherwise,
+ * static stubs are used.
+ *
+ * <p>The default value of the
+ * {@code java.rmi.server.ignoreStubClasses} property is {@code false}.
+ *
+ * <p>Statically generated stubs are typically pregenerated from the
+ * remote object's class using the {@code rmic} tool. A static stub is
+ * loaded and an instance of that stub class is constructed as described
+ * below.
+ *
  * <ul>
  *
- * <li>A "root class" is determined as follows:  if the remote object's
+ * <li>A "root class" is determined as follows: if the remote object's
  * class directly implements an interface that extends {@link Remote}, then
  * the remote object's class is the root class; otherwise, the root class is
  * the most derived superclass of the remote object's class that directly
- * implements an interface that extends <code>Remote</code>.
+ * implements an interface that extends {@code Remote}.
  *
  * <li>The name of the stub class to load is determined by concatenating
- * the binary name of the root class with the suffix <code>"_Stub"</code>.
+ * the binary name of the root class with the suffix {@code _Stub}.
  *
  * <li>The stub class is loaded by name using the class loader of the root
- * class.  The stub class must extend {@link RemoteStub} and must have a
- * public constructor that has one parameter, of type {@link RemoteRef}.
+ * class. The stub class must extend {@link RemoteStub} and must have a
+ * public constructor that has one parameter of type {@link RemoteRef}.
  *
  * <li>Finally, an instance of the stub class is constructed with a
  * {@link RemoteRef}.
- * </ul>
  *
- * <li>If the appropriate stub class could not be found, or the stub class
- * could not be loaded, or a problem occurs creating the stub instance, a
+ * <li>If the appropriate stub class could not be found, or if the stub class
+ * could not be loaded, or if a problem occurs creating the stub instance, a
  * {@link StubNotFoundException} is thrown.
  *
- * <p>
- * <li>For all other means of exporting:
- * <p><ul>
+ * </ul>
  *
- * <li>If the remote object's stub class (as defined above) could not be
- * loaded or the system property
- * <code>java.rmi.server.ignoreStubClasses</code> is set to
- * <code>"true"</code> (case insensitive), a {@link
- * java.lang.reflect.Proxy} instance is constructed with the following
- * properties:
+ * <p>Stubs are dynamically generated by constructing an instance of
+ * a {@link java.lang.reflect.Proxy Proxy} with the following characteristics:
  *
  * <ul>
  *
@@ -91,29 +127,13 @@
  *
  * <li>If the proxy could not be created, a {@link StubNotFoundException}
  * will be thrown.
- * </ul>
  *
- * <p>
- * <li>Otherwise, an instance of the remote object's stub class (as
- * described above) is used as the stub.
- *
- * </ul>
  * </ul>
  *
- * <p>If an object is exported with the
- * {@link #exportObject(Remote) exportObject(Remote)}
- * or
- * {@link #exportObject(Remote, int) exportObject(Remote, port)}
- * methods, or if a subclass constructor invokes one of the
- * {@link #UnicastRemoteObject()}
- * or
- * {@link #UnicastRemoteObject(int) UnicastRemoteObject(port)}
- * constructors, the object is exported with a server socket created using the
- * {@link RMISocketFactory}
- * class.
- *
  * @implNote
- * <p>By default, server sockets created by the {@link RMISocketFactory} class
+ * Depending upon which constructor or static method is used for exporting an
+ * object, {@link RMISocketFactory} may be used for creating sockets.
+ * By default, server sockets created by {@link RMISocketFactory}
  * listen on all network interfaces. See the
  * {@link RMISocketFactory} class and the section
  * <a href="{@docRoot}/../platform/rmi/spec/rmi-server29.html">RMI Socket Factories</a>
@@ -148,6 +168,10 @@
     /**
      * Creates and exports a new UnicastRemoteObject object using an
      * anonymous port.
+     *
+     * <p>The object is exported with a server socket
+     * created using the {@link RMISocketFactory} class.
+     *
      * @throws RemoteException if failed to export object
      * @since JDK1.1
      */
@@ -159,6 +183,10 @@
     /**
      * Creates and exports a new UnicastRemoteObject object using the
      * particular supplied port.
+     *
+     * <p>The object is exported with a server socket
+     * created using the {@link RMISocketFactory} class.
+     *
      * @param port the port number on which the remote object receives calls
      * (if <code>port</code> is zero, an anonymous port is chosen)
      * @throws RemoteException if failed to export object
@@ -173,6 +201,11 @@
     /**
      * Creates and exports a new UnicastRemoteObject object using the
      * particular supplied port and socket factories.
+     *
+     * <p>Either socket factory may be {@code null}, in which case
+     * the corresponding client or server socket creation method of
+     * {@link RMISocketFactory} is used instead.
+     *
      * @param port the port number on which the remote object receives calls
      * (if <code>port</code> is zero, an anonymous port is chosen)
      * @param csf the client-side socket factory for making calls to the
@@ -238,12 +271,23 @@
 
     /**
      * Exports the remote object to make it available to receive incoming
-     * calls using an anonymous port.
+     * calls using an anonymous port. This method will always return a
+     * statically generated stub.
+     *
+     * <p>The object is exported with a server socket
+     * created using the {@link RMISocketFactory} class.
+     *
      * @param obj the remote object to be exported
      * @return remote object stub
      * @exception RemoteException if export fails
      * @since JDK1.1
+     * @deprecated This method is deprecated because it supports only static stubs.
+     * Use {@link #exportObject(Remote, int) exportObject(Remote, port)} or
+     * {@link #exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)
+     * exportObject(Remote, port, csf, ssf)}
+     * instead.
      */
+    @Deprecated
     public static RemoteStub exportObject(Remote obj)
         throws RemoteException
     {
@@ -260,6 +304,10 @@
     /**
      * Exports the remote object to make it available to receive incoming
      * calls, using the particular supplied port.
+     *
+     * <p>The object is exported with a server socket
+     * created using the {@link RMISocketFactory} class.
+     *
      * @param obj the remote object to be exported
      * @param port the port to export the object on
      * @return remote object stub
@@ -275,6 +323,11 @@
     /**
      * Exports the remote object to make it available to receive incoming
      * calls, using a transport specified by the given socket factory.
+     *
+     * <p>Either socket factory may be {@code null}, in which case
+     * the corresponding client or server socket creation method of
+     * {@link RMISocketFactory} is used instead.
+     *
      * @param obj the remote object to be exported
      * @param port the port to export the object on
      * @param csf the client-side socket factory for making calls to the
--- a/jdk/src/share/classes/java/rmi/server/package.html	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/rmi/server/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 <!--
- Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,27 @@
 generated by the rmic stub compiler.  Another group of classes
 implements the RMI Transport protocol and HTTP tunneling.
 
+<p><strong>Deprecated: HTTP Tunneling.</strong> <em>The HTTP tunneling
+mechanism has been deprecated. See {@link java.rmi.server.RMISocketFactory} for
+further information.</em>
+
+<p><strong>Deprecated: Skeletons and Static Stubs.</strong>
+
+<em>Skeletons and statically generated stubs are deprecated.  This
+includes the APIs in this package that require the use of skeletons
+or static stubs, the runtime support for them, and the use of the
+{@code rmic} stub compiler to generate them.  Support for skeletons
+and static stubs may be removed in a future release of the
+platform. Skeletons are unnecessary, as server-side method dispatching
+is handled directly by the RMI runtime. Statically generated stubs are
+unnecessary, as stubs are generated dynamically using {@link
+java.lang.reflect.Proxy Proxy} objects. See {@link
+java.rmi.server.UnicastRemoteObject UnicastRemoteObject} for
+information about dynamic stub generation. Generation of skeletons and
+static stubs was typically performed as part of an application's build
+process by calling the {@code rmic} tool. This is unnecessary, and
+calls to {@code rmic} can simply be omitted.</em>
+
 <!--
 <h2>Package Specification</h2>
 
--- a/jdk/src/share/classes/java/security/AccessControlContext.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/AccessControlContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -350,6 +350,10 @@
         return combiner;
     }
 
+    boolean isAuthorized() {
+        return isAuthorized;
+    }
+
     /**
      * Determines whether the access request indicated by the
      * specified permission should be allowed or denied, based on
--- a/jdk/src/share/classes/java/security/AccessControlException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/AccessControlException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/AccessController.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/AccessController.java	Mon Nov 11 16:20:48 2013 +0100
@@ -39,9 +39,9 @@
  * <ul>
  * <li> to decide whether an access to a critical system
  * resource is to be allowed or denied, based on the security policy
- * currently in effect,<p>
+ * currently in effect,
  * <li>to mark code as being "privileged", thus affecting subsequent
- * access determinations, and<p>
+ * access determinations, and
  * <li>to obtain a "snapshot" of the current calling context so
  * access-control decisions from a different context can be made with
  * respect to the saved context. </ul>
@@ -344,9 +344,10 @@
      * If the action's {@code run} method throws an (unchecked) exception,
      * it will propagate through this method.
      * <p>
-     * If a security manager is installed and the {@code AccessControlContext}
-     * was not created by system code and the caller's {@code ProtectionDomain}
-     * has not been granted the {@literal "createAccessControlContext"}
+     * If a security manager is installed and the specified
+     * {@code AccessControlContext} was not created by system code and the
+     * caller's {@code ProtectionDomain} has not been granted the
+     * {@literal "createAccessControlContext"}
      * {@link java.security.SecurityPermission}, then the action is performed
      * with no permissions.
      *
@@ -384,6 +385,13 @@
      * <p>
      * If the action's {@code run} method throws an (unchecked) exception,
      * it will propagate through this method.
+     * <p>
+     * If a security manager is installed and the specified
+     * {@code AccessControlContext} was not created by system code and the
+     * caller's {@code ProtectionDomain} has not been granted the
+     * {@literal "createAccessControlContext"}
+     * {@link java.security.SecurityPermission}, then the action is performed
+     * with no permissions.
      *
      * @param <T> the type of the value returned by the PrivilegedAction's
      *                  {@code run} method.
@@ -438,6 +446,13 @@
      *
      * <p> This method preserves the current AccessControlContext's
      * DomainCombiner (which may be null) while the action is performed.
+     * <p>
+     * If a security manager is installed and the specified
+     * {@code AccessControlContext} was not created by system code and the
+     * caller's {@code ProtectionDomain} has not been granted the
+     * {@literal "createAccessControlContext"}
+     * {@link java.security.SecurityPermission}, then the action is performed
+     * with no permissions.
      *
      * @param <T> the type of the value returned by the PrivilegedAction's
      *                  {@code run} method.
@@ -571,8 +586,18 @@
                       AccessControlContext parent, AccessControlContext context,
                       Permission[] perms)
     {
-        return new AccessControlContext(getCallerPD(caller), combiner, parent,
-                                        context, perms);
+        ProtectionDomain callerPD = getCallerPD(caller);
+        // check if caller is authorized to create context
+        if (context != null && !context.isAuthorized() &&
+            System.getSecurityManager() != null &&
+            !callerPD.impliesCreateAccessControlContext())
+        {
+            ProtectionDomain nullPD = new ProtectionDomain(null, null);
+            return new AccessControlContext(new ProtectionDomain[] { nullPD });
+        } else {
+            return new AccessControlContext(callerPD, combiner, parent,
+                                            context, perms);
+        }
     }
 
     private static ProtectionDomain getCallerPD(final Class <?> caller) {
@@ -597,9 +622,10 @@
      * If the action's {@code run} method throws an <i>unchecked</i>
      * exception, it will propagate through this method.
      * <p>
-     * If a security manager is installed and the {@code AccessControlContext}
-     * was not created by system code and the caller's {@code ProtectionDomain}
-     * has not been granted the {@literal "createAccessControlContext"}
+     * If a security manager is installed and the specified
+     * {@code AccessControlContext} was not created by system code and the
+     * caller's {@code ProtectionDomain} has not been granted the
+     * {@literal "createAccessControlContext"}
      * {@link java.security.SecurityPermission}, then the action is performed
      * with no permissions.
      *
@@ -641,6 +667,13 @@
      * <p>
      * If the action's {@code run} method throws an (unchecked) exception,
      * it will propagate through this method.
+     * <p>
+     * If a security manager is installed and the specified
+     * {@code AccessControlContext} was not created by system code and the
+     * caller's {@code ProtectionDomain} has not been granted the
+     * {@literal "createAccessControlContext"}
+     * {@link java.security.SecurityPermission}, then the action is performed
+     * with no permissions.
      *
      * @param <T> the type of the value returned by the
      *                  PrivilegedExceptionAction's {@code run} method.
@@ -697,6 +730,13 @@
      *
      * <p> This method preserves the current AccessControlContext's
      * DomainCombiner (which may be null) while the action is performed.
+     * <p>
+     * If a security manager is installed and the specified
+     * {@code AccessControlContext} was not created by system code and the
+     * caller's {@code ProtectionDomain} has not been granted the
+     * {@literal "createAccessControlContext"}
+     * {@link java.security.SecurityPermission}, then the action is performed
+     * with no permissions.
      *
      * @param <T> the type of the value returned by the
      *                  PrivilegedExceptionAction's {@code run} method.
--- a/jdk/src/share/classes/java/security/AlgorithmParameterGenerator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/AlgorithmParameterGenerator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -48,7 +48,7 @@
  * of the prime modulus (in bits).
  * When using this approach, algorithm-specific parameter generation
  * values - if any - default to some standard values, unless they can be
- * derived from the specified size.<P>
+ * derived from the specified size.
  *
  * <li>The other approach initializes a parameter generator object
  * using algorithm-specific semantics, which are represented by a set of
--- a/jdk/src/share/classes/java/security/BasicPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/BasicPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -57,7 +57,6 @@
  * Subclasses may implement actions on top of BasicPermission,
  * if desired.
  * <p>
- * <P>
  * @see java.security.Permission
  * @see java.security.Permissions
  * @see java.security.PermissionCollection
@@ -153,9 +152,9 @@
      * Checks if the specified permission is "implied" by
      * this object.
      * <P>
-     * More specifically, this method returns true if:<p>
+     * More specifically, this method returns true if:
      * <ul>
-     * <li> <i>p</i>'s class is the same as this object's class, and<p>
+     * <li> <i>p</i>'s class is the same as this object's class, and
      * <li> <i>p</i>'s name equals or (in the case of wildcards)
      *      is implied by this object's
      *      name. For example, "a.b.*" implies "a.b.c".
--- a/jdk/src/share/classes/java/security/CodeSource.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/CodeSource.java	Mon Nov 11 16:20:48 2013 +0100
@@ -234,7 +234,7 @@
      * Returns true if this CodeSource object "implies" the specified CodeSource.
      * <p>
      * More specifically, this method makes the following checks.
-     * If any fail, it returns false. If they all succeed, it returns true.<p>
+     * If any fail, it returns false. If they all succeed, it returns true.
      * <ul>
      * <li> <i>codesource</i> must not be null.
      * <li> If this object's certificates are not null, then all
@@ -242,7 +242,7 @@
      * certificates.
      * <li> If this object's location (getLocation()) is not null, then the
      * following checks are made against this object's location and
-     * <i>codesource</i>'s:<p>
+     * <i>codesource</i>'s:
      *   <ul>
      *     <li>  <i>codesource</i>'s location must not be null.
      *
--- a/jdk/src/share/classes/java/security/DigestOutputStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/DigestOutputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/Key.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/Key.java	Mon Nov 11 16:20:48 2013 +0100
@@ -39,7 +39,7 @@
  * RSA), which will work with those algorithms and with related
  * algorithms (such as MD5 with RSA, SHA-1 with RSA, Raw DSA, etc.)
  * The name of the algorithm of a key is obtained using the
- * {@link #getAlgorithm() getAlgorithm} method.<P>
+ * {@link #getAlgorithm() getAlgorithm} method.
  *
  * <LI>An Encoded Form
  *
@@ -65,12 +65,11 @@
  * For more information, see
  * <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
  * Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a>.
- * <P>
  *
  * <LI>A Format
  *
  * <P>This is the name of the format of the encoded key. It is returned
- * by the {@link #getFormat() getFormat} method.<P>
+ * by the {@link #getFormat() getFormat} method.
  *
  * </UL>
  *
--- a/jdk/src/share/classes/java/security/KeyPairGenerator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/KeyPairGenerator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -77,7 +77,6 @@
  * providers might have precomputed parameter sets for more than just the
  * three modulus sizes mentioned above. Still others might not have a list of
  * precomputed parameters at all and instead always create new parameter sets.
- * <p>
  *
  * <li><b>Algorithm-Specific Initialization</b>
  * <p>For situations where a set of algorithm-specific parameters already
--- a/jdk/src/share/classes/java/security/KeyStore.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/KeyStore.java	Mon Nov 11 16:20:48 2013 +0100
@@ -98,7 +98,6 @@
  *    KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
  * </pre>
  * The system will return a keystore implementation for the default type.
- * <p>
  *
  * <li>To provide a specific keystore type:
  * <pre>
@@ -1612,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
          */
@@ -1628,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/MessageDigest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/MessageDigest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -54,21 +54,21 @@
  *
  * <p>Implementations are free to implement the Cloneable interface.
  * Client applications can test cloneability by attempting cloning
- * and catching the CloneNotSupportedException: <p>
+ * and catching the CloneNotSupportedException:
+ *
+ * <pre>{@code
+ * MessageDigest md = MessageDigest.getInstance("SHA");
  *
-* <pre>
-* MessageDigest md = MessageDigest.getInstance("SHA");
-*
-* try {
-*     md.update(toChapter1);
-*     MessageDigest tc1 = md.clone();
-*     byte[] toChapter1Digest = tc1.digest();
-*     md.update(toChapter2);
-*     ...etc.
-* } catch (CloneNotSupportedException cnse) {
-*     throw new DigestException("couldn't make digest of partial content");
-* }
-* </pre>
+ * try {
+ *     md.update(toChapter1);
+ *     MessageDigest tc1 = md.clone();
+ *     byte[] toChapter1Digest = tc1.digest();
+ *     md.update(toChapter2);
+ *     ...etc.
+ * } catch (CloneNotSupportedException cnse) {
+ *     throw new DigestException("couldn't make digest of partial content");
+ * }
+ * }</pre>
  *
  * <p>Note that if a given implementation is not cloneable, it is
  * still possible to compute intermediate digests by instantiating
--- a/jdk/src/share/classes/java/security/Permission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/Permission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -138,14 +138,14 @@
      * Returns the hash code value for this Permission object.
      * <P>
      * The required {@code hashCode} behavior for Permission Objects is
-     * the following: <p>
+     * the following:
      * <ul>
      * <li>Whenever it is invoked on the same Permission object more than
      *     once during an execution of a Java application, the
      *     {@code hashCode} method
      *     must consistently return the same integer. This integer need not
      *     remain consistent from one execution of an application to another
-     *     execution of the same application. <p>
+     *     execution of the same application.
      * <li>If two Permission objects are equal according to the
      *     {@code equals}
      *     method, then calling the {@code hashCode} method on each of the
--- a/jdk/src/share/classes/java/security/PermissionCollection.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/PermissionCollection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,7 +37,6 @@
  *      collection, using the {@code implies} method.
  * <LI> enumerate all the permissions, using the {@code elements} method.
  * </UL>
- * <P>
  *
  * <p>When it is desirable to group together a number of Permission objects
  * of the same type, the {@code newPermissionCollection} method on that
--- a/jdk/src/share/classes/java/security/ProtectionDomain.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/ProtectionDomain.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/Provider.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/Provider.java	Mon Nov 11 16:20:48 2013 +0100
@@ -30,6 +30,9 @@
 import static java.util.Locale.ENGLISH;
 import java.lang.ref.*;
 import java.lang.reflect.*;
+import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 
 /**
  * This class represents a "provider" for the
@@ -185,15 +188,10 @@
      * Clears this provider so that it no longer contains the properties
      * used to look up facilities implemented by the provider.
      *
-     * <p>First, if there is a security manager, its
-     * {@code checkSecurityAccess} method is called with the string
-     * {@code "clearProviderProperties."+name} (where {@code name}
-     * is the provider name) to see if it's ok to clear this provider.
-     * If the default implementation of {@code checkSecurityAccess}
-     * is used (that is, that method is not overriden), then this results in
-     * a call to the security manager's {@code checkPermission} method
-     * with a {@code SecurityPermission("clearProviderProperties."+name)}
-     * permission.
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the string {@code "clearProviderProperties."+name}
+     * (where {@code name} is the provider name) to see if it's ok to clear
+     * this provider.
      *
      * @throws  SecurityException
      *          if a security manager exists and its {@link
@@ -202,6 +200,7 @@
      *
      * @since 1.2
      */
+    @Override
     public synchronized void clear() {
         check("clearProviderProperties."+name);
         if (debug != null) {
@@ -218,6 +217,7 @@
      *               input stream.
      * @see java.util.Properties#load
      */
+    @Override
     public synchronized void load(InputStream inStream) throws IOException {
         check("putProviderProperty."+name);
         if (debug != null) {
@@ -235,6 +235,7 @@
      *
      * @since 1.2
      */
+    @Override
     public synchronized void putAll(Map<?,?> t) {
         check("putProviderProperty."+name);
         if (debug != null) {
@@ -250,6 +251,7 @@
      * @see   java.util.Map.Entry
      * @since 1.2
      */
+    @Override
     public synchronized Set<Map.Entry<Object,Object>> entrySet() {
         checkInitialized();
         if (entrySet == null) {
@@ -276,6 +278,7 @@
      *
      * @since 1.2
      */
+    @Override
     public Set<Object> keySet() {
         checkInitialized();
         return Collections.unmodifiableSet(super.keySet());
@@ -287,6 +290,7 @@
      *
      * @since 1.2
      */
+    @Override
     public Collection<Object> values() {
         checkInitialized();
         return Collections.unmodifiableCollection(super.values());
@@ -296,22 +300,10 @@
      * Sets the {@code key} property to have the specified
      * {@code value}.
      *
-     * <p>First, if there is a security manager, its
-     * {@code checkSecurityAccess} method is called with the string
-     * {@code "putProviderProperty."+name}, where {@code name} is the
-     * provider name, to see if it's ok to set this provider's property values.
-     * If the default implementation of {@code checkSecurityAccess}
-     * is used (that is, that method is not overriden), then this results in
-     * a call to the security manager's {@code checkPermission} method
-     * with a {@code SecurityPermission("putProviderProperty."+name)}
-     * permission.
-     *
-     * @param key the property key.
-     *
-     * @param value the property value.
-     *
-     * @return the previous value of the specified property
-     * ({@code key}), or null if it did not have one.
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the string {@code "putProviderProperty."+name},
+     * where {@code name} is the provider name, to see if it's ok to set this
+     * provider's property values.
      *
      * @throws  SecurityException
      *          if a security manager exists and its {@link
@@ -320,6 +312,7 @@
      *
      * @since 1.2
      */
+    @Override
     public synchronized Object put(Object key, Object value) {
         check("putProviderProperty."+name);
         if (debug != null) {
@@ -330,24 +323,38 @@
     }
 
     /**
+     * If the specified key is not already associated with a value (or is mapped
+     * to {@code null}) associates it with the given value and returns
+     * {@code null}, else returns the current value.
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the string {@code "putProviderProperty."+name},
+     * where {@code name} is the provider name, to see if it's ok to set this
+     * provider's property values.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to set property values.
+     */
+    @Override
+    public synchronized Object putIfAbsent(Object key, Object value) {
+        check("putProviderProperty."+name);
+        if (debug != null) {
+            debug.println("Set " + name + " provider property [" +
+                          key + "/" + value +"]");
+        }
+        return implPutIfAbsent(key, value);
+    }
+
+    /**
      * Removes the {@code key} property (and its corresponding
      * {@code value}).
      *
-     * <p>First, if there is a security manager, its
-     * {@code checkSecurityAccess} method is called with the string
-     * {@code "removeProviderProperty."+name}, where {@code name} is
-     * the provider name, to see if it's ok to remove this provider's
-     * properties. If the default implementation of
-     * {@code checkSecurityAccess} is used (that is, that method is not
-     * overriden), then this results in a call to the security manager's
-     * {@code checkPermission} method with a
-     * {@code SecurityPermission("removeProviderProperty."+name)}
-     * permission.
-     *
-     * @param key the key for the property to be removed.
-     *
-     * @return the value to which the key had been mapped,
-     * or null if the key did not have a mapping.
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the string {@code "removeProviderProperty."+name},
+     * where {@code name} is the provider name, to see if it's ok to remove this
+     * provider's properties.
      *
      * @throws  SecurityException
      *          if a security manager exists and its {@link
@@ -356,6 +363,7 @@
      *
      * @since 1.2
      */
+    @Override
     public synchronized Object remove(Object key) {
         check("removeProviderProperty."+name);
         if (debug != null) {
@@ -364,19 +372,245 @@
         return implRemove(key);
     }
 
+    /**
+     * Removes the entry for the specified key only if it is currently
+     * mapped to the specified value.
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the string {@code "removeProviderProperty."+name},
+     * where {@code name} is the provider name, to see if it's ok to remove this
+     * provider's properties.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to remove this provider's properties.
+     */
+    @Override
+    public synchronized boolean remove(Object key, Object value) {
+        check("removeProviderProperty."+name);
+        if (debug != null) {
+            debug.println("Remove " + name + " provider property " + key);
+        }
+        return implRemove(key, value);
+    }
+
+    /**
+     * Replaces the entry for the specified key only if currently
+     * mapped to the specified value.
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the string {@code "putProviderProperty."+name},
+     * where {@code name} is the provider name, to see if it's ok to set this
+     * provider's property values.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to set property values.
+     */
+    @Override
+    public synchronized boolean replace(Object key, Object oldValue,
+            Object newValue) {
+        check("putProviderProperty." + name);
+
+        if (debug != null) {
+            debug.println("Replace " + name + " provider property " + key);
+        }
+        return implReplace(key, oldValue, newValue);
+    }
+
+    /**
+     * Replaces the entry for the specified key only if it is
+     * currently mapped to some value.
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the string {@code "putProviderProperty."+name},
+     * where {@code name} is the provider name, to see if it's ok to set this
+     * provider's property values.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to set property values.
+     */
+    @Override
+    public synchronized Object replace(Object key, Object value) {
+        check("putProviderProperty." + name);
+
+        if (debug != null) {
+            debug.println("Replace " + name + " provider property " + key);
+        }
+        return implReplace(key, value);
+    }
+
+    /**
+     * Replaces each entry's value with the result of invoking the given
+     * function on that entry, in the order entries are returned by an entry
+     * set iterator, until all entries have been processed or the function
+     * throws an exception.
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the string {@code "putProviderProperty."+name},
+     * where {@code name} is the provider name, to see if it's ok to set this
+     * provider's property values.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to set property values.
+     */
+    @Override
+    public synchronized void replaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) {
+        check("putProviderProperty." + name);
+
+        if (debug != null) {
+            debug.println("ReplaceAll " + name + " provider property ");
+        }
+        implReplaceAll(function);
+    }
+
+    /**
+     * Attempts to compute a mapping for the specified key and its
+     * current mapped value (or {@code null} if there is no current
+     * mapping).
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the strings {@code "putProviderProperty."+name}
+     * and {@code "removeProviderProperty."+name}, where {@code name} is the
+     * provider name, to see if it's ok to set this provider's property values
+     * and remove this provider's properties.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to set property values or remove properties.
+     */
+    @Override
+    public synchronized Object compute(Object key,
+        BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction) {
+        check("putProviderProperty." + name);
+        check("removeProviderProperty" + name);
+
+        if (debug != null) {
+            debug.println("Compute " + name + " provider property " + key);
+        }
+        return implCompute(key, remappingFunction);
+    }
+
+    /**
+     * If the specified key is not already associated with a value (or
+     * is mapped to {@code null}), attempts to compute its value using
+     * the given mapping function and enters it into this map unless
+     * {@code null}.
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the strings {@code "putProviderProperty."+name}
+     * and {@code "removeProviderProperty."+name}, where {@code name} is the
+     * provider name, to see if it's ok to set this provider's property values
+     * and remove this provider's properties.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to set property values and remove properties.
+     */
+    @Override
+    public synchronized Object computeIfAbsent(Object key, Function<? super Object, ? extends Object> mappingFunction) {
+        check("putProviderProperty." + name);
+        check("removeProviderProperty" + name);
+
+        if (debug != null) {
+            debug.println("ComputeIfAbsent " + name + " provider property " +
+                    key);
+        }
+        return implComputeIfAbsent(key, mappingFunction);
+    }
+
+    /**
+     * If the value for the specified key is present and non-null, attempts to
+     * compute a new mapping given the key and its current mapped value.
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the strings {@code "putProviderProperty."+name}
+     * and {@code "removeProviderProperty."+name}, where {@code name} is the
+     * provider name, to see if it's ok to set this provider's property values
+     * and remove this provider's properties.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to set property values or remove properties.
+     */
+    @Override
+    public synchronized Object computeIfPresent(Object key, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction) {
+        check("putProviderProperty." + name);
+        check("removeProviderProperty" + name);
+
+        if (debug != null) {
+            debug.println("ComputeIfPresent " + name + " provider property " +
+                    key);
+        }
+        return implComputeIfPresent(key, remappingFunction);
+    }
+
+    /**
+     * If the specified key is not already associated with a value or is
+     * associated with null, associates it with the given value. Otherwise,
+     * replaces the value with the results of the given remapping function,
+     * or removes if the result is null. This method may be of use when
+     * combining multiple mapped values for a key.
+     *
+     * <p>If a security manager is enabled, its {@code checkSecurityAccess}
+     * method is called with the strings {@code "putProviderProperty."+name}
+     * and {@code "removeProviderProperty."+name}, where {@code name} is the
+     * provider name, to see if it's ok to set this provider's property values
+     * and remove this provider's properties.
+     *
+     * @throws  SecurityException
+     *          if a security manager exists and its {@link
+     *          java.lang.SecurityManager#checkSecurityAccess} method
+     *          denies access to set property values or remove properties.
+     */
+    @Override
+    public synchronized Object merge(Object key, Object value,  BiFunction<? super Object, ? super Object, ? extends Object>  remappingFunction) {
+        check("putProviderProperty." + name);
+        check("removeProviderProperty" + name);
+
+        if (debug != null) {
+            debug.println("Merge " + name + " provider property " + key);
+        }
+        return implMerge(key, value, remappingFunction);
+    }
+
     // let javadoc show doc from superclass
+    @Override
     public Object get(Object key) {
         checkInitialized();
         return super.get(key);
     }
 
+    @Override
+    public synchronized Object getOrDefault(Object key, Object defaultValue) {
+        checkInitialized();
+        return super.getOrDefault(key, defaultValue);
+    }
+
+    @Override
+    public synchronized void forEach(BiConsumer<? super Object, ? super Object> action) {
+        checkInitialized();
+        super.forEach(action);
+    }
+
     // let javadoc show doc from superclass
+    @Override
     public Enumeration<Object> keys() {
         checkInitialized();
         return super.keys();
     }
 
     // let javadoc show doc from superclass
+    @Override
     public Enumeration<Object> elements() {
         checkInitialized();
         return super.elements();
@@ -446,6 +680,19 @@
         putAll(copy);
     }
 
+    private boolean checkLegacy(Object key) {
+        String keyString = (String)key;
+        if (keyString.startsWith("Provider.")) {
+            return false;
+        }
+
+        legacyChanged = true;
+        if (legacyStrings == null) {
+            legacyStrings = new LinkedHashMap<String,String>();
+        }
+        return true;
+    }
+
     /**
      * Copies all of the mappings from the specified Map to this provider.
      * Internal method to be called AFTER the security check has been
@@ -459,34 +706,121 @@
 
     private Object implRemove(Object key) {
         if (key instanceof String) {
-            String keyString = (String)key;
-            if (keyString.startsWith("Provider.")) {
+            if (!checkLegacy(key)) {
                 return null;
             }
-            legacyChanged = true;
-            if (legacyStrings == null) {
-                legacyStrings = new LinkedHashMap<String,String>();
-            }
-            legacyStrings.remove(keyString);
+            legacyStrings.remove((String)key);
         }
         return super.remove(key);
     }
 
-    private Object implPut(Object key, Object value) {
+    private boolean implRemove(Object key, Object value) {
+        if (key instanceof String && value instanceof String) {
+            if (!checkLegacy(key)) {
+                return false;
+            }
+            legacyStrings.remove((String)key, value);
+        }
+        return super.remove(key, value);
+    }
+
+    private boolean implReplace(Object key, Object oldValue, Object newValue) {
+        if ((key instanceof String) && (oldValue instanceof String) &&
+                (newValue instanceof String)) {
+            if (!checkLegacy(key)) {
+                return false;
+            }
+            legacyStrings.replace((String)key, (String)oldValue,
+                    (String)newValue);
+        }
+        return super.replace(key, oldValue, newValue);
+    }
+
+    private Object implReplace(Object key, Object value) {
         if ((key instanceof String) && (value instanceof String)) {
-            String keyString = (String)key;
-            if (keyString.startsWith("Provider.")) {
+            if (!checkLegacy(key)) {
+                return null;
+            }
+            legacyStrings.replace((String)key, (String)value);
+        }
+        return super.replace(key, value);
+    }
+
+    private void implReplaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) {
+        legacyChanged = true;
+        if (legacyStrings == null) {
+            legacyStrings = new LinkedHashMap<String,String>();
+        } else {
+            legacyStrings.replaceAll((BiFunction<? super String, ? super String, ? extends String>) function);
+        }
+        super.replaceAll(function);
+    }
+
+
+    private Object implMerge(Object key, Object value, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction) {
+        if ((key instanceof String) && (value instanceof String)) {
+            if (!checkLegacy(key)) {
                 return null;
             }
-            legacyChanged = true;
-            if (legacyStrings == null) {
-                legacyStrings = new LinkedHashMap<String,String>();
+            legacyStrings.merge((String)key, (String)value,
+                    (BiFunction<? super String, ? super String, ? extends String>) remappingFunction);
+        }
+        return super.merge(key, value, remappingFunction);
+    }
+
+    private Object implCompute(Object key, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction) {
+        if (key instanceof String) {
+            if (!checkLegacy(key)) {
+                return null;
+            }
+            legacyStrings.computeIfAbsent((String) key,
+                    (Function<? super String, ? extends String>) remappingFunction);
+        }
+        return super.compute(key, remappingFunction);
+    }
+
+    private Object implComputeIfAbsent(Object key, Function<? super Object, ? extends Object> mappingFunction) {
+        if (key instanceof String) {
+            if (!checkLegacy(key)) {
+                return null;
             }
-            legacyStrings.put(keyString, (String)value);
+            legacyStrings.computeIfAbsent((String) key,
+                    (Function<? super String, ? extends String>) mappingFunction);
+        }
+        return super.computeIfAbsent(key, mappingFunction);
+    }
+
+    private Object implComputeIfPresent(Object key, BiFunction<? super Object, ? super Object, ? extends Object> remappingFunction) {
+        if (key instanceof String) {
+            if (!checkLegacy(key)) {
+                return null;
+            }
+            legacyStrings.computeIfPresent((String) key,
+                    (BiFunction<? super String, ? super String, ? extends String>) remappingFunction);
+        }
+        return super.computeIfPresent(key, remappingFunction);
+    }
+
+    private Object implPut(Object key, Object value) {
+        if ((key instanceof String) && (value instanceof String)) {
+            if (!checkLegacy(key)) {
+                return null;
+            }
+            legacyStrings.put((String)key, (String)value);
         }
         return super.put(key, value);
     }
 
+    private Object implPutIfAbsent(Object key, Object value) {
+        if ((key instanceof String) && (value instanceof String)) {
+            if (!checkLegacy(key)) {
+                return null;
+            }
+            legacyStrings.putIfAbsent((String)key, (String)value);
+        }
+        return super.putIfAbsent(key, value);
+    }
+
     private void implClear() {
         if (legacyStrings != null) {
             legacyStrings.clear();
--- a/jdk/src/share/classes/java/security/Security.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/Security.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/SecurityPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/SecurityPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -44,7 +44,6 @@
  * The following table lists all the possible SecurityPermission target names,
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
- * <P>
  *
  * <table border=1 cellpadding=5 summary="target name,what the permission allows, and associated risks">
  * <tr>
@@ -193,7 +192,6 @@
  * associated with classes that have been deprecated: {@link Identity},
  * {@link IdentityScope}, {@link Signer}. Use of them is discouraged. See the
  * applicable classes for more information.
- * <P>
  *
  * <table border=1 cellpadding=5 summary="target name,what the permission allows, and associated risks">
  * <tr>
--- a/jdk/src/share/classes/java/security/Signature.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/Signature.java	Mon Nov 11 16:20:48 2013 +0100
@@ -77,13 +77,13 @@
  *     (see {@link #initSign(PrivateKey)}
  *     and {@link #initSign(PrivateKey, SecureRandom)}).
  *
- *     </ul><p>
+ *     </ul>
  *
- * <li>Updating<p>
+ * <li>Updating
  *
  * <p>Depending on the type of initialization, this will update the
  * bytes to be signed or verified. See the
- * {@link #update(byte) update} methods.<p>
+ * {@link #update(byte) update} methods.
  *
  * <li>Signing or Verifying a signature on all updated bytes. See the
  * {@link #sign() sign} methods and the {@link #verify(byte[]) verify}
--- a/jdk/src/share/classes/java/security/SignedObject.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/SignedObject.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,7 +43,7 @@
  * object passed to the constructor and the {@code verify} method.
  * A typical usage for signing is the following:
  *
- * <p> <pre>{@code
+ * <pre>{@code
  * Signature signingEngine = Signature.getInstance(algorithm,
  *                                                 provider);
  * SignedObject so = new SignedObject(myobject, signingKey,
@@ -53,7 +53,7 @@
  * <p> A typical usage for verification is the following (having
  * received SignedObject {@code so}):
  *
- * <p> <pre>{@code
+ * <pre>{@code
  * Signature verificationEngine =
  *     Signature.getInstance(algorithm, provider);
  * if (so.verify(publickey, verificationEngine))
--- a/jdk/src/share/classes/java/security/UnresolvedPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/UnresolvedPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/acl/Acl.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/acl/Acl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -42,27 +42,27 @@
  * granted to the associated principal. If negative, the permissions
  * are to be denied.<p>
  *
- * The ACL Entries in each ACL observe the following rules:<p>
+ * The ACL Entries in each ACL observe the following rules:
  *
  * <ul> <li>Each principal can have at most one positive ACL entry and
  * one negative entry; that is, multiple positive or negative ACL
  * entries are not allowed for any principal.  Each entry specifies
  * the set of permissions that are to be granted (if positive) or
- * denied (if negative). <p>
+ * denied (if negative).
  *
  * <li>If there is no entry for a particular principal, then the
- * principal is considered to have a null (empty) permission set.<p>
+ * principal is considered to have a null (empty) permission set.
  *
  * <li>If there is a positive entry that grants a principal a
  * particular permission, and a negative entry that denies the
  * principal the same permission, the result is as though the
- * permission was never granted or denied. <p>
+ * permission was never granted or denied.
  *
  * <li>Individual permissions always override permissions of the
  * group(s) to which the individual belongs. That is, individual
  * negative permissions (specific denial of permissions) override the
  * groups' positive permissions. And individual positive permissions
- * override the groups' negative permissions.<p>
+ * override the groups' negative permissions.
  *
  * </ul>
  *
@@ -159,12 +159,12 @@
      * Returns an enumeration for the set of allowed permissions for the
      * specified principal (representing an entity such as an individual or
      * a group). This set of allowed permissions is calculated as
-     * follows:<p>
+     * follows:
      *
      * <ul>
      *
      * <li>If there is no entry in this Access Control List for the
-     * specified principal, an empty permission set is returned.<p>
+     * specified principal, an empty permission set is returned.
      *
      * <li>Otherwise, the principal's group permission sets are determined.
      * (A principal can belong to one or more groups, where a group is a
--- a/jdk/src/share/classes/java/security/cert/CertificateFactory.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/cert/CertificateFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -63,7 +63,7 @@
  * supports those methods), so that each call to
  * {@code generateCertificate} consumes only one certificate, and the
  * read position of the input stream is positioned to the next certificate in
- * the file:<p>
+ * the file:
  *
  * <pre>{@code
  * FileInputStream fis = new FileInputStream(filename);
@@ -78,7 +78,7 @@
  * }</pre>
  *
  * <p>The following example parses a PKCS#7-formatted certificate reply stored
- * in a file and extracts all the certificates from it:<p>
+ * in a file and extracts all the certificates from it:
  *
  * <pre>
  * FileInputStream fis = new FileInputStream(filename);
--- a/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/cert/PKIXRevocationChecker.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/cert/PKIXRevocationChecker.java	Mon Nov 11 16:20:48 2013 +0100
@@ -299,7 +299,7 @@
         /**
          * Allow revocation check to succeed if the revocation status cannot be
          * determined for one of the following reasons:
-         * <p><ul>
+         * <ul>
          *  <li>The CRL or OCSP response cannot be obtained because of a
          *      network error.
          *  <li>The OCSP responder returns one of the following errors
--- a/jdk/src/share/classes/java/security/cert/PolicyQualifierInfo.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/cert/PolicyQualifierInfo.java	Mon Nov 11 16:20:48 2013 +0100
@@ -35,7 +35,7 @@
  * structure.
  *
  * <p>The ASN.1 definition is as follows:
- * <p><pre>
+ * <pre>
  *   PolicyQualifierInfo ::= SEQUENCE {
  *        policyQualifierId       PolicyQualifierId,
  *        qualifier               ANY DEFINED BY policyQualifierId }
--- a/jdk/src/share/classes/java/security/cert/TrustAnchor.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/cert/TrustAnchor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -44,7 +44,6 @@
  * individual parameters.
  * <p>
  * <b>Concurrent Access</b>
- * <p>
  * <p>All {@code TrustAnchor} objects must be immutable and
  * thread-safe. That is, multiple threads may concurrently invoke the
  * methods defined in this class on a single {@code TrustAnchor}
--- a/jdk/src/share/classes/java/security/cert/X509CertSelector.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/cert/X509CertSelector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -359,7 +359,7 @@
      * criticality setting, and encapsulating OCTET STRING)
      * for a SubjectKeyIdentifier extension.
      * The ASN.1 notation for this structure follows.
-     * <p>
+     *
      * <pre>{@code
      * SubjectKeyIdentifier ::= KeyIdentifier
      *
@@ -399,7 +399,7 @@
      * criticality setting, and encapsulating OCTET STRING)
      * for an AuthorityKeyIdentifier extension.
      * The ASN.1 notation for this structure follows.
-     * <p>
+     *
      * <pre>{@code
      * AuthorityKeyIdentifier ::= SEQUENCE {
      *    keyIdentifier             [0] KeyIdentifier           OPTIONAL,
--- a/jdk/src/share/classes/java/security/interfaces/DSAKeyPairGenerator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/interfaces/DSAKeyPairGenerator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,11 +43,11 @@
  *
  * <li>Get a key pair generator for the DSA algorithm by calling the
  * KeyPairGenerator {@code getInstance} method with "DSA"
- * as its argument.<p>
+ * as its argument.
  *
  * <li>Initialize the generator by casting the result to a DSAKeyPairGenerator
  * and calling one of the
- * {@code initialize} methods from this DSAKeyPairGenerator interface.<p>
+ * {@code initialize} methods from this DSAKeyPairGenerator interface.
  *
  * <li>Generate a key pair by calling the {@code generateKeyPair}
  * method from the KeyPairGenerator class.
--- a/jdk/src/share/classes/java/security/spec/ECFieldF2m.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/security/spec/ECFieldF2m.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/Array.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/BatchUpdateException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/Blob.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/CallableStatement.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/Clob.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/Connection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/DataTruncation.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/DatabaseMetaData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/DriverManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/DriverPropertyInfo.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/PreparedStatement.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/ResultSet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLFeatureNotSupportedException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLIntegrityConstraintViolationException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLInvalidAuthorizationSpecException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLNonTransientConnectionException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLNonTransientException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLRecoverableException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLSyntaxErrorException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLTimeoutException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLTransactionRollbackException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLTransientConnectionException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLTransientException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLWarning.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/SQLXML.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/Statement.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/Struct.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/sql/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/BreakIterator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/ChoiceFormat.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/DigitList.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/FieldPosition.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/Format.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/MessageFormat.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/MessageFormat.java	Mon Nov 11 16:20:48 2013 +0100
@@ -125,7 +125,6 @@
  * valid patterns, but <code>"ab {0'}' de"</code>, <code>"ab } de"</code>
  * and <code>"''{''"</code> are not.
  *
- * <p>
  * <dl><dt><b>Warning:</b><dd>The rules for using quotes within message
  * format patterns unfortunately have shown to be somewhat confusing.
  * In particular, it isn't always obvious to localizers whether single
@@ -146,7 +145,7 @@
  * table shows how the values map to {@code Format} instances. Combinations not
  * shown in the table are illegal. A <i>SubformatPattern</i> must
  * be a valid pattern string for the {@code Format} subclass used.
- * <p>
+ *
  * <table border=1 summary="Shows how FormatType and FormatStyle values map to Format instances">
  *    <tr>
  *       <th id="ft" class="TableHeadingColor">FormatType
@@ -215,7 +214,6 @@
  *       <td headers="fs"><i>SubformatPattern</i>
  *       <td headers="sc">{@code new} {@link ChoiceFormat#ChoiceFormat(String) ChoiceFormat}{@code (subformatPattern)}
  * </table>
- * <p>
  *
  * <h4>Usage Information</h4>
  *
@@ -761,7 +759,7 @@
      * as indicated by the first matching line of the following table. An
      * argument is <i>unavailable</i> if <code>arguments</code> is
      * <code>null</code> or has fewer than argumentIndex+1 elements.
-     * <p>
+     *
      * <table border=1 summary="Examples of subformat,argument,and formatted text">
      *    <tr>
      *       <th>Subformat
--- a/jdk/src/share/classes/java/text/Normalizer.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/Normalizer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -53,12 +53,12 @@
  * several different ways in Unicode.  For example, take the character A-acute.
  * In Unicode, this can be encoded as a single character (the "composed" form):
  *
- * <p><pre>
+ * <pre>
  *      U+00C1    LATIN CAPITAL LETTER A WITH ACUTE</pre>
  *
  * or as two separate characters (the "decomposed" form):
  *
- * <p><pre>
+ * <pre>
  *      U+0041    LATIN CAPITAL LETTER A
  *      U+0301    COMBINING ACUTE ACCENT</pre>
  *
@@ -72,14 +72,14 @@
  * <p>
  * Similarly, the string "ffi" can be encoded as three separate letters:
  *
- * <p><pre>
+ * <pre>
  *      U+0066    LATIN SMALL LETTER F
  *      U+0066    LATIN SMALL LETTER F
  *      U+0069    LATIN SMALL LETTER I</pre>
  *
  * or as the single character
  *
- * <p><pre>
+ * <pre>
  *      U+FB03    LATIN SMALL LIGATURE FFI</pre>
  *
  * The ffi ligature is not a distinct semantic character, and strictly speaking
--- a/jdk/src/share/classes/java/text/RuleBasedCollator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/RuleBasedCollator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/text/SimpleDateFormat.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/text/SimpleDateFormat.java	Mon Nov 11 16:20:48 2013 +0100
@@ -356,7 +356,6 @@
  * may be replaced with other, locale dependent, pattern letters.
  * <code>SimpleDateFormat</code> does not deal with the localization of text
  * other than the pattern letters; that's up to the client of the class.
- * <p>
  *
  * <h4>Examples</h4>
  *
--- a/jdk/src/share/classes/java/time/Duration.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/Duration.java	Mon Nov 11 16:20:48 2013 +0100
@@ -141,7 +141,7 @@
     /**
      * The pattern for parsing.
      */
-    private final static Pattern PATTERN =
+    private static final Pattern PATTERN =
             Pattern.compile("([-+]?)P(?:([-+]?[0-9]+)D)?" +
                     "(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?",
                     Pattern.CASE_INSENSITIVE);
@@ -554,7 +554,7 @@
      * the simple initialization in Duration.
      */
     private static class DurationUnits {
-        final static List<TemporalUnit> UNITS =
+        static final List<TemporalUnit> UNITS =
                 Collections.unmodifiableList(Arrays.<TemporalUnit>asList(SECONDS, NANOS));
     }
 
--- a/jdk/src/share/classes/java/time/OffsetDateTime.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/OffsetDateTime.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1903,9 +1903,9 @@
      * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
-     *  out.writeByte(10);  // identifies a OffsetDateTime
-     *  out.writeObject(dateTime);
-     *  out.writeObject(offset);
+     *  out.writeByte(10);  // identifies an OffsetDateTime
+     *  // the <a href="../../serialized-form.html#java.time.LocalDateTime">datetime</a> excluding the one byte header
+     *  // the <a href="../../serialized-form.html#java.time.ZoneOffset">offset</a> excluding the one byte header
      * </pre>
      *
      * @return the instance of {@code Ser}, not null
@@ -1924,13 +1924,13 @@
     }
 
     void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(dateTime);
-        out.writeObject(offset);
+        dateTime.writeExternal(out);
+        offset.writeExternal(out);
     }
 
     static OffsetDateTime readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        LocalDateTime dateTime = (LocalDateTime) in.readObject();
-        ZoneOffset offset = (ZoneOffset) in.readObject();
+        LocalDateTime dateTime = LocalDateTime.readExternal(in);
+        ZoneOffset offset = ZoneOffset.readExternal(in);
         return OffsetDateTime.of(dateTime, offset);
     }
 
--- a/jdk/src/share/classes/java/time/OffsetTime.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/OffsetTime.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1374,9 +1374,9 @@
      * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
-     *  out.writeByte(9);  // identifies a OffsetTime
-     *  out.writeObject(time);
-     *  out.writeObject(offset);
+     *  out.writeByte(9);  // identifies an OffsetTime
+     *  // the <a href="../../serialized-form.html#java.time.LocalTime">time</a> excluding the one byte header
+     *  // the <a href="../../serialized-form.html#java.time.ZoneOffset">offset</a> excluding the one byte header
      * </pre>
      *
      * @return the instance of {@code Ser}, not null
@@ -1395,13 +1395,13 @@
     }
 
     void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(time);
-        out.writeObject(offset);
+        time.writeExternal(out);
+        offset.writeExternal(out);
     }
 
     static OffsetTime readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        LocalTime time = (LocalTime) in.readObject();
-        ZoneOffset offset = (ZoneOffset) in.readObject();
+        LocalTime time = LocalTime.readExternal(in);
+        ZoneOffset offset = ZoneOffset.readExternal(in);
         return OffsetTime.of(time, offset);
     }
 
--- a/jdk/src/share/classes/java/time/Period.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/Period.java	Mon Nov 11 16:20:48 2013 +0100
@@ -138,13 +138,13 @@
     /**
      * The pattern for parsing.
      */
-    private final static Pattern PATTERN =
+    private static final Pattern PATTERN =
             Pattern.compile("([-+]?)P(?:([-+]?[0-9]+)Y)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)W)?(?:([-+]?[0-9]+)D)?", Pattern.CASE_INSENSITIVE);
 
     /**
      * The set of supported units.
      */
-    private final static List<TemporalUnit> SUPPORTED_UNITS =
+    private static final List<TemporalUnit> SUPPORTED_UNITS =
             Collections.unmodifiableList(Arrays.<TemporalUnit>asList(YEARS, MONTHS, DAYS));
 
     /**
--- a/jdk/src/share/classes/java/time/ZoneId.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/ZoneId.java	Mon Nov 11 16:20:48 2013 +0100
@@ -169,60 +169,15 @@
 public abstract class ZoneId implements Serializable {
 
     /**
-     * A map of zone overrides to enable the older short time-zone names to be used.
-     * <p>
-     * Use of short zone IDs has been deprecated in {@code java.util.TimeZone}.
-     * This map allows the IDs to continue to be used via the
-     * {@link #of(String, Map)} factory method.
-     * <p>
-     * This map contains an older mapping of the IDs, where 'EST', 'MST' and 'HST'
-     * map to IDs which include daylight savings.
-     * This is in line with versions of TZDB before 2005r.
-     * <p>
-     * This maps as follows:
-     * <ul>
-     * <li>EST - America/New_York</li>
-     * <li>MST - America/Denver</li>
-     * <li>HST - Pacific/Honolulu</li>
-     * <li>ACT - Australia/Darwin</li>
-     * <li>AET - Australia/Sydney</li>
-     * <li>AGT - America/Argentina/Buenos_Aires</li>
-     * <li>ART - Africa/Cairo</li>
-     * <li>AST - America/Anchorage</li>
-     * <li>BET - America/Sao_Paulo</li>
-     * <li>BST - Asia/Dhaka</li>
-     * <li>CAT - Africa/Harare</li>
-     * <li>CNT - America/St_Johns</li>
-     * <li>CST - America/Chicago</li>
-     * <li>CTT - Asia/Shanghai</li>
-     * <li>EAT - Africa/Addis_Ababa</li>
-     * <li>ECT - Europe/Paris</li>
-     * <li>IET - America/Indiana/Indianapolis</li>
-     * <li>IST - Asia/Kolkata</li>
-     * <li>JST - Asia/Tokyo</li>
-     * <li>MIT - Pacific/Apia</li>
-     * <li>NET - Asia/Yerevan</li>
-     * <li>NST - Pacific/Auckland</li>
-     * <li>PLT - Asia/Karachi</li>
-     * <li>PNT - America/Phoenix</li>
-     * <li>PRT - America/Puerto_Rico</li>
-     * <li>PST - America/Los_Angeles</li>
-     * <li>SST - Pacific/Guadalcanal</li>
-     * <li>VST - Asia/Ho_Chi_Minh</li>
-     * </ul>
-     * The map is unmodifiable.
-     */
-    public static final Map<String, String> OLD_SHORT_IDS;
-    /**
      * A map of zone overrides to enable the short time-zone names to be used.
      * <p>
      * Use of short zone IDs has been deprecated in {@code java.util.TimeZone}.
      * This map allows the IDs to continue to be used via the
      * {@link #of(String, Map)} factory method.
      * <p>
-     * This map contains a newer mapping of the IDs, where 'EST', 'MST' and 'HST'
-     * map to IDs which do not include daylight savings
-     * This is in line with TZDB 2005r and later.
+     * This map contains a mapping of the IDs that is in line with TZDB 2005r and
+     * later, where 'EST', 'MST' and 'HST' map to IDs which do not include daylight
+     * savings.
      * <p>
      * This maps as follows:
      * <ul>
@@ -259,42 +214,36 @@
      */
     public static final Map<String, String> SHORT_IDS;
     static {
-        Map<String, String> base = new HashMap<>();
-        base.put("ACT", "Australia/Darwin");
-        base.put("AET", "Australia/Sydney");
-        base.put("AGT", "America/Argentina/Buenos_Aires");
-        base.put("ART", "Africa/Cairo");
-        base.put("AST", "America/Anchorage");
-        base.put("BET", "America/Sao_Paulo");
-        base.put("BST", "Asia/Dhaka");
-        base.put("CAT", "Africa/Harare");
-        base.put("CNT", "America/St_Johns");
-        base.put("CST", "America/Chicago");
-        base.put("CTT", "Asia/Shanghai");
-        base.put("EAT", "Africa/Addis_Ababa");
-        base.put("ECT", "Europe/Paris");
-        base.put("IET", "America/Indiana/Indianapolis");
-        base.put("IST", "Asia/Kolkata");
-        base.put("JST", "Asia/Tokyo");
-        base.put("MIT", "Pacific/Apia");
-        base.put("NET", "Asia/Yerevan");
-        base.put("NST", "Pacific/Auckland");
-        base.put("PLT", "Asia/Karachi");
-        base.put("PNT", "America/Phoenix");
-        base.put("PRT", "America/Puerto_Rico");
-        base.put("PST", "America/Los_Angeles");
-        base.put("SST", "Pacific/Guadalcanal");
-        base.put("VST", "Asia/Ho_Chi_Minh");
-        Map<String, String> pre = new HashMap<>(base);
-        pre.put("EST", "America/New_York");
-        pre.put("MST", "America/Denver");
-        pre.put("HST", "Pacific/Honolulu");
-        OLD_SHORT_IDS = Collections.unmodifiableMap(pre);
-        Map<String, String> post = new HashMap<>(base);
-        post.put("EST", "-05:00");
-        post.put("MST", "-07:00");
-        post.put("HST", "-10:00");
-        SHORT_IDS = Collections.unmodifiableMap(post);
+        Map<String, String> map = new HashMap<>(64);
+        map.put("ACT", "Australia/Darwin");
+        map.put("AET", "Australia/Sydney");
+        map.put("AGT", "America/Argentina/Buenos_Aires");
+        map.put("ART", "Africa/Cairo");
+        map.put("AST", "America/Anchorage");
+        map.put("BET", "America/Sao_Paulo");
+        map.put("BST", "Asia/Dhaka");
+        map.put("CAT", "Africa/Harare");
+        map.put("CNT", "America/St_Johns");
+        map.put("CST", "America/Chicago");
+        map.put("CTT", "Asia/Shanghai");
+        map.put("EAT", "Africa/Addis_Ababa");
+        map.put("ECT", "Europe/Paris");
+        map.put("IET", "America/Indiana/Indianapolis");
+        map.put("IST", "Asia/Kolkata");
+        map.put("JST", "Asia/Tokyo");
+        map.put("MIT", "Pacific/Apia");
+        map.put("NET", "Asia/Yerevan");
+        map.put("NST", "Pacific/Auckland");
+        map.put("PLT", "Asia/Karachi");
+        map.put("PNT", "America/Phoenix");
+        map.put("PRT", "America/Puerto_Rico");
+        map.put("PST", "America/Los_Angeles");
+        map.put("SST", "Pacific/Guadalcanal");
+        map.put("VST", "Asia/Ho_Chi_Minh");
+        map.put("EST", "-05:00");
+        map.put("MST", "-07:00");
+        map.put("HST", "-10:00");
+        SHORT_IDS = Collections.unmodifiableMap(map);
     }
     /**
      * Serialization version.
@@ -314,7 +263,7 @@
      * @throws ZoneRulesException if the converted zone region ID cannot be found
      */
     public static ZoneId systemDefault() {
-        return ZoneId.of(TimeZone.getDefault().getID(), SHORT_IDS);
+        return TimeZone.getDefault().toZoneId();
     }
 
     /**
--- a/jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -104,7 +104,7 @@
     /**
      * The set of supported units.
      */
-    private final static List<TemporalUnit> SUPPORTED_UNITS =
+    private static final List<TemporalUnit> SUPPORTED_UNITS =
             Collections.unmodifiableList(Arrays.<TemporalUnit>asList(YEARS, MONTHS, DAYS));
 
     /**
--- a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/chrono/JapaneseDate.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/JapaneseDate.java	Mon Nov 11 16:20:48 2013 +0100
@@ -140,7 +140,7 @@
     /**
      * The first day supported by the JapaneseChronology is Meiji 6, January 1st.
      */
-    final static LocalDate MEIJI_6_ISODATE = LocalDate.of(1873, 1, 1);
+    static final LocalDate MEIJI_6_ISODATE = LocalDate.of(1873, 1, 1);
 
     //-----------------------------------------------------------------------
     /**
--- a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -557,12 +557,13 @@
      * a two digit year parse will be in the range 1950-01-01 to 2049-12-31.
      * Only the year would be extracted from the date, thus a base date of
      * 1950-08-25 would also parse to the range 1950-01-01 to 2049-12-31.
-     * This behaviour is necessary to support fields such as week-based-year
+     * This behavior is necessary to support fields such as week-based-year
      * or other calendar systems where the parsed value does not align with
      * standard ISO years.
      * <p>
      * The exact behavior is as follows. Parse the full set of fields and
-     * determine the effective chronology. Then convert the base date to the
+     * determine the effective chronology using the last chronology if
+     * it appears more than once. Then convert the base date to the
      * effective chronology. Then extract the specified field from the
      * chronology-specific base date and use it to determine the
      * {@code baseValue} used below.
@@ -2809,9 +2810,19 @@
         int setValue(DateTimeParseContext context, long value, int errorPos, int successPos) {
             int baseValue = this.baseValue;
             if (baseDate != null) {
-                // TODO: effective chrono is inaccurate at this point
                 Chronology chrono = context.getEffectiveChronology();
                 baseValue = chrono.date(baseDate).get(field);
+
+                // In case the Chronology is changed later, add a callback when/if it changes
+                final long initialValue = value;
+                context.addChronoChangedListener(
+                        (_unused) ->  {
+                            /* Repeat the set of the field using the current Chronology
+                             * The success/error position is ignored because the value is
+                             * intentionally being overwritten.
+                             */
+                            setValue(context, initialValue, errorPos, successPos);
+                        });
             }
             int parseLen = successPos - errorPos;
             if (parseLen == minWidth && value >= 0) {
--- a/jdk/src/share/classes/java/time/format/DateTimeParseContext.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/format/DateTimeParseContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -61,7 +61,6 @@
  */
 package java.time.format;
 
-import java.time.Duration;
 import java.time.ZoneId;
 import java.time.chrono.Chronology;
 import java.time.chrono.IsoChronology;
@@ -69,6 +68,7 @@
 import java.util.ArrayList;
 import java.util.Locale;
 import java.util.Objects;
+import java.util.function.Consumer;
 
 /**
  * Context object used during date and time parsing.
@@ -105,6 +105,10 @@
      * The list of parsed data.
      */
     private final ArrayList<Parsed> parsed = new ArrayList<>();
+    /**
+     * List of Consumers<Chronology> to be notified if the Chronology changes.
+     */
+    private ArrayList<Consumer<Chronology>> chronoListeners = null;
 
     /**
      * Creates a new instance of the context.
@@ -354,12 +358,36 @@
      * <p>
      * This stores the chronology that has been parsed.
      * No validation is performed other than ensuring it is not null.
+     * <p>
+     * The list of listeners is copied and cleared so that each
+     * listener is called only once.  A listener can add itself again
+     * if it needs to be notified of future changes.
      *
      * @param chrono  the parsed chronology, not null
      */
     void setParsed(Chronology chrono) {
         Objects.requireNonNull(chrono, "chrono");
         currentParsed().chrono = chrono;
+        if (chronoListeners != null && !chronoListeners.isEmpty()) {
+            Consumer[] tmp = new Consumer[1];
+            Consumer<Chronology>[] listeners = chronoListeners.toArray(tmp);
+            chronoListeners.clear();
+            for (Consumer<Chronology> l : listeners) {
+                l.accept(chrono);
+            }
+        }
+    }
+
+    /**
+     * Adds a Consumer<Chronology> to the list of listeners to be notified
+     * if the Chronology changes.
+     * @param listener a Consumer<Chronology> to be called when Chronology changes
+     */
+    void addChronoChangedListener(Consumer<Chronology> listener) {
+        if (chronoListeners == null) {
+            chronoListeners = new ArrayList<Consumer<Chronology>>();
+        }
+        chronoListeners.add(listener);
     }
 
     /**
--- a/jdk/src/share/classes/java/time/temporal/TemporalQueries.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/temporal/TemporalQueries.java	Mon Nov 11 16:20:48 2013 +0100
@@ -341,34 +341,23 @@
     /**
      * A strict query for the {@code ZoneId}.
      */
-    static final TemporalQuery<ZoneId> ZONE_ID = (temporal) -> {
-        return temporal.query(ZONE_ID);
-    };
+    static final TemporalQuery<ZoneId> ZONE_ID = (temporal) ->
+        temporal.query(TemporalQueries.ZONE_ID);
 
     /**
      * A query for the {@code Chronology}.
      */
-    static final TemporalQuery<Chronology> CHRONO = (temporal) -> {
-        return temporal.query(CHRONO);
-    };
+    static final TemporalQuery<Chronology> CHRONO = (temporal) ->
+        temporal.query(TemporalQueries.CHRONO);
 
     /**
      * A query for the smallest supported unit.
      */
-    static final TemporalQuery<TemporalUnit> PRECISION = (temporal) -> {
-        return temporal.query(PRECISION);
-    };
+    static final TemporalQuery<TemporalUnit> PRECISION = (temporal) ->
+        temporal.query(TemporalQueries.PRECISION);
 
     //-----------------------------------------------------------------------
     /**
-     * A lenient query for the {@code ZoneId}, falling back to the {@code ZoneOffset}.
-     */
-    static final TemporalQuery<ZoneId> ZONE = (temporal) -> {
-        ZoneId zone = temporal.query(ZONE_ID);
-        return (zone != null ? zone : temporal.query(OFFSET));
-    };
-
-    /**
      * A query for {@code ZoneOffset} returning null if not found.
      */
     static final TemporalQuery<ZoneOffset> OFFSET = (temporal) -> {
@@ -379,6 +368,14 @@
     };
 
     /**
+     * A lenient query for the {@code ZoneId}, falling back to the {@code ZoneOffset}.
+     */
+    static final TemporalQuery<ZoneId> ZONE = (temporal) -> {
+        ZoneId zone = temporal.query(ZONE_ID);
+        return (zone != null ? zone : temporal.query(OFFSET));
+    };
+
+    /**
      * A query for {@code LocalDate} returning null if not found.
      */
     static final TemporalQuery<LocalDate> LOCAL_DATE = (temporal) -> {
--- a/jdk/src/share/classes/java/time/temporal/WeekFields.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/temporal/WeekFields.java	Mon Nov 11 16:20:48 2013 +0100
@@ -245,15 +245,15 @@
     /**
      * The field used to access the computed DayOfWeek.
      */
-    private transient final TemporalField dayOfWeek = ComputedDayOfField.ofDayOfWeekField(this);
+    private final transient TemporalField dayOfWeek = ComputedDayOfField.ofDayOfWeekField(this);
     /**
      * The field used to access the computed WeekOfMonth.
      */
-    private transient final TemporalField weekOfMonth = ComputedDayOfField.ofWeekOfMonthField(this);
+    private final transient TemporalField weekOfMonth = ComputedDayOfField.ofWeekOfMonthField(this);
     /**
      * The field used to access the computed WeekOfYear.
      */
-    private transient final TemporalField weekOfYear = ComputedDayOfField.ofWeekOfYearField(this);
+    private final transient TemporalField weekOfYear = ComputedDayOfField.ofWeekOfYearField(this);
     /**
      * The field that represents the week-of-week-based-year.
      * <p>
@@ -261,7 +261,7 @@
      * <p>
      * This unit is an immutable and thread-safe singleton.
      */
-    private transient final TemporalField weekOfWeekBasedYear = ComputedDayOfField.ofWeekOfWeekBasedYearField(this);
+    private final transient TemporalField weekOfWeekBasedYear = ComputedDayOfField.ofWeekOfWeekBasedYearField(this);
     /**
      * The field that represents the week-based-year.
      * <p>
@@ -269,7 +269,7 @@
      * <p>
      * This unit is an immutable and thread-safe singleton.
      */
-    private transient final TemporalField weekBasedYear = ComputedDayOfField.ofWeekBasedYearField(this);
+    private final transient TemporalField weekBasedYear = ComputedDayOfField.ofWeekBasedYearField(this);
 
     //-----------------------------------------------------------------------
     /**
--- a/jdk/src/share/classes/java/time/zone/Ser.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/zone/Ser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -171,9 +171,9 @@
      * <li><a href="../../../serialized-form.html#java.time.zone.ZoneRules">ZoneRules</a>
      * - {@code ZoneRules.of(standardTransitions, standardOffsets, savingsInstantTransitions, wallOffsets, lastRules);}
      * <li><a href="../../../serialized-form.html#java.time.zone.ZoneOffsetTransition">ZoneOffsetTransition</a>
-     * - {@code ;}
+     * - {@code ZoneOffsetTransition of(LocalDateTime.ofEpochSecond(epochSecond), offsetBefore, offsetAfter);}
      * <li><a href="../../../serialized-form.html#java.time.zone.ZoneOffsetTransitionRule">ZoneOffsetTransitionRule</a>
-     * - {@code ;}
+     * - {@code ZoneOffsetTransitionRule.of(month, dom, dow, time, timeEndOfDay, timeDefinition, standardOffset, offsetBefore, offsetAfter);}
      * </ul>
      * @param in  the data to read, not null
      */
--- a/jdk/src/share/classes/java/time/zone/TzdbZoneRulesProvider.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/zone/TzdbZoneRulesProvider.java	Mon Nov 11 16:20:48 2013 +0100
@@ -62,6 +62,7 @@
 package java.time.zone;
 
 import java.io.ByteArrayInputStream;
+import java.io.BufferedInputStream;
 import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -107,7 +108,8 @@
         try {
             String libDir = System.getProperty("java.home") + File.separator + "lib";
             try (DataInputStream dis = new DataInputStream(
-                     new FileInputStream(new File(libDir, "tzdb.dat")))) {
+                     new BufferedInputStream(new FileInputStream(
+                         new File(libDir, "tzdb.dat"))))) {
                 load(dis);
             }
         } catch (Exception ex) {
--- a/jdk/src/share/classes/java/time/zone/ZoneOffsetTransition.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/zone/ZoneOffsetTransition.java	Mon Nov 11 16:20:48 2013 +0100
@@ -191,7 +191,7 @@
      *   out.writeByte(2);                // identifies a ZoneOffsetTransition
      *   out.writeEpochSec(toEpochSecond);
      *   out.writeOffset(offsetBefore);
-     *   out.writeOfset(offsetAfter);
+     *   out.writeOffset(offsetAfter);
      * }
      * </pre>
      * @return the replacing object, not null
--- a/jdk/src/share/classes/java/time/zone/ZoneRules.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/time/zone/ZoneRules.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Arrays.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/Base64.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Base64.java	Mon Nov 11 16:20:48 2013 +0100
@@ -40,7 +40,6 @@
  * <a href="http://www.ietf.org/rfc/rfc4648.txt">RFC 4648</a> and
  * <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>.
  *
- * <p>
  * <ul>
  * <li><a name="basic"><b>Basic</b></a>
  * <p> Uses "The Base64 Alphabet" as specified in Table 1 of
@@ -128,7 +127,7 @@
      *          character of "The Base64 Alphabet" as specified in Table 1 of
      *          RFC 2045.
      */
-    public static Encoder getEncoder(int lineLength, byte[] lineSeparator) {
+    public static Encoder getMimeEncoder(int lineLength, byte[] lineSeparator) {
          Objects.requireNonNull(lineSeparator);
          int[] base64 = Decoder.fromBase64;
          for (byte b : lineSeparator) {
@@ -620,11 +619,20 @@
      * required. So if the final unit of the encoded byte data only has
      * two or three Base64 characters (without the corresponding padding
      * character(s) padded), they are decoded as if followed by padding
-     * character(s). If there is padding character present in the
-     * final unit, the correct number of padding character(s) must be
-     * present, otherwise {@code IllegalArgumentException} (
-     * {@code IOException} when reading from a Base64 stream) is thrown
-     * during decoding.
+     * character(s).
+     * <p>
+     * For decoders that use the <a href="#basic">Basic</a> and
+     * <a href="#url">URL and Filename safe</a> type base64 scheme, and
+     * if there is padding character present in the final unit, the
+     * correct number of padding character(s) must be present, otherwise
+     * {@code IllegalArgumentException} ({@code IOException} when reading
+     * from a Base64 stream) is thrown during decoding.
+     * <p>
+     * Decoders that use the <a href="#mime">MIME</a> type base64 scheme
+     * are more lenient when decoding the padding character(s). If the
+     * padding character(s) is incorrectly encoded, the first padding
+     * character encountered is interpreted as the end of the encoded byte
+     * data, the decoding operation will then end and return normally.
      *
      * <p> Instances of {@link Decoder} class are safe for use by
      * multiple concurrent threads.
@@ -903,8 +911,9 @@
                     int b = sa[sp++] & 0xff;
                     if ((b = base64[b]) < 0) {
                         if (b == -2) {   // padding byte
-                            if (shiftto == 6 && (sp == sl || sa[sp++] != '=') ||
-                                shiftto == 18) {
+                            if (!isMIME &&
+                                (shiftto == 6 && (sp == sl || sa[sp++] != '=') ||
+                                 shiftto == 18)) {
                                 throw new IllegalArgumentException(
                                      "Input byte array has wrong 4-byte ending unit");
                             }
@@ -943,11 +952,12 @@
                     throw new IllegalArgumentException(
                         "Last unit does not have enough valid bits");
                 }
-                while (sp < sl) {
-                    if (isMIME && base64[sa[sp++]] < 0)
-                        continue;
-                    throw new IllegalArgumentException(
-                        "Input byte array has incorrect ending byte at " + sp);
+                if (sp < sl) {
+                    if (isMIME)
+                        sp = sl;
+                    else
+                        throw new IllegalArgumentException(
+                            "Input byte array has incorrect ending byte at " + sp);
                 }
                 mark = sp;
                 return dp - dp0;
@@ -972,8 +982,9 @@
                     int b = src.get(sp++) & 0xff;
                     if ((b = base64[b]) < 0) {
                         if (b == -2) {  // padding byte
-                            if (shiftto == 6 && (sp == sl || src.get(sp++) != '=') ||
-                                shiftto == 18) {
+                            if (!isMIME &&
+                                (shiftto == 6 && (sp == sl || src.get(sp++) != '=') ||
+                                 shiftto == 18)) {
                                 throw new IllegalArgumentException(
                                      "Input byte array has wrong 4-byte ending unit");
                             }
@@ -1012,11 +1023,12 @@
                     throw new IllegalArgumentException(
                         "Last unit does not have enough valid bits");
                 }
-                while (sp < sl) {
-                    if (isMIME && base64[src.get(sp++)] < 0)
-                        continue;
-                    throw new IllegalArgumentException(
-                        "Input byte array has incorrect ending byte at " + sp);
+                if (sp < sl) {
+                    if (isMIME)
+                        sp = sl;
+                    else
+                        throw new IllegalArgumentException(
+                            "Input byte array has incorrect ending byte at " + sp);
                 }
                 mark = sp;
                 return dp - dp0;
@@ -1072,14 +1084,15 @@
             while (sp < sl) {
                 int b = src[sp++] & 0xff;
                 if ((b = base64[b]) < 0) {
-                    if (b == -2) {     // padding byte '='
-                        // xx=   shiftto==6&&sp==sl missing last =
-                        // xx=y  shiftto==6 last is not =
-                        // =     shiftto==18 unnecessary padding
-                        // x=    shiftto==12 be taken care later
-                        //       together with single x, invalid anyway
-                        if (shiftto == 6 && (sp == sl || src[sp++] != '=') ||
-                            shiftto == 18) {
+                    if (b == -2) {         // padding byte '='
+                        if (!isMIME  &&    // be lenient for rfc2045
+                            // =     shiftto==18 unnecessary padding
+                            // x=    shiftto==12 a dangling single x
+                            // x     to be handled together with non-padding case
+                            // xx=   shiftto==6&&sp==sl missing last =
+                            // xx=y  shiftto==6 last is not =
+                            (shiftto == 6 && (sp == sl || src[sp++] != '=') ||
+                            shiftto == 18)) {
                             throw new IllegalArgumentException(
                                 "Input byte array has wrong 4-byte ending unit");
                         }
@@ -1109,14 +1122,14 @@
                 dst[dp++] = (byte)(bits >> 16);
                 dst[dp++] = (byte)(bits >>  8);
             } else if (shiftto == 12) {
+                // dangling single "x", throw exception even in lenient mode,
+                // it's incorrectly encoded.
                 throw new IllegalArgumentException(
                     "Last unit does not have enough valid bits");
             }
             // anything left is invalid, if is not MIME.
-            // if MIME, ignore all non-base64 character
-            while (sp < sl) {
-                if (isMIME && base64[src[sp++]] < 0)
-                    continue;
+            // if MIME (lenient), just ignore all leftover
+            if (sp < sl && !isMIME) {
                 throw new IllegalArgumentException(
                     "Input byte array has incorrect ending byte at " + sp);
             }
@@ -1286,7 +1299,7 @@
                         if (nextin == 12)
                             throw new IOException("Base64 stream has one un-decoded dangling byte.");
                         // treat ending xx/xxx without padding character legal.
-                        // same logic as v == 'v' below
+                        // same logic as v == '=' below
                         b[off++] = (byte)(bits >> (16));
                         len--;
                         if (nextin == 0) {           // only one padding byte
@@ -1305,21 +1318,31 @@
                 }
                 if (v == '=') {                  // padding byte(s)
                     // =     shiftto==18 unnecessary padding
-                    // x=    shiftto==12 invalid unit
+                    // x=    shiftto==12 dangling x, invalid unit
                     // xx=   shiftto==6 && missing last '='
-                    // xx=y                or last is not '='
+                    // xx=y  or last is not '='
                     if (nextin == 18 || nextin == 12 ||
                         nextin == 6 && is.read() != '=') {
-                        throw new IOException("Illegal base64 ending sequence:" + nextin);
-                    }
-                    b[off++] = (byte)(bits >> (16));
-                    len--;
-                    if (nextin == 0) {           // only one padding byte
-                        if (len == 0) {          // no enough output space
-                            bits >>= 8;          // shift to lowest byte
-                            nextout = 0;
-                        } else {
-                            b[off++] = (byte) (bits >>  8);
+                        if (!isMIME || nextin == 12) {
+                            throw new IOException("Illegal base64 ending sequence:" + nextin);
+                        } else if (nextin != 18) {
+                            // lenient mode for mime
+                            // (1) handle the "unnecessary padding in "xxxx ="
+                            //     case as the eof (nextin == 18)
+                            // (2) decode "xx=" and "xx=y" normally
+                            b[off++] = (byte)(bits >> (16));
+                            len--;
+                        }
+                    } else {
+                        b[off++] = (byte)(bits >> (16));
+                        len--;
+                        if (nextin == 0) {           // only one padding byte
+                            if (len == 0) {          // no enough output space
+                                bits >>= 8;          // shift to lowest byte
+                                nextout = 0;
+                            } else {
+                                b[off++] = (byte) (bits >>  8);
+                            }
                         }
                     }
                     eof = true;
--- a/jdk/src/share/classes/java/util/BitSet.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/BitSet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1164,10 +1164,10 @@
      * <p>Example:
      * <pre>
      * BitSet drPepper = new BitSet();</pre>
-     * Now {@code drPepper.toString()} returns "{@code {}}".<p>
+     * Now {@code drPepper.toString()} returns "{@code {}}".
      * <pre>
      * drPepper.set(2);</pre>
-     * Now {@code drPepper.toString()} returns "{@code {2}}".<p>
+     * Now {@code drPepper.toString()} returns "{@code {2}}".
      * <pre>
      * drPepper.set(4);
      * drPepper.set(10);</pre>
--- a/jdk/src/share/classes/java/util/Deque.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Deque.java	Mon Nov 11 16:20:48 2013 +0100
@@ -56,7 +56,6 @@
  * <p>The twelve methods described above are summarized in the
  * following table:
  *
- * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
  * <caption>Summary of Deque methods</caption>
  *  <tr>
@@ -100,7 +99,6 @@
  * inherited from the {@code Queue} interface are precisely equivalent to
  * {@code Deque} methods as indicated in the following table:
  *
- * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
  * <caption>Comparison of Queue and Deque methods</caption>
  *  <tr>
@@ -139,7 +137,6 @@
  * beginning of the deque.  Stack methods are precisely equivalent to
  * {@code Deque} methods as indicated in the table below:
  *
- * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
  * <caption>Comparison of Stack and Deque methods</caption>
  *  <tr>
--- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Mon Nov 11 16:20:48 2013 +0100
@@ -127,7 +127,7 @@
      * numerical sum compared to a simple summation of {@code double}
      * values.
      *
-     * @apiNote Sorting values by increasing absolute magnitude tends to yield
+     * @apiNote Values sorted by increasing absolute magnitude tend to yield
      * more accurate results.
      *
      * @return the sum of values, or zero if none
--- a/jdk/src/share/classes/java/util/Formatter.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Formatter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -131,7 +131,7 @@
  *   import static java.util.Calendar.*;
  *
  *   Calendar c = new GregorianCalendar(1995, MAY, 23);
- *   String s = String.format("Duke's Birthday: %1$tm %1$te,%1$tY", c);
+ *   String s = String.format("Duke's Birthday: %1$tb %1$te, %1$tY", c);
  *   // -&gt; s == "Duke's Birthday: May 23, 1995"
  * </pre></blockquote>
  *
@@ -253,7 +253,7 @@
  * <li> <b>Integral</b> - may be applied to Java integral types: {@code byte},
  * {@link Byte}, {@code short}, {@link Short}, {@code int} and {@link
  * Integer}, {@code long}, {@link Long}, and {@link java.math.BigInteger
- * BigInteger}
+ * BigInteger} (but not {@code char} or {@link Character})
  *
  * <li><b>Floating Point</b> - may be applied to Java floating-point types:
  * {@code float}, {@link Float}, {@code double}, {@link Double}, and {@link
@@ -899,7 +899,7 @@
  * <table cellpadding=5 summary="IntConv">
  *
  * <tr><td valign="top"> {@code 'd'}
- *     <td valign="top"> <tt>'&#92;u0054'</tt>
+ *     <td valign="top"> <tt>'&#92;u0064'</tt>
  *     <td> Formats the argument as a decimal integer. The <a
  *     href="#L10nAlgorithm">localization algorithm</a> is applied.
  *
@@ -1057,7 +1057,7 @@
  * <table cellpadding=5 summary="BIntConv">
  *
  * <tr><td valign="top"> {@code 'd'}
- *     <td valign="top"> <tt>'&#92;u0054'</tt>
+ *     <td valign="top"> <tt>'&#92;u0064'</tt>
  *     <td> Requires the output to be formatted as a decimal integer. The <a
  *     href="#L10nAlgorithm">localization algorithm</a> is applied.
  *
--- a/jdk/src/share/classes/java/util/HashMap.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/HashMap.java	Mon Nov 11 16:20:48 2013 +0100
@@ -915,7 +915,7 @@
             return removeNode(hash(key), key, null, false, true) != null;
         }
         public final Spliterator<K> spliterator() {
-            return new KeySpliterator<K,V>(HashMap.this, 0, -1, 0, 0);
+            return new KeySpliterator<>(HashMap.this, 0, -1, 0, 0);
         }
         public final void forEach(Consumer<? super K> action) {
             Node<K,V>[] tab;
@@ -959,7 +959,7 @@
         public final Iterator<V> iterator()     { return new ValueIterator(); }
         public final boolean contains(Object o) { return containsValue(o); }
         public final Spliterator<V> spliterator() {
-            return new ValueSpliterator<K,V>(HashMap.this, 0, -1, 0, 0);
+            return new ValueSpliterator<>(HashMap.this, 0, -1, 0, 0);
         }
         public final void forEach(Consumer<? super V> action) {
             Node<K,V>[] tab;
@@ -1022,7 +1022,7 @@
             return false;
         }
         public final Spliterator<Map.Entry<K,V>> spliterator() {
-            return new EntrySpliterator<K,V>(HashMap.this, 0, -1, 0, 0);
+            return new EntrySpliterator<>(HashMap.this, 0, -1, 0, 0);
         }
         public final void forEach(Consumer<? super Map.Entry<K,V>> action) {
             Node<K,V>[] tab;
@@ -1042,19 +1042,23 @@
 
     // Overrides of JDK8 Map extension methods
 
+    @Override
     public V getOrDefault(Object key, V defaultValue) {
         Node<K,V> e;
         return (e = getNode(hash(key), key)) == null ? defaultValue : e.value;
     }
 
+    @Override
     public V putIfAbsent(K key, V value) {
         return putVal(hash(key), key, value, true, true);
     }
 
+    @Override
     public boolean remove(Object key, Object value) {
         return removeNode(hash(key), key, value, true, true) != null;
     }
 
+    @Override
     public boolean replace(K key, V oldValue, V newValue) {
         Node<K,V> e; V v;
         if ((e = getNode(hash(key), key)) != null &&
@@ -1066,6 +1070,7 @@
         return false;
     }
 
+    @Override
     public V replace(K key, V value) {
         Node<K,V> e;
         if ((e = getNode(hash(key), key)) != null) {
@@ -1077,6 +1082,7 @@
         return null;
     }
 
+    @Override
     public V computeIfAbsent(K key,
                              Function<? super K, ? extends V> mappingFunction) {
         if (mappingFunction == null)
@@ -1150,6 +1156,7 @@
         return null;
     }
 
+    @Override
     public V compute(K key,
                      BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         if (remappingFunction == null)
@@ -1202,6 +1209,7 @@
         return v;
     }
 
+    @Override
     public V merge(K key, V value,
                    BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
         if (remappingFunction == null)
@@ -1230,7 +1238,11 @@
             }
         }
         if (old != null) {
-            V v = remappingFunction.apply(old.value, value);
+            V v;
+            if (old.value != null)
+                v = remappingFunction.apply(old.value, value);
+            else
+                v = value;
             if (v != null) {
                 old.value = v;
                 afterNodeAccess(old);
@@ -1254,6 +1266,7 @@
         return value;
     }
 
+    @Override
     public void forEach(BiConsumer<? super K, ? super V> action) {
         Node<K,V>[] tab;
         if (action == null)
@@ -1269,6 +1282,7 @@
         }
     }
 
+    @Override
     public void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
         Node<K,V>[] tab;
         if (function == null)
@@ -1295,6 +1309,7 @@
      * @return a shallow copy of this map
      */
     @SuppressWarnings("unchecked")
+    @Override
     public Object clone() {
         HashMap<K,V> result;
         try {
@@ -1496,7 +1511,7 @@
         public KeySpliterator<K,V> trySplit() {
             int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
             return (lo >= mid || current != null) ? null :
-                new KeySpliterator<K,V>(map, lo, index = mid, est >>>= 1,
+                new KeySpliterator<>(map, lo, index = mid, est >>>= 1,
                                         expectedModCount);
         }
 
@@ -1568,7 +1583,7 @@
         public ValueSpliterator<K,V> trySplit() {
             int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
             return (lo >= mid || current != null) ? null :
-                new ValueSpliterator<K,V>(map, lo, index = mid, est >>>= 1,
+                new ValueSpliterator<>(map, lo, index = mid, est >>>= 1,
                                           expectedModCount);
         }
 
@@ -1639,7 +1654,7 @@
         public EntrySpliterator<K,V> trySplit() {
             int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
             return (lo >= mid || current != null) ? null :
-                new EntrySpliterator<K,V>(map, lo, index = mid, est >>>= 1,
+                new EntrySpliterator<>(map, lo, index = mid, est >>>= 1,
                                           expectedModCount);
         }
 
@@ -1714,22 +1729,22 @@
 
     // Create a regular (non-tree) node
     Node<K,V> newNode(int hash, K key, V value, Node<K,V> next) {
-        return new Node<K,V>(hash, key, value, next);
+        return new Node<>(hash, key, value, next);
     }
 
     // For conversion from TreeNodes to plain nodes
     Node<K,V> replacementNode(Node<K,V> p, Node<K,V> next) {
-        return new Node<K,V>(p.hash, p.key, p.value, next);
+        return new Node<>(p.hash, p.key, p.value, next);
     }
 
     // Create a tree bin node
     TreeNode<K,V> newTreeNode(int hash, K key, V value, Node<K,V> next) {
-        return new TreeNode<K,V>(hash, key, value, next);
+        return new TreeNode<>(hash, key, value, next);
     }
 
     // For treeifyBin
     TreeNode<K,V> replacementTreeNode(Node<K,V> p, Node<K,V> next) {
-        return new TreeNode<K,V>(p.hash, p.key, p.value, next);
+        return new TreeNode<>(p.hash, p.key, p.value, next);
     }
 
     /**
--- a/jdk/src/share/classes/java/util/Iterator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Iterator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -94,10 +94,10 @@
     }
 
     /**
-     * Performs the given action for each remaining element, in the order
-     * elements occur when iterating, until all elements have been processed or
-     * the action throws an exception.  Errors or runtime exceptions thrown by
-     * the action are relayed to the caller.
+     * Performs the given action for each remaining element until all elements
+     * have been processed or the action throws an exception.  Actions are
+     * performed in the order of iteration, if that order is specified.
+     * Exceptions thrown by the action are relayed to the caller.
      *
      * @implSpec
      * <p>The default implementation behaves as if:
--- a/jdk/src/share/classes/java/util/List.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/List.java	Mon Nov 11 16:20:48 2013 +0100
@@ -192,8 +192,9 @@
      * The following code can be used to dump the list into a newly
      * allocated array of <tt>String</tt>:
      *
-     * <pre>
-     *     String[] y = x.toArray(new String[0]);</pre>
+     * <pre>{@code
+     *     String[] y = x.toArray(new String[0]);
+     * }</pre>
      *
      * Note that <tt>toArray(new Object[0])</tt> is identical in function to
      * <tt>toArray()</tt>.
@@ -383,14 +384,13 @@
      *
      * @implSpec
      * The default implementation is equivalent to, for this {@code list}:
-     * <pre>
-     * {@code
-     * final ListIterator<E> li = list.listIterator();
-     * while (li.hasNext()) {
-     *   li.set(operator.apply(li.next()));
-     * }
-     * }
-     * </pre>
+     * <pre>{@code
+     *     final ListIterator<E> li = list.listIterator();
+     *     while (li.hasNext()) {
+     *         li.set(operator.apply(li.next()));
+     *     }
+     * }</pre>
+     *
      * If the list's list-iterator does not support the {@code set} operation
      * then an {@code UnsupportedOperationException} will be thrown when
      * replacing the first element.
@@ -469,11 +469,11 @@
     /**
      * Returns the hash code value for this list.  The hash code of a list
      * is defined to be the result of the following calculation:
-     * <pre>
-     *  int hashCode = 1;
-     *  for (E e : list)
-     *      hashCode = 31*hashCode + (e==null ? 0 : e.hashCode());
-     * </pre>
+     * <pre>{@code
+     *     int hashCode = 1;
+     *     for (E e : list)
+     *         hashCode = 31*hashCode + (e==null ? 0 : e.hashCode());
+     * }</pre>
      * This ensures that <tt>list1.equals(list2)</tt> implies that
      * <tt>list1.hashCode()==list2.hashCode()</tt> for any two lists,
      * <tt>list1</tt> and <tt>list2</tt>, as required by the general
@@ -640,9 +640,9 @@
      * a list can be used as a range operation by passing a subList view
      * instead of a whole list.  For example, the following idiom
      * removes a range of elements from a list:
-     * <pre>
+     * <pre>{@code
      *      list.subList(from, to).clear();
-     * </pre>
+     * }</pre>
      * Similar idioms may be constructed for <tt>indexOf</tt> and
      * <tt>lastIndexOf</tt>, and all of the algorithms in the
      * <tt>Collections</tt> class can be applied to a subList.<p>
--- a/jdk/src/share/classes/java/util/Locale.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Locale.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1248,7 +1248,7 @@
      * Returns a string representation of this <code>Locale</code>
      * object, consisting of language, country, variant, script,
      * and extensions as below:
-     * <p><blockquote>
+     * <blockquote>
      * language + "_" + country + "_" + (variant + "_#" | "#") + script + "-" + extensions
      * </blockquote>
      *
@@ -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.
@@ -2199,7 +2199,7 @@
      * are exactly "ja", "JP", "JP" or "th", "TH", "TH" and script/extensions
      * fields are empty, this method supplies <code>UNICODE_LOCALE_EXTENSION</code>
      * "ca"/"japanese" (calendar type is "japanese") or "nu"/"thai" (number script
-     * type is "thai"). See <a href="Locale.html#special_cases_constructor"/>Special Cases</a>
+     * type is "thai"). See <a href="Locale.html#special_cases_constructor">Special Cases</a>
      * for more information.
      *
      * @return an instance of <code>Locale</code> equivalent to
--- a/jdk/src/share/classes/java/util/Map.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Map.java	Mon Nov 11 16:20:48 2013 +0100
@@ -562,11 +562,11 @@
     // Defaultable methods
 
     /**
-     * Returns the value to which the specified key is mapped,
-     * or {@code defaultValue} if this map contains no mapping
-     * for the key.
+     * Returns the value to which the specified key is mapped, or
+     * {@code defaultValue} if this map contains no mapping for the key.
      *
-     * <p>The default implementation makes no guarantees about synchronization
+     * @implSpec
+     * The default implementation makes no guarantees about synchronization
      * or atomicity properties of this method. Any implementation providing
      * atomicity guarantees must override this method and document its
      * concurrency properties.
@@ -591,27 +591,24 @@
     }
 
     /**
-     * Performs the given action on each entry in this map, in the order entries
-     * are returned by an entry set iterator (which may be unspecified), until
-     * all entries have been processed or the action throws an {@code Exception}.
+     * Performs the given action for each entry in this map until all entries
+     * have been processed or the action throws an exception.   Unless
+     * otherwise specified by the implementing class, actions are performed in
+     * the order of entry set iteration (if an iteration order is specified.)
      * Exceptions thrown by the action are relayed to the caller.
      *
-     * <p>The default implementation should be overridden by implementations if
-     * they can provide a more performant implementation than an iterator-based
-     * one.
-     *
-     * <p>The default implementation makes no guarantees about synchronization
-     * or atomicity properties of this method. Any implementation providing
-     * atomicity guarantees must override this method and document its
-     * concurrency properties.
-     *
-     * @implSpec The default implementation is equivalent to, for this
-     * {@code map}:
+     * @implSpec
+     * The default implementation is equivalent to, for this {@code map}:
      * <pre> {@code
      * for ((Map.Entry<K, V> entry : map.entrySet())
      *     action.accept(entry.getKey(), entry.getValue());
      * }</pre>
      *
+     * The default implementation makes no guarantees about synchronization
+     * or atomicity properties of this method. Any implementation providing
+     * atomicity guarantees must override this method and document its
+     * concurrency properties.
+     *
      * @param action The action to be performed for each entry
      * @throws NullPointerException if the specified action is null
      * @throws ConcurrentModificationException if an entry is found to be
@@ -636,14 +633,9 @@
 
     /**
      * Replaces each entry's value with the result of invoking the given
-     * function on that entry, in the order entries are returned by an entry
-     * set iterator, until all entries have been processed or the function
-     * throws an exception.
-     *
-     * <p>The default implementation makes no guarantees about synchronization
-     * or atomicity properties of this method. Any implementation providing
-     * atomicity guarantees must override this method and document its
-     * concurrency properties.
+     * function on that entry until all entries have been processed or the
+     * function throws an exception.  Exceptions thrown by the function are
+     * relayed to the caller.
      *
      * @implSpec
      * <p>The default implementation is equivalent to, for this {@code map}:
@@ -652,6 +644,11 @@
      *     entry.setValue(function.apply(entry.getKey(), entry.getValue()));
      * }</pre>
      *
+     * <p>The default implementation makes no guarantees about synchronization
+     * or atomicity properties of this method. Any implementation providing
+     * atomicity guarantees must override this method and document its
+     * concurrency properties.
+     *
      * @param function the function to apply to each entry
      * @throws UnsupportedOperationException if the {@code set} operation
      * is not supported by this map's entry set iterator.
@@ -703,22 +700,23 @@
      * to {@code null}) associates it with the given value and returns
      * {@code null}, else returns the current value.
      *
-     * <p>The default implementation makes no guarantees about synchronization
-     * or atomicity properties of this method. Any implementation providing
-     * atomicity guarantees must override this method and document its
-     * concurrency properties.
-     *
      * @implSpec
      * The default implementation is equivalent to, for this {@code
      * map}:
      *
      * <pre> {@code
-     * if (map.get(key) == null)
-     *     return map.put(key, value);
-     * else
-     *     return map.get(key);
+     * V v = map.get(key);
+     * if (v == null)
+     *     v = map.put(key, value);
+     *
+     * return v;
      * }</pre>
      *
+     * <p>The default implementation makes no guarantees about synchronization
+     * or atomicity properties of this method. Any implementation providing
+     * atomicity guarantees must override this method and document its
+     * concurrency properties.
+     *
      * @param key key with which the specified value is to be associated
      * @param value value to be associated with the specified key
      * @return the previous value associated with the specified key, or
@@ -738,16 +736,12 @@
      * @throws IllegalArgumentException if some property of the specified key
      *         or value prevents it from being stored in this map
      *         (<a href="Collection.html#optional-restrictions">optional</a>)
-     * @throws ConcurrentModificationException if a modification of the map is
-     * detected during insertion of the value.
      * @since 1.8
      */
     default V putIfAbsent(K key, V value) {
         V v = get(key);
         if (v == null) {
-            if (put(key, value) != null) {
-                throw new ConcurrentModificationException();
-            }
+            v = put(key, value);
         }
 
         return v;
@@ -757,11 +751,6 @@
      * Removes the entry for the specified key only if it is currently
      * mapped to the specified value.
      *
-     * <p>The default implementation makes no guarantees about synchronization
-     * or atomicity properties of this method. Any implementation providing
-     * atomicity guarantees must override this method and document its
-     * concurrency properties.
-     *
      * @implSpec
      * The default implementation is equivalent to, for this {@code map}:
      *
@@ -773,6 +762,11 @@
      *     return false;
      * }</pre>
      *
+     * <p>The default implementation makes no guarantees about synchronization
+     * or atomicity properties of this method. Any implementation providing
+     * atomicity guarantees must override this method and document its
+     * concurrency properties.
+     *
      * @param key key with which the specified value is associated
      * @param value value expected to be associated with the specified key
      * @return {@code true} if the value was removed
@@ -801,11 +795,6 @@
      * Replaces the entry for the specified key only if currently
      * mapped to the specified value.
      *
-     * <p>The default implementation makes no guarantees about synchronization
-     * or atomicity properties of this method. Any implementation providing
-     * atomicity guarantees must override this method and document its
-     * concurrency properties.
-    *
      * @implSpec
      * The default implementation is equivalent to, for this {@code map}:
      *
@@ -821,6 +810,11 @@
      * for maps that do not support null values if oldValue is null unless
      * newValue is also null.
      *
+     * <p>The default implementation makes no guarantees about synchronization
+     * or atomicity properties of this method. Any implementation providing
+     * atomicity guarantees must override this method and document its
+     * concurrency properties.
+     *
      * @param key key with which the specified value is associated
      * @param oldValue value expected to be associated with the specified key
      * @param newValue value to be associated with the specified key
@@ -853,11 +847,6 @@
      * Replaces the entry for the specified key only if it is
      * currently mapped to some value.
      *
-     * <p>The default implementation makes no guarantees about synchronization
-     * or atomicity properties of this method. Any implementation providing
-     * atomicity guarantees must override this method and document its
-     * concurrency properties.
-     *
      * @implSpec
      * The default implementation is equivalent to, for this {@code map}:
      *
@@ -868,6 +857,11 @@
      *     return null;
      * }</pre>
      *
+     * <p>The default implementation makes no guarantees about synchronization
+     * or atomicity properties of this method. Any implementation providing
+     * atomicity guarantees must override this method and document its
+     * concurrency properties.
+      *
      * @param key key with which the specified value is associated
      * @param value value to be associated with the specified key
      * @return the previous value associated with the specified key, or
@@ -888,14 +882,17 @@
      * @since 1.8
      */
     default V replace(K key, V value) {
-        return containsKey(key) ? put(key, value) : null;
+        V curValue;
+        if (((curValue = get(key)) != null) || containsKey(key)) {
+            curValue = put(key, value);
+        }
+        return curValue;
     }
 
     /**
-     * If the specified key is not already associated with a value (or
-     * is mapped to {@code null}), attempts to compute its value using
-     * the given mapping function and enters it into this map unless
-     * {@code null}.
+     * If the specified key is not already associated with a value (or is mapped
+     * to {@code null}), attempts to compute its value using the given mapping
+     * function and enters it into this map unless {@code null}.
      *
      * <p>If the function returns {@code null} no mapping is recorded. If
      * the function itself throws an (unchecked) exception, the
@@ -907,35 +904,42 @@
      * map.computeIfAbsent(key, k -> new Value(f(k)));
      * }</pre>
      *
+     * <p>Or to implement a multi-value map, {@code Map<K,Collection<V>>},
+     * supporting multiple values per key:
+     *
+     * <pre> {@code
+     * map.computeIfAbsent(key, k -> new HashSet<V>()).add(v);
+     * }</pre>
+     *
+     *
+     * @implSpec
+     * The default implementation is equivalent to the following steps for this
+     * {@code map}, then returning the current value or {@code null} if now
+     * absent:
+     *
+     * <pre> {@code
+     * if (map.get(key) == null) {
+     *     V newValue = mappingFunction.apply(key);
+     *     if (newValue != null)
+     *         map.put(key, newValue);
+     * }
+     * }</pre>
+     *
      * <p>The default implementation makes no guarantees about synchronization
      * or atomicity properties of this method. Any implementation providing
      * atomicity guarantees must override this method and document its
      * concurrency properties. In particular, all implementations of
      * subinterface {@link java.util.concurrent.ConcurrentMap} must document
      * whether the function is applied once atomically only if the value is not
-     * present.  Any class that permits null values must document
-     * whether and how this method distinguishes absence from null mappings.
-     *
-     * @implSpec
-     * The default implementation is equivalent to the following
-     * steps for this {@code map}, then returning the current value or
-     * {@code null} if now absent:
-     *
-     * <pre> {@code
-     * if (map.get(key) == null) {
-     *     V newValue = mappingFunction.apply(key);
-     *     if (newValue != null)
-     *         map.putIfAbsent(key, newValue);
-     * }
-     * }</pre>
+     * present.
      *
      * @param key key with which the specified value is to be associated
      * @param mappingFunction the function to compute a value
      * @return the current (existing or computed) value associated with
      *         the specified key, or null if the computed value is null
      * @throws NullPointerException if the specified key is null and
-     *         this map does not support null keys, or the
-     *         mappingFunction is null
+     *         this map does not support null keys, or the mappingFunction
+     *         is null
      * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
      *         (<a href="Collection.html#optional-restrictions">optional</a>)
@@ -947,10 +951,16 @@
     default V computeIfAbsent(K key,
             Function<? super K, ? extends V> mappingFunction) {
         Objects.requireNonNull(mappingFunction);
-        V v, newValue;
-        return ((v = get(key)) == null &&
-                (newValue = mappingFunction.apply(key)) != null &&
-                (v = putIfAbsent(key, newValue)) == null) ? newValue : v;
+        V v;
+        if ((v = get(key)) == null) {
+            V newValue;
+            if ((newValue = mappingFunction.apply(key)) != null) {
+                put(key, newValue);
+                return newValue;
+            }
+        }
+
+        return v;
     }
 
     /**
@@ -960,6 +970,22 @@
      * <p>If the function returns {@code null}, the mapping is removed.  If the
      * function itself throws an (unchecked) exception, the exception is
      * rethrown, and the current mapping is left unchanged.
+    *
+     * @implSpec
+     * The default implementation is equivalent to performing the following
+     * steps for this {@code map}, then returning the current value or
+     * {@code null} if now absent:
+     *
+     * <pre> {@code
+     * if (map.get(key) != null) {
+     *     V oldValue = map.get(key);
+     *     V newValue = remappingFunction.apply(key, oldValue);
+     *     if (newValue != null)
+     *         map.put(key, newValue);
+     *     else
+     *         map.remove(key);
+     * }
+     * }</pre>
      *
      * <p>The default implementation makes no guarantees about synchronization
      * or atomicity properties of this method. Any implementation providing
@@ -967,27 +993,7 @@
      * concurrency properties. In particular, all implementations of
      * subinterface {@link java.util.concurrent.ConcurrentMap} must document
      * whether the function is applied once atomically only if the value is not
-     * present.  Any class that permits null values must document
-     * whether and how this method distinguishes absence from null mappings.
-     *
-     * @implSpec
-     * The default implementation is equivalent to performing the
-     * following steps for this {@code map}, then returning the
-     * current value or {@code null} if now absent:
-     *
-     * <pre> {@code
-     * if (map.get(key) != null) {
-     *     V oldValue = map.get(key);
-     *     V newValue = remappingFunction.apply(key, oldValue);
-     *     if (newValue != null)
-     *         map.replace(key, oldValue, newValue);
-     *     else
-     *         map.remove(key, oldValue);
-     * }
-     * }</pre>
-     *
-     * In concurrent contexts, the default implementation may retry
-     * these steps when multiple threads attempt updates.
+     * present.
      *
      * @param key key with which the specified value is to be associated
      * @param remappingFunction the function to compute a value
@@ -1007,22 +1013,25 @@
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
         V oldValue;
-        while ((oldValue = get(key)) != null) {
+        if ((oldValue = get(key)) != null) {
             V newValue = remappingFunction.apply(key, oldValue);
             if (newValue != null) {
-                if (replace(key, oldValue, newValue))
-                    return newValue;
-            } else if (remove(key, oldValue))
+                put(key, newValue);
+                return newValue;
+            } else {
+                remove(key);
                 return null;
+            }
+        } else {
+            return null;
         }
-        return oldValue;
     }
 
     /**
-     * Attempts to compute a mapping for the specified key and its
-     * current mapped value (or {@code null} if there is no current
-     * mapping). For example, to either create or append a {@code
-     * String msg} to a value mapping:
+     * Attempts to compute a mapping for the specified key and its current
+     * mapped value (or {@code null} if there is no current mapping). For
+     * example, to either create or append a {@code String} msg to a value
+     * mapping:
      *
      * <pre> {@code
      * map.compute(key, (k, v) -> (v == null) ? msg : v.concat(msg))}</pre>
@@ -1033,15 +1042,6 @@
      * (unchecked) exception, the exception is rethrown, and the current mapping
      * is left unchanged.
      *
-     * <p>The default implementation makes no guarantees about synchronization
-     * or atomicity properties of this method. Any implementation providing
-     * atomicity guarantees must override this method and document its
-     * concurrency properties. In particular, all implementations of
-     * subinterface {@link java.util.concurrent.ConcurrentMap} must document
-     * whether the function is applied once atomically only if the value is not
-     * present.  Any class that permits null values must document
-     * whether and how this method distinguishes absence from null mappings.
-     *
      * @implSpec
      * The default implementation is equivalent to performing the following
      * steps for this {@code map}, then returning the current value or
@@ -1052,19 +1052,24 @@
      * V newValue = remappingFunction.apply(key, oldValue);
      * if (oldValue != null ) {
      *    if (newValue != null)
-     *       map.replace(key, oldValue, newValue);
+     *       map.put(key, newValue);
      *    else
-     *       map.remove(key, oldValue);
+     *       map.remove(key);
      * } else {
      *    if (newValue != null)
-     *       map.putIfAbsent(key, newValue);
+     *       map.put(key, newValue);
      *    else
      *       return null;
      * }
      * }</pre>
      *
-     * In concurrent contexts, the default implementation may retry
-     * these steps when multiple threads attempt updates.
+     * <p>The default implementation makes no guarantees about synchronization
+     * or atomicity properties of this method. Any implementation providing
+     * atomicity guarantees must override this method and document its
+     * concurrency properties. In particular, all implementations of
+     * subinterface {@link java.util.concurrent.ConcurrentMap} must document
+     * whether the function is applied once atomically only if the value is not
+     * present.
      *
      * @param key key with which the specified value is to be associated
      * @param remappingFunction the function to compute a value
@@ -1084,44 +1089,22 @@
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
         V oldValue = get(key);
-        for (;;) {
-            V newValue = remappingFunction.apply(key, oldValue);
-            if (newValue == null) {
-                // delete mapping
-                if(oldValue != null || containsKey(key)) {
-                    // something to remove
-                    if (remove(key, oldValue)) {
-                        // removed the old value as expected
-                        return null;
-                    }
 
-                    // some other value replaced old value. try again.
-                    oldValue = get(key);
-                } else {
-                    // nothing to do. Leave things as they were.
-                    return null;
-                }
+        V newValue = remappingFunction.apply(key, oldValue);
+        if (newValue == null) {
+            // delete mapping
+            if (oldValue != null || containsKey(key)) {
+                // something to remove
+                remove(key);
+                return null;
             } else {
-                // add or replace old mapping
-                if (oldValue != null) {
-                    // replace
-                    if (replace(key, oldValue, newValue)) {
-                        // replaced as expected.
-                        return newValue;
-                    }
-
-                    // some other value replaced old value. try again.
-                    oldValue = get(key);
-                } else {
-                    // add (replace if oldValue was null)
-                    if ((oldValue = putIfAbsent(key, newValue)) == null) {
-                        // replaced
-                        return newValue;
-                    }
-
-                    // some other value replaced old value. try again.
-                }
+                // nothing to do. Leave things as they were.
+                return null;
             }
+        } else {
+            // add or replace old mapping
+            put(key, newValue);
+            return newValue;
         }
     }
 
@@ -1143,15 +1126,6 @@
      * (unchecked) exception, the exception is rethrown, and the current mapping
      * is left unchanged.
      *
-     * <p>The default implementation makes no guarantees about synchronization
-     * or atomicity properties of this method. Any implementation providing
-     * atomicity guarantees must override this method and document its
-     * concurrency properties. In particular, all implementations of
-     * subinterface {@link java.util.concurrent.ConcurrentMap} must document
-     * whether the function is applied once atomically only if the value is not
-     * present.  Any class that permits null values must document
-     * whether and how this method distinguishes absence from null mappings.
-     *
      * @implSpec
      * The default implementation is equivalent to performing the
      * following steps for this {@code map}, then returning the
@@ -1162,15 +1136,20 @@
      * V newValue = (oldValue == null) ? value :
      *              remappingFunction.apply(oldValue, value);
      * if (newValue == null)
-     *     map.remove(key, oldValue);
+     *     map.remove(key);
      * else if (oldValue == null)
-     *     map.putIfAbsent(key, newValue);
+     *     map.remove(key);
      * else
-     *     map.replace(key, oldValue, newValue);
+     *     map.put(key, newValue);
      * }</pre>
      *
-     * In concurrent contexts, the default implementation may retry
-     * these steps when multiple threads attempt updates.
+     * <p>The default implementation makes no guarantees about synchronization
+     * or atomicity properties of this method. Any implementation providing
+     * atomicity guarantees must override this method and document its
+     * concurrency properties. In particular, all implementations of
+     * subinterface {@link java.util.concurrent.ConcurrentMap} must document
+     * whether the function is applied once atomically only if the value is not
+     * present.
      *
      * @param key key with which the specified value is to be associated
      * @param value the value to use if absent
@@ -1183,32 +1162,30 @@
      *         prevents it from being stored in this map
      *         (<a href="Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key is null and
-     *         this map does not support null keys, or the
-     *         remappingFunction is null
+     *         this map does not support null keys, or the remappingFunction
+     *         is null
      * @since 1.8
      */
     default V merge(K key, V value,
             BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
         Objects.requireNonNull(remappingFunction);
         V oldValue = get(key);
-        for (;;) {
-            if (oldValue != null) {
-                V newValue = remappingFunction.apply(oldValue, value);
-                if (newValue != null) {
-                    if (replace(key, oldValue, newValue))
-                        return newValue;
-                } else if (remove(key, oldValue)) {
-                    return null;
-                }
-                oldValue = get(key);
+        if (oldValue != null) {
+            V newValue = remappingFunction.apply(oldValue, value);
+            if (newValue != null) {
+                put(key, newValue);
+                return newValue;
             } else {
-                if (value == null) {
-                    return null;
-                }
-
-                if ((oldValue = putIfAbsent(key, value)) == null) {
-                    return value;
-                }
+                remove(key);
+                return null;
+            }
+        } else {
+            if (value == null) {
+                remove(key);
+                return null;
+            } else {
+                put(key, value);
+                return value;
             }
         }
     }
--- a/jdk/src/share/classes/java/util/MissingFormatWidthException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/MissingFormatWidthException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/PrimitiveIterator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/PrimitiveIterator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -76,6 +76,7 @@
      * @param action The action to be performed for each element
      * @throws NullPointerException if the specified action is null
      */
+    @SuppressWarnings("overloads")
     void forEachRemaining(T_CONS action);
 
     /**
@@ -93,10 +94,10 @@
         int nextInt();
 
         /**
-         * Performs the given action for each remaining element, in the order
-         * elements occur when iterating, until all elements have been processed
-         * or the action throws an exception.  Errors or runtime exceptions
-         * thrown by the action are relayed to the caller.
+         * Performs the given action for each remaining element until all elements
+         * have been processed or the action throws an exception.  Actions are
+         * performed in the order of iteration, if that order is specified.
+         * Exceptions thrown by the action are relayed to the caller.
          *
          * @implSpec
          * <p>The default implementation behaves as if:
@@ -167,10 +168,10 @@
         long nextLong();
 
         /**
-         * Performs the given action for each remaining element, in the order
-         * elements occur when iterating, until all elements have been processed
-         * or the action throws an exception.  Errors or runtime exceptions
-         * thrown by the action are relayed to the caller.
+         * Performs the given action for each remaining element until all elements
+         * have been processed or the action throws an exception.  Actions are
+         * performed in the order of iteration, if that order is specified.
+         * Exceptions thrown by the action are relayed to the caller.
          *
          * @implSpec
          * <p>The default implementation behaves as if:
@@ -240,10 +241,10 @@
         double nextDouble();
 
         /**
-         * Performs the given action for each remaining element, in the order
-         * elements occur when iterating, until all elements have been processed
-         * or the action throws an exception.  Errors or runtime exceptions
-         * thrown by the action are relayed to the caller.
+         * Performs the given action for each remaining element until all elements
+         * have been processed or the action throws an exception.  Actions are
+         * performed in the order of iteration, if that order is specified.
+         * Exceptions thrown by the action are relayed to the caller.
          *
          * @implSpec
          * <p>The default implementation behaves as if:
--- a/jdk/src/share/classes/java/util/PriorityQueue.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/PriorityQueue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/Properties.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Properties.java	Mon Nov 11 16:20:48 2013 +0100
@@ -244,7 +244,6 @@
      * As an example, each of the following three lines specifies the key
      * {@code "Truth"} and the associated element value
      * {@code "Beauty"}:
-     * <p>
      * <pre>
      * Truth = Beauty
      *  Truth:Beauty
@@ -252,14 +251,12 @@
      * </pre>
      * As another example, the following three lines specify a single
      * property:
-     * <p>
      * <pre>
      * fruits                           apple, banana, pear, \
      *                                  cantaloupe, watermelon, \
      *                                  kiwi, mango
      * </pre>
      * The key is {@code "fruits"} and the associated element is:
-     * <p>
      * <pre>"apple, banana, pear, cantaloupe, watermelon, kiwi, mango"</pre>
      * Note that a space appears before each {@code \} so that a space
      * will appear after each comma in the final result; the {@code \},
@@ -268,13 +265,11 @@
      * characters.
      * <p>
      * As a third example, the line:
-     * <p>
      * <pre>cheeses
      * </pre>
      * specifies that the key is {@code "cheeses"} and the associated
-     * element is the empty string {@code ""}.<p>
+     * element is the empty string {@code ""}.
      * <p>
-     *
      * <a name="unicodeescapes"></a>
      * Characters in keys and elements can be represented in escape
      * sequences similar to those used for character and string literals
--- a/jdk/src/share/classes/java/util/PropertyPermission.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/PropertyPermission.java	Mon Nov 11 16:20:48 2013 +0100
@@ -51,11 +51,10 @@
  * signify a wildcard match. For example: "java.*" and "*" signify a wildcard
  * match, while "*java" and "a*b" do not.
  * <P>
- * <P>
  * The actions to be granted are passed to the constructor in a string containing
  * a list of one or more comma-separated keywords. The possible keywords are
  * "read" and "write". Their meaning is defined as follows:
- * <P>
+ *
  * <DL>
  *    <DT> read
  *    <DD> read permission. Allows <code>System.getProperty</code> to
@@ -166,11 +165,11 @@
      * Checks if this PropertyPermission object "implies" the specified
      * permission.
      * <P>
-     * More specifically, this method returns true if:<p>
+     * More specifically, this method returns true if:
      * <ul>
-     * <li> <i>p</i> is an instanceof PropertyPermission,<p>
+     * <li> <i>p</i> is an instanceof PropertyPermission,
      * <li> <i>p</i>'s actions are a subset of this
-     * object's actions, and <p>
+     * object's actions, and
      * <li> <i>p</i>'s name is implied by this object's
      *      name. For example, "java.*" implies "java.home".
      * </ul>
--- a/jdk/src/share/classes/java/util/Queue.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Queue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -47,7 +47,6 @@
  * implementations; in most implementations, insert operations cannot
  * fail.
  *
- * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
  * <caption>Summary of Queue methods</caption>
  *  <tr>
--- a/jdk/src/share/classes/java/util/ResourceBundle.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/ResourceBundle.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1084,7 +1084,6 @@
      * bundles. Conceptually, the bundle loading process with the given
      * <code>control</code> is performed in the following steps.
      *
-     * <p>
      * <ol>
      * <li>This factory method looks up the resource bundle in the cache for
      * the specified <code>baseName</code>, <code>targetLocale</code> and
@@ -1255,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
@@ -2241,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>:
          *
@@ -2844,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/Scanner.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Scanner.java	Mon Nov 11 16:20:48 2013 +0100
@@ -216,7 +216,6 @@
  * are specified in terms of the following regular-expression grammar, where
  * Rmax is the highest digit in the radix being used (for example, Rmax is 9 in base 10).
  *
- * <p>
  * <dl>
  *   <dt><i>NonAsciiDigit</i>:
  *       <dd>A non-ASCII character c for which
--- a/jdk/src/share/classes/java/util/Spliterator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/Spliterator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -613,6 +613,7 @@
          * upon entry to this method, else {@code true}.
          * @throws NullPointerException if the specified action is null
          */
+        @SuppressWarnings("overloads")
         boolean tryAdvance(T_CONS action);
 
         /**
@@ -630,6 +631,7 @@
          * @param action The action
          * @throws NullPointerException if the specified action is null
          */
+        @SuppressWarnings("overloads")
         default void forEachRemaining(T_CONS action) {
             do { } while (tryAdvance(action));
         }
--- a/jdk/src/share/classes/java/util/TimeZone.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/TimeZone.java	Mon Nov 11 16:20:48 2013 +0100
@@ -544,7 +544,16 @@
      * @since 1.8
      */
     public ZoneId toZoneId() {
-        return ZoneId.of(getID(), ZoneId.SHORT_IDS);
+        String id = getID();
+        if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
+            if ("EST".equals(id))
+                return ZoneId.of("America/New_York");
+            if ("MST".equals(id))
+                return ZoneId.of("America/Denver");
+            if ("HST".equals(id))
+                return ZoneId.of("America/Honolulu");
+        }
+        return ZoneId.of(id, ZoneId.SHORT_IDS);
     }
 
     private static TimeZone getTimeZone(String ID, boolean fallback) {
@@ -597,7 +606,7 @@
      * Otherwise, the method takes the following steps to determine the default
      * time zone.
      *
-     * <p><ul>
+     * <ul>
      * <li>Use the {@code user.timezone} property value as the default
      * time zone ID if it's available.</li>
      * <li>Detect the platform time zone ID. The source of the
--- a/jdk/src/share/classes/java/util/UUID.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/UUID.java	Mon Nov 11 16:20:48 2013 +0100
@@ -233,7 +233,7 @@
      * number describes how this {@code UUID} was generated.
      *
      * The version number has the following meaning:
-     * <p><ul>
+     * <ul>
      * <li>1    Time-based UUID
      * <li>2    DCE security UUID
      * <li>3    Name-based UUID
@@ -252,7 +252,7 @@
      * number describes the layout of the {@code UUID}.
      *
      * The variant number has the following meaning:
-     * <p><ul>
+     * <ul>
      * <li>0    Reserved for NCS backward compatibility
      * <li>2    <a href="http://www.ietf.org/rfc/rfc4122.txt">IETF&nbsp;RFC&nbsp;4122</a>
      * (Leach-Salz), used by this class
--- a/jdk/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/BlockingDeque.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/BlockingDeque.java	Mon Nov 11 16:20:48 2013 +0100
@@ -50,7 +50,6 @@
  * and the fourth blocks for only a given maximum time limit before giving
  * up.  These methods are summarized in the following table:
  *
- * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
  * <caption>Summary of BlockingDeque methods</caption>
  *  <tr>
@@ -126,7 +125,6 @@
  * {@code BlockingQueue} interface are precisely equivalent to
  * {@code BlockingDeque} methods as indicated in the following table:
  *
- * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
  * <caption>Comparison of BlockingQueue and BlockingDeque methods</caption>
  *  <tr>
--- a/jdk/src/share/classes/java/util/concurrent/BlockingQueue.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/BlockingQueue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -53,7 +53,6 @@
  * and the fourth blocks for only a given maximum time limit before giving
  * up.  These methods are summarized in the following table:
  *
- * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
  * <caption>Summary of BlockingQueue methods</caption>
  *  <tr>
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java	Mon Nov 11 16:20:48 2013 +0100
@@ -36,7 +36,9 @@
 package java.util.concurrent;
 import java.util.Map;
 import java.util.Objects;
+import java.util.function.BiConsumer;
 import java.util.function.BiFunction;
+import java.util.function.Function;
 
 /**
  * A {@link java.util.Map} providing thread safety and atomicity
@@ -64,9 +66,13 @@
      * {@inheritDoc}
      *
      * @implNote This implementation assumes that the ConcurrentMap cannot
-     * contain null values and get() returning null unambiguously means the key
-     * is absent. Implementations which support null values must override this
-     * default implementation.
+     * contain null values and {@code get()} returning null unambiguously means
+     * the key is absent. Implementations which support null values
+     * <strong>must</strong> override this default implementation.
+     *
+     * @throws ClassCastException {@inheritDoc}
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
      */
     @Override
     default V getOrDefault(Object key, V defaultValue) {
@@ -74,6 +80,41 @@
         return ((v = get(key)) != null) ? v : defaultValue;
     }
 
+   /**
+     * {@inheritDoc}
+     *
+     * @implSpec The default implementation is equivalent to, for this
+     * {@code map}:
+     * <pre> {@code
+     * for ((Map.Entry<K, V> entry : map.entrySet())
+     *     action.accept(entry.getKey(), entry.getValue());
+     * }</pre>
+     *
+     * @implNote The default implementation assumes that
+     * {@code IllegalStateException} thrown by {@code getKey()} or
+     * {@code getValue()} indicates that the entry has been removed and cannot
+     * be processed. Operation continues for subsequent entries.
+     *
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    @Override
+    default void forEach(BiConsumer<? super K, ? super V> action) {
+        Objects.requireNonNull(action);
+        for (Map.Entry<K, V> entry : entrySet()) {
+            K k;
+            V v;
+            try {
+                k = entry.getKey();
+                v = entry.getValue();
+            } catch(IllegalStateException ise) {
+                // this usually means the entry is no longer in the map.
+                continue;
+            }
+            action.accept(k, v);
+        }
+    }
+
     /**
      * If the specified key is not already associated
      * with a value, associate it with the given value.
@@ -82,10 +123,14 @@
      * if (!map.containsKey(key))
      *   return map.put(key, value);
      * else
-     *   return map.get(key);}</pre>
+     *   return map.get(key);
+     * }</pre>
      *
      * except that the action is performed atomically.
      *
+     * @implNote This implementation intentionally re-abstracts the
+     * inappropriate default provided in {@code Map}.
+     *
      * @param key key with which the specified value is to be associated
      * @param value value to be associated with the specified key
      * @return the previous value associated with the specified key, or
@@ -102,7 +147,7 @@
      * @throws IllegalArgumentException if some property of the specified key
      *         or value prevents it from being stored in this map
      */
-    V putIfAbsent(K key, V value);
+     V putIfAbsent(K key, V value);
 
     /**
      * Removes the entry for a key only if currently mapped to a given value.
@@ -112,10 +157,14 @@
      *   map.remove(key);
      *   return true;
      * } else
-     *   return false;}</pre>
+     *   return false;
+     * }</pre>
      *
      * except that the action is performed atomically.
      *
+     * @implNote This implementation intentionally re-abstracts the
+     * inappropriate default provided in {@code Map}.
+     *
      * @param key key with which the specified value is associated
      * @param value value expected to be associated with the specified key
      * @return {@code true} if the value was removed
@@ -138,10 +187,14 @@
      *   map.put(key, newValue);
      *   return true;
      * } else
-     *   return false;}</pre>
+     *   return false;
+     * }</pre>
      *
      * except that the action is performed atomically.
      *
+     * @implNote This implementation intentionally re-abstracts the
+     * inappropriate default provided in {@code Map}.
+     *
      * @param key key with which the specified value is associated
      * @param oldValue value expected to be associated with the specified key
      * @param newValue value to be associated with the specified key
@@ -164,10 +217,14 @@
      * if (map.containsKey(key)) {
      *   return map.put(key, value);
      * } else
-     *   return null;}</pre>
+     *   return null;
+     * }</pre>
      *
      * except that the action is performed atomically.
      *
+     * @implNote This implementation intentionally re-abstracts the
+     * inappropriate default provided in {@code Map}.
+     *
      * @param key key with which the specified value is associated
      * @param value value to be associated with the specified key
      * @return the previous value associated with the specified key, or
@@ -189,10 +246,30 @@
     /**
      * {@inheritDoc}
      *
-     * @implNote This implementation assumes that the ConcurrentMap cannot
-     * contain null values and get() returning null unambiguously means the key
-     * is absent. Implementations which support null values
-     * <strong>must</strong> override this default implementation.
+     * @implSpec
+     * <p>The default implementation is equivalent to, for this {@code map}:
+     * <pre> {@code
+     * for ((Map.Entry<K, V> entry : map.entrySet())
+     *     do {
+     *        K k = entry.getKey();
+     *        V v = entry.getValue();
+     *     } while(!replace(k, v, function.apply(k, v)));
+     * }</pre>
+     *
+     * The default implementation may retry these steps when multiple
+     * threads attempt updates including potentially calling the function
+     * repeatedly for a given key.
+     *
+     * <p>This implementation assumes that the ConcurrentMap cannot contain null
+     * values and {@code get()} returning null unambiguously means the key is
+     * absent. Implementations which support null values <strong>must</strong>
+     * override this default implementation.
+     *
+     * @throws UnsupportedOperationException {@inheritDoc}
+     * @throws NullPointerException {@inheritDoc}
+     * @throws ClassCastException {@inheritDoc}
+     * @throws IllegalArgumentException {@inheritDoc}
+     * @since 1.8
      */
     @Override
     default void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
@@ -200,11 +277,243 @@
         forEach((k,v) -> {
             while(!replace(k, v, function.apply(k, v))) {
                 // v changed or k is gone
-                if( (v = get(k)) == null) {
+                if ( (v = get(k)) == null) {
                     // k is no longer in the map.
                     break;
                 }
             }
         });
     }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @implSpec
+     * The default implementation is equivalent to the following steps for this
+     * {@code map}, then returning the current value or {@code null} if now
+     * absent:
+     *
+     * <pre> {@code
+     * if (map.get(key) == null) {
+     *     V newValue = mappingFunction.apply(key);
+     *     if (newValue != null)
+     *         return map.putIfAbsent(key, newValue);
+     * }
+     * }</pre>
+     *
+     * The default implementation may retry these steps when multiple
+     * threads attempt updates including potentially calling the mapping
+     * function multiple times.
+     *
+     * <p>This implementation assumes that the ConcurrentMap cannot contain null
+     * values and {@code get()} returning null unambiguously means the key is
+     * absent. Implementations which support null values <strong>must</strong>
+     * override this default implementation.
+     *
+     * @throws UnsupportedOperationException {@inheritDoc}
+     * @throws ClassCastException {@inheritDoc}
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    @Override
+    default V computeIfAbsent(K key,
+            Function<? super K, ? extends V> mappingFunction) {
+        Objects.requireNonNull(mappingFunction);
+        V v, newValue;
+        return ((v = get(key)) == null &&
+                (newValue = mappingFunction.apply(key)) != null &&
+                (v = putIfAbsent(key, newValue)) == null) ? newValue : v;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @implSpec
+     * The default implementation is equivalent to performing the following
+     * steps for this {@code map}, then returning the current value or
+     * {@code null} if now absent. :
+     *
+     * <pre> {@code
+     * if (map.get(key) != null) {
+     *     V oldValue = map.get(key);
+     *     V newValue = remappingFunction.apply(key, oldValue);
+     *     if (newValue != null)
+     *         map.replace(key, oldValue, newValue);
+     *     else
+     *         map.remove(key, oldValue);
+     * }
+     * }</pre>
+     *
+     * The default implementation may retry these steps when multiple threads
+     * attempt updates including potentially calling the remapping function
+     * multiple times.
+     *
+     * <p>This implementation assumes that the ConcurrentMap cannot contain null
+     * values and {@code get()} returning null unambiguously means the key is
+     * absent. Implementations which support null values <strong>must</strong>
+     * override this default implementation.
+     *
+     * @throws UnsupportedOperationException {@inheritDoc}
+     * @throws ClassCastException {@inheritDoc}
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    @Override
+    default V computeIfPresent(K key,
+            BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        Objects.requireNonNull(remappingFunction);
+        V oldValue;
+        while((oldValue = get(key)) != null) {
+            V newValue = remappingFunction.apply(key, oldValue);
+            if (newValue != null) {
+                if (replace(key, oldValue, newValue))
+                    return newValue;
+            } else if (remove(key, oldValue))
+               return null;
+        }
+        return oldValue;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @implSpec
+     * The default implementation is equivalent to performing the following
+     * steps for this {@code map}, then returning the current value or
+     * {@code null} if absent:
+     *
+     * <pre> {@code
+     * V oldValue = map.get(key);
+     * V newValue = remappingFunction.apply(key, oldValue);
+     * if (oldValue != null ) {
+     *    if (newValue != null)
+     *       map.replace(key, oldValue, newValue);
+     *    else
+     *       map.remove(key, oldValue);
+     * } else {
+     *    if (newValue != null)
+     *       map.putIfAbsent(key, newValue);
+     *    else
+     *       return null;
+     * }
+     * }</pre>
+     *
+     * The default implementation may retry these steps when multiple
+     * threads attempt updates including potentially calling the remapping
+     * function multiple times.
+     *
+     * <p>This implementation assumes that the ConcurrentMap cannot contain null
+     * values and {@code get()} returning null unambiguously means the key is
+     * absent. Implementations which support null values <strong>must</strong>
+     * override this default implementation.
+     *
+     * @throws UnsupportedOperationException {@inheritDoc}
+     * @throws ClassCastException {@inheritDoc}
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    @Override
+    default V compute(K key,
+            BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        Objects.requireNonNull(remappingFunction);
+        V oldValue = get(key);
+        for(;;) {
+            V newValue = remappingFunction.apply(key, oldValue);
+            if (newValue == null) {
+                // delete mapping
+                if (oldValue != null || containsKey(key)) {
+                    // something to remove
+                    if (remove(key, oldValue)) {
+                        // removed the old value as expected
+                        return null;
+                    }
+
+                    // some other value replaced old value. try again.
+                    oldValue = get(key);
+                } else {
+                    // nothing to do. Leave things as they were.
+                    return null;
+                }
+            } else {
+                // add or replace old mapping
+                if (oldValue != null) {
+                    // replace
+                    if (replace(key, oldValue, newValue)) {
+                        // replaced as expected.
+                        return newValue;
+                    }
+
+                    // some other value replaced old value. try again.
+                    oldValue = get(key);
+                } else {
+                    // add (replace if oldValue was null)
+                    if ((oldValue = putIfAbsent(key, newValue)) == null) {
+                        // replaced
+                        return newValue;
+                    }
+
+                    // some other value replaced old value. try again.
+                }
+            }
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     *
+     * @implSpec
+     * The default implementation is equivalent to performing the
+     * following steps for this {@code map}, then returning the
+     * current value or {@code null} if absent:
+     *
+     * <pre> {@code
+     * V oldValue = map.get(key);
+     * V newValue = (oldValue == null) ? value :
+     *              remappingFunction.apply(oldValue, value);
+     * if (newValue == null)
+     *     map.remove(key);
+     * else if (oldValue == null)
+     *     map.remove(key);
+     * else
+     *     map.put(key, newValue);
+     * }</pre>
+     *
+     * <p>The default implementation may retry these steps when multiple
+     * threads attempt updates including potentially calling the remapping
+     * function multiple times.
+     *
+     * <p>This implementation assumes that the ConcurrentMap cannot contain null
+     * values and {@code get()} returning null unambiguously means the key is
+     * absent. Implementations which support null values <strong>must</strong>
+     * override this default implementation.
+     *
+     * @throws UnsupportedOperationException {@inheritDoc}
+     * @throws ClassCastException {@inheritDoc}
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    @Override
+    default V merge(K key, V value,
+            BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
+        Objects.requireNonNull(remappingFunction);
+        Objects.requireNonNull(value);
+        V oldValue = get(key);
+        for (;;) {
+            if (oldValue != null) {
+                V newValue = remappingFunction.apply(oldValue, value);
+                if (newValue != null) {
+                    if (replace(key, oldValue, newValue))
+                        return newValue;
+                } else if (remove(key, oldValue)) {
+                    return null;
+                }
+                oldValue = get(key);
+            } else {
+                if ((oldValue = putIfAbsent(key, value)) == null) {
+                    return value;
+                }
+            }
+        }
+    }
 }
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/ExecutorCompletionService.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/concurrent/Future.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/Future.java	Mon Nov 11 16:20:48 2013 +0100
@@ -52,8 +52,8 @@
  *
  * <p>
  * <b>Sample Usage</b> (Note that the following classes are all
- * made-up.) <p>
- *  <pre> {@code
+ * made-up.)
+ * <pre> {@code
  * interface ArchiveSearcher { String search(String target); }
  * class App {
  *   ExecutorService executor = ...
--- a/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -224,18 +224,71 @@
         return (float)get();
     }
 
-    private void writeObject(java.io.ObjectOutputStream s)
-        throws java.io.IOException {
-        s.defaultWriteObject();
-        s.writeDouble(get());
+    /**
+     * Serialization proxy, used to avoid reference to the non-public
+     * Striped64 superclass in serialized forms.
+     * @serial include
+     */
+    private static class SerializationProxy implements Serializable {
+        private static final long serialVersionUID = 7249069246863182397L;
+
+        /**
+         * The current value returned by get().
+         * @serial
+         */
+        private final double value;
+        /**
+         * The function used for updates.
+         * @serial
+         */
+        private final DoubleBinaryOperator function;
+        /**
+         * The identity value
+         * @serial
+         */
+        private final long identity;
+
+        SerializationProxy(DoubleAccumulator a) {
+            function = a.function;
+            identity = a.identity;
+            value = a.get();
+        }
+
+        /**
+         * Returns a {@code DoubleAccumulator} object with initial state
+         * held by this proxy.
+         *
+         * @return a {@code DoubleAccumulator} object with initial state
+         * held by this proxy.
+         */
+        private Object readResolve() {
+            double d = Double.longBitsToDouble(identity);
+            DoubleAccumulator a = new DoubleAccumulator(function, d);
+            a.base = Double.doubleToRawLongBits(value);
+            return a;
+        }
     }
 
+    /**
+     * Returns a
+     * <a href="../../../../serialized-form.html#java.util.concurrent.atomic.DoubleAccumulator.SerializationProxy">
+     * SerializationProxy</a>
+     * representing the state of this instance.
+     *
+     * @return a {@link SerializationProxy}
+     * representing the state of this instance
+     */
+    private Object writeReplace() {
+        return new SerializationProxy(this);
+    }
+
+    /**
+     * @param s the stream
+     * @throws java.io.InvalidObjectException always
+     */
     private void readObject(java.io.ObjectInputStream s)
-        throws java.io.IOException, ClassNotFoundException {
-        s.defaultReadObject();
-        cellsBusy = 0;
-        cells = null;
-        base = Double.doubleToRawLongBits(s.readDouble());
+        throws java.io.InvalidObjectException {
+        throw new java.io.InvalidObjectException("Proxy required");
     }
 
 }
--- a/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAdder.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAdder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -210,18 +210,58 @@
         return (float)sum();
     }
 
-    private void writeObject(java.io.ObjectOutputStream s)
-        throws java.io.IOException {
-        s.defaultWriteObject();
-        s.writeDouble(sum());
+    /**
+     * Serialization proxy, used to avoid reference to the non-public
+     * Striped64 superclass in serialized forms.
+     * @serial include
+     */
+    private static class SerializationProxy implements Serializable {
+        private static final long serialVersionUID = 7249069246863182397L;
+
+        /**
+         * The current value returned by sum().
+         * @serial
+         */
+        private final double value;
+
+        SerializationProxy(DoubleAdder a) {
+            value = a.sum();
+        }
+
+        /**
+         * Returns a {@code DoubleAdder} object with initial state
+         * held by this proxy.
+         *
+         * @return a {@code DoubleAdder} object with initial state
+         * held by this proxy.
+         */
+        private Object readResolve() {
+            DoubleAdder a = new DoubleAdder();
+            a.base = Double.doubleToRawLongBits(value);
+            return a;
+        }
     }
 
+    /**
+     * Returns a
+     * <a href="../../../../serialized-form.html#java.util.concurrent.atomic.DoubleAdder.SerializationProxy">
+     * SerializationProxy</a>
+     * representing the state of this instance.
+     *
+     * @return a {@link SerializationProxy}
+     * representing the state of this instance
+     */
+    private Object writeReplace() {
+        return new SerializationProxy(this);
+    }
+
+    /**
+     * @param s the stream
+     * @throws java.io.InvalidObjectException always
+     */
     private void readObject(java.io.ObjectInputStream s)
-        throws java.io.IOException, ClassNotFoundException {
-        s.defaultReadObject();
-        cellsBusy = 0;
-        cells = null;
-        base = Double.doubleToRawLongBits(s.readDouble());
+        throws java.io.InvalidObjectException {
+        throw new java.io.InvalidObjectException("Proxy required");
     }
 
 }
--- a/jdk/src/share/classes/java/util/concurrent/atomic/LongAccumulator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/atomic/LongAccumulator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -221,18 +221,70 @@
         return (double)get();
     }
 
-    private void writeObject(java.io.ObjectOutputStream s)
-        throws java.io.IOException {
-        s.defaultWriteObject();
-        s.writeLong(get());
+    /**
+     * Serialization proxy, used to avoid reference to the non-public
+     * Striped64 superclass in serialized forms.
+     * @serial include
+     */
+    private static class SerializationProxy implements Serializable {
+        private static final long serialVersionUID = 7249069246863182397L;
+
+        /**
+         * The current value returned by get().
+         * @serial
+         */
+        private final long value;
+        /**
+         * The function used for updates.
+         * @serial
+         */
+        private final LongBinaryOperator function;
+        /**
+         * The identity value
+         * @serial
+         */
+        private final long identity;
+
+        SerializationProxy(LongAccumulator a) {
+            function = a.function;
+            identity = a.identity;
+            value = a.get();
+        }
+
+        /**
+         * Returns a {@code LongAccumulator} object with initial state
+         * held by this proxy.
+         *
+         * @return a {@code LongAccumulator} object with initial state
+         * held by this proxy.
+         */
+        private Object readResolve() {
+            LongAccumulator a = new LongAccumulator(function, identity);
+            a.base = value;
+            return a;
+        }
     }
 
+    /**
+     * Returns a
+     * <a href="../../../../serialized-form.html#java.util.concurrent.atomic.LongAccumulator.SerializationProxy">
+     * SerializationProxy</a>
+     * representing the state of this instance.
+     *
+     * @return a {@link SerializationProxy}
+     * representing the state of this instance
+     */
+    private Object writeReplace() {
+        return new SerializationProxy(this);
+    }
+
+    /**
+     * @param s the stream
+     * @throws java.io.InvalidObjectException always
+     */
     private void readObject(java.io.ObjectInputStream s)
-        throws java.io.IOException, ClassNotFoundException {
-        s.defaultReadObject();
-        cellsBusy = 0;
-        cells = null;
-        base = s.readLong();
+        throws java.io.InvalidObjectException {
+        throw new java.io.InvalidObjectException("Proxy required");
     }
 
 }
--- a/jdk/src/share/classes/java/util/concurrent/atomic/LongAdder.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/atomic/LongAdder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -211,18 +211,58 @@
         return (double)sum();
     }
 
-    private void writeObject(java.io.ObjectOutputStream s)
-        throws java.io.IOException {
-        s.defaultWriteObject();
-        s.writeLong(sum());
+    /**
+     * Serialization proxy, used to avoid reference to the non-public
+     * Striped64 superclass in serialized forms.
+     * @serial include
+     */
+    private static class SerializationProxy implements Serializable {
+        private static final long serialVersionUID = 7249069246863182397L;
+
+        /**
+         * The current value returned by sum().
+         * @serial
+         */
+        private final long value;
+
+        SerializationProxy(LongAdder a) {
+            value = a.sum();
+        }
+
+        /**
+         * Return a {@code LongAdder} object with initial state
+         * held by this proxy.
+         *
+         * @return a {@code LongAdder} object with initial state
+         * held by this proxy.
+         */
+        private Object readResolve() {
+            LongAdder a = new LongAdder();
+            a.base = value;
+            return a;
+        }
     }
 
+    /**
+     * Returns a
+     * <a href="../../../../serialized-form.html#java.util.concurrent.atomic.LongAdder.SerializationProxy">
+     * SerializationProxy</a>
+     * representing the state of this instance.
+     *
+     * @return a {@link SerializationProxy}
+     * representing the state of this instance
+     */
+    private Object writeReplace() {
+        return new SerializationProxy(this);
+    }
+
+    /**
+     * @param s the stream
+     * @throws java.io.InvalidObjectException always
+     */
     private void readObject(java.io.ObjectInputStream s)
-        throws java.io.IOException, ClassNotFoundException {
-        s.defaultReadObject();
-        cellsBusy = 0;
-        cells = null;
-        base = s.readLong();
+        throws java.io.InvalidObjectException {
+        throw new java.io.InvalidObjectException("Proxy required");
     }
 
 }
--- a/jdk/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java	Mon Nov 11 16:20:48 2013 +0100
@@ -56,7 +56,6 @@
  * constraints.  A nonfair lock that is continuously contended may
  * indefinitely postpone one or more reader or writer threads, but
  * will normally have higher throughput than a fair lock.
- * <p>
  *
  * <dt><b><i>Fair mode</i></b>
  * <dd>When constructed as fair, threads contend for entry using an
--- a/jdk/src/share/classes/java/util/function/package-info.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/function/package-info.java	Mon Nov 11 16:20:48 2013 +0100
@@ -60,7 +60,11 @@
  * actions, or predicates.  In documenting functional interfaces, or referring
  * to variables typed as functional interfaces, it is common to refer directly
  * to those abstract concepts, for example using "this function" instead of
- * "the function represented by this object".
+ * "the function represented by this object".  When an API method is said to
+ * accept or return a functional interface in this manner, such as "applies the
+ * provided function to...", this is understood to mean a <i>non-null</i>
+ * reference to an object implementing the appropriate functional interface,
+ * unless potential nullity is explicitly specified.
  *
  * <p>The functional interfaces in this package follow an extensible naming
  * convention, as follows:
--- a/jdk/src/share/classes/java/util/jar/Manifest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/jar/Manifest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/jar/Pack200.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/jar/Pack200.java	Mon Nov 11 16:20:48 2013 +0100
@@ -44,7 +44,7 @@
  * The unpacker  engine is used by deployment applications to
  * transform the byte-stream back to JAR format.
  * <p>
- * Here is an example using  packer and unpacker:<p>
+ * Here is an example using  packer and unpacker:
  * <pre>{@code
  *    import java.util.jar.Pack200;
  *    import java.util.jar.Pack200.*;
--- a/jdk/src/share/classes/java/util/logging/LogManager.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/LogManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -770,9 +770,10 @@
             ref = owner.new LoggerWeakRef(logger);
             namedLoggers.put(name, ref);
 
-            // Apply any initial level defined for the new logger.
+            // Apply any initial level defined for the new logger, unless
+            // the logger's level is already initialized
             Level level = owner.getLevelProperty(name + ".level", null);
-            if (level != null) {
+            if (level != null && !logger.isLevelInitialized()) {
                 doSetLevel(logger, level);
             }
 
--- a/jdk/src/share/classes/java/util/logging/Logger.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/Logger.java	Mon Nov 11 16:20:48 2013 +0100
@@ -150,7 +150,7 @@
  * has or inherited a resource bundle name, then that resource bundle name
  * will be mapped to a {@code ResourceBundle} object, using the default Locale
  * at the time of logging.
- * <br><a name="ResourceBundleMapping"/>When mapping resource bundle names to
+ * <br id="ResourceBundleMapping">When mapping resource bundle names to
  * {@code ResourceBundle} objects, the logger will first try to use the
  * Thread's {@linkplain java.lang.Thread#getContextClassLoader() context class
  * loader} to map the given resource bundle name to a {@code ResourceBundle}.
@@ -555,7 +555,9 @@
      * Even although the new logger is anonymous, it is configured
      * to have the root logger ("") as its parent.  This means that
      * by default it inherits its effective level and handlers
-     * from the root logger.
+     * from the root logger. Changing its parent via the
+     * {@link #setParent(java.util.logging.Logger) setParent} method
+     * will still require the security permission specified by that method.
      * <p>
      *
      * @return a newly created private Logger
@@ -579,7 +581,9 @@
      * Even although the new logger is anonymous, it is configured
      * to have the root logger ("") as its parent.  This means that
      * by default it inherits its effective level and handlers
-     * from the root logger.
+     * from the root logger.  Changing its parent via the
+     * {@link #setParent(java.util.logging.Logger) setParent} method
+     * will still require the security permission specified by that method.
      * <p>
      * @param   resourceBundleName  name of ResourceBundle to be used for localizing
      *                          messages for this logger.
@@ -648,8 +652,9 @@
      * be published.
      *
      * @param   newFilter  a filter object (may be null)
-     * @exception  SecurityException  if a security manager exists and if
-     *             the caller does not have LoggingPermission("control").
+     * @throws  SecurityException if a security manager exists,
+     *          this logger is not anonymous, and the caller
+     *          does not have LoggingPermission("control").
      */
     public void setFilter(Filter newFilter) throws SecurityException {
         checkPermission();
@@ -1629,8 +1634,9 @@
      * (non-null) level value.
      *
      * @param newLevel   the new value for the log level (may be null)
-     * @exception  SecurityException  if a security manager exists and if
-     *             the caller does not have LoggingPermission("control").
+     * @throws  SecurityException if a security manager exists,
+     *          this logger is not anonymous, and the caller
+     *          does not have LoggingPermission("control").
      */
     public void setLevel(Level newLevel) throws SecurityException {
         checkPermission();
@@ -1640,6 +1646,10 @@
         }
     }
 
+    final boolean isLevelInitialized() {
+        return levelObject != null;
+    }
+
     /**
      * Get the log Level that has been specified for this Logger.
      * The result may be null, which means that this logger's
@@ -1682,8 +1692,9 @@
      * that essentially act as default handlers for all loggers.
      *
      * @param   handler a logging Handler
-     * @exception  SecurityException  if a security manager exists and if
-     *             the caller does not have LoggingPermission("control").
+     * @throws  SecurityException if a security manager exists,
+     *          this logger is not anonymous, and the caller
+     *          does not have LoggingPermission("control").
      */
     public void addHandler(Handler handler) throws SecurityException {
         // Check for null handler
@@ -1698,8 +1709,9 @@
      * Returns silently if the given Handler is not found or is null
      *
      * @param   handler a logging Handler
-     * @exception  SecurityException  if a security manager exists and if
-     *             the caller does not have LoggingPermission("control").
+     * @throws  SecurityException if a security manager exists,
+     *          this logger is not anonymous, and the caller
+     *          does not have LoggingPermission("control").
      */
     public void removeHandler(Handler handler) throws SecurityException {
         checkPermission();
@@ -1726,8 +1738,9 @@
      *
      * @param useParentHandlers   true if output is to be sent to the
      *          logger's parent.
-     * @exception  SecurityException  if a security manager exists and if
-     *             the caller does not have LoggingPermission("control").
+     * @throws  SecurityException if a security manager exists,
+     *          this logger is not anonymous, and the caller
+     *          does not have LoggingPermission("control").
      */
     public void setUseParentHandlers(boolean useParentHandlers) {
         checkPermission();
@@ -1890,8 +1903,9 @@
      *         {@linkplain ResourceBundle#getBaseBundleName base name},
      *         or if this logger already has a resource bundle set but
      *         the given bundle has a different base name.
-     * @throws SecurityException  if a security manager exists and if
-     *         the caller does not have LoggingPermission("control").
+     * @throws SecurityException if a security manager exists,
+     *         this logger is not anonymous, and the caller
+     *         does not have LoggingPermission("control").
      * @since 1.8
      */
     public void setResourceBundle(ResourceBundle bundle) {
@@ -1948,14 +1962,20 @@
      * It should not be called from application code.
      * <p>
      * @param  parent   the new parent logger
-     * @exception  SecurityException  if a security manager exists and if
-     *             the caller does not have LoggingPermission("control").
+     * @throws  SecurityException  if a security manager exists and if
+     *          the caller does not have LoggingPermission("control").
      */
     public void setParent(Logger parent) {
         if (parent == null) {
             throw new NullPointerException();
         }
-        checkPermission();
+
+        // check permission for all loggers, including anonymous loggers
+        if (manager == null) {
+            manager = LogManager.getLogManager();
+        }
+        manager.checkPermission();
+
         doSetParent(parent);
     }
 
--- a/jdk/src/share/classes/java/util/regex/Pattern.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/regex/Pattern.java	Mon Nov 11 16:20:48 2013 +0100
@@ -618,7 +618,7 @@
  * are in conformance with the recommendation of <i>Annex C: Compatibility Properties</i>
  * of <a href="http://www.unicode.org/reports/tr18/"><i>Unicode Regular Expression
  * </i></a>, when {@link #UNICODE_CHARACTER_CLASS} flag is specified.
- * <p>
+ *
  * <table border="0" cellpadding="1" cellspacing="0"
  *  summary="predefined and posix character classes in Unicode mode">
  * <tr align="left">
@@ -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/java/util/spi/LocaleServiceProvider.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/spi/LocaleServiceProvider.java	Mon Nov 11 16:20:48 2013 +0100
@@ -41,7 +41,7 @@
  * <code>java.util</code> packages use implementations of the provider
  * interfaces to offer support for locales beyond the set of locales
  * supported by the Java runtime environment itself.
- * <p>
+ *
  * <h3>Packaging of Locale Sensitive Service Provider Implementations</h3>
  * Implementations of these locale sensitive services are packaged using the
  * <a href="../../../../technotes/guides/extensions/index.html">Java Extension Mechanism</a>
--- a/jdk/src/share/classes/java/util/stream/BaseStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/BaseStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -35,9 +35,10 @@
 import java.util.function.Predicate;
 
 /**
- * A sequence of elements supporting sequential and parallel aggregate
- * operations.  The following example illustrates an aggregate operation using
- * {@link Stream} and {@link IntStream}:
+ * Base interface for streams, which are sequences of elements supporting
+ * sequential and parallel aggregate operations.  The following example
+ * illustrates an aggregate operation using the stream types {@link Stream}
+ * and {@link IntStream}, computing the sum of the weights of the red widgets:
  *
  * <pre>{@code
  *     int sum = widgets.stream()
@@ -46,80 +47,18 @@
  *                      .sum();
  * }</pre>
  *
- * In this example, {@code widgets} is a {@code Collection<Widget>}.  We create
- * a stream of {@code Widget} objects via {@link Collection#stream Collection.stream()},
- * filter it to produce a stream containing only the red widgets, and then
- * transform it into a stream of {@code int} values representing the weight of
- * each red widget. Then this stream is summed to produce a total weight.
- *
- * <p>To perform a computation, stream
- * <a href="package-summary.html#StreamOps">operations</a> are composed into a
- * <em>stream pipeline</em>.  A stream pipeline consists of a source (which
- * might be an array, a collection, a generator function, an IO channel,
- * etc), zero or more <em>intermediate operations</em> (which transform a
- * stream into another stream, such as {@link Stream#filter(Predicate)}), and a
- * <em>terminal operation</em> (which produces a result or side-effect, such
- * as {@link IntStream#sum()} or {@link IntStream#forEach(IntConsumer)}).
- * Streams are lazy; computation on the source data is only performed when the
- * terminal operation is initiated, and source elements are consumed only
- * as needed.
- *
- * <p>Collections and streams, while bearing some superficial similarities,
- * have different goals.  Collections are primarily concerned with the efficient
- * management of, and access to, their elements.  By contrast, streams do not
- * provide a means to directly access or manipulate their elements, and are
- * instead concerned with declaratively describing their source and the
- * computational operations which will be performed in aggregate on that source.
- * However, if the provided stream operations do not offer the desired
- * functionality, the {@link #iterator()} and {@link #spliterator()} operations
- * can be used to perform a controlled traversal.
- *
- * <p>A stream pipeline, like the "widgets" example above, can be viewed as
- * a <em>query</em> on the stream source.  Unless the source was explicitly
- * designed for concurrent modification (such as a {@link ConcurrentHashMap}),
- * unpredictable or erroneous behavior may result from modifying the stream
- * source while it is being queried.
- *
- * <p>Most stream operations accept parameters that describe user-specified
- * behavior, such as the lambda expression {@code w -> w.getWeight()} passed to
- * {@code mapToInt} in the example above.  Such parameters are always instances
- * of a <a href="../function/package-summary.html">functional interface</a> such
- * as {@link java.util.function.Function}, and are often lambda expressions or
- * method references.  These parameters can never be null, should not modify the
- * stream source, and should be
- * <a href="package-summary.html#NonInterference">effectively stateless</a>
- * (their result should not depend on any state that might change during
- * execution of the stream pipeline.)
- *
- * <p>A stream should be operated on (invoking an intermediate or terminal stream
- * operation) only once.  This rules out, for example, "forked" streams, where
- * the same source feeds two or more pipelines, or multiple traversals of the
- * same stream.  A stream implementation may throw {@link IllegalStateException}
- * if it detects that the stream is being reused. However, since some stream
- * operations may return their receiver rather than a new stream object, it may
- * not be possible to detect reuse in all cases.
- *
- * <p>Streams have a {@link #close()} method and implement {@link AutoCloseable},
- * but nearly all stream instances do not actually need to be closed after use.
- * Generally, only streams whose source is an IO channel (such as those returned
- * by {@link Files#lines(Path, Charset)}) will require closing.  Most streams
- * are backed by collections, arrays, or generating functions, which require no
- * special resource management.  (If a stream does require closing, it can be
- * declared as a resource in a {@code try}-with-resources statement.)
- *
- * <p>Stream pipelines may execute either sequentially or in
- * <a href="package-summary.html#Parallelism">parallel</a>.  This
- * execution mode is a property of the stream.  Streams are created
- * with an initial choice of sequential or parallel execution.  (For example,
- * {@link Collection#stream() Collection.stream()} creates a sequential stream,
- * and {@link Collection#parallelStream() Collection.parallelStream()} creates
- * a parallel one.)  This choice of execution mode may be modified by the
- * {@link #sequential()} or {@link #parallel()} methods, and may be queried with
- * the {@link #isParallel()} method.
+ * See the class documentation for {@link Stream} and the package documentation
+ * for <a href="package-summary.html">java.util.stream</a> for additional
+ * specification of streams, stream operations, stream pipelines, and
+ * parallelism, which governs the behavior of all stream types.
  *
  * @param <T> the type of the stream elements
  * @param <S> the type of of the stream implementing {@code BaseStream}
  * @since 1.8
+ * @see Stream
+ * @see IntStream
+ * @see LongStream
+ * @see DoubleStream
  * @see <a href="package-summary.html">java.util.stream</a>
  */
 public interface BaseStream<T, S extends BaseStream<T, S>>
--- a/jdk/src/share/classes/java/util/stream/Collectors.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/Collectors.java	Mon Nov 11 16:20:48 2013 +0100
@@ -462,7 +462,7 @@
      */
     public static <T> Collector<T, ?, Integer>
     summingInt(ToIntFunction<? super T> mapper) {
-        return new CollectorImpl<T, int[], Integer>(
+        return new CollectorImpl<>(
                 () -> new int[1],
                 (a, t) -> { a[0] += mapper.applyAsInt(t); },
                 (a, b) -> { a[0] += b[0]; return a; },
@@ -480,7 +480,7 @@
      */
     public static <T> Collector<T, ?, Long>
     summingLong(ToLongFunction<? super T> mapper) {
-        return new CollectorImpl<T, long[], Long>(
+        return new CollectorImpl<>(
                 () -> new long[1],
                 (a, t) -> { a[0] += mapper.applyAsLong(t); },
                 (a, b) -> { a[0] += b[0]; return a; },
@@ -505,7 +505,7 @@
      */
     public static <T> Collector<T, ?, Double>
     summingDouble(ToDoubleFunction<? super T> mapper) {
-        return new CollectorImpl<T, double[], Double>(
+        return new CollectorImpl<>(
                 () -> new double[1],
                 (a, t) -> { a[0] += mapper.applyAsDouble(t); },
                 (a, b) -> { a[0] += b[0]; return a; },
@@ -523,7 +523,7 @@
      */
     public static <T> Collector<T, ?, Double>
     averagingInt(ToIntFunction<? super T> mapper) {
-        return new CollectorImpl<T, long[], Double>(
+        return new CollectorImpl<>(
                 () -> new long[2],
                 (a, t) -> { a[0] += mapper.applyAsInt(t); a[1]++; },
                 (a, b) -> { a[0] += b[0]; a[1] += b[1]; return a; },
@@ -541,7 +541,7 @@
      */
     public static <T> Collector<T, ?, Double>
     averagingLong(ToLongFunction<? super T> mapper) {
-        return new CollectorImpl<T, long[], Double>(
+        return new CollectorImpl<>(
                 () -> new long[2],
                 (a, t) -> { a[0] += mapper.applyAsLong(t); a[1]++; },
                 (a, b) -> { a[0] += b[0]; a[1] += b[1]; return a; },
@@ -566,7 +566,7 @@
      */
     public static <T> Collector<T, ?, Double>
     averagingDouble(ToDoubleFunction<? super T> mapper) {
-        return new CollectorImpl<T, double[], Double>(
+        return new CollectorImpl<>(
                 () -> new double[2],
                 (a, t) -> { a[0] += mapper.applyAsDouble(t); a[1]++; },
                 (a, b) -> { a[0] += b[0]; a[1] += b[1]; return a; },
@@ -723,6 +723,14 @@
      *     groupingBy(classifier, toList());
      * }</pre>
      *
+     * @implNote
+     * The returned {@code Collector} is not concurrent.  For parallel stream
+     * pipelines, the {@code combiner} function operates by merging the keys
+     * from one map into another, which can be an expensive operation.  If
+     * preservation of the order in which elements appear in the resulting {@code Map}
+     * collector is not required, using {@link #groupingByConcurrent(Function)}
+     * may offer better parallel performance.
+     *
      * @param <T> the type of the input elements
      * @param <K> the type of the keys
      * @param classifier the classifier function mapping input elements to keys
@@ -759,6 +767,14 @@
      *                                              mapping(Person::getLastName, toSet())));
      * }</pre>
      *
+     * @implNote
+     * The returned {@code Collector} is not concurrent.  For parallel stream
+     * pipelines, the {@code combiner} function operates by merging the keys
+     * from one map into another, which can be an expensive operation.  If
+     * preservation of the order in which elements are presented to the downstream
+     * collector is not required, using {@link #groupingByConcurrent(Function, Collector)}
+     * may offer better parallel performance.
+     *
      * @param <T> the type of the input elements
      * @param <K> the type of the keys
      * @param <A> the intermediate accumulation type of the downstream collector
@@ -798,6 +814,14 @@
      *                                              mapping(Person::getLastName, toSet())));
      * }</pre>
      *
+     * @implNote
+     * The returned {@code Collector} is not concurrent.  For parallel stream
+     * pipelines, the {@code combiner} function operates by merging the keys
+     * from one map into another, which can be an expensive operation.  If
+     * preservation of the order in which elements are presented to the downstream
+     * collector is not required, using {@link #groupingByConcurrent(Function, Supplier, Collector)}
+     * may offer better parallel performance.
+     *
      * @param <T> the type of the input elements
      * @param <K> the type of the keys
      * @param <A> the intermediate accumulation type of the downstream collector
@@ -871,7 +895,7 @@
      * @param <T> the type of the input elements
      * @param <K> the type of the keys
      * @param classifier a classifier function mapping input elements to keys
-     * @return a {@code Collector} implementing the group-by operation
+     * @return a concurrent, unordered {@code Collector} implementing the group-by operation
      *
      * @see #groupingBy(Function)
      * @see #groupingByConcurrent(Function, Collector)
@@ -912,7 +936,7 @@
      * @param <D> the result type of the downstream reduction
      * @param classifier a classifier function mapping input elements to keys
      * @param downstream a {@code Collector} implementing the downstream reduction
-     * @return a {@code Collector} implementing the cascaded group-by operation
+     * @return a concurrent, unordered {@code Collector} implementing the cascaded group-by operation
      *
      * @see #groupingBy(Function, Collector)
      * @see #groupingByConcurrent(Function)
@@ -958,7 +982,7 @@
      * @param downstream a {@code Collector} implementing the downstream reduction
      * @param mapFactory a function which, when called, produces a new empty
      *                   {@code ConcurrentMap} of the desired type
-     * @return a {@code Collector} implementing the cascaded group-by operation
+     * @return a concurrent, unordered {@code Collector} implementing the cascaded group-by operation
      *
      * @see #groupingByConcurrent(Function)
      * @see #groupingByConcurrent(Function, Collector)
@@ -1072,7 +1096,7 @@
     }
 
     /**
-     * Returns a {@code Collector} that accumulate elements into a
+     * Returns a {@code Collector} that accumulates elements into a
      * {@code Map} whose keys and values are the result of applying the provided
      * mapping functions to the input elements.
      *
@@ -1101,6 +1125,14 @@
      *                                         Functions.identity());
      * }</pre>
      *
+     * @implNote
+     * The returned {@code Collector} is not concurrent.  For parallel stream
+     * pipelines, the {@code combiner} function operates by merging the keys
+     * from one map into another, which can be an expensive operation.  If it is
+     * not required that results are inserted into the {@code Map} in encounter
+     * order, using {@link #toConcurrentMap(Function, Function)}
+     * may offer better parallel performance.
+     *
      * @param <T> the type of the input elements
      * @param <K> the output type of the key mapping function
      * @param <U> the output type of the value mapping function
@@ -1121,7 +1153,7 @@
     }
 
     /**
-     * Returns a {@code Collector} that accumulate elements into a
+     * Returns a {@code Collector} that accumulates elements into a
      * {@code Map} whose keys and values are the result of applying the provided
      * mapping functions to the input elements.
      *
@@ -1146,6 +1178,14 @@
      *                                       (s, a) -> s + ", " + a));
      * }</pre>
      *
+     * @implNote
+     * The returned {@code Collector} is not concurrent.  For parallel stream
+     * pipelines, the {@code combiner} function operates by merging the keys
+     * from one map into another, which can be an expensive operation.  If it is
+     * not required that results are merged into the {@code Map} in encounter
+     * order, using {@link #toConcurrentMap(Function, Function, BinaryOperator)}
+     * may offer better parallel performance.
+     *
      * @param <T> the type of the input elements
      * @param <K> the output type of the key mapping function
      * @param <U> the output type of the value mapping function
@@ -1172,7 +1212,7 @@
     }
 
     /**
-     * Returns a {@code Collector} that accumulate elements into a
+     * Returns a {@code Collector} that accumulates elements into a
      * {@code Map} whose keys and values are the result of applying the provided
      * mapping functions to the input elements.
      *
@@ -1182,6 +1222,14 @@
      * results are merged using the provided merging function.  The {@code Map}
      * is created by a provided supplier function.
      *
+     * @implNote
+     * The returned {@code Collector} is not concurrent.  For parallel stream
+     * pipelines, the {@code combiner} function operates by merging the keys
+     * from one map into another, which can be an expensive operation.  If it is
+     * not required that results are merged into the {@code Map} in encounter
+     * order, using {@link #toConcurrentMap(Function, Function, BinaryOperator, Supplier)}
+     * may offer better parallel performance.
+     *
      * @param <T> the type of the input elements
      * @param <K> the output type of the key mapping function
      * @param <U> the output type of the value mapping function
@@ -1215,7 +1263,7 @@
     }
 
     /**
-     * Returns a {@code Collector} that accumulate elements into a
+     * Returns a concurrent {@code Collector} that accumulates elements into a
      * {@code ConcurrentMap} whose keys and values are the result of applying
      * the provided mapping functions to the input elements.
      *
@@ -1252,7 +1300,7 @@
      * @param <U> the output type of the value mapping function
      * @param keyMapper the mapping function to produce keys
      * @param valueMapper the mapping function to produce values
-     * @return a concurrent {@code Collector} which collects elements into a
+     * @return a concurrent, unordered {@code Collector} which collects elements into a
      * {@code ConcurrentMap} whose keys are the result of applying a key mapping
      * function to the input elements, and whose values are the result of
      * applying a value mapping function to the input elements
@@ -1268,7 +1316,7 @@
     }
 
     /**
-     * Returns a {@code Collector} that accumulate elements into a
+     * Returns a concurrent {@code Collector} that accumulates elements into a
      * {@code ConcurrentMap} whose keys and values are the result of applying
      * the provided mapping functions to the input elements.
      *
@@ -1303,7 +1351,7 @@
      * @param mergeFunction a merge function, used to resolve collisions between
      *                      values associated with the same key, as supplied
      *                      to {@link Map#merge(Object, Object, BiFunction)}
-     * @return a concurrent {@code Collector} which collects elements into a
+     * @return a concurrent, unordered {@code Collector} which collects elements into a
      * {@code ConcurrentMap} whose keys are the result of applying a key mapping
      * function to the input elements, and whose values are the result of
      * applying a value mapping function to all input elements equal to the key
@@ -1322,7 +1370,7 @@
     }
 
     /**
-     * Returns a {@code Collector} that accumulate elements into a
+     * Returns a concurrent {@code Collector} that accumulates elements into a
      * {@code ConcurrentMap} whose keys and values are the result of applying
      * the provided mapping functions to the input elements.
      *
@@ -1345,7 +1393,7 @@
      *                      to {@link Map#merge(Object, Object, BiFunction)}
      * @param mapSupplier a function which returns a new, empty {@code Map} into
      *                    which the results will be inserted
-     * @return a concurrent {@code Collector} which collects elements into a
+     * @return a concurrent, unordered {@code Collector} which collects elements into a
      * {@code ConcurrentMap} whose keys are the result of applying a key mapping
      * function to the input elements, and whose values are the result of
      * applying a value mapping function to all input elements equal to the key
--- a/jdk/src/share/classes/java/util/stream/DistinctOps.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/DistinctOps.java	Mon Nov 11 16:20:48 2013 +0100
@@ -54,6 +54,16 @@
     static <T> ReferencePipeline<T, T> makeRef(AbstractPipeline<?, T, ?> upstream) {
         return new ReferencePipeline.StatefulOp<T, T>(upstream, StreamShape.REFERENCE,
                                                       StreamOpFlag.IS_DISTINCT | StreamOpFlag.NOT_SIZED) {
+
+            <P_IN> Node<T> reduce(PipelineHelper<T> helper, Spliterator<P_IN> spliterator) {
+                // If the stream is SORTED then it should also be ORDERED so the following will also
+                // preserve the sort order
+                TerminalOp<T, LinkedHashSet<T>> reduceOp
+                        = ReduceOps.<T, LinkedHashSet<T>>makeRef(LinkedHashSet::new, LinkedHashSet::add,
+                                                                 LinkedHashSet::addAll);
+                return Nodes.node(reduceOp.evaluateParallel(helper, spliterator));
+            }
+
             @Override
             <P_IN> Node<T> opEvaluateParallel(PipelineHelper<T> helper,
                                               Spliterator<P_IN> spliterator,
@@ -63,12 +73,7 @@
                     return helper.evaluate(spliterator, false, generator);
                 }
                 else if (StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) {
-                    // If the stream is SORTED then it should also be ORDERED so the following will also
-                    // preserve the sort order
-                    TerminalOp<T, LinkedHashSet<T>> reduceOp
-                            = ReduceOps.<T, LinkedHashSet<T>>makeRef(LinkedHashSet::new, LinkedHashSet::add,
-                                                                     LinkedHashSet::addAll);
-                    return Nodes.node(reduceOp.evaluateParallel(helper, spliterator));
+                    return reduce(helper, spliterator);
                 }
                 else {
                     // Holder of null state since ConcurrentHashMap does not support null values
@@ -95,6 +100,22 @@
             }
 
             @Override
+            <P_IN> Spliterator<T> opEvaluateParallelLazy(PipelineHelper<T> helper, Spliterator<P_IN> spliterator) {
+                if (StreamOpFlag.DISTINCT.isKnown(helper.getStreamAndOpFlags())) {
+                    // No-op
+                    return helper.wrapSpliterator(spliterator);
+                }
+                else if (StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) {
+                    // Not lazy, barrier required to preserve order
+                    return reduce(helper, spliterator).spliterator();
+                }
+                else {
+                    // Lazy
+                    return new StreamSpliterators.DistinctSpliterator<>(helper.wrapSpliterator(spliterator));
+                }
+            }
+
+            @Override
             Sink<T> opWrapSink(int flags, Sink<T> sink) {
                 Objects.requireNonNull(sink);
 
--- a/jdk/src/share/classes/java/util/stream/DoubleStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -50,9 +50,13 @@
 import java.util.function.Supplier;
 
 /**
- * A sequence of elements supporting sequential and parallel aggregate
- * operations.  The following example illustrates an aggregate operation using
- * {@link Stream} and {@link DoubleStream}:
+ * A sequence of primitive double-valued elements supporting sequential and parallel
+ * aggregate operations.  This is the {@code double} primitive specialization of
+ * {@link Stream}.
+ *
+ * <p>The following example illustrates an aggregate operation using
+ * {@link Stream} and {@link DoubleStream}, computing the sum of the weights of the
+ * red widgets:
  *
  * <pre>{@code
  *     double sum = widgets.stream()
@@ -61,78 +65,13 @@
  *                         .sum();
  * }</pre>
  *
- * In this example, {@code widgets} is a {@code Collection<Widget>}.  We create
- * a stream of {@code Widget} objects via {@link Collection#stream Collection.stream()},
- * filter it to produce a stream containing only the red widgets, and then
- * transform it into a stream of {@code double} values representing the weight of
- * each red widget. Then this stream is summed to produce a total weight.
- *
- * <p>To perform a computation, stream
- * <a href="package-summary.html#StreamOps">operations</a> are composed into a
- * <em>stream pipeline</em>.  A stream pipeline consists of a source (which
- * might be an array, a collection, a generator function, an IO channel,
- * etc), zero or more <em>intermediate operations</em> (which transform a
- * stream into another stream, such as {@link DoubleStream#filter(DoublePredicate)}), and a
- * <em>terminal operation</em> (which produces a result or side-effect, such
- * as {@link DoubleStream#sum()} or {@link DoubleStream#forEach(DoubleConsumer)}.
- * Streams are lazy; computation on the source data is only performed when the
- * terminal operation is initiated, and source elements are consumed only
- * as needed.
- *
- * <p>Collections and streams, while bearing some superficial similarities,
- * have different goals.  Collections are primarily concerned with the efficient
- * management of, and access to, their elements.  By contrast, streams do not
- * provide a means to directly access or manipulate their elements, and are
- * instead concerned with declaratively describing their source and the
- * computational operations which will be performed in aggregate on that source.
- * However, if the provided stream operations do not offer the desired
- * functionality, the {@link #iterator()} and {@link #spliterator()} operations
- * can be used to perform a controlled traversal.
- *
- * <p>A stream pipeline, like the "widgets" example above, can be viewed as
- * a <em>query</em> on the stream source.  Unless the source was explicitly
- * designed for concurrent modification (such as a {@link ConcurrentHashMap}),
- * unpredictable or erroneous behavior may result from modifying the stream
- * source while it is being queried.
- *
- * <p>Most stream operations accept parameters that describe user-specified
- * behavior, such as the lambda expression {@code w -> w.getWeight()} passed to
- * {@code mapToDouble} in the example above.  Such parameters are always instances
- * of a <a href="../function/package-summary.html">functional interface</a> such
- * as {@link java.util.function.Function}, and are often lambda expressions or
- * method references.  These parameters can never be null, should not modify the
- * stream source, and should be
- * <a href="package-summary.html#NonInterference">effectively stateless</a>
- * (their result should not depend on any state that might change during
- * execution of the stream pipeline.)
- *
- * <p>A stream should be operated on (invoking an intermediate or terminal stream
- * operation) only once.  This rules out, for example, "forked" streams, where
- * the same source feeds two or more pipelines, or multiple traversals of the
- * same stream.  A stream implementation may throw {@link IllegalStateException}
- * if it detects that the stream is being reused. However, since some stream
- * operations may return their receiver rather than a new stream object, it may
- * not be possible to detect reuse in all cases.
- *
- * <p>Streams have a {@link #close()} method and implement {@link AutoCloseable},
- * but nearly all stream instances do not actually need to be closed after use.
- * Generally, only streams whose source is an IO channel (such as those returned
- * by {@link Files#lines(Path, Charset)}) will require closing.  Most streams
- * are backed by collections, arrays, or generating functions, which require no
- * special resource management.  (If a stream does require closing, it can be
- * declared as a resource in a {@code try}-with-resources statement.)
- *
- * <p>Stream pipelines may execute either sequentially or in
- * <a href="package-summary.html#Parallelism">parallel</a>.  This
- * execution mode is a property of the stream.  Streams are created
- * with an initial choice of sequential or parallel execution.  (For example,
- * {@link Collection#stream() Collection.stream()} creates a sequential stream,
- * and {@link Collection#parallelStream() Collection.parallelStream()} creates
- * a parallel one.)  This choice of execution mode may be modified by the
- * {@link #sequential()} or {@link #parallel()} methods, and may be queried with
- * the {@link #isParallel()} method.
+ * See the class documentation for {@link Stream} and the package documentation
+ * for <a href="package-summary.html">java.util.stream</a> for additional
+ * specification of streams, stream operations, stream pipelines, and
+ * parallelism.
  *
  * @since 1.8
+ * @see Stream
  * @see <a href="package-summary.html">java.util.stream</a>
  */
 public interface DoubleStream extends BaseStream<Double, DoubleStream> {
@@ -144,9 +83,10 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">
-     *                  non-interfering, stateless</a> predicate to apply to
-     *                  each element to determine if it should be included
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to each element to determine if it
+     *                  should be included
      * @return the new stream
      */
     DoubleStream filter(DoublePredicate predicate);
@@ -158,9 +98,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to
-     *               each element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     DoubleStream map(DoubleUnaryOperator mapper);
@@ -173,9 +113,9 @@
      *     intermediate operation</a>.
      *
      * @param <U> the element type of the new stream
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     <U> Stream<U> mapToObj(DoubleFunction<? extends U> mapper);
@@ -187,9 +127,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     IntStream mapToInt(DoubleToIntFunction mapper);
@@ -201,9 +141,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     LongStream mapToLong(DoubleToLongFunction mapper);
@@ -218,10 +158,10 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to
-     *               each element which produces an {@code DoubleStream} of new
-     *               values
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element which produces a
+     *               {@code DoubleStream} of new values
      * @return the new stream
      * @see Stream#flatMap(Function)
      */
@@ -276,8 +216,8 @@
      * }</pre>
      *
      * @param action a <a href="package-summary.html#NonInterference">
-     *                 non-interfering</a> action to perform on the elements as
-     *                 they are consumed from the stream
+     *               non-interfering</a> action to perform on the elements as
+     *               they are consumed from the stream
      * @return the new stream
      */
     DoubleStream peek(DoubleConsumer action);
@@ -423,9 +363,10 @@
      * synchronization and with greatly reduced risk of data races.
      *
      * @param identity the identity value for the accumulating function
-     * @param op an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for combining two values
+     * @param op an <a href="package-summary.html#Associativity">associative</a>,
+     *           <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *           <a href="package-summary.html#Statelessness">stateless</a>
+     *           function for combining two values
      * @return the result of the reduction
      * @see #sum()
      * @see #min()
@@ -462,9 +403,10 @@
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
-     * @param op an <a href="package-summary.html#Associativity">associative</a>
-     *           <a href="package-summary.html#NonInterference">non-interfering,
-     *           stateless</a> function for combining two values
+     * @param op an <a href="package-summary.html#Associativity">associative</a>,
+     *           <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *           <a href="package-summary.html#Statelessness">stateless</a>
+     *           function for combining two values
      * @return the result of the reduction
      * @see #reduce(double, DoubleBinaryOperator)
      */
@@ -495,14 +437,15 @@
      * @param supplier a function that creates a new result container. For a
      *                 parallel execution, this function may be called
      *                 multiple times and must return a fresh value each time.
-     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for incorporating an additional
-     *                    element into a result
-     * @param combiner an <a href="package-summary.html#Associativity">associative</a>
-     *                 <a href="package-summary.html#NonInterference">non-interfering,
-     *                 stateless</a> function for combining two values, which
-     *                 must be compatible with the accumulator function
+     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for incorporating an additional element into a result
+     * @param combiner an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for combining two values, which must be
+     *                    compatible with the accumulator function
      * @return the result of the reduction
      * @see Stream#collect(Supplier, BiConsumer, BiConsumer)
      */
@@ -544,8 +487,8 @@
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
-     * @apiNote Sorting values by increasing absolute magnitude tends to yield
-     * more accurate results.
+     * @apiNote Elements sorted by increasing absolute magnitude tend
+     * to yield more accurate results.
      *
      * @return the sum of elements in this stream
      */
@@ -651,48 +594,67 @@
     /**
      * Returns whether any elements of this stream match the provided
      * predicate.  May not evaluate the predicate on all elements if not
-     * necessary for determining the result.
+     * necessary for determining the result.  If the stream is empty then
+     * {@code false} is returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
+     * @apiNote
+     * This method evaluates the <em>existential quantification</em> of the
+     * predicate over the elements of the stream (for some x P(x)).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
      * @return {@code true} if any elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * predicate, otherwise {@code false}
      */
     boolean anyMatch(DoublePredicate predicate);
 
     /**
      * Returns whether all elements of this stream match the provided predicate.
      * May not evaluate the predicate on all elements if not necessary for
-     * determining the result.
+     * determining the result.  If the stream is empty then {@code true} is
+     * returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
-     * @return {@code true} if all elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * @apiNote
+     * This method evaluates the <em>universal quantification</em> of the
+     * predicate over the elements of the stream (for all x P(x)).  If the
+     * stream is empty, the quantification is said to be <em>vacuously
+     * satisfied</em> and is always {@code true} (regardless of P(x)).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
+     * @return {@code true} if either all elements of the stream match the
+     * provided predicate or the stream is empty, otherwise {@code false}
      */
     boolean allMatch(DoublePredicate predicate);
 
     /**
      * Returns whether no elements of this stream match the provided predicate.
      * May not evaluate the predicate on all elements if not necessary for
-     * determining the result.
+     * determining the result.  If the stream is empty then {@code true} is
+     * returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
-     * @return {@code true} if no elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * @apiNote
+     * This method evaluates the <em>universal quantification</em> of the
+     * negated predicate over the elements of the stream (for all x ~P(x)).  If
+     * the stream is empty, the quantification is said to be vacuously satisfied
+     * and is always {@code true}, regardless of P(x).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
+     * @return {@code true} if either no elements of the stream match the
+     * provided predicate or the stream is empty, otherwise {@code false}
      */
     boolean noneMatch(DoublePredicate predicate);
 
@@ -832,12 +794,12 @@
     }
 
     /**
-     * Returns a sequential stream where each element is generated by
-     * the provided {@code DoubleSupplier}.  This is suitable for generating
-     * constant streams, streams of random elements, etc.
+     * Returns an infinite sequential unordered stream where each element is
+     * generated by the provided {@code DoubleSupplier}.  This is suitable for
+     * generating constant streams, streams of random elements, etc.
      *
      * @param s the {@code DoubleSupplier} for generated elements
-     * @return a new sequential {@code DoubleStream}
+     * @return a new infinite sequential unordered {@code DoubleStream}
      */
     public static DoubleStream generate(DoubleSupplier s) {
         Objects.requireNonNull(s);
@@ -848,11 +810,16 @@
     /**
      * Creates a lazily concatenated stream whose elements are all the
      * elements of the first stream followed by all the elements of the
-     * second stream. The resulting stream is ordered if both
+     * second stream.  The resulting stream is ordered if both
      * of the input streams are ordered, and parallel if either of the input
      * streams is parallel.  When the resulting stream is closed, the close
      * handlers for both input streams are invoked.
      *
+     * @implNote
+     * Use caution when constructing streams from repeated concatenation.
+     * Accessing an element of a deeply concatenated stream can result in deep
+     * call chains, or even {@code StackOverflowException}.
+     *
      * @param a the first stream
      * @param b the second stream
      * @return the concatenation of the two input streams
--- a/jdk/src/share/classes/java/util/stream/IntStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/IntStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -24,11 +24,7 @@
  */
 package java.util.stream;
 
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Path;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.IntSummaryStatistics;
 import java.util.Objects;
 import java.util.OptionalDouble;
@@ -36,7 +32,6 @@
 import java.util.PrimitiveIterator;
 import java.util.Spliterator;
 import java.util.Spliterators;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.BiConsumer;
 import java.util.function.Function;
 import java.util.function.IntBinaryOperator;
@@ -51,9 +46,13 @@
 import java.util.function.Supplier;
 
 /**
- * A sequence of elements supporting sequential and parallel aggregate
- * operations.  The following example illustrates an aggregate operation using
- * {@link Stream} and {@link IntStream}:
+ * A sequence of primitive int-valued elements supporting sequential and parallel
+ * aggregate operations.  This is the {@code int} primitive specialization of
+ * {@link Stream}.
+ *
+ * <p>The following example illustrates an aggregate operation using
+ * {@link Stream} and {@link IntStream}, computing the sum of the weights of the
+ * red widgets:
  *
  * <pre>{@code
  *     int sum = widgets.stream()
@@ -62,78 +61,13 @@
  *                      .sum();
  * }</pre>
  *
- * In this example, {@code widgets} is a {@code Collection<Widget>}.  We create
- * a stream of {@code Widget} objects via {@link Collection#stream Collection.stream()},
- * filter it to produce a stream containing only the red widgets, and then
- * transform it into a stream of {@code int} values representing the weight of
- * each red widget. Then this stream is summed to produce a total weight.
- *
- * <p>To perform a computation, stream
- * <a href="package-summary.html#StreamOps">operations</a> are composed into a
- * <em>stream pipeline</em>.  A stream pipeline consists of a source (which
- * might be an array, a collection, a generator function, an IO channel,
- * etc), zero or more <em>intermediate operations</em> (which transform a
- * stream into another stream, such as {@link IntStream#filter(IntPredicate)}), and a
- * <em>terminal operation</em> (which produces a result or side-effect, such
- * as {@link IntStream#sum()} or {@link IntStream#forEach(IntConsumer)}).
- * Streams are lazy; computation on the source data is only performed when the
- * terminal operation is initiated, and source elements are consumed only
- * as needed.
- *
- * <p>Collections and streams, while bearing some superficial similarities,
- * have different goals.  Collections are primarily concerned with the efficient
- * management of, and access to, their elements.  By contrast, streams do not
- * provide a means to directly access or manipulate their elements, and are
- * instead concerned with declaratively describing their source and the
- * computational operations which will be performed in aggregate on that source.
- * However, if the provided stream operations do not offer the desired
- * functionality, the {@link #iterator()} and {@link #spliterator()} operations
- * can be used to perform a controlled traversal.
- *
- * <p>A stream pipeline, like the "widgets" example above, can be viewed as
- * a <em>query</em> on the stream source.  Unless the source was explicitly
- * designed for concurrent modification (such as a {@link ConcurrentHashMap}),
- * unpredictable or erroneous behavior may result from modifying the stream
- * source while it is being queried.
- *
- * <p>Most stream operations accept parameters that describe user-specified
- * behavior, such as the lambda expression {@code w -> w.getWeight()} passed to
- * {@code mapToInt} in the example above.  Such parameters are always instances
- * of a <a href="../function/package-summary.html">functional interface</a> such
- * as {@link java.util.function.Function}, and are often lambda expressions or
- * method references.  These parameters can never be null, should not modify the
- * stream source, and should be
- * <a href="package-summary.html#NonInterference">effectively stateless</a>
- * (their result should not depend on any state that might change during
- * execution of the stream pipeline.)
- *
- * <p>A stream should be operated on (invoking an intermediate or terminal stream
- * operation) only once.  This rules out, for example, "forked" streams, where
- * the same source feeds two or more pipelines, or multiple traversals of the
- * same stream.  A stream implementation may throw {@link IllegalStateException}
- * if it detects that the stream is being reused. However, since some stream
- * operations may return their receiver rather than a new stream object, it may
- * not be possible to detect reuse in all cases.
- *
- * <p>Streams have a {@link #close()} method and implement {@link AutoCloseable},
- * but nearly all stream instances do not actually need to be closed after use.
- * Generally, only streams whose source is an IO channel (such as those returned
- * by {@link Files#lines(Path, Charset)}) will require closing.  Most streams
- * are backed by collections, arrays, or generating functions, which require no
- * special resource management.  (If a stream does require closing, it can be
- * declared as a resource in a {@code try}-with-resources statement.)
- *
- * <p>Stream pipelines may execute either sequentially or in
- * <a href="package-summary.html#Parallelism">parallel</a>.  This
- * execution mode is a property of the stream.  Streams are created
- * with an initial choice of sequential or parallel execution.  (For example,
- * {@link Collection#stream() Collection.stream()} creates a sequential stream,
- * and {@link Collection#parallelStream() Collection.parallelStream()} creates
- * a parallel one.)  This choice of execution mode may be modified by the
- * {@link #sequential()} or {@link #parallel()} methods, and may be queried with
- * the {@link #isParallel()} method.
+ * See the class documentation for {@link Stream} and the package documentation
+ * for <a href="package-summary.html">java.util.stream</a> for additional
+ * specification of streams, stream operations, stream pipelines, and
+ * parallelism.
  *
  * @since 1.8
+ * @see Stream
  * @see <a href="package-summary.html">java.util.stream</a>
  */
 public interface IntStream extends BaseStream<Integer, IntStream> {
@@ -145,9 +79,10 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">
-     *                  non-interfering, stateless</a> predicate to apply to
-     *                  each element to determine if it should be included
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to each element to determine if it
+     *                  should be included
      * @return the new stream
      */
     IntStream filter(IntPredicate predicate);
@@ -159,9 +94,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     IntStream map(IntUnaryOperator mapper);
@@ -174,9 +109,9 @@
      *     intermediate operation</a>.
      *
      * @param <U> the element type of the new stream
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     <U> Stream<U> mapToObj(IntFunction<? extends U> mapper);
@@ -188,9 +123,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     LongStream mapToLong(IntToLongFunction mapper);
@@ -202,9 +137,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     DoubleStream mapToDouble(IntToDoubleFunction mapper);
@@ -219,10 +154,10 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to
-     *               each element which produces an {@code IntStream} of new
-     *               values
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element which produces an
+     *               {@code IntStream} of new values
      * @return the new stream
      * @see Stream#flatMap(Function)
      */
@@ -421,9 +356,10 @@
      * synchronization and with greatly reduced risk of data races.
      *
      * @param identity the identity value for the accumulating function
-     * @param op an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for combining two values
+     * @param op an <a href="package-summary.html#Associativity">associative</a>,
+     *           <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *           <a href="package-summary.html#Statelessness">stateless</a>
+     *           function for combining two values
      * @return the result of the reduction
      * @see #sum()
      * @see #min()
@@ -460,9 +396,10 @@
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
-     * @param op an <a href="package-summary.html#Associativity">associative</a>
-     *           <a href="package-summary.html#NonInterference">non-interfering,
-     *           stateless</a> function for combining two values
+     * @param op an <a href="package-summary.html#Associativity">associative</a>,
+     *           <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *           <a href="package-summary.html#Statelessness">stateless</a>
+     *           function for combining two values
      * @return the result of the reduction
      * @see #reduce(int, IntBinaryOperator)
      */
@@ -492,14 +429,15 @@
      * @param supplier a function that creates a new result container. For a
      *                 parallel execution, this function may be called
      *                 multiple times and must return a fresh value each time.
-     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for incorporating an additional
-     *                    element into a result
-     * @param combiner an <a href="package-summary.html#Associativity">associative</a>
-     *                 <a href="package-summary.html#NonInterference">non-interfering,
-     *                 stateless</a> function for combining two values, which
-     *                 must be compatible with the accumulator function
+     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for incorporating an additional element into a result
+     * @param combiner an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for combining two values, which must be
+     *                    compatible with the accumulator function
      * @return the result of the reduction
      * @see Stream#collect(Supplier, BiConsumer, BiConsumer)
      */
@@ -599,48 +537,67 @@
     /**
      * Returns whether any elements of this stream match the provided
      * predicate.  May not evaluate the predicate on all elements if not
-     * necessary for determining the result.
+     * necessary for determining the result.  If the stream is empty then
+     * {@code false} is returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
+     * @apiNote
+     * This method evaluates the <em>existential quantification</em> of the
+     * predicate over the elements of the stream (for some x P(x)).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
      * @return {@code true} if any elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * predicate, otherwise {@code false}
      */
     boolean anyMatch(IntPredicate predicate);
 
     /**
      * Returns whether all elements of this stream match the provided predicate.
      * May not evaluate the predicate on all elements if not necessary for
-     * determining the result.
+     * determining the result.  If the stream is empty then {@code true} is
+     * returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
-     * @return {@code true} if all elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * @apiNote
+     * This method evaluates the <em>universal quantification</em> of the
+     * predicate over the elements of the stream (for all x P(x)).  If the
+     * stream is empty, the quantification is said to be <em>vacuously
+     * satisfied</em> and is always {@code true} (regardless of P(x)).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
+     * @return {@code true} if either all elements of the stream match the
+     * provided predicate or the stream is empty, otherwise {@code false}
      */
     boolean allMatch(IntPredicate predicate);
 
     /**
      * Returns whether no elements of this stream match the provided predicate.
      * May not evaluate the predicate on all elements if not necessary for
-     * determining the result.
+     * determining the result.  If the stream is empty then {@code true} is
+     * returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
-     * @return {@code true} if no elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * @apiNote
+     * This method evaluates the <em>universal quantification</em> of the
+     * negated predicate over the elements of the stream (for all x ~P(x)).  If
+     * the stream is empty, the quantification is said to be vacuously satisfied
+     * and is always {@code true}, regardless of P(x).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
+     * @return {@code true} if either no elements of the stream match the
+     * provided predicate or the stream is empty, otherwise {@code false}
      */
     boolean noneMatch(IntPredicate predicate);
 
@@ -803,12 +760,12 @@
     }
 
     /**
-     * Returns a sequential stream where each element is generated by
-     * the provided {@code IntSupplier}.  This is suitable for generating
-     * constant streams, streams of random elements, etc.
+     * Returns an infinite sequential unordered stream where each element is
+     * generated by the provided {@code IntSupplier}.  This is suitable for
+     * generating constant streams, streams of random elements, etc.
      *
      * @param s the {@code IntSupplier} for generated elements
-     * @return a new sequential {@code IntStream}
+     * @return a new infinite sequential unordered {@code IntStream}
      */
     public static IntStream generate(IntSupplier s) {
         Objects.requireNonNull(s);
@@ -871,11 +828,16 @@
     /**
      * Creates a lazily concatenated stream whose elements are all the
      * elements of the first stream followed by all the elements of the
-     * second stream. The resulting stream is ordered if both
+     * second stream.  The resulting stream is ordered if both
      * of the input streams are ordered, and parallel if either of the input
      * streams is parallel.  When the resulting stream is closed, the close
      * handlers for both input streams are invoked.
      *
+     * @implNote
+     * Use caution when constructing streams from repeated concatenation.
+     * Accessing an element of a deeply concatenated stream can result in deep
+     * call chains, or even {@code StackOverflowException}.
+     *
      * @param a the first stream
      * @param b the second stream
      * @return the concatenation of the two input streams
--- a/jdk/src/share/classes/java/util/stream/LongStream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/LongStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -51,9 +51,13 @@
 import java.util.function.Supplier;
 
 /**
- * A sequence of elements supporting sequential and parallel aggregate
- * operations.  The following example illustrates an aggregate operation using
- * {@link Stream} and {@link LongStream}:
+ * A sequence of primitive long-valued elements supporting sequential and parallel
+ * aggregate operations.  This is the {@code long} primitive specialization of
+ * {@link Stream}.
+ *
+ * <p>The following example illustrates an aggregate operation using
+ * {@link Stream} and {@link LongStream}, computing the sum of the weights of the
+ * red widgets:
  *
  * <pre>{@code
  *     long sum = widgets.stream()
@@ -62,78 +66,13 @@
  *                       .sum();
  * }</pre>
  *
- * In this example, {@code widgets} is a {@code Collection<Widget>}.  We create
- * a stream of {@code Widget} objects via {@link Collection#stream Collection.stream()},
- * filter it to produce a stream containing only the red widgets, and then
- * transform it into a stream of {@code long} values representing the weight of
- * each red widget. Then this stream is summed to produce a total weight.
- *
- * <p>To perform a computation, stream
- * <a href="package-summary.html#StreamOps">operations</a> are composed into a
- * <em>stream pipeline</em>.  A stream pipeline consists of a source (which
- * might be an array, a collection, a generator function, an IO channel,
- * etc), zero or more <em>intermediate operations</em> (which transform a
- * stream into another stream, such as {@link LongStream#filter(LongPredicate)}), and a
- * <em>terminal operation</em> (which produces a result or side-effect, such
- * as {@link LongStream#sum()} or {@link LongStream#forEach(LongConsumer)}).
- * Streams are lazy; computation on the source data is only performed when the
- * terminal operation is initiated, and source elements are consumed only
- * as needed.
- *
- * <p>Collections and streams, while bearing some superficial similarities,
- * have different goals.  Collections are primarily concerned with the efficient
- * management of, and access to, their elements.  By contrast, streams do not
- * provide a means to directly access or manipulate their elements, and are
- * instead concerned with declaratively describing their source and the
- * computational operations which will be performed in aggregate on that source.
- * However, if the provided stream operations do not offer the desired
- * functionality, the {@link #iterator()} and {@link #spliterator()} operations
- * can be used to perform a controlled traversal.
- *
- * <p>A stream pipeline, like the "widgets" example above, can be viewed as
- * a <em>query</em> on the stream source.  Unless the source was explicitly
- * designed for concurrent modification (such as a {@link ConcurrentHashMap}),
- * unpredictable or erroneous behavior may result from modifying the stream
- * source while it is being queried.
- *
- * <p>Most stream operations accept parameters that describe user-specified
- * behavior, such as the lambda expression {@code w -> w.getWeight()} passed to
- * {@code mapToLong} in the example above.  Such parameters are always instances
- * of a <a href="../function/package-summary.html">functional interface</a> such
- * as {@link java.util.function.Function}, and are often lambda expressions or
- * method references.  These parameters can never be null, should not modify the
- * stream source, and should be
- * <a href="package-summary.html#NonInterference">effectively stateless</a>
- * (their result should not depend on any state that might change during
- * execution of the stream pipeline.)
- *
- * <p>A stream should be operated on (invoking an intermediate or terminal stream
- * operation) only once.  This rules out, for example, "forked" streams, where
- * the same source feeds two or more pipelines, or multiple traversals of the
- * same stream.  A stream implementation may throw {@link IllegalStateException}
- * if it detects that the stream is being reused. However, since some stream
- * operations may return their receiver rather than a new stream object, it may
- * not be possible to detect reuse in all cases.
- *
- * <p>Streams have a {@link #close()} method and implement {@link AutoCloseable},
- * but nearly all stream instances do not actually need to be closed after use.
- * Generally, only streams whose source is an IO channel (such as those returned
- * by {@link Files#lines(Path, Charset)}) will require closing.  Most streams
- * are backed by collections, arrays, or generating functions, which require no
- * special resource management.  (If a stream does require closing, it can be
- * declared as a resource in a {@code try}-with-resources statement.)
- *
- * <p>Stream pipelines may execute either sequentially or in
- * <a href="package-summary.html#Parallelism">parallel</a>.  This
- * execution mode is a property of the stream.  Streams are created
- * with an initial choice of sequential or parallel execution.  (For example,
- * {@link Collection#stream() Collection.stream()} creates a sequential stream,
- * and {@link Collection#parallelStream() Collection.parallelStream()} creates
- * a parallel one.)  This choice of execution mode may be modified by the
- * {@link #sequential()} or {@link #parallel()} methods, and may be queried with
- * the {@link #isParallel()} method.
+ * See the class documentation for {@link Stream} and the package documentation
+ * for <a href="package-summary.html">java.util.stream</a> for additional
+ * specification of streams, stream operations, stream pipelines, and
+ * parallelism.
  *
  * @since 1.8
+ * @see Stream
  * @see <a href="package-summary.html">java.util.stream</a>
  */
 public interface LongStream extends BaseStream<Long, LongStream> {
@@ -145,9 +84,10 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">
-     *                  non-interfering, stateless</a> predicate to apply to
-     *                  each element to determine if it should be included
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to each element to determine if it
+     *                  should be included
      * @return the new stream
      */
     LongStream filter(LongPredicate predicate);
@@ -159,9 +99,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     LongStream map(LongUnaryOperator mapper);
@@ -174,9 +114,9 @@
      *     intermediate operation</a>.
      *
      * @param <U> the element type of the new stream
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     <U> Stream<U> mapToObj(LongFunction<? extends U> mapper);
@@ -188,9 +128,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     IntStream mapToInt(LongToIntFunction mapper);
@@ -202,9 +142,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     DoubleStream mapToDouble(LongToDoubleFunction mapper);
@@ -219,10 +159,10 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to
-     *               each element which produces an {@code LongStream} of new
-     *               values
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element which produces a
+     *               {@code LongStream} of new values
      * @return the new stream
      * @see Stream#flatMap(Function)
      */
@@ -421,9 +361,10 @@
      * synchronization and with greatly reduced risk of data races.
      *
      * @param identity the identity value for the accumulating function
-     * @param op an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for combining two values
+     * @param op an <a href="package-summary.html#Associativity">associative</a>,
+     *           <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *           <a href="package-summary.html#Statelessness">stateless</a>
+     *           function for combining two values
      * @return the result of the reduction
      * @see #sum()
      * @see #min()
@@ -460,9 +401,10 @@
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
-     * @param op an <a href="package-summary.html#Associativity">associative</a>
-     *           <a href="package-summary.html#NonInterference">non-interfering,
-     *           stateless</a> function for combining two values
+     * @param op an <a href="package-summary.html#Associativity">associative</a>,
+     *           <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *           <a href="package-summary.html#Statelessness">stateless</a>
+     *           function for combining two values
      * @return the result of the reduction
      * @see #reduce(long, LongBinaryOperator)
      */
@@ -492,14 +434,15 @@
      * @param supplier a function that creates a new result container. For a
      *                 parallel execution, this function may be called
      *                 multiple times and must return a fresh value each time.
-     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for incorporating an additional
-     *                    element into a result
-     * @param combiner an <a href="package-summary.html#Associativity">associative</a>
-     *                 <a href="package-summary.html#NonInterference">non-interfering,
-     *                 stateless</a> function for combining two values, which
-     *                 must be compatible with the accumulator function
+     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for incorporating an additional element into a result
+     * @param combiner an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for combining two values, which must be
+     *                    compatible with the accumulator function
      * @return the result of the reduction
      * @see Stream#collect(Supplier, BiConsumer, BiConsumer)
      */
@@ -599,48 +542,67 @@
     /**
      * Returns whether any elements of this stream match the provided
      * predicate.  May not evaluate the predicate on all elements if not
-     * necessary for determining the result.
+     * necessary for determining the result.  If the stream is empty then
+     * {@code false} is returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
+     * @apiNote
+     * This method evaluates the <em>existential quantification</em> of the
+     * predicate over the elements of the stream (for some x P(x)).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
      * @return {@code true} if any elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * predicate, otherwise {@code false}
      */
     boolean anyMatch(LongPredicate predicate);
 
     /**
      * Returns whether all elements of this stream match the provided predicate.
      * May not evaluate the predicate on all elements if not necessary for
-     * determining the result.
+     * determining the result.  If the stream is empty then {@code true} is
+     * returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
-     * @return {@code true} if all elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * @apiNote
+     * This method evaluates the <em>universal quantification</em> of the
+     * predicate over the elements of the stream (for all x P(x)).  If the
+     * stream is empty, the quantification is said to be <em>vacuously
+     * satisfied</em> and is always {@code true} (regardless of P(x)).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
+     * @return {@code true} if either all elements of the stream match the
+     * provided predicate or the stream is empty, otherwise {@code false}
      */
     boolean allMatch(LongPredicate predicate);
 
     /**
-     * Returns whether no elements of this stream match the provided  predicate.
+     * Returns whether no elements of this stream match the provided predicate.
      * May not evaluate the predicate on all elements if not necessary for
-     * determining the result.
+     * determining the result.  If the stream is empty then {@code true} is
+     * returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
-     * @return {@code true} if no elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * @apiNote
+     * This method evaluates the <em>universal quantification</em> of the
+     * negated predicate over the elements of the stream (for all x ~P(x)).  If
+     * the stream is empty, the quantification is said to be vacuously satisfied
+     * and is always {@code true}, regardless of P(x).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
+     * @return {@code true} if either no elements of the stream match the
+     * provided predicate or the stream is empty, otherwise {@code false}
      */
     boolean noneMatch(LongPredicate predicate);
 
@@ -791,12 +753,12 @@
     }
 
     /**
-     * Returns a sequential stream where each element is generated by
-     * the provided {@code LongSupplier}.  This is suitable for generating
-     * constant streams, streams of random elements, etc.
+     * Returns an infinite sequential unordered stream where each element is
+     * generated by the provided {@code LongSupplier}.  This is suitable for
+     * generating constant streams, streams of random elements, etc.
      *
      * @param s the {@code LongSupplier} for generated elements
-     * @return a new sequential {@code LongStream}
+     * @return a new infinite sequential unordered {@code LongStream}
      */
     public static LongStream generate(LongSupplier s) {
         Objects.requireNonNull(s);
@@ -874,11 +836,16 @@
     /**
      * Creates a lazily concatenated stream whose elements are all the
      * elements of the first stream followed by all the elements of the
-     * second stream. The resulting stream is ordered if both
+     * second stream.  The resulting stream is ordered if both
      * of the input streams are ordered, and parallel if either of the input
      * streams is parallel.  When the resulting stream is closed, the close
      * handlers for both input streams are invoked.
      *
+     * @implNote
+     * Use caution when constructing streams from repeated concatenation.
+     * Accessing an element of a deeply concatenated stream can result in deep
+     * call chains, or even {@code StackOverflowException}.
+     *
      * @param a the first stream
      * @param b the second stream
      * @return the concatenation of the two input streams
--- a/jdk/src/share/classes/java/util/stream/Node.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/Node.java	Mon Nov 11 16:20:48 2013 +0100
@@ -241,6 +241,7 @@
          * @param action a consumer that is to be invoked with each
          *        element in this {@code Node.OfPrimitive}
          */
+        @SuppressWarnings("overloads")
         void forEach(T_CONS action);
 
         @Override
--- a/jdk/src/share/classes/java/util/stream/SpinedBuffer.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/SpinedBuffer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -579,6 +579,7 @@
             spineIndex = 0;
         }
 
+        @SuppressWarnings("overloads")
         public void forEach(T_CONS consumer) {
             // completed chunks, if any
             for (int j = 0; j < spineIndex; j++)
--- a/jdk/src/share/classes/java/util/stream/Stream.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/Stream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -67,6 +67,11 @@
  * transform it into a stream of {@code int} values representing the weight of
  * each red widget. Then this stream is summed to produce a total weight.
  *
+ * <p>In addition to {@code Stream}, which is a stream of object references,
+ * there are primitive specializations for {@link IntStream}, {@link LongStream},
+ * and {@link DoubleStream}, all of which are referred to as "streams" and
+ * conform to the characteristics and restrictions described here.
+ *
  * <p>To perform a computation, stream
  * <a href="package-summary.html#StreamOps">operations</a> are composed into a
  * <em>stream pipeline</em>.  A stream pipeline consists of a source (which
@@ -97,14 +102,21 @@
  *
  * <p>Most stream operations accept parameters that describe user-specified
  * behavior, such as the lambda expression {@code w -> w.getWeight()} passed to
- * {@code mapToInt} in the example above.  Such parameters are always instances
- * of a <a href="../function/package-summary.html">functional interface</a> such
+ * {@code mapToInt} in the example above.  To preserve correct behavior,
+ * these <em>behavioral parameters</em>:
+ * <ul>
+ * <li>must be <a href="package-summary.html#NonInterference">non-interfering</a>
+ * (they do not modify the stream source); and</li>
+ * <li>in most cases must be <a href="package-summary.html#Statelessness">stateless</a>
+ * (their result should not depend on any state that might change during execution
+ * of the stream pipeline).</li>
+ * </ul>
+ *
+ * <p>Such parameters are always instances of a
+ * <a href="../function/package-summary.html">functional interface</a> such
  * as {@link java.util.function.Function}, and are often lambda expressions or
- * method references.  These parameters can never be null, should not modify the
- * stream source, and should be
- * <a href="package-summary.html#NonInterference">effectively stateless</a>
- * (their result should not depend on any state that might change during
- * execution of the stream pipeline.)
+ * method references.  Unless otherwise specified these parameters must be
+ * <em>non-null</em>.
  *
  * <p>A stream should be operated on (invoking an intermediate or terminal stream
  * operation) only once.  This rules out, for example, "forked" streams, where
@@ -134,6 +146,9 @@
  *
  * @param <T> the type of the stream elements
  * @since 1.8
+ * @see IntStream
+ * @see LongStream
+ * @see DoubleStream
  * @see <a href="package-summary.html">java.util.stream</a>
  */
 public interface Stream<T> extends BaseStream<T, Stream<T>> {
@@ -145,9 +160,10 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">
-     *                  non-interfering, stateless</a> predicate to apply to
-     *                  each element to determine if it should be included
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to each element to determine if it
+     *                  should be included
      * @return the new stream
      */
     Stream<T> filter(Predicate<? super T> predicate);
@@ -160,9 +176,9 @@
      * operation</a>.
      *
      * @param <R> The element type of the new stream
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     <R> Stream<R> map(Function<? super T, ? extends R> mapper);
@@ -174,9 +190,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">
      *     intermediate operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     IntStream mapToInt(ToIntFunction<? super T> mapper);
@@ -188,9 +204,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     LongStream mapToLong(ToLongFunction<? super T> mapper);
@@ -202,9 +218,9 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element
      * @return the new stream
      */
     DoubleStream mapToDouble(ToDoubleFunction<? super T> mapper);
@@ -221,19 +237,33 @@
      *
      * @apiNote
      * The {@code flatMap()} operation has the effect of applying a one-to-many
-     * tranformation to the elements of the stream, and then flattening the
-     * resulting elements into a new stream. For example, if {@code orders}
-     * is a stream of purchase orders, and each purchase order contains a
-     * collection of line items, then the following produces a stream of line
-     * items:
+     * transformation to the elements of the stream, and then flattening the
+     * resulting elements into a new stream.
+     *
+     * <p><b>Examples.</b>
+     *
+     * <p>If {@code orders} is a stream of purchase orders, and each purchase
+     * order contains a collection of line items, then the following produces a
+     * stream containing all the line items in all the orders:
      * <pre>{@code
-     *     orderStream.flatMap(order -> order.getLineItems().stream())...
+     *     orders.flatMap(order -> order.getLineItems().stream())...
      * }</pre>
      *
+     * <p>If {@code path} is the path to a file, then the following produces a
+     * stream of the {@code words} contained in that file:
+     * <pre>{@code
+     *     Stream<String> lines = Files.lines(path, StandardCharsets.UTF_8);
+     *     Stream<String> words = lines.flatMap(line -> Stream.of(line.split(" +")));
+     * }</pre>
+     * The {@code mapper} function passed to {@code flatMap} splits a line,
+     * using a simple regular expression, into an array of words, and then
+     * creates a stream of words from that array.
+     *
      * @param <R> The element type of the new stream
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element which produces a stream of new values
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element which produces a stream
+     *               of new values
      * @return the new stream
      */
     <R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends R>> mapper);
@@ -248,10 +278,12 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element which produces a stream of new values
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element which produces a stream
+     *               of new values
      * @return the new stream
+     * @see #flatMap(Function)
      */
     IntStream flatMapToInt(Function<? super T, ? extends IntStream> mapper);
 
@@ -265,10 +297,12 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to
-     *               each element which produces a stream of new values
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element which produces a stream
+     *               of new values
      * @return the new stream
+     * @see #flatMap(Function)
      */
     LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper);
 
@@ -282,10 +316,12 @@
      * <p>This is an <a href="package-summary.html#StreamOps">intermediate
      * operation</a>.
      *
-     * @param mapper a <a href="package-summary.html#NonInterference">
-     *               non-interfering, stateless</a> function to apply to each
-     *               element which produces a stream of new values
+     * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *               <a href="package-summary.html#Statelessness">stateless</a>
+     *               function to apply to each element which produces a stream
+     *               of new values
      * @return the new stream
+     * @see #flatMap(Function)
      */
     DoubleStream flatMapToDouble(Function<? super T, ? extends DoubleStream> mapper);
 
@@ -293,9 +329,27 @@
      * Returns a stream consisting of the distinct elements (according to
      * {@link Object#equals(Object)}) of this stream.
      *
+     * <p>For ordered streams, the selection of distinct elements is stable
+     * (for duplicated elements, the element appearing first in the encounter
+     * order is preserved.)  For unordered streams, no stability guarantees
+     * are made.
+     *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
+     * @apiNote
+     * Preserving stability for {@code distinct()} in parallel pipelines is
+     * relatively expensive (requires that the operation act as a full barrier,
+     * with substantial buffering overhead), and stability is often not needed.
+     * Using an unordered stream source (such as {@link #generate(Supplier)})
+     * or removing the ordering constraint with {@link #unordered()} may result
+     * in significantly more efficient execution for {@code distinct()} in parallel
+     * pipelines, if the semantics of your situation permit.  If consistency
+     * with encounter order is required, and you are experiencing poor performance
+     * or memory utilization with {@code distinct()} in parallel pipelines,
+     * switching to sequential execution with {@link #sequential()} may improve
+     * performance.
+     *
      * @return the new stream
      */
     Stream<T> distinct();
@@ -306,6 +360,9 @@
      * {@code Comparable}, a {@code java.lang.ClassCastException} may be thrown
      * when the terminal operation is executed.
      *
+     * <p>For ordered streams, the sort is stable.  For unordered streams, no
+     * stability guarantees are made.
+     *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
@@ -317,12 +374,15 @@
      * Returns a stream consisting of the elements of this stream, sorted
      * according to the provided {@code Comparator}.
      *
+     * <p>For ordered streams, the sort is stable.  For unordered streams, no
+     * stability guarantees are made.
+     *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
-     * @param comparator a <a href="package-summary.html#NonInterference">
-     *                   non-interfering, stateless</a> {@code Comparator} to
-     *                   be used to compare stream elements
+     * @param comparator a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                   <a href="package-summary.html#Statelessness">stateless</a>
+     *                   {@code Comparator} to be used to compare stream elements
      * @return the new stream
      */
     Stream<T> sorted(Comparator<? super T> comparator);
@@ -420,7 +480,8 @@
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
-     * <p>For parallel stream pipelines, this operation does <em>not</em>
+     * <p>The behavior of this operation is explicitly nondeterministic.
+     * For parallel stream pipelines, this operation does <em>not</em>
      * guarantee to respect the encounter order of the stream, as doing so
      * would sacrifice the benefit of parallelism.  For any given element, the
      * action may be performed at whatever time and in whatever thread the
@@ -433,13 +494,18 @@
     void forEach(Consumer<? super T> action);
 
     /**
-     * Performs an action for each element of this stream, guaranteeing that
-     * each element is processed in encounter order for streams that have a
-     * defined encounter order.
+     * Performs an action for each element of this stream, in the encounter
+     * order of the stream if the stream has a defined encounter order.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
+     * <p>This operation processes the elements one at a time, in encounter
+     * order if one exists.  Performing the action for one element
+     * <a href="../concurrent/package-summary.html#MemoryVisibility"><i>happens-before</i></a>
+     * performing the action for subsequent elements, but for any given element,
+     * the action may be performed in whatever thread the library chooses.
+     *
      * @param action a <a href="package-summary.html#NonInterference">
      *               non-interfering</a> action to perform on the elements
      * @see #forEach(Consumer)
@@ -528,9 +594,10 @@
      * synchronization and with greatly reduced risk of data races.
      *
      * @param identity the identity value for the accumulating function
-     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for combining two values
+     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for combining two values
      * @return the result of the reduction
      */
     T reduce(T identity, BinaryOperator<T> accumulator);
@@ -563,14 +630,15 @@
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
-     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for combining two values
+     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for combining two values
      * @return an {@link Optional} describing the result of the reduction
      * @throws NullPointerException if the result of the reduction is null
      * @see #reduce(Object, BinaryOperator)
-     * @see #min(java.util.Comparator)
-     * @see #max(java.util.Comparator)
+     * @see #min(Comparator)
+     * @see #max(Comparator)
      */
     Optional<T> reduce(BinaryOperator<T> accumulator);
 
@@ -608,14 +676,15 @@
      *
      * @param <U> The type of the result
      * @param identity the identity value for the combiner function
-     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for incorporating an additional
-     *                    element into a result
-     * @param combiner an <a href="package-summary.html#Associativity">associative</a>
-     *                 <a href="package-summary.html#NonInterference">non-interfering,
-     *                 stateless</a> function for combining two values, which
-     *                 must be compatible with the accumulator function
+     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for incorporating an additional element into a result
+     * @param combiner an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for combining two values, which must be
+     *                    compatible with the accumulator function
      * @return the result of the reduction
      * @see #reduce(BinaryOperator)
      * @see #reduce(Object, BinaryOperator)
@@ -664,14 +733,15 @@
      * @param supplier a function that creates a new result container. For a
      *                 parallel execution, this function may be called
      *                 multiple times and must return a fresh value each time.
-     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>
-     *                    <a href="package-summary.html#NonInterference">non-interfering,
-     *                    stateless</a> function for incorporating an additional
-     *                    element into a result
-     * @param combiner an <a href="package-summary.html#Associativity">associative</a>
-     *                 <a href="package-summary.html#NonInterference">non-interfering,
-     *                 stateless</a> function for combining two values, which
-     *                 must be compatible with the accumulator function
+     * @param accumulator an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for incorporating an additional element into a result
+     * @param combiner an <a href="package-summary.html#Associativity">associative</a>,
+     *                    <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                    <a href="package-summary.html#Statelessness">stateless</a>
+     *                    function for combining two values, which must be
+     *                    compatible with the accumulator function
      * @return the result of the reduction
      */
     <R> R collect(Supplier<R> supplier,
@@ -687,6 +757,13 @@
      * collection strategies and composition of collect operations such as
      * multiple-level grouping or partitioning.
      *
+     * <p>If the stream is parallel, and the {@code Collector}
+     * is {@link Collector.Characteristics#CONCURRENT concurrent}, and
+     * either the stream is unordered or the collector is
+     * {@link Collector.Characteristics#UNORDERED unordered},
+     * then a concurrent reduction will be performed (see {@link Collector} for
+     * details on concurrent reduction.)
+     *
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
@@ -732,9 +809,9 @@
      *
      * <p>This is a <a href="package-summary.html#StreamOps">terminal operation</a>.
      *
-     * @param comparator a <a href="package-summary.html#NonInterference">non-interfering,
-     *                   stateless</a> {@code Comparator} to use to compare
-     *                   elements of this stream
+     * @param comparator a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                   <a href="package-summary.html#Statelessness">stateless</a>
+     *                   {@code Comparator} to compare elements of this stream
      * @return an {@code Optional} describing the minimum element of this stream,
      * or an empty {@code Optional} if the stream is empty
      * @throws NullPointerException if the minimum element is null
@@ -749,9 +826,9 @@
      * <p>This is a <a href="package-summary.html#StreamOps">terminal
      * operation</a>.
      *
-     * @param comparator a <a href="package-summary.html#NonInterference">non-interfering,
-     *                   stateless</a> {@code Comparator} to use to compare
-     *                   elements of this stream
+     * @param comparator a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                   <a href="package-summary.html#Statelessness">stateless</a>
+     *                   {@code Comparator} to compare elements of this stream
      * @return an {@code Optional} describing the maximum element of this stream,
      * or an empty {@code Optional} if the stream is empty
      * @throws NullPointerException if the maximum element is null
@@ -775,48 +852,67 @@
     /**
      * Returns whether any elements of this stream match the provided
      * predicate.  May not evaluate the predicate on all elements if not
-     * necessary for determining the result.
+     * necessary for determining the result.  If the stream is empty then
+     * {@code false} is returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
+     * @apiNote
+     * This method evaluates the <em>existential quantification</em> of the
+     * predicate over the elements of the stream (for some x P(x)).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
      * @return {@code true} if any elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * predicate, otherwise {@code false}
      */
     boolean anyMatch(Predicate<? super T> predicate);
 
     /**
      * Returns whether all elements of this stream match the provided predicate.
      * May not evaluate the predicate on all elements if not necessary for
-     * determining the result.
+     * determining the result.  If the stream is empty then {@code true} is
+     * returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
-     * @return {@code true} if all elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * @apiNote
+     * This method evaluates the <em>universal quantification</em> of the
+     * predicate over the elements of the stream (for all x P(x)).  If the
+     * stream is empty, the quantification is said to be <em>vacuously
+     * satisfied</em> and is always {@code true} (regardless of P(x)).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
+     * @return {@code true} if either all elements of the stream match the
+     * provided predicate or the stream is empty, otherwise {@code false}
      */
     boolean allMatch(Predicate<? super T> predicate);
 
     /**
      * Returns whether no elements of this stream match the provided predicate.
      * May not evaluate the predicate on all elements if not necessary for
-     * determining the result.
+     * determining the result.  If the stream is empty then {@code true} is
+     * returned and the predicate is not evaluated.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * terminal operation</a>.
      *
-     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering,
-     *                  stateless</a> predicate to apply to elements of this
-     *                  stream
-     * @return {@code true} if no elements of the stream match the provided
-     * predicate otherwise {@code false}
+     * @apiNote
+     * This method evaluates the <em>universal quantification</em> of the
+     * negated predicate over the elements of the stream (for all x ~P(x)).  If
+     * the stream is empty, the quantification is said to be vacuously satisfied
+     * and is always {@code true}, regardless of P(x).
+     *
+     * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
+     *                  <a href="package-summary.html#Statelessness">stateless</a>
+     *                  predicate to apply to elements of this stream
+     * @return {@code true} if either no elements of the stream match the
+     * provided predicate or the stream is empty, otherwise {@code false}
      */
     boolean noneMatch(Predicate<? super T> predicate);
 
@@ -939,13 +1035,13 @@
     }
 
     /**
-     * Returns a sequential stream where each element is generated by
-     * the provided {@code Supplier}.  This is suitable for generating
-     * constant streams, streams of random elements, etc.
+     * Returns an infinite sequential unordered stream where each element is
+     * generated by the provided {@code Supplier}.  This is suitable for
+     * generating constant streams, streams of random elements, etc.
      *
      * @param <T> the type of stream elements
      * @param s the {@code Supplier} of generated elements
-     * @return a new sequential {@code Stream}
+     * @return a new infinite sequential unordered {@code Stream}
      */
     public static<T> Stream<T> generate(Supplier<T> s) {
         Objects.requireNonNull(s);
@@ -956,11 +1052,16 @@
     /**
      * Creates a lazily concatenated stream whose elements are all the
      * elements of the first stream followed by all the elements of the
-     * second stream. The resulting stream is ordered if both
+     * second stream.  The resulting stream is ordered if both
      * of the input streams are ordered, and parallel if either of the input
      * streams is parallel.  When the resulting stream is closed, the close
      * handlers for both input streams are invoked.
      *
+     * @implNote
+     * Use caution when constructing streams from repeated concatenation.
+     * Accessing an element of a deeply concatenated stream can result in deep
+     * call chains, or even {@code StackOverflowException}.
+     *
      * @param <T> The type of stream elements
      * @param a the first stream
      * @param b the second stream
--- a/jdk/src/share/classes/java/util/stream/StreamSpliterators.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/StreamSpliterators.java	Mon Nov 11 16:20:48 2013 +0100
@@ -27,6 +27,7 @@
 import java.util.Comparator;
 import java.util.Objects;
 import java.util.Spliterator;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.BooleanSupplier;
 import java.util.function.Consumer;
@@ -1227,6 +1228,88 @@
     }
 
     /**
+     * A wrapping spliterator that only reports distinct elements of the
+     * underlying spliterator. Does not preserve size and encounter order.
+     */
+    static final class DistinctSpliterator<T> implements Spliterator<T>, Consumer<T> {
+
+        // The value to represent null in the ConcurrentHashMap
+        private static final Object NULL_VALUE = new Object();
+
+        // The underlying spliterator
+        private final Spliterator<T> s;
+
+        // ConcurrentHashMap holding distinct elements as keys
+        private final ConcurrentHashMap<T, Boolean> seen;
+
+        // Temporary element, only used with tryAdvance
+        private T tmpSlot;
+
+        DistinctSpliterator(Spliterator<T> s) {
+            this(s, new ConcurrentHashMap<>());
+        }
+
+        private DistinctSpliterator(Spliterator<T> s, ConcurrentHashMap<T, Boolean> seen) {
+            this.s = s;
+            this.seen = seen;
+        }
+
+        @Override
+        public void accept(T t) {
+            this.tmpSlot = t;
+        }
+
+        @SuppressWarnings("unchecked")
+        private T mapNull(T t) {
+            return t != null ? t : (T) NULL_VALUE;
+        }
+
+        @Override
+        public boolean tryAdvance(Consumer<? super T> action) {
+            while (s.tryAdvance(this)) {
+                if (seen.putIfAbsent(mapNull(tmpSlot), Boolean.TRUE) == null) {
+                    action.accept(tmpSlot);
+                    tmpSlot = null;
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        @Override
+        public void forEachRemaining(Consumer<? super T> action) {
+            s.forEachRemaining(t -> {
+                if (seen.putIfAbsent(mapNull(t), Boolean.TRUE) == null) {
+                    action.accept(t);
+                }
+            });
+        }
+
+        @Override
+        public Spliterator<T> trySplit() {
+            Spliterator<T> split = s.trySplit();
+            return (split != null) ? new DistinctSpliterator<>(split, seen) : null;
+        }
+
+        @Override
+        public long estimateSize() {
+            return s.estimateSize();
+        }
+
+        @Override
+        public int characteristics() {
+            return (s.characteristics() & ~(Spliterator.SIZED | Spliterator.SUBSIZED |
+                                            Spliterator.SORTED | Spliterator.ORDERED))
+                   | Spliterator.DISTINCT;
+        }
+
+        @Override
+        public Comparator<? super T> getComparator() {
+            return s.getComparator();
+        }
+    }
+
+    /**
      * A Spliterator that infinitely supplies elements in no particular order.
      *
      * <p>Splitting divides the estimated size in two and stops when the
--- a/jdk/src/share/classes/java/util/stream/StreamSupport.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/StreamSupport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -96,7 +96,8 @@
      * @param supplier a {@code Supplier} of a {@code Spliterator}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator}.  The characteristics must be equal to
-     *        {@code supplier.get().characteristics()}.
+     *        {@code supplier.get().characteristics()}, otherwise undefined
+     *        behavior may occur when terminal operation commences.
      * @param parallel if {@code true} then the returned stream is a parallel
      *        stream; if {@code false} the returned stream is a sequential
      *        stream.
@@ -163,7 +164,8 @@
      * @param supplier a {@code Supplier} of a {@code Spliterator.OfInt}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator.OfInt}.  The characteristics must be equal to
-     *        {@code supplier.get().characteristics()}
+     *        {@code supplier.get().characteristics()}, otherwise undefined
+     *        behavior may occur when terminal operation commences.
      * @param parallel if {@code true} then the returned stream is a parallel
      *        stream; if {@code false} the returned stream is a sequential
      *        stream.
@@ -230,7 +232,8 @@
      * @param supplier a {@code Supplier} of a {@code Spliterator.OfLong}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator.OfLong}.  The characteristics must be equal to
-     *        {@code supplier.get().characteristics()}
+     *        {@code supplier.get().characteristics()}, otherwise undefined
+     *        behavior may occur when terminal operation commences.
      * @param parallel if {@code true} then the returned stream is a parallel
      *        stream; if {@code false} the returned stream is a sequential
      *        stream.
@@ -297,7 +300,8 @@
      * @param supplier A {@code Supplier} of a {@code Spliterator.OfDouble}
      * @param characteristics Spliterator characteristics of the supplied
      *        {@code Spliterator.OfDouble}.  The characteristics must be equal to
-     *        {@code supplier.get().characteristics()}
+     *        {@code supplier.get().characteristics()}, otherwise undefined
+     *        behavior may occur when terminal operation commences.
      * @param parallel if {@code true} then the returned stream is a parallel
      *        stream; if {@code false} the returned stream is a sequential
      *        stream.
--- a/jdk/src/share/classes/java/util/stream/package-info.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/package-info.java	Mon Nov 11 16:20:48 2013 +0100
@@ -219,31 +219,18 @@
  * <em>not modified at all</em> during the execution of the stream pipeline.
  * The notable exception to this are streams whose sources are concurrent
  * collections, which are specifically designed to handle concurrent modification.
+ * Concurrent stream sources are those whose {@code Spliterator} reports the
+ * {@code CONCURRENT} characteristic.
  *
- * <p>Accordingly, behavioral parameters passed to stream methods should never
- * modify the stream's data source.  An implementation is said to
- * <em>interfere</em> with the data source if it modifies, or causes to be
+ * <p>Accordingly, behavioral parameters in stream pipelines whose source might
+ * not be concurrent should never modify the stream's data source.
+ * A behavioral parameter is said to <em>interfere</em> with a non-concurrent
+ * data source if it modifies, or causes to be
  * modified, the stream's data source.  The need for non-interference applies
  * to all pipelines, not just parallel ones.  Unless the stream source is
  * concurrent, modifying a stream's data source during execution of a stream
  * pipeline can cause exceptions, incorrect answers, or nonconformant behavior.
  *
- * <p>Results may be nondeterministic or incorrect if the behavioral
- * parameters of stream operations are <em>stateful</em>.  A stateful lambda
- * (or other object implementing the appropriate functional interface) is one
- * whose result depends on any state which might change during the execution
- * of the stream pipeline.  An example of a stateful lambda is:
- *
- * <pre>{@code
- *     Set<Integer> seen = Collections.synchronizedSet(new HashSet<>());
- *     stream.parallel().map(e -> { if (seen.add(e)) return 0; else return e; })...
- * }</pre>
- *
- * Here, if the mapping operation is performed in parallel, the results for the
- * same input could vary from run to run, due to thread scheduling differences,
- * whereas, with a stateless lambda expression the results would always be the
- * same.
- *
  * For well-behaved stream sources, the source can be modified before the
  * terminal operation commences and those modifications will be reflected in
  * the covered elements.  For example, consider the following code:
@@ -265,26 +252,54 @@
  * <a href="package-summary.html#StreamSources">Low-level stream
  * construction</a> for requirements for building well-behaved streams.
  *
- * <p>Some streams, particularly those whose stream sources are concurrent, can
- * tolerate concurrent modification during execution of a stream pipeline.
- * However, in no case -- even if the stream source is concurrent -- should
- * behavioral parameters to stream operations modify the stream source.  Modifying
- * the stream source from within the stream source may cause pipeline execution
- * to fail to terminate, produce inaccurate results, or throw exceptions.
- * The following example shows inappropriate interference with the source:
+ * <h3><a name="Statelessness">Stateless behaviors</a></h3>
+ *
+ * Stream pipeline results may be nondeterministic or incorrect if the behavioral
+ * parameters to the stream operations are <em>stateful</em>.  A stateful lambda
+ * (or other object implementing the appropriate functional interface) is one
+ * whose result depends on any state which might change during the execution
+ * of the stream pipeline.  An example of a stateful lambda is the parameter
+ * to {@code map()} in:
+ *
  * <pre>{@code
- *     // Don't do this!
- *     List<String> l = new ArrayList(Arrays.asList("one", "two"));
- *     Stream<String> sl = l.stream();
- *     String s = sl.peek(s -> l.add("BAD LAMBDA")).collect(joining(" "));
+ *     Set<Integer> seen = Collections.synchronizedSet(new HashSet<>());
+ *     stream.parallel().map(e -> { if (seen.add(e)) return 0; else return e; })...
  * }</pre>
  *
+ * Here, if the mapping operation is performed in parallel, the results for the
+ * same input could vary from run to run, due to thread scheduling differences,
+ * whereas, with a stateless lambda expression the results would always be the
+ * same.
+ *
+ * <p>Note also that attempting to access mutable state from behavioral parameters
+ * presents you with a bad choice with respect to safety and performance; if
+ * you do not synchronize access to that state, you have a data race and
+ * therefore your code is broken, but if you do synchronize access to that
+ * state, you risk having contention undermine the parallelism you are seeking
+ * to benefit from.  The best approach is to avoid stateful behavioral
+ * parameters to stream operations entirely; there is usually a way to
+ * restructure the stream pipeline to avoid statefulness.
+ *
  * <h3>Side-effects</h3>
  *
  * Side-effects in behavioral parameters to stream operations are, in general,
  * discouraged, as they can often lead to unwitting violations of the
- * statelessness requirement, as well as other thread-safety hazards.  Many
- * computations where one might be tempted to use side effects can be more
+ * statelessness requirement, as well as other thread-safety hazards.
+ *
+ * <p>If the behavioral parameters do have side-effects, unless explicitly
+ * stated, there are no guarantees as to the
+ * <a href="../concurrent/package-summary.html#MemoryVisibility"><i>visibility</i></a>
+ * of those side-effects to other threads, nor are there any guarantees that
+ * different operations on the "same" element within the same stream pipeline
+ * are executed in the same thread.  Further, the ordering of those effects
+ * may be surprising.  Even when a pipeline is constrained to produce a
+ * <em>result</em> that is consistent with the encounter order of the stream
+ * source (for example, {@code IntStream.range(0,5).parallel().map(x -> x*2).toArray()}
+ * must produce {@code [0, 2, 4, 6, 8]}), no guarantees are made as to the order
+ * in which the mapper function is applied to individual elements, or in what
+ * thread any behavioral parameter is executed for a given element.
+ *
+ * <p>Many computations where one might be tempted to use side effects can be more
  * safely and efficiently expressed without side-effects, such as using
  * <a href="package-summary.html#Reduction">reduction</a> instead of mutable
  * accumulators. However, side-effects such as using {@code println()} for debugging
--- a/jdk/src/share/classes/javax/accessibility/AccessibleContext.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleText.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/crypto/NullCipher.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/crypto/NullCipherSpi.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/IIOParam.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/ImageIO.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/ImageReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/ImageWriteParam.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/ImageWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/event/IIOReadProgressListener.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/event/IIOReadUpdateListener.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/event/IIOReadWarningListener.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/event/IIOWriteWarningListener.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadata.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html	Mon Nov 11 16:20:48 2013 +0100
@@ -228,7 +228,7 @@
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "HorizontalPixelOffset" EMPTY&gt;
-        &lt;!-- The horizonal position, in pixels, where the image should be 
+        &lt;!-- The horizontal position, in pixels, where the image should be 
              rendered onto a raster display --&gt; 
         &lt;!ATTLIST "HorizontalPixelOffset" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Integer --&gt;
--- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/management/relation/RelationService.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/management/relation/RelationServiceMBean.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/NoCallStackClassLoader.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/management/remote/rmi/NoCallStackClassLoader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -120,6 +120,7 @@
      */
     @Override
     protected Class<?> findClass(String name) throws ClassNotFoundException {
+        // Note: classNames is guaranteed by the constructor to be non-null.
         for (int i = 0; i < classNames.length; i++) {
             if (name.equals(classNames[i])) {
                 return defineClass(classNames[i], byteCodes[i], 0,
--- a/jdk/src/share/classes/javax/management/remote/rmi/package.html	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/management/remote/rmi/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/Binding.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/CompositeName.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/CompositeName.java	Mon Nov 11 16:20:48 2013 +0100
@@ -41,7 +41,7 @@
  * This range may be written as [0,N).
  * The most significant component is at index 0.
  * An empty composite name has no components.
- *<p>
+ *
  * <h1>JNDI Composite Name Syntax</h1>
  * JNDI defines a standard string representation for composite names. This
  * representation is the concatenation of the components of a composite name
@@ -72,12 +72,12 @@
  * A trailing component separator (the composite name string ends with
  * a separator) denotes a trailing empty component.
  * Adjacent component separators denote an empty component.
- *<p>
+ *
  *<h1>Composite Name Examples</h1>
  *This table shows examples of some composite names. Each row shows
  *the string form of a composite name and its corresponding structural form
  *(<tt>CompositeName</tt>).
- *<p>
+ *
 <table border="1" cellpadding=3 summary="examples showing string form of composite name and its corresponding structural form (CompositeName)">
 
 <tr>
@@ -136,7 +136,7 @@
 <td>{"x", "", "y"}</td>
 </tr>
 </table>
- * <p>
+ *
  *<h1>Composition Examples</h1>
  * Here are some composition examples.  The right column shows composing
  * string composite names while the left column shows composing the
@@ -144,7 +144,7 @@
  * string forms of two composite names simply involves concatenating
  * their string forms together.
 
-<p> <table border="1" cellpadding=3 summary="composition examples showing string names and composite names">
+<table border="1" cellpadding=3 summary="composition examples showing string names and composite names">
 
 <tr>
 <th>String Names</th>
@@ -188,7 +188,7 @@
 </tr>
 
 </table>
- *<p>
+ *
  *<h1>Multithreaded Access</h1>
  * A <tt>CompositeName</tt> instance is not synchronized against concurrent
  * multithreaded access. Multiple threads trying to access and modify a
--- a/jdk/src/share/classes/javax/naming/CompoundName.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/CompoundName.java	Mon Nov 11 16:20:48 2013 +0100
@@ -38,7 +38,7 @@
  * This range may be written as [0,N).
  * The most significant component is at index 0.
  * An empty compound name has no components.
- *<p>
+ *
  * <h1>Compound Name Syntax</h1>
  * The syntax of a compound name is specified using a set of properties:
  *<dl>
@@ -135,7 +135,7 @@
  * applied (e.g. embedded separators are escaped or quoted)
  * so that when the same string is parsed, it will yield the same components
  * of the original compound name.
- *<p>
+ *
  *<h1>Multithreaded Access</h1>
  * A <tt>CompoundName</tt> instance is not synchronized against concurrent
  * multithreaded access. Multiple threads trying to access and modify a
--- a/jdk/src/share/classes/javax/naming/Context.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/Context.java	Mon Nov 11 16:20:48 2013 +0100
@@ -31,7 +31,7 @@
  * This interface represents a naming context, which
  * consists of a set of name-to-object bindings.
  * It contains methods for examining and updating these bindings.
- * <p>
+ *
  * <h1>Names</h1>
  * Each name passed as an argument to a <tt>Context</tt> method is relative
  * to that context.  The empty name is used to name the context itself.
@@ -68,12 +68,12 @@
  * <tt>NamingEnumeration</tt> may be names in their own namespace rather than
  * names in a composite namespace, at the discretion of the service
  * provider.
- *<p>
+ *
  *<h1>Exceptions</h1>
  * All the methods in this interface can throw a <tt>NamingException</tt> or
  * any of its subclasses. See <tt>NamingException</tt> and their subclasses
  * for details on each exception.
- *<p>
+ *
  *<h1>Concurrent Access</h1>
  * A Context instance is not guaranteed to be synchronized against
  * concurrent access by multiple threads.  Threads that need to access
@@ -90,7 +90,7 @@
  * use, or while any referrals generated by that operation are still
  * being followed.
  *
- *<p>
+ *
  *<h1>Parameters</h1>
  * A <tt>Name</tt> parameter passed to any method of the
  * <tt>Context</tt> interface or one of its subinterfaces
@@ -102,7 +102,7 @@
  * A <tt>Name</tt> returned by any such method is owned by the caller.
  * The caller may subsequently modify it; the service provider may not.
  *
- *<p>
+ *
  *<h1>Environment Properties</h1>
  *<p>
  * JNDI applications need a way to communicate various preferences
--- a/jdk/src/share/classes/javax/naming/InitialContext.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/InitialContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -361,7 +361,7 @@
      * follows.
      * Define a new method that uses this method to get an initial
      * context of the desired subclass.
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      * protected XXXContext getURLOrDefaultInitXXXCtx(Name name)
      * throws NamingException {
      *  Context answer = getURLOrDefaultInitCtx(name);
@@ -377,7 +377,7 @@
      * </pre></blockquote>
      * When providing implementations for the new methods in the subclass,
      * use this newly defined method to get the initial context.
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      * public Object XXXMethod1(Name name, ...) {
      *  throws NamingException {
      *    return getURLOrDefaultInitXXXCtx(name).XXXMethod1(name, ...);
--- a/jdk/src/share/classes/javax/naming/InsufficientResourcesException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/InsufficientResourcesException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/ReferralException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/ReferralException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -156,7 +156,7 @@
      * <code>getReferralContext</code> to allow the processing of
      * other referrals to continue.
      * The following code fragment shows a typical usage pattern.
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      *  } catch (ReferralException e) {
      *      if (!shallIFollow(e.getReferralInfo())) {
      *          if (!e.skipReferral()) {
@@ -177,7 +177,7 @@
      * <code>getReferralContext</code> to allow the current
      * referral to be retried.
      * The following code fragment shows a typical usage pattern.
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      *  } catch (ReferralException e) {
      *      while (true) {
      *          try {
--- a/jdk/src/share/classes/javax/naming/directory/DirContext.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/directory/DirContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -31,7 +31,7 @@
  * The directory service interface, containing
  * methods for examining and updating attributes
  * associated with objects, and for searching the directory.
- * <p>
+ *
  * <h1>Names</h1>
  * Each name passed as an argument to a <tt>DirContext</tt> method is relative
  * to that context.  The empty name is used to name the context itself.
@@ -50,7 +50,7 @@
  * See <tt>Context</tt> for a discussion on the interpretation of the
  * name argument to the <tt>Context</tt> methods. These same rules
  * apply to the name argument to the <tt>DirContext</tt> methods.
- * <p>
+ *
  * <h1>Attribute Models</h1>
  * There are two basic models of what attributes should be
  * associated with.  First, attributes may be directly associated with a
@@ -80,7 +80,7 @@
  * JNDI clients are safest when they do not make assumptions about
  * whether an object's attributes are stored as part of the object, or stored
  * within the parent object and associated with the object's name.
- * <p>
+ *
  * <h1>Attribute Type Names</h1>
  * In the <tt>getAttributes()</tt> and <tt>search()</tt> methods,
  * you can supply the attributes to return by supplying a list of
@@ -112,7 +112,7 @@
  * <li>description;lang-fr
  * </ul>
  *
- * <p>
+ *
  *<h1>Operational Attributes</h1>
  *<p>
  * Some directories have the notion of "operational attributes" which are
@@ -126,7 +126,7 @@
  * The attributes returned do <em>not</em> include operational attributes.
  * In order to retrieve operational attributes, you must name them explicitly.
  *
- * <p>
+ *
  * <h1>Named Context</h1>
  * <p>
  * There are certain methods in which the name must resolve to a context
@@ -137,7 +137,7 @@
  * <code>NotContextException</code> is thrown.
  * Aside from these methods, there is no requirement that the
  * <em>named object</em> be a DirContext.
- *<p>
+ *
  *<h1>Parameters</h1>
  *<p>
  * An <tt>Attributes</tt>, <tt>SearchControls</tt>, or array object
@@ -149,7 +149,7 @@
  * An <tt>Attributes</tt> object returned by any method is owned by
  * the caller.  The caller may subsequently modify it; the service
  * provider will not.
- *<p>
+ *
  *<h1>Exceptions</h1>
  *<p>
  * All the methods in this interface can throw a NamingException or
--- a/jdk/src/share/classes/javax/naming/event/EventContext.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/event/EventContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -33,7 +33,7 @@
 /**
  * Contains methods for registering/deregistering listeners to be notified of
  * events fired when objects named in a context changes.
- *<p>
+ *
  *<h1>Target</h1>
  * The name parameter in the <tt>addNamingListener()</tt> methods is referred
  * to as the <em>target</em>. The target, along with the scope, identify
@@ -58,7 +58,7 @@
  * An application can use the method <tt>targetMustExist()</tt> to check
  * whether a <tt>EventContext</tt> supports registration
  * of nonexistent targets.
- *<p>
+ *
  *<h1>Event Source</h1>
  * The <tt>EventContext</tt> instance on which you invoke the
  * registration methods is the <em>event source</em> of the events that are
--- a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -338,7 +338,7 @@
      * parameter, a system property, or one or more resource files.
      *<p>
      * The value of this constant is "java.naming.factory.control".
-     *<p>
+     *
      * @see ControlFactory
      * @see javax.naming.Context#addToEnvironment
      * @see javax.naming.Context#removeFromEnvironment
--- a/jdk/src/share/classes/javax/naming/ldap/LdapName.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapName.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -116,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.
@@ -315,7 +315,6 @@
      * @return  A negative integer, zero, or a positive integer as this Rdn
      *          is less than, equal to, or greater than the given Object.
      * @exception ClassCastException if obj is null or not a Rdn.
-     * <p>
      */
     public int compareTo(Object obj) {
         if (!(obj instanceof Rdn)) {
@@ -344,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,
@@ -606,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 &&
@@ -663,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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/net/ssl/SSLPeerUnverifiedException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/CancelablePrintJob.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/DocFlavor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/DocPrintJob.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/MultiDoc.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/PrintService.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/attribute/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaTray.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/attribute/standard/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/event/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &amp; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/print/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/script/AbstractScriptEngine.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/script/CompiledScript.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/script/Invocable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/script/ScriptEngine.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/security/sasl/RealmChoiceCallback.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/security/sasl/Sasl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/security/sasl/SaslClient.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/security/sasl/SaslException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/smartcardio/CardChannel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/smartcardio/CardTerminal.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/midi/MidiDevice.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/midi/MidiMessage.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/midi/ShortMessage.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/midi/Soundbank.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/midi/Synthesizer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sound/sampled/ReverbType.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/PooledConnection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/RowSet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/StatementEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/Joinable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/Predicate.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/AbstractButton.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/Action.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/BoxLayout.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/DefaultRowSorter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/GroupLayout.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/ImageIcon.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JApplet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JComboBox.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JComponent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JDialog.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JFileChooser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JFormattedTextField.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JFrame.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JLabel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JMenu.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JPasswordField.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JRootPane.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JSlider.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JSpinner.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JSplitPane.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JTable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JViewport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/JWindow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/ProgressMonitor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/RepaintManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/RootPaneContainer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/ScrollPaneConstants.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/SpinnerDateModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt; maximum</code> then an
+     * <code>minimum &gt; maximum</code> then an
      * <code>IllegalArgumentException</code> is thrown.
      * Similarly if <code>(minimum &lt;= value &lt;= 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/SpinnerModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt; maximum</code> then an
+     * are specified and <code>minimum &gt; maximum</code> then an
      * <code>IllegalArgumentException</code> is thrown.
      * Similarly if <code>(minimum &lt;= value &lt;= maximum</code>) is false,
      * an <code>IllegalArgumentException</code> is thrown.
--- a/jdk/src/share/classes/javax/swing/SpringLayout.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/SpringLayout.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/SwingUtilities.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/ToolTipManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/TransferHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/UIManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/border/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/colorchooser/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/event/DocumentEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/event/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/filechooser/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/ComboBoxUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;=0.  If the value is -1, a position
+         * will be calculated automatically.  If the value &lt; -1,
+         * the {@code BadLocationException} will be thrown.
          *
          * @param pos the position to convert &gt;= 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java	Mon Nov 11 16:20:48 2013 +0100
@@ -57,7 +57,7 @@
  *     <code>UIManager.put("swing.boldMetal",&nbsp;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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &quot;incomplete.&quot; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/multi/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;= 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 &gt;= 1.
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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 @@
   &lt;state value="SELECTED">
     &lt;painter idref="stateFallbackPainter"/>
     &lt;painter idref="stateButtonBackgroundPainter" method="buttonBackground"/>
-  &lt/state>
+  &lt;/state>
 &lt;/style>
       </pre>
     </div>      
--- a/jdk/src/share/classes/javax/swing/plaf/synth/package.html	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -27,6 +27,7 @@
 
 
 -->
+<title></title>
 </head>
 <body bgcolor="white">
     <p>
--- a/jdk/src/share/classes/javax/swing/table/DefaultTableColumnModel.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/table/DefaultTableColumnModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/table/JTableHeader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/table/TableColumn.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/table/TableColumnModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/table/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;= 0.
          * @param nitems  The number of items in the sequence to remove &gt;= 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/AbstractWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;=0.  If the value is -1, a position
+     * will be calculated automatically.  If the value &lt; -1,
+     * the {@code BadLocationException} will be thrown.
      *
-     * @param pos the position to convert &gt;= 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/BoxView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;= 0
      * @param y the Y coordinate &gt;= 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/CompositeView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;=0.  If the value is -1, a position
+     * will be calculated automatically.  If the value &lt; -1,
+     * the {@code BadLocationException} will be thrown.
      *
-     * @param pos the position to convert &gt;= 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/DefaultHighlighter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/Document.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/DocumentFilter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/ElementIterator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/FlowView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/GapContent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/GapVector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;=0.  If the value is -1, a position
+     * will be calculated automatically.  If the value &lt; -1,
+     * the {@code BadLocationException} will be thrown.
      *
-     * @param pos the position to convert &gt;= 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &ge; 0
+     * @param len the length &ge; 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 &ge; 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 &ge; 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 &ge; 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 &ge; 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 &ge; 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 &ge; 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 &ge; 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 &ge; 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 &ge; 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 &ge; 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 &ge; 0
          */
         public int getSelectionEnd() {
             return JTextComponent.this.getSelectionEnd();
--- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/ParagraphView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/SimpleAttributeSet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/StyleConstants.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/StyleContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/TableView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/View.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 &gt;=0.  If the value is -1, a position
+     * will be calculated automatically.  If the value &lt; -1,
+     * the {@code BadLocationException} will be thrown.
      *
-     * @param pos the position to convert &gt;= 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/ZoneView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/BlockView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/CSSParser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/FormSubmitEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/FormView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/FrameSetView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/HTML.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&trade;
+ * 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 &lt;img&gt; 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLFrameHyperlinkEvent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/OptionListModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/TableView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/DocumentParser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Element.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/text/rtf/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/TreeModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/tree/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/swing/undo/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/KeySelector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/MarshalException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/TransformException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignatureException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/jdi-overview.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/jdk/internal/org/objectweb/asm/Frame.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Analyzer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Interpreter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/jdk/internal/org/xml/sax/EntityResolver.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/PropertiesDefaultHandler.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -27,6 +27,7 @@
 
 import java.io.*;
 import java.util.InvalidPropertiesFormatException;
+import java.util.Map.Entry;
 import java.util.Properties;
 import jdk.internal.org.xml.sax.Attributes;
 import jdk.internal.org.xml.sax.InputSource;
@@ -107,12 +108,17 @@
                 writer.writeEndElement();
             }
 
-            for (String key : props.stringPropertyNames()) {
-                String val = props.getProperty(key);
-                writer.writeStartElement(ELEMENT_ENTRY);
-                writer.writeAttribute(ATTR_KEY, key);
-                writer.writeCharacters(val);
-                writer.writeEndElement();
+            synchronized(props) {
+                for (Entry<Object, Object> e : props.entrySet()) {
+                    final Object k = e.getKey();
+                    final Object v = e.getValue();
+                    if (k instanceof String && v instanceof String) {
+                        writer.writeStartElement(ELEMENT_ENTRY);
+                        writer.writeAttribute(ATTR_KEY, (String)k);
+                        writer.writeCharacters((String)v);
+                        writer.writeEndElement();
+                    }
+                }
             }
 
             writer.writeEndElement();
--- a/jdk/src/share/classes/jdk/internal/util/xml/XMLStreamException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/jdk/internal/util/xml/XMLStreamException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/jdk/internal/util/xml/impl/Parser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSCredential.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/org/ietf/jgss/GSSName.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/org/ietf/jgss/package.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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/AppletClassLoader.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/applet/AppletClassLoader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -239,6 +239,7 @@
      * the "localhost".
      *
      * @param codesource the codesource
+     * @throws NullPointerException if {@code codesource} is {@code null}.
      * @return the permissions granted to the codesource
      */
     protected PermissionCollection getPermissions(CodeSource codesource)
--- a/jdk/src/share/classes/sun/applet/AppletSecurity.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/AppContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/GlobalCursorManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/shell/ShellFolderManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/FileFontStrike.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/FontManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/FontRunIterator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/LayoutPathImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/ScriptRun.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/StandardTextSource.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/StrikeCache.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/SunFontManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/TextLabelFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/TrueTypeFont.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/font/Type1Font.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/SurfaceDataProxy.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/loops/ProcessPath.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/pipe/BufferedMaskFill.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/pipe/BufferedRenderPipe.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/pipe/BufferedTextPipe.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/pipe/DrawImage.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/pipe/hw/AccelDeviceEventNotifier.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfDataBufferImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/FileMonitoredVm.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/launcher/resources/launcher_pt_BR.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -34,7 +34,7 @@
 java.launcher.ergo.message2  =\                  porque a execu\u00E7\u00E3o est\u00E1 sendo feita em uma m\u00E1quina de classe de servidor.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n    -classpath <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n                  Uma lista separada por {0} de diret\u00F3rios, archives JAR\n                  e archives ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n    -D<nome>=<valor>\n                  define uma propriedade do sistema\n    -verbose:[classe|gc|jni]\n                  ativa a sa\u00EDda detalhada\n    -version      imprime a vers\u00E3o do produto e sai do programa\n    -version:<valor>\n                  requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n    -showversion  imprime a vers\u00E3o do produto e continua\n    -jre-restrict-search | -no-jre-restrict-search\n                  inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n    -? -help      imprime esta mensagem de ajuda\n    -X            imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n    -ea[:<nome do pacote>...|:<nome da classe>]\n    -enableassertions[:<nome do pacote>...|:<nome da classe>]\n                  ativa asser\u00E7\u00F5es com granularidade especificada\n    -da[:<nome do pacote>...|:<nome da classe>]\n    -disableassertions[:<nome do pacote>...|:<nome da classe>]\n                  desativa asser\u00E7\u00F5es com granularidade especificada\n    -esa | -enablesystemassertions\n                  ativa asser\u00E7\u00F5es do sistema\n    -dsa | -disablesystemassertions\n                  desativa asser\u00E7\u00F5es do sistema\n    -agentlib:<nome da biblioteca>[=<op\u00E7\u00F5es>]\n                  carrega a biblioteca de agentes nativa <nome da biblioteca>, por exemplo: -agentlib:hprof\n                  consulte tamb\u00E9m: -agentlib:jdwp=help e -agentlib:hprof=help\n    -agentpath:<nome do caminho>[=<op\u00E7\u00F5es>]\n                  carrega a biblioteca de agentes nativa com base no nome do caminho completo\n    -javaagent:<caminho do arquivo jar>[=<op\u00E7\u00F5es>]\n                  carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n    -splash:<caminho da imagem>\n                  mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
+java.launcher.opt.footer     =\    -cp <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n    -classpath <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n                  Uma lista separada por {0} de diret\u00F3rios, archives JAR\n                  e archives ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n    -D<nome>=<valor>\n                  define uma propriedade do sistema\n    -verbose:[class|gc|jni]\n                  ativa a sa\u00EDda detalhada\n    -version      imprime a vers\u00E3o do produto e sai do programa\n    -version:<valor>\n                  requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n    -showversion  imprime a vers\u00E3o do produto e continua\n    -jre-restrict-search | -no-jre-restrict-search\n                  inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n    -? -help      imprime esta mensagem de ajuda\n    -X            imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n    -ea[:<nome do pacote>...|:<nome da classe>]\n    -enableassertions[:<nome do pacote>...|:<nome da classe>]\n                  ativa asser\u00E7\u00F5es com granularidade especificada\n    -da[:<nome do pacote>...|:<nome da classe>]\n    -disableassertions[:<nome do pacote>...|:<nome da classe>]\n                  desativa asser\u00E7\u00F5es com granularidade especificada\n    -esa | -enablesystemassertions\n                  ativa asser\u00E7\u00F5es do sistema\n    -dsa | -disablesystemassertions\n                  desativa asser\u00E7\u00F5es do sistema\n    -agentlib:<nome da biblioteca>[=<op\u00E7\u00F5es>]\n                  carrega a biblioteca de agentes nativa <nome da biblioteca>, por exemplo: -agentlib:hprof\n                  consulte tamb\u00E9m: -agentlib:jdwp=help e -agentlib:hprof=help\n    -agentpath:<nome do caminho>[=<op\u00E7\u00F5es>]\n                  carrega a biblioteca de agentes nativa com base no nome do caminho completo\n    -javaagent:<caminho do arquivo jar>[=<op\u00E7\u00F5es>]\n                  carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n    -splash:<caminho da imagem>\n                  mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
 
 # Translators please note do not translate the options themselves
 java.launcher.X.usage=\    -Xmixed           execu\u00E7\u00E3o no modo misto (default)\n    -Xint             execu\u00E7\u00E3o somente no modo interpretado\n    -Xbootclasspath:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      define o caminho de pesquisa para classes e recursos de inicializa\u00E7\u00E3o\n    -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexa no final do caminho da classe de inicializa\u00E7\u00E3o\n    -Xbootclasspath/p:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexa no in\u00EDcio do caminho da classe de inicializa\u00E7\u00E3o\n    -Xdiag            mostra mensagens de diagn\u00F3stico adicionais\n    -Xnoclassgc       desativa a coleta de lixo da classe\n    -Xincgc           ativa a coleta de lixo incremental\n    -Xloggc:<arquivo>    registra o status do GC status em um arquivo com marca\u00E7\u00F5es de data e hor\u00E1rio\n    -Xbatch           desativa a compila\u00E7\u00E3o em segundo plano\n    -Xms<tamanho>        define o tamanho inicial do heap Java\n    -Xmx<tamanho>        define o tamanho m\u00E1ximo do heap Java\n    -Xss<tamanho>        define o tamanho da pilha de threads java\n    -Xprof            produz dados de perfil da cpu\n    -Xfuture          ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo de exig\u00EAncia, prevendo o valor default futuro\n    -Xrs              reduz o uso de sinais do SO pelo(a) Java/VM (consulte a documenta\u00E7\u00E3o)\n    -Xcheck:jni       executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es da JNI\n    -Xshare:off       n\u00E3o tenta usar dados da classe compartilhada\n    -Xshare:auto      se poss\u00EDvel, usa dados da classe compartilhada (default)\n    -Xshare:on        requer o uso de dados da classe compartilhada, caso contr\u00E1rio haver\u00E1 falha.\n    -XshowSettings    mostra todas as defini\u00E7\u00F5es e continua\n    -XshowSettings:all\n                      mostra todas as defini\u00E7\u00F5es e continua\n    -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 vm e continua\n    -XshowSettings:properties\n                      mostra todas as defini\u00E7\u00F5es da propriedade e continua\n    -XshowSettings:locale\n                      mostra todas as defini\u00E7\u00F5es relativas \u00E0s configura\u00E7\u00F5es regionais e continua\n\nAs -X options n\u00E3o s\u00E3o padronizadas e est\u00E3o sujeitas a altera\u00E7\u00F5es sem aviso.\n
--- a/jdk/src/share/classes/sun/management/Agent.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/management/Agent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -323,7 +323,7 @@
                     : String.format(
                     "service:jmx:rmi:///jndi/rmi://%s:%s/jmxrmi", hostname, jmxremotePort);
 
-            String instanceName = System.getProperty("com.sun.management.jdp.name");
+            String instanceName = props.getProperty("com.sun.management.jdp.name");
 
             try{
                JdpController.startDiscoveryService(address, port, instanceName, jmxUrlStr);
--- a/jdk/src/share/classes/sun/management/counter/perf/InstrumentationException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/management/counter/perf/InstrumentationException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/management/counter/perf/PerfDataType.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/management/jdp/JdpController.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/management/jdp/JdpController.java	Mon Nov 11 16:20:48 2013 +0100
@@ -29,6 +29,12 @@
 import java.net.UnknownHostException;
 import java.util.UUID;
 
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import sun.management.VMManagement;
+
 /**
  * JdpController is responsible to create and manage a broadcast loop
  *
@@ -126,6 +132,25 @@
         }
     }
 
+    // Get the process id of the current running Java process
+    private static Integer getProcessId() {
+        try {
+            // Get the current process id using a reflection hack
+            RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+            Field jvm = runtime.getClass().getDeclaredField("jvm");
+            jvm.setAccessible(true);
+
+            VMManagement mgmt = (sun.management.VMManagement) jvm.get(runtime);
+            Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId");
+            pid_method.setAccessible(true);
+            Integer pid = (Integer) pid_method.invoke(mgmt);
+            return pid;
+        } catch(Exception ex) {
+            return null;
+        }
+    }
+
+
     /**
      * Starts discovery service
      *
@@ -173,6 +198,20 @@
         // it the key is skipped. PacketWriter is responsible to skip keys having null value.
         packet.setInstanceName(instanceName);
 
+        // Set rmi server hostname if it explicitly specified by user with
+        // java.rmi.server.hostname
+        String rmiHostname = System.getProperty("java.rmi.server.hostname");
+        packet.setRmiHostname(rmiHostname);
+
+        // Set broadcast interval
+        packet.setBroadcastInterval(new Integer(pause).toString());
+
+        // Set process id
+        Integer pid = getProcessId();
+        if (pid != null) {
+           packet.setProcessId(pid.toString());
+        }
+
         JdpBroadcaster bcast = new JdpBroadcaster(address, sourceAddress, port, ttl);
 
         // Stop discovery service if it's already running
--- a/jdk/src/share/classes/sun/management/jdp/JdpJmxPacket.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/management/jdp/JdpJmxPacket.java	Mon Nov 11 16:20:48 2013 +0100
@@ -64,11 +64,27 @@
      * Name of Java instance
      */
     public final static String INSTANCE_NAME_KEY = "INSTANCE_NAME";
+    /**
+     * PID of java process, optional presented if it could be obtained
+     */
+    public final static String PROCESS_ID_KEY = "PROCESS_ID";
+    /**
+     * Hostname of rmi server, optional presented if user overrides rmi server
+     * hostname by java.rmi.server.hostname property
+     */
+    public final static String RMI_HOSTNAME_KEY = "RMI_HOSTNAME";
+    /**
+     * Configured broadcast interval, optional
+     */
+    public final static String BROADCAST_INTERVAL_KEY = "BROADCAST_INTERVAL";
 
     private UUID id;
     private String mainClass;
     private String jmxServiceUrl;
     private String instanceName;
+    private String processId;
+    private String rmiHostname;
+    private String broadcastInterval;
 
     /**
      * Create new instance from user provided data. Set mandatory fields
@@ -99,6 +115,9 @@
         this.jmxServiceUrl = p.get(JMX_SERVICE_URL_KEY);
         this.mainClass = p.get(MAIN_CLASS_KEY);
         this.instanceName = p.get(INSTANCE_NAME_KEY);
+        this.processId = p.get(PROCESS_ID_KEY);
+        this.rmiHostname = p.get(RMI_HOSTNAME_KEY);
+        this.broadcastInterval = p.get(BROADCAST_INTERVAL_KEY);
     }
 
     /**
@@ -150,6 +169,30 @@
         return instanceName;
     }
 
+    public String getProcessId() {
+        return processId;
+    }
+
+    public void setProcessId(String processId) {
+        this.processId = processId;
+    }
+
+    public String getRmiHostname() {
+        return rmiHostname;
+    }
+
+    public void setRmiHostname(String rmiHostname) {
+        this.rmiHostname = rmiHostname;
+    }
+
+    public String getBroadcastInterval() {
+        return broadcastInterval;
+    }
+
+    public void setBroadcastInterval(String broadcastInterval) {
+        this.broadcastInterval = broadcastInterval;
+    }
+
     /**
      *
      * @return assembled packet ready to be sent across a Net
@@ -164,6 +207,10 @@
         writer.addEntry(MAIN_CLASS_KEY, mainClass);
         writer.addEntry(JMX_SERVICE_URL_KEY, jmxServiceUrl);
         writer.addEntry(INSTANCE_NAME_KEY, instanceName);
+        writer.addEntry(PROCESS_ID_KEY, processId);
+        writer.addEntry(RMI_HOSTNAME_KEY, rmiHostname);
+        writer.addEntry(BROADCAST_INTERVAL_KEY, broadcastInterval);
+
         return writer.getPacketBytes();
     }
 
--- a/jdk/src/share/classes/sun/misc/CRC16.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/misc/CRC16.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/misc/CharacterDecoder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/JavaLangAccess.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/misc/JavaLangAccess.java	Mon Nov 11 16:20:48 2013 +0100
@@ -28,6 +28,7 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Executable;
 import java.security.AccessControlContext;
+import java.util.Map;
 
 import sun.reflect.ConstantPool;
 import sun.reflect.annotation.AnnotationType;
@@ -50,6 +51,11 @@
     AnnotationType getAnnotationType(Class<?> klass);
 
     /**
+     * Get the declared annotations for a given class, indexed by their types.
+     */
+    Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass);
+
+    /**
      * Get the array of bytes that is the class-file representation
      * of this Class' annotations.
      */
--- a/jdk/src/share/classes/sun/misc/PerformanceLogger.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/misc/PerformanceLogger.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/NetworkClient.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/TelnetOutputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/ftp/FtpClient.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/httpserver/Request.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/idn/StringPrep.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/smtp/SmtpProtocolException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/www/http/ChunkedInputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/www/http/HttpClient.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/www/http/PosterOutputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheValue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -903,6 +903,18 @@
 
     private String getHostAndPort(URL url) {
         String host = url.getHost();
+        final String hostarg = host;
+        try {
+            // lookup hostname and use IP address if available
+            host = AccessController.doPrivileged(
+                new PrivilegedExceptionAction<String>() {
+                    public String run() throws IOException {
+                            InetAddress addr = InetAddress.getByName(hostarg);
+                            return addr.getHostAddress();
+                    }
+                }
+            );
+        } catch (PrivilegedActionException e) {}
         int port = url.getPort();
         if (port == -1) {
             String scheme = url.getProtocol();
@@ -2256,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/ch/FileChannelImpl.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -840,7 +840,15 @@
             ti = threads.add();
             if (!isOpen())
                 return null;
-            if (size() < position + size) { // Extend file size
+
+            long filesize;
+            do {
+                filesize = nd.size(fd);
+            } while ((filesize == IOStatus.INTERRUPTED) && isOpen());
+            if (!isOpen())
+                return null;
+
+            if (filesize < position + size) { // Extend file size
                 if (!writable) {
                     throw new IOException("Channel not open for writing " +
                         "- cannot extend file to required size");
@@ -849,6 +857,8 @@
                 do {
                     rv = nd.truncate(fd, position + size);
                 } while ((rv == IOStatus.INTERRUPTED) && isOpen());
+                if (!isOpen())
+                    return null;
             }
             if (size == 0) {
                 addr = 0;
--- a/jdk/src/share/classes/sun/nio/cs/ext/DoubleByte.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/nio/cs/ext/DoubleByte.java	Mon Nov 11 16:20:48 2013 +0100
@@ -111,7 +111,6 @@
     public static class Decoder extends CharsetDecoder
                                 implements DelegatableDecoder, ArrayDecoder
     {
-
         final char[][] b2c;
         final char[] b2cSB;
         final int b2Min;
@@ -122,7 +121,12 @@
             return CoderResult.UNDERFLOW;
         }
 
-        protected CoderResult crMalformedOrUnmappable(int b) {
+        protected CoderResult crMalformedOrUnmappable(int b1, int b2) {
+            if (b2c[b1] == B2C_UNMAPPABLE ||                // isNotLeadingByte(b1)
+                b2c[b2] != B2C_UNMAPPABLE ||                // isLeadingByte(b2)
+                decodeSingle(b2) != UNMAPPABLE_DECODING) {  // isSingle(b2)
+                return CoderResult.malformedForLength(1);
+            }
             return CoderResult.unmappableForLength(2);
         }
 
@@ -161,7 +165,7 @@
                         int b2 = sa[sp + 1] & 0xff;
                         if (b2 < b2Min || b2 > b2Max ||
                             (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) {
-                            return crMalformedOrUnmappable(b1);
+                            return crMalformedOrUnmappable(b1, b2);
                         }
                         inSize++;
                     }
@@ -190,7 +194,7 @@
                         int b2 = src.get() & 0xff;
                         if (b2 < b2Min || b2 > b2Max ||
                             (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING)
-                            return crMalformedOrUnmappable(b1);
+                            return crMalformedOrUnmappable(b1, b2);
                         inSize++;
                     }
                     dst.put(c);
@@ -221,8 +225,13 @@
                 if (c == UNMAPPABLE_DECODING) {
                     if (sp < sl) {
                         int b2 = src[sp++] & 0xff;
-                        if (b2 >= b2Min && b2 <= b2Max) {
-                            c = b2c[b1][b2 - b2Min];
+                        if (b2 < b2Min || b2 > b2Max ||
+                            (c = b2c[b1][b2 - b2Min]) == UNMAPPABLE_DECODING) {
+                            if (b2c[b1] == B2C_UNMAPPABLE ||  // isNotLeadingByte
+                                b2c[b2] != B2C_UNMAPPABLE ||  // isLeadingByte
+                                decodeSingle(b2) != UNMAPPABLE_DECODING) {
+                                sp--;
+                            }
                         }
                     }
                     if (c == UNMAPPABLE_DECODING) {
@@ -466,8 +475,8 @@
             return CoderResult.UNDERFLOW;
         }
 
-        protected CoderResult crMalformedOrUnmappable(int b) {
-            if (b == SS2 || b == SS3 )
+        protected CoderResult crMalformedOrUnmappable(int b1, int b2) {
+            if (b1 == SS2 || b1 == SS3 )
                 return CoderResult.malformedForLength(1);
             return CoderResult.unmappableForLength(2);
         }
--- a/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/nio/fs/Util.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/nio/fs/Util.java	Mon Nov 11 16:20:48 2013 +0100
@@ -27,6 +27,9 @@
 
 import java.util.*;
 import java.nio.file.*;
+import java.nio.charset.Charset;
+import java.security.*;
+import sun.security.action.*;
 
 /**
  * Utility methods
@@ -35,6 +38,33 @@
 class Util {
     private Util() { }
 
+    private static final Charset jnuEncoding = Charset.forName(
+        AccessController.doPrivileged(new GetPropertyAction("sun.jnu.encoding")));
+
+    /**
+     * Returns {@code Charset} corresponding to the sun.jnu.encoding property
+     */
+    static Charset jnuEncoding() {
+        return jnuEncoding;
+    }
+
+    /**
+     * Encodes the given String into a sequence of bytes using the {@code Charset}
+     * specified by the sun.jnu.encoding property.
+     */
+    static byte[] toBytes(String s) {
+        return s.getBytes(jnuEncoding);
+    }
+
+    /**
+     * Constructs a new String by decoding the specified array of bytes using the
+     * {@code Charset} specified by the sun.jnu.encoding property.
+     */
+    static String toString(byte[] bytes) {
+        return new String(bytes, jnuEncoding);
+    }
+
+
     /**
      * Splits a string around the given character. The array returned by this
      * method contains each substring that is terminated by the character. Use
--- a/jdk/src/share/classes/sun/print/PSPathGraphics.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/print/PSPathGraphics.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/print/PathGraphics.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/print/PrintJob2D.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/print/RasterPrinterJob.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/reflect/Reflection.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/reflect/Reflection.java	Mon Nov 11 16:20:48 2013 +0100
@@ -57,6 +57,14 @@
     @CallerSensitive
     public static native Class<?> getCallerClass();
 
+    /**
+     * @deprecated This method will be removed in JDK 9.
+     * This method is a private JDK API and retained temporarily for
+     * existing code to run until a replacement API is defined.
+     */
+    @Deprecated
+    public static native Class<?> getCallerClass(int depth);
+
     /** Retrieves the access flags written to the class file. For
         inner classes these flags may differ from those returned by
         Class.getModifiers(), which searches the InnerClasses
--- a/jdk/src/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -95,6 +95,8 @@
             Class<?> clz = (Class)type;
             if (clz.getEnclosingClass() == null)
                 return addTo;
+            if (Modifier.isStatic(clz.getModifiers()))
+                return addNesting(clz.getEnclosingClass(), addTo);
             return addNesting(clz.getEnclosingClass(), addTo.pushInner());
         } else if (type instanceof ParameterizedType) {
             ParameterizedType t = (ParameterizedType)type;
@@ -166,7 +168,7 @@
 
         @Override
         public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotation) {
-            return AnnotationSupport.getMultipleAnnotations(annotations, annotation);
+            return AnnotationSupport.getDirectlyAndIndirectlyPresent(annotations, annotation);
         }
 
         // AnnotatedType
--- a/jdk/src/share/classes/sun/reflect/annotation/AnnotationSupport.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/reflect/annotation/AnnotationSupport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -28,109 +28,212 @@
 import java.lang.annotation.*;
 import java.lang.reflect.*;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
+
+import sun.misc.JavaLangAccess;
 
 public final class AnnotationSupport {
+    private static final JavaLangAccess LANG_ACCESS = sun.misc.SharedSecrets.getJavaLangAccess();
+
     /**
-     * Finds and returns all annotation of the type indicated by
-     * {@code annotationClass} from the {@code Map} {@code
-     * annotationMap}. Looks into containers of the {@code
-     * annotationClass} (as specified by an the {@code
-     * annotationClass} type being meta-annotated with an {@code
-     * Repeatable} annotation).
+     * Finds and returns all annotations in {@code annotations} matching
+     * the given {@code annoClass}.
+     *
+     * Apart from annotations directly present in {@code annotations} this
+     * method searches for annotations inside containers i.e. indirectly
+     * present annotations.
      *
-     * @param annotationMap the {@code Map} used to store annotations indexed by their type
-     * @param annotationClass the type of annotation to search for
+     * The order of the elements in the array returned depends on the iteration
+     * order of the provided map. Specifically, the directly present annotations
+     * come before the indirectly present annotations if and only if the
+     * directly present annotations come before the indirectly present
+     * annotations in the map.
      *
-     * @return an array of instances of {@code annotationClass} or an empty array if none were found
+     * @param annotations the {@code Map} in which to search for annotations
+     * @param annoClass the type of annotation to search for
+     *
+     * @return an array of instances of {@code annoClass} or an empty
+     *         array if none were found
      */
-    public static  <A extends Annotation> A[] getMultipleAnnotations(
-            final Map<Class<? extends Annotation>, Annotation> annotationMap,
-            final Class<A> annotationClass) {
-        final List<A> res = new ArrayList<A>();
+    public static <A extends Annotation> A[] getDirectlyAndIndirectlyPresent(
+            Map<Class<? extends Annotation>, Annotation> annotations,
+            Class<A> annoClass) {
+        List<A> result = new ArrayList<A>();
 
         @SuppressWarnings("unchecked")
-        final A candidate = (A)annotationMap.get(annotationClass);
-        if (candidate != null) {
-            res.add(candidate);
+        A direct = (A) annotations.get(annoClass);
+        if (direct != null)
+            result.add(direct);
+
+        A[] indirect = getIndirectlyPresent(annotations, annoClass);
+        if (indirect != null && indirect.length != 0) {
+            boolean indirectFirst = direct == null ||
+                                    containerBeforeContainee(annotations, annoClass);
+
+            result.addAll((indirectFirst ? 0 : 1), Arrays.asList(indirect));
         }
 
-        final Class<? extends Annotation> containerClass = getContainer(annotationClass);
-        if (containerClass != null) {
-            res.addAll(unpackAll(annotationMap.get(containerClass), annotationClass));
-        }
+        @SuppressWarnings("unchecked")
+        A[] arr = (A[]) Array.newInstance(annoClass, result.size());
+        return result.toArray(arr);
+    }
 
-        @SuppressWarnings("unchecked") // should be safe annotationClass is a token for A
-        final A[] emptyTemplateArray = (A[])Array.newInstance(annotationClass, 0);
-        return res.isEmpty() ? emptyTemplateArray : res.toArray(emptyTemplateArray);
+    /**
+     * Finds and returns all annotations matching the given {@code annoClass}
+     * indirectly present in {@code annotations}.
+     *
+     * @param annotations annotations to search indexed by their types
+     * @param annoClass the type of annotation to search for
+     *
+     * @return an array of instances of {@code annoClass} or an empty array if no
+     *         indirectly present annotations were found
+     */
+    private static <A extends Annotation> A[] getIndirectlyPresent(
+            Map<Class<? extends Annotation>, Annotation> annotations,
+            Class<A> annoClass) {
+
+        Repeatable repeatable = annoClass.getDeclaredAnnotation(Repeatable.class);
+        if (repeatable == null)
+            return null;  // Not repeatable -> no indirectly present annotations
+
+        Class<? extends Annotation> containerClass = repeatable.value();
+
+        Annotation container = annotations.get(containerClass);
+        if (container == null)
+            return null;
+
+        // Unpack container
+        A[] valueArray = getValueArray(container);
+        checkTypes(valueArray, container, annoClass);
+
+        return valueArray;
     }
 
-    /** Helper to get the container, or null if none, of an annotation. */
-    private static <A extends Annotation> Class<? extends Annotation> getContainer(Class<A> annotationClass) {
-        Repeatable containingAnnotation = annotationClass.getDeclaredAnnotation(Repeatable.class);
-        return (containingAnnotation == null) ? null : containingAnnotation.value();
+
+    /**
+     * Figures out if conatiner class comes before containee class among the
+     * keys of the given map.
+     *
+     * @return true if container class is found before containee class when
+     *         iterating over annotations.keySet().
+     */
+    private static <A extends Annotation> boolean containerBeforeContainee(
+            Map<Class<? extends Annotation>, Annotation> annotations,
+            Class<A> annoClass) {
+
+        Class<? extends Annotation> containerClass =
+                annoClass.getDeclaredAnnotation(Repeatable.class).value();
+
+        for (Class<? extends Annotation> c : annotations.keySet()) {
+            if (c == containerClass) return true;
+            if (c == annoClass) return false;
+        }
+
+        // Neither containee nor container present
+        return false;
     }
 
-    /** Reflectively look up and get the returned array from the the
-     * invocation of the value() element on an instance of an
-     * Annotation.
+
+    /**
+     * Finds and returns all associated annotations matching the given class.
+     *
+     * The order of the elements in the array returned depends on the iteration
+     * order of the provided maps. Specifically, the directly present annotations
+     * come before the indirectly present annotations if and only if the
+     * directly present annotations come before the indirectly present
+     * annotations in the relevant map.
+     *
+     * @param declaredAnnotations the declared annotations indexed by their types
+     * @param decl the class declaration on which to search for annotations
+     * @param annoClass the type of annotation to search for
+     *
+     * @return an array of instances of {@code annoClass} or an empty array if none were found.
      */
-    private static  <A extends Annotation> A[] getValueArray(Annotation containerInstance) {
+    public static <A extends Annotation> A[] getAssociatedAnnotations(
+            Map<Class<? extends Annotation>, Annotation> declaredAnnotations,
+            Class<?> decl,
+            Class<A> annoClass) {
+        Objects.requireNonNull(decl);
+
+        // Search declared
+        A[] result = getDirectlyAndIndirectlyPresent(declaredAnnotations, annoClass);
+
+        // Search inherited
+        if(AnnotationType.getInstance(annoClass).isInherited()) {
+            Class<?> superDecl = decl.getSuperclass();
+            while (result.length == 0 && superDecl != null) {
+                result = getDirectlyAndIndirectlyPresent(LANG_ACCESS.getDeclaredAnnotationMap(superDecl), annoClass);
+                superDecl = superDecl.getSuperclass();
+            }
+        }
+
+        return result;
+    }
+
+
+    /* Reflectively invoke the values-method of the given annotation
+     * (container), cast it to an array of annotations and return the result.
+     */
+    private static <A extends Annotation> A[] getValueArray(Annotation container) {
         try {
-            // the spec tells us the container must have an array-valued
-            // value element. Get the AnnotationType, get the "value" element
-            // and invoke it to get the contents.
+            // According to JLS the container must have an array-valued value
+            // method. Get the AnnotationType, get the "value" method and invoke
+            // it to get the content.
 
-            Class<? extends Annotation> containerClass = containerInstance.annotationType();
+            Class<? extends Annotation> containerClass = container.annotationType();
             AnnotationType annoType = AnnotationType.getInstance(containerClass);
             if (annoType == null)
-                throw new AnnotationFormatError(containerInstance + " is an invalid container for repeating annotations");
+                throw invalidContainerException(container, null);
 
             Method m = annoType.members().get("value");
             if (m == null)
-                throw new AnnotationFormatError(containerInstance +
-                                                          " is an invalid container for repeating annotations");
+                throw invalidContainerException(container, null);
+
             m.setAccessible(true);
 
-            @SuppressWarnings("unchecked") // not provably safe, but we catch the ClassCastException
-            A[] a = (A[])m.invoke(containerInstance); // this will erase to (Annotation[]) but we
-                                                      // do a runtime cast on the return-value
-                                                      // in the methods that call this method
-            return a;
-        } catch (IllegalAccessException | // couldnt loosen security
-                 IllegalArgumentException | // parameters doesn't match
+            // This will erase to (Annotation[]) but we do a runtime cast on the
+            // return-value in the method that call this method.
+            @SuppressWarnings("unchecked")
+            A[] values = (A[]) m.invoke(container);
+
+            return values;
+
+        } catch (IllegalAccessException    | // couldn't loosen security
+                 IllegalArgumentException  | // parameters doesn't match
                  InvocationTargetException | // the value method threw an exception
-                 ClassCastException e) { // well, a cast failed ...
-            throw new AnnotationFormatError(
-                    containerInstance + " is an invalid container for repeating annotations",
-                    e);
+                 ClassCastException e) {
+
+            throw invalidContainerException(container, e);
+
         }
     }
 
-    /* Sanity check type of and return a list of all the annotation
-     * instances of type {@code annotationClass} from {@code
-     * containerInstance}.
-     */
-    private static <A extends Annotation> List<A> unpackAll(Annotation containerInstance,
-                                                            Class<A> annotationClass) {
-        if (containerInstance == null) {
-            return Collections.emptyList(); // container not present
-        }
+
+    private static AnnotationFormatError invalidContainerException(Annotation anno,
+                                                                   Throwable cause) {
+        return new AnnotationFormatError(
+                anno + " is an invalid container for repeating annotations",
+                cause);
+    }
+
 
-        try {
-            A[] a = getValueArray(containerInstance);
-            List<A> l = new ArrayList<>(a.length);
-            for (int i  = 0; i < a.length; i++)
-                l.add(annotationClass.cast(a[i]));
-            return l;
-        } catch (ClassCastException |
-                 NullPointerException e) {
-            throw new AnnotationFormatError(
-                    String.format("%s is an invalid container for repeating annotations of type: %s",
-                        containerInstance, annotationClass),
-                    e);
+    /* Sanity check type of all the annotation instances of type {@code annoClass}
+     * from {@code container}.
+     */
+    private static <A extends Annotation> void checkTypes(A[] annotations,
+                                                          Annotation container,
+                                                          Class<A> annoClass) {
+        for (A a : annotations) {
+            if (!annoClass.isInstance(a)) {
+                throw new AnnotationFormatError(
+                        String.format("%s is an invalid container for " +
+                                      "repeating annotations of type: %s",
+                                      container, annoClass));
+            }
         }
     }
 }
--- a/jdk/src/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -54,7 +54,7 @@
      *
      * @param rawAnnotations the byte[] encoding of all type annotations on this declaration
      * @param cp the ConstantPool needed to parse the embedded Annotation
-     * @param decl the dclaration this type annotation is on
+     * @param decl the declaration this type annotation is on
      * @param container the Class this type annotation is on (may be the same as decl)
      * @param type the type the AnnotatedType corresponds to
      * @param filter the type annotation targets included in this AnnotatedType
--- a/jdk/src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -198,7 +198,7 @@
     @Override
     public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) {
         Objects.requireNonNull(annotationClass);
-        return AnnotationSupport.getMultipleAnnotations(mapAnnotations(getAnnotations()), annotationClass);
+        return AnnotationSupport.getDirectlyAndIndirectlyPresent(mapAnnotations(getAnnotations()), annotationClass);
     }
 
     @Override
--- a/jdk/src/share/classes/sun/rmi/rmic/RemoteClass.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/rmic/RemoteClass.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/rmic/Util.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/rmic/newrmic/jrmp/StubSkeletonWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/runtime/Log.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/server/Activation.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/transport/ObjectTable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/proxy/RMIMasterSocketFactory.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -34,6 +34,7 @@
 import sun.rmi.runtime.NewThreadAction;
 import sun.security.action.GetBooleanAction;
 import sun.security.action.GetLongAction;
+import sun.security.action.GetPropertyAction;
 
 /**
  * RMIMasterSocketFactory attempts to create a socket connection to the
@@ -103,22 +104,21 @@
         try {
             String proxyHost;
             proxyHost = java.security.AccessController.doPrivileged(
-                new sun.security.action.GetPropertyAction("http.proxyHost"));
+                new GetPropertyAction("http.proxyHost"));
 
             if (proxyHost == null)
                 proxyHost = java.security.AccessController.doPrivileged(
-                    new sun.security.action.GetPropertyAction("proxyHost"));
+                    new GetPropertyAction("proxyHost"));
 
-            Boolean tmp = java.security.AccessController.doPrivileged(
-                new sun.security.action.GetBooleanAction("java.rmi.server.disableHttp"));
+            boolean disable = java.security.AccessController.doPrivileged(
+                new GetPropertyAction("java.rmi.server.disableHttp", "true"))
+                .equalsIgnoreCase("true");
 
-            if (!tmp.booleanValue() &&
-                (proxyHost != null && proxyHost.length() > 0)) {
+            if (!disable && proxyHost != null && proxyHost.length() > 0) {
                 setFactories = true;
             }
         } catch (Exception e) {
-            // unable to obtain the properties, so assume default behavior.
-            setFactories = true;
+            // unable to obtain the properties, so use the default behavior.
         }
 
         if (setFactories) {
--- a/jdk/src/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/MultiplexOutputStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/TCPChannel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jca/GetInstance.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Context.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5NameElement.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/MessageToken.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jgss/spi/GSSContextSpi.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/krb5/KdcComm.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/krb5/Realm.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/krb5/internal/CredentialsUtil.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/DesCbcEType.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11DHKeyFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11DSAKeyFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/DSA.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/certpath/AdjacencyList.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/provider/certpath/RevocationChecker.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java	Mon Nov 11 16:20:48 2013 +0100
@@ -307,7 +307,7 @@
                                               : anchor.getCAPublicKey();
         }
         crlSignFlag = true;
-        if (params.certPath() != null) {
+        if (params != null && params.certPath() != null) {
             certIndex = params.certPath().getCertificates().size() - 1;
         } else {
             certIndex = -1;
--- a/jdk/src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/HandshakeOutStream.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/RSASignature.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/Record.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/SunJSSE.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/tools/jarsigner/Resources_ja.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Resources_ja.java	Mon Nov 11 16:20:48 2013 +0100
@@ -79,7 +79,7 @@
         {".verbose.suboptions.verbose.output.when.signing.verifying.",
                 "[-verbose[:suboptions]]     \u7F72\u540D/\u691C\u8A3C\u6642\u306E\u8A73\u7D30\u51FA\u529B\u3002"},
         {".suboptions.can.be.all.grouped.or.summary",
-                "                            \u30B5\u30D6\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3057\u3066\u3001\u3059\u3079\u3066\u3001\u30B0\u30EB\u30FC\u30D7\u307E\u305F\u306F\u30B5\u30DE\u30EA\u30FC\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059"},
+                "                            \u30B5\u30D6\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3057\u3066\u3001all\u3001grouped\u307E\u305F\u306Fsummary\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059"},
         {".certs.display.certificates.when.verbose.and.verifying",
                 "[-certs]                    \u8A73\u7D30\u51FA\u529B\u304A\u3088\u3073\u691C\u8A3C\u6642\u306B\u8A3C\u660E\u66F8\u3092\u8868\u793A"},
         {".tsa.url.location.of.the.Timestamping.Authority",
--- a/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1092,19 +1092,19 @@
         JMenu menu = new JMenu();
         configureButton(menu, "File");
         ActionListener actionListener = new FileMenuListener(tool, this);
-        addMenuItem(menu, NEW_POLICY_FILE, actionListener);
-        addMenuItem(menu, OPEN_POLICY_FILE, actionListener);
-        addMenuItem(menu, SAVE_POLICY_FILE, actionListener);
-        addMenuItem(menu, SAVE_AS_POLICY_FILE, actionListener);
-        addMenuItem(menu, VIEW_WARNINGS, actionListener);
-        addMenuItem(menu, QUIT, actionListener);
+        addMenuItem(menu, NEW_POLICY_FILE, actionListener, "N");
+        addMenuItem(menu, OPEN_POLICY_FILE, actionListener, "O");
+        addMenuItem(menu, SAVE_POLICY_FILE, actionListener, "S");
+        addMenuItem(menu, SAVE_AS_POLICY_FILE, actionListener, null);
+        addMenuItem(menu, VIEW_WARNINGS, actionListener, null);
+        addMenuItem(menu, QUIT, actionListener, null);
         menuBar.add(menu);
 
         // create a KeyStore menu
         menu = new JMenu();
         configureButton(menu, "KeyStore");
         actionListener = new MainWindowListener(tool, this);
-        addMenuItem(menu, EDIT_KEYSTORE, actionListener);
+        addMenuItem(menu, EDIT_KEYSTORE, actionListener, null);
         menuBar.add(menu);
         setJMenuBar(menuBar);
 
@@ -1220,23 +1220,24 @@
     // Platform specific modifier (control / command).
     private int shortCutModifier = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
 
-    private void addMenuItem(JMenu menu, String key, ActionListener actionListener) {
+    private void addMenuItem(JMenu menu, String key, ActionListener actionListener, String accelerator) {
         JMenuItem menuItem = new JMenuItem();
         configureButton(menuItem, key);
 
         if (PolicyTool.rb.containsKey(key + ".accelerator")) {
-            String accelerator = PolicyTool.getMessage(key + ".accelerator");
-            if (accelerator != null && !accelerator.isEmpty()) {
-                KeyStroke keyStroke;
-                if (accelerator.matches("^control .$")) {
-                    // Map "control" key to "command" on MacOS
-                    keyStroke = KeyStroke.getKeyStroke(KeyEvent.getExtendedKeyCodeForChar(accelerator.charAt(8)),
-                                                       shortCutModifier);
-                } else {
-                    keyStroke = KeyStroke.getKeyStroke(accelerator);
-                }
-                menuItem.setAccelerator(keyStroke);
+            // Accelerator from resources takes precedence
+            accelerator = PolicyTool.getMessage(key + ".accelerator");
+        }
+
+        if (accelerator != null && !accelerator.isEmpty()) {
+            KeyStroke keyStroke;
+            if (accelerator.length() == 1) {
+                keyStroke = KeyStroke.getKeyStroke(KeyEvent.getExtendedKeyCodeForChar(accelerator.charAt(0)),
+                                                   shortCutModifier);
+            } else {
+                keyStroke = KeyStroke.getKeyStroke(accelerator);
             }
+            menuItem.setAccelerator(keyStroke);
         }
 
         menuItem.addActionListener(actionListener);
--- a/jdk/src/share/classes/sun/security/tools/policytool/Resources.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/tools/policytool/Resources.java	Mon Nov 11 16:20:48 2013 +0100
@@ -45,11 +45,8 @@
         {".file.file.policy.file.location",
                 "  [-file <file>]    policy file location"},
         {"New", "&New"},
-        {"New.accelerator", "control N"},
         {"Open", "&Open..."},
-        {"Open.accelerator", "control O"},
         {"Save", "&Save"},
-        {"Save.accelerator", "control S"},
         {"Save.As", "Save &As..."},
         {"View.Warning.Log", "View &Warning Log"},
         {"Exit", "E&xit"},
@@ -92,8 +89,6 @@
         {"OK.to.overwrite.existing.file.filename.",
                 "OK to overwrite existing file {0}?"},
         {"Cancel", "Cancel"},
-
-        // Policy Entry Dialog
         {"CodeBase.", "&CodeBase:"},
         {"SignedBy.", "&SignedBy:"},
         {"Add.Principal", "&Add Principal"},
@@ -104,13 +99,10 @@
         {".Edit.Permission", "  Ed&it Permission"},
         {"Remove.Permission", "Re&move Permission"},
         {"Done", "Done"},
-
-        // KeyStore Edit Dialog
         {"KeyStore.URL.", "KeyStore &URL:"},
         {"KeyStore.Type.", "KeyStore &Type:"},
         {"KeyStore.Provider.", "KeyStore &Provider:"},
         {"KeyStore.Password.URL.", "KeyStore Pass&word URL:"},
-
         {"Principals", "Principals"},
         {".Edit.Principal.", "  Edit Principal:"},
         {".Add.New.Principal.", "  Add New Principal:"},
--- a/jdk/src/share/classes/sun/security/util/HostnameChecker.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/util/HostnameChecker.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/security/x509/AlgIdDSA.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/Paint9Painter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/text/resources/th/CollationData_th.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jar/Main.java	Mon Nov 11 16:20:48 2013 +0100
@@ -31,6 +31,7 @@
 import java.util.*;
 import java.util.zip.*;
 import java.util.jar.*;
+import java.util.jar.Pack200.*;
 import java.util.jar.Manifest;
 import java.text.MessageFormat;
 import sun.misc.JarIndex;
@@ -72,8 +73,9 @@
      * flag0: no zip compression (store only)
      * Mflag: DO NOT generate a manifest file (just ZIP)
      * iflag: generate jar index
+     * nflag: Perform jar normalization at the end
      */
-    boolean cflag, uflag, xflag, tflag, vflag, flag0, Mflag, iflag;
+    boolean cflag, uflag, xflag, tflag, vflag, flag0, Mflag, iflag, nflag;
 
     static final String MANIFEST_DIR = "META-INF/";
     static final String VERSION = "1.0";
@@ -197,12 +199,56 @@
                         vflag = false;
                     }
                 }
+                File tmpfile = null;
+                final OutputStream finalout = out;
+                final String tmpbase = (fname == null)
+                        ? "tmpjar"
+                        : fname.substring(fname.indexOf(File.separatorChar) + 1);
+                if (nflag) {
+                    tmpfile = createTemporaryFile(tmpbase, ".jar");
+                    out = new FileOutputStream(tmpfile);
+                }
                 expand(null, files, false);
                 create(new BufferedOutputStream(out, 4096), manifest);
                 if (in != null) {
                     in.close();
                 }
                 out.close();
+                if(nflag) {
+                    JarFile jarFile = null;
+                    File packFile = null;
+                    JarOutputStream jos = null;
+                    try {
+                        Packer packer = Pack200.newPacker();
+                        Map<String, String> p = packer.properties();
+                        p.put(Packer.EFFORT, "1"); // Minimal effort to conserve CPU
+                        jarFile = new JarFile(tmpfile.getCanonicalPath());
+                        packFile = createTemporaryFile(tmpbase, ".pack");
+                        out = new FileOutputStream(packFile);
+                        packer.pack(jarFile, out);
+                        jos = new JarOutputStream(finalout);
+                        Unpacker unpacker = Pack200.newUnpacker();
+                        unpacker.unpack(packFile, jos);
+                    } catch (IOException ioe) {
+                        fatalError(ioe);
+                    } finally {
+                        if (jarFile != null) {
+                            jarFile.close();
+                        }
+                        if (out != null) {
+                            out.close();
+                        }
+                        if (jos != null) {
+                            jos.close();
+                        }
+                        if (tmpfile != null && tmpfile.exists()) {
+                            tmpfile.delete();
+                        }
+                        if (packFile != null && packFile.exists()) {
+                            packFile.delete();
+                        }
+                    }
+                }
             } else if (uflag) {
                 File inputFile = null, tmpFile = null;
                 FileInputStream in;
@@ -358,6 +404,9 @@
                     rootjar = args[count++];
                     iflag = true;
                     break;
+                case 'n':
+                    nflag = true;
+                    break;
                 case 'e':
                      ename = args[count++];
                      break;
@@ -1170,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);
@@ -1215,4 +1264,34 @@
             e.setCrc(crc.getValue());
         }
     }
+
+    /**
+     * Attempt to create temporary file in the system-provided temporary folder, if failed attempts
+     * to create it in the same folder as the file in parameter (if any)
+     */
+    private File createTemporaryFile(String tmpbase, String suffix) {
+        File tmpfile = null;
+
+        try {
+            tmpfile = File.createTempFile(tmpbase, suffix);
+        } catch (IOException | SecurityException e) {
+            // Unable to create file due to permission violation or security exception
+        }
+        if (tmpfile == null) {
+            // Were unable to create temporary file, fall back to temporary file in the same folder
+            if (fname != null) {
+                try {
+                    File tmpfolder = new File(fname).getAbsoluteFile().getParentFile();
+                    tmpfile = File.createTempFile(fname, ".tmp" + suffix, tmpfolder);
+                } catch (IOException ioe) {
+                    // Last option failed - fall gracefully
+                    fatalError(ioe);
+                }
+            } else {
+                // No options left - we can not compress to stdout without access to the temporary folder
+                fatalError(new IOException(getMsg("error.create.tempfile")));
+            }
+        }
+        return tmpfile;
+    }
 }
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -44,6 +44,8 @@
         {0} : could not create directory
 error.incorrect.length=\
         incorrect length while processing: {0}
+error.create.tempfile=\
+        Could not create a temporary file
 out.added.manifest=\
         added manifest
 out.update.manifest=\
@@ -66,7 +68,7 @@
         (in = {0}) (out= {1})
 
 usage=\
-Usage: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\
+Usage: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\
 Options:\n\
 \ \   -c  create new archive\n\
 \ \   -t  list table of contents for archive\n\
@@ -75,6 +77,7 @@
 \ \   -v  generate verbose output on standard output\n\
 \ \   -f  specify archive file name\n\
 \ \   -m  include manifest information from specified manifest file\n\
+\ \   -n  perform Pack200 normalization after creating a new archive\n\
 \ \   -e  specify application entry point for stand-alone application \n\
 \ \       bundled into an executable jar file\n\
 \ \   -0  store only; use no ZIP compression\n\
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -44,4 +44,4 @@
 out.inflated=\ inflado: {0}
 out.size=(entrada = {0}) (salida = {1})
 
-usage=Sintaxis: jar {ctxui}[vfm0Me] [archive-jar] [archive-manifiesto] [punto-entrada] [-C dir] archivos...\nOpciones:\n    -c  crear nuevo archivo\n    -t  crear la tabla de contenido del archivo\n    -x extraer el archive mencionado (o todos) del archivo\n    -u  actualizar archive existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archive de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archive jar ejecutable\n    -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archive de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Sintaxis: jar {ctxui}[vfm0Me] [archive-jar] [archive-manifiesto] [punto-entrada] [-C dir] archivos...\nOpciones:\n    -c  crear nuevo archivo\n    -t  crear la tabla de contenido del archivo\n    -x  extraer el archive mencionado (o todos) del archivo\n    -u  actualizar archive existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archive de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archive jar ejecutable\n    -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archive de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -44,4 +44,4 @@
 out.inflated=\ decompresso: {0}
 out.size=(in = {0}) (out = {1})
 
-usage=Uso: jar {ctxui}[vfm0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n    -c  crea un nuovo archivio\n    -t  visualizza l'indice dell'archivio\n    -x  estrae i file con nome (o tutti i file) dall'archivio\n    -u  aggiorna l'archivio esistente\n    -v  genera output commentato dall'output standard\n    -f  specifica il nome file dell'archivio\n    -m  include informazioni manifest dal file manifest specificato\n    -e  specifica il punto di ingresso per l'applicazione stand-alone \n        inclusa nel file jar eseguibile\n    -0  solo memorizzazione; senza compressione ZIP\n    -M  consente di non creare un file manifest per le voci\n    -i  genera informazioni sull'indice per i file jar specificati\n    -C  imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n           file della directory foo/ in 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/.\n
+usage=Uso: jar {ctxui}[vfm0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n    -c  crea un nuovo archivio\n    -t  visualizza l'indice dell'archivio\n    -x  estrae i file con nome (o tutti i file) dall'archivio\n    -u  aggiorna l'archivio esistente\n    -v  genera output commentato dall'output standard\n    -f  specifica il nome file dell'archivio\n    -m  include informazioni manifest dal file manifest specificato\n    -e  specifica il punto di ingresso per l'applicazione stand-alone \n        inclusa nel file jar eseguibile\n    -0  solo memorizzazione; senza compressione ZIP\n    -M  consente di non creare un file manifest per le voci\n    -i  genera informazioni sull'indice per i file jar specificati\n    -C  imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n           file della directory foo/ in 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -44,4 +44,4 @@
 out.inflated=\ {0}\u304C\u5C55\u958B\u3055\u308C\u307E\u3057\u305F
 out.size=(\u5165={0})(\u51FA={1})
 
-usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n   -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n   -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n   -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n   -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n   -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n   -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n   -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n   -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n      \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n   -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n   -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n   -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n   -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n     jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n    \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n     jar cvfm classes.jar mymanifest -C foo/ \n
+usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n   -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n   -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n   -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n   -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n   -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n   -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n   -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n   -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n      \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n   -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n   -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n   -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n   -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n     jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n     \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n     jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -44,4 +44,4 @@
 out.inflated=\ uppackat: {0}
 out.size=(in = {0}) (ut = {1})
 
-usage=Syntax: jar {ctxui}[vfm0Me] [jar fil] [manifestfil] [startpunkt] [-C-katalog] ...\nAlternativ:\n    -c  skapa nytt arkiv\n    -t  lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n    -x  extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n    -u  uppdatera befintligt arkiv\n    -v  generera utf\u00F6rliga utdata vid standardutmatning\n    -f  ange arkivfilens namn\n    -m  inkludera manifestinformation fr\u00E5n angivet manifest\n    -e  ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n        som medf\u00F6ljer i en jar-programfil\n    -0  endast lagra  (ingen zip-komprimering)\n    -M  skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n    -i  generera indexinformation f\u00F6r de angivna jar-filerna\n    -C  \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges i samma\nordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n           filer fr\u00E5n katalogen foo/ i classes.jar: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
+usage=Syntax: jar {ctxui}[vfm0Me] [jar-fil] [manifestfil] [startpunkt] [-C katalog] filer...\nAlternativ:\n    -c  skapa nytt arkiv\n    -t  lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n    -x  extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n    -u  uppdatera befintligt arkiv\n    -v  generera utf\u00F6rliga utdata vid standardutmatning\n    -f  ange arkivfilens namn\n    -m  inkludera manifestinformation fr\u00E5n angivet manifest\n    -e  ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n        som medf\u00F6ljer i en jar-programfil\n    -0  endast lagra  (ingen zip-komprimering)\n    -M  skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n    -i  generera indexinformation f\u00F6r de angivna jar-filerna\n    -C  \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges i samma\nordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n           filer fr\u00E5n katalogen foo/ i classes.jar: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -44,4 +44,4 @@
 out.inflated=\  \u5DF2\u89E3\u538B: {0}
 out.size=(\u8F93\u5165 = {0}) (\u8F93\u51FA = {1})
 
-usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879\u5305\u62EC: \n    -c  \u521B\u5EFA\u65B0\u7684\u5F52\u6863\u6587\u4EF6\n    -t  \u5217\u51FA\u5F52\u6863\u76EE\u5F55\n    -x  \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n    -u  \u66F4\u65B0\u73B0\u6709\u7684\u5F52\u6863\u6587\u4EF6\n    -v  \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n    -f  \u6307\u5B9A\u5F52\u6863\u6587\u4EF6\u540D\n    -m  \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n    -e  \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n        \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n    -0  \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u60C5\u51B5\u4EFB\u4F55 ZIP \u538B\u7F29\n    -M  \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n    -i  \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n    -C  \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u5176\u4E2D\u7684\u6587\u4EF6\n\u5982\u679C\u6709\u4EFB\u4F55\u76EE\u5F55\u6587\u4EF6, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u5F52\u6863\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u5F52\u6863\u6587\u4EF6\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n           \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/\u3002\n
+usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879\u5305\u62EC: \n    -c  \u521B\u5EFA\u65B0\u7684\u5F52\u6863\u6587\u4EF6\n    -t  \u5217\u51FA\u5F52\u6863\u76EE\u5F55\n    -x  \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n    -u  \u66F4\u65B0\u73B0\u6709\u7684\u5F52\u6863\u6587\u4EF6\n    -v  \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n    -f  \u6307\u5B9A\u5F52\u6863\u6587\u4EF6\u540D\n    -m  \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n    -e  \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n        \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n    -0  \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u60C5\u51B5\u4EFB\u4F55 ZIP \u538B\u7F29\n    -M  \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n    -i  \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n    -C  \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u5176\u4E2D\u7684\u6587\u4EF6\n\u5982\u679C\u6709\u4EFB\u4F55\u76EE\u5F55\u6587\u4EF6, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u5F52\u6863\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u5F52\u6863\u6587\u4EF6\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n           \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
--- a/jdk/src/share/classes/sun/tools/jconsole/BorderedComponent.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jconsole/BorderedComponent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jconsole/inspector/XTextField.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jinfo/JInfo.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jmap/JMap.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jstat/ColumnFormat.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/jstat/resources/jstat_options	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/tree/ExprExpression.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/calendar/ZoneInfoFile.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java	Mon Nov 11 16:20:48 2013 +0100
@@ -26,6 +26,7 @@
 package sun.util.calendar;
 
 import java.io.ByteArrayInputStream;
+import java.io.BufferedInputStream;
 import java.io.DataInput;
 import java.io.DataInputStream;
 import java.io.File;
@@ -65,8 +66,17 @@
      * @return a set of time zone IDs.
      */
     public static String[] getZoneIds() {
-        String[] ids = Arrays.copyOf(regions, regions.length + oldMappings.length);
+        int len = regions.length + oldMappings.length;
+        if (!USE_OLDMAPPING) {
+            len += 3;    // EST/HST/MST not in tzdb.dat
+        }
+        String[] ids = Arrays.copyOf(regions, len);
         int i = regions.length;
+        if (!USE_OLDMAPPING) {
+            ids[i++] = "EST";
+            ids[i++] = "HST";
+            ids[i++] = "MST";
+        }
         for (int j = 0; j < oldMappings.length; j++) {
             ids[i++] = oldMappings[j][0];
         }
@@ -243,7 +253,8 @@
                 try {
                     String libDir = System.getProperty("java.home") + File.separator + "lib";
                     try (DataInputStream dis = new DataInputStream(
-                             new FileInputStream(new File(libDir, "tzdb.dat")))) {
+                             new BufferedInputStream(new FileInputStream(
+                                 new File(libDir, "tzdb.dat"))))) {
                         load(dis);
                     }
                 } catch (Exception x) {
@@ -262,9 +273,17 @@
             aliases.put("EST", "America/New_York");
             aliases.put("MST", "America/Denver");
             aliases.put("HST", "Pacific/Honolulu");
+        } else {
+            zones.put("EST", new ZoneInfo("EST", -18000000));
+            zones.put("MST", new ZoneInfo("MST", -25200000));
+            zones.put("HST", new ZoneInfo("HST", -36000000));
         }
     }
 
+    public static boolean useOldMapping() {
+       return USE_OLDMAPPING;
+    }
+
     /**
      * Loads the rules from a DateInputStream
      *
--- a/jdk/src/share/classes/sun/util/locale/provider/RuleBasedBreakIterator.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/util/locale/provider/RuleBasedBreakIterator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/classes/sun/util/resources/ko/LocaleNames_ko.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/util/resources/ko/LocaleNames_ko.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -1045,7 +1045,7 @@
 PN=\ud54f\ucf00\uc5b8 \uc81c\ub3c4
 PR=\ud478\uc5d0\ub974\ud1a0\ub9ac\ucf54
 PS=\ud314\ub808\uc2a4\ud0c0\uc778
-PT=\ud3ec\ub974\ud2b8\uce7c
+PT=\ud3ec\ub974\ud22c\uce7c
 PW=\ud314\ub77c\uc6b0
 PY=\ud30c\ub77c\uacfc\uc774
 QA=\uce74\ud0c0\ub974
--- a/jdk/src/share/classes/sun/util/resources/sv/LocaleNames_sv.properties	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/util/resources/sv/LocaleNames_sv.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -1106,7 +1106,7 @@
 WS=Samoa
 YE=Jemen
 YT=Mayotte
-ZA=Sydafrika 
+ZA=Sydafrika
 ZM=Zambia
 ZW=Zimbabwe
 
--- a/jdk/src/share/classes/sun/util/xml/PlatformXmlPropertiesProvider.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/classes/sun/util/xml/PlatformXmlPropertiesProvider.java	Mon Nov 11 16:20:48 2013 +0100
@@ -28,6 +28,7 @@
 import java.io.*;
 import java.util.*;
 import java.nio.charset.*;
+import java.util.Map.Entry;
 import org.xml.sax.*;
 import org.w3c.dom.*;
 import javax.xml.parsers.*;
@@ -153,11 +154,15 @@
         }
 
         synchronized (props) {
-            for (String key : props.stringPropertyNames()) {
-                Element entry = (Element)properties.appendChild(
-                    doc.createElement("entry"));
-                entry.setAttribute("key", key);
-                entry.appendChild(doc.createTextNode(props.getProperty(key)));
+            for (Entry<Object, Object> e : props.entrySet()) {
+                final Object k = e.getKey();
+                final Object v = e.getValue();
+                if (k instanceof String && v instanceof String) {
+                    Element entry = (Element)properties.appendChild(
+                        doc.createElement("entry"));
+                    entry.setAttribute("key", (String)k);
+                    entry.appendChild(doc.createTextNode((String)v));
+                }
             }
         }
         emitDocument(doc, os, encoding);
--- a/jdk/src/share/demo/jfc/Font2DTest/FontPanel.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/demo/jfc/Font2DTest/FontPanel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/Notepad/resources/Notepad_fr.properties	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#
-# Resource strings for Notepad example
-
-Title=Notepad
-
-# Menu labels
-fileLabel=Fichier
-openLabel=Ouvrir
-newLabel=Nouveau
-saveLabel=Sauver
-exitLabel=Quitter
-
-editLabel=Edition
-cutLabel=Couper
-copyLabel=Copier
-pasteLabel=Coller
-
--- a/jdk/src/share/demo/jfc/Notepad/resources/Notepad_sv.properties	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#
-# Resource strings for Notepad example
-
-Title=Notepad
-
-# Menu labels
-fileLabel=Arkiv
-openLabel=Öppna
-newLabel=Ny
-saveLabel=Spara
-exitLabel=Avsluta
-
-editLabel=Redigera
-cutLabel=Klippa
-copyLabel=Kopiera
-pasteLabel=Klistra
-
--- a/jdk/src/share/demo/jfc/TableExample/TableExample4.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/demo/jfc/TableExample/TableExample4.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/demo/jvmti/hprof/debug_malloc.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/javavm/export/jvm.h	Mon Nov 11 16:20:48 2013 +0100
@@ -351,7 +351,7 @@
  * java.lang.Class and java.lang.ClassLoader
  */
 
-#define JVM_DEPTH -1
+#define JVM_CALLER_DEPTH -1
 
 /*
  * Returns the immediate caller class of the native method invoking
@@ -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/lib/security/java.security-linux	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/lib/security/java.security-linux	Mon Nov 11 16:20:48 2013 +0100
@@ -183,6 +183,7 @@
                com.sun.jmx.,\
                com.sun.media.sound.,\
                com.sun.proxy.,\
+               com.sun.corba.se.,\
                com.sun.org.apache.bcel.internal.,\
                com.sun.org.apache.regexp.internal.,\
                com.sun.org.apache.xerces.internal.,\
@@ -228,6 +229,7 @@
                    com.sun.jmx.,\
                    com.sun.media.sound.,\
                    com.sun.proxy.,\
+                   com.sun.corba.se.,\
                    com.sun.org.apache.bcel.internal.,\
                    com.sun.org.apache.regexp.internal.,\
                    com.sun.org.apache.xerces.internal.,\
--- a/jdk/src/share/lib/security/java.security-macosx	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/lib/security/java.security-macosx	Mon Nov 11 16:20:48 2013 +0100
@@ -184,6 +184,7 @@
                com.sun.jmx.,\
                com.sun.media.sound.,\
                com.sun.proxy.,\
+               com.sun.corba.se.,\
                com.sun.org.apache.bcel.internal.,\
                com.sun.org.apache.regexp.internal.,\
                com.sun.org.apache.xerces.internal.,\
@@ -229,6 +230,7 @@
                    com.sun.jmx.,\
                    com.sun.media.sound.,\
                    com.sun.proxy.,\
+                   com.sun.corba.se.,\
                    com.sun.org.apache.bcel.internal.,\
                    com.sun.org.apache.regexp.internal.,\
                    com.sun.org.apache.xerces.internal.,\
--- a/jdk/src/share/lib/security/java.security-solaris	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/lib/security/java.security-solaris	Mon Nov 11 16:20:48 2013 +0100
@@ -185,6 +185,7 @@
                com.sun.jmx.,\
                com.sun.media.sound.,\
                com.sun.proxy.,\
+               com.sun.corba.se.,\
                com.sun.org.apache.bcel.internal.,\
                com.sun.org.apache.regexp.internal.,\
                com.sun.org.apache.xerces.internal.,\
@@ -229,6 +230,7 @@
                    com.sun.jmx.,\
                    com.sun.media.sound.,\
                    com.sun.proxy.,\
+                   com.sun.corba.se.,\
                    com.sun.org.apache.bcel.internal.,\
                    com.sun.org.apache.regexp.internal.,\
                    com.sun.org.apache.xerces.internal.,\
--- a/jdk/src/share/lib/security/java.security-windows	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/lib/security/java.security-windows	Mon Nov 11 16:20:48 2013 +0100
@@ -184,6 +184,7 @@
                com.sun.jmx.,\
                com.sun.media.sound.,\
                com.sun.proxy.,\
+               com.sun.corba.se.,\
                com.sun.org.apache.bcel.internal.,\
                com.sun.org.apache.regexp.internal.,\
                com.sun.org.apache.xerces.internal.,\
@@ -229,6 +230,7 @@
                    com.sun.jmx.,\
                    com.sun.media.sound.,\
                    com.sun.proxy.,\
+                   com.sun.corba.se.,\
                    com.sun.org.apache.bcel.internal.,\
                    com.sun.org.apache.regexp.internal.,\
                    com.sun.org.apache.xerces.internal.,\
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -62,7 +62,7 @@
 
 #endif // End of ZLIB
 
-#ifdef sparc
+#ifdef _BIG_ENDIAN
 #define SWAP_BYTES(a) \
     ((((a) << 8) & 0xff00) | 0x00ff) & (((a) >> 8) | 0xff00)
 #else
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/com/sun/media/sound/PlatformMidi.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/common/jni_util.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/java/lang/fdlibm/src/k_rem_pio2.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/java/util/zip/zip_util.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/image/cvutils/img_dcm.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/image/cvutils/img_replscale.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/libpng/CHANGES	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/libpng/png.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/libpng/pngconf.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/libpng/pngpriv.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/awt/libpng/pngrutil.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/font/layout/IndicReordering.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/font/layout/TibetanReordering.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/java2d/loops/ProcessPath.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/java2d/opengl/OGLBlitLoops.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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/reflect/Reflection.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/reflect/Reflection.c	Mon Nov 11 16:20:48 2013 +0100
@@ -26,10 +26,16 @@
 #include "jvm.h"
 #include "sun_reflect_Reflection.h"
 
-JNIEXPORT jclass JNICALL Java_sun_reflect_Reflection_getCallerClass
+JNIEXPORT jclass JNICALL Java_sun_reflect_Reflection_getCallerClass__
 (JNIEnv *env, jclass unused)
 {
-    return JVM_GetCallerClass(env, JVM_DEPTH); // JVM_DEPTH is only the expected value
+    return JVM_GetCallerClass(env, JVM_CALLER_DEPTH);
+}
+
+JNIEXPORT jclass JNICALL Java_sun_reflect_Reflection_getCallerClass__I
+(JNIEnv *env, jclass unused, jint depth)
+{
+    return JVM_GetCallerClass(env, depth);
 }
 
 JNIEXPORT jint JNICALL Java_sun_reflect_Reflection_getClassAccessFlags
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/sample/jmx/jmx-scandir/index.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/sample/nio/chatserver/ClientReader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/share/sample/scripting/scriptpad/src/resources/gui.js	Mon Nov 11 16:20:48 2013 +0100
@@ -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/lang/UNIXProcess.java.bsd	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Mon Nov 11 16:20:48 2013 +0100
@@ -337,40 +337,54 @@
      * able to read any buffered data lingering in the OS pipe buffer.
      */
     static class ProcessPipeInputStream extends BufferedInputStream {
+        private final Object closeLock = new Object();
+
         ProcessPipeInputStream(int fd) {
             super(new FileInputStream(newFileDescriptor(fd)));
         }
 
-        private static byte[] drainInputStream(InputStream in)
+        private InputStream drainInputStream(InputStream in)
                 throws IOException {
-            if (in == null) return null;
             int n = 0;
             int j;
             byte[] a = null;
-            while ((j = in.available()) > 0) {
+            synchronized (closeLock) {
+                if (buf == null) // asynchronous close()?
+                    return null; // discard
+                j = in.available();
+            }
+            while (j > 0) {
                 a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
-                n += in.read(a, n, j);
+                synchronized (closeLock) {
+                    if (buf == null) // asynchronous close()?
+                        return null; // discard
+                    n += in.read(a, n, j);
+                    j = in.available();
+                }
             }
-            return (a == null || n == a.length) ? a : Arrays.copyOf(a, n);
+            return (a == null) ?
+                    ProcessBuilder.NullInputStream.INSTANCE :
+                    new ByteArrayInputStream(n == a.length ? a : Arrays.copyOf(a, n));
         }
 
         /** Called by the process reaper thread when the process exits. */
         synchronized void processExited() {
-            // Most BufferedInputStream methods are synchronized, but close()
-            // is not, and so we have to handle concurrent racing close().
             try {
                 InputStream in = this.in;
                 if (in != null) {
-                    byte[] stragglers = drainInputStream(in);
+                    InputStream stragglers = drainInputStream(in);
                     in.close();
-                    this.in = (stragglers == null) ?
-                        ProcessBuilder.NullInputStream.INSTANCE :
-                        new ByteArrayInputStream(stragglers);
-                    if (buf == null) // asynchronous close()?
-                        this.in = null;
+                    this.in = stragglers;
                 }
-            } catch (IOException ignored) {
-                // probably an asynchronous close().
+            } catch (IOException ignored) { }
+        }
+
+        @Override
+        public void close() throws IOException {
+            // BufferedInputStream#close() is not synchronized unlike most other methods.
+            // Synchronizing helps avoid racing with drainInputStream().
+            synchronized (closeLock) {
+                super.close();
             }
         }
     }
--- a/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux	Mon Nov 11 16:20:48 2013 +0100
@@ -339,40 +339,54 @@
      * able to read any buffered data lingering in the OS pipe buffer.
      */
     static class ProcessPipeInputStream extends BufferedInputStream {
+        private final Object closeLock = new Object();
+
         ProcessPipeInputStream(int fd) {
             super(new FileInputStream(newFileDescriptor(fd)));
         }
 
-        private static byte[] drainInputStream(InputStream in)
+        private InputStream drainInputStream(InputStream in)
                 throws IOException {
-            if (in == null) return null;
             int n = 0;
             int j;
             byte[] a = null;
-            while ((j = in.available()) > 0) {
+            synchronized (closeLock) {
+                if (buf == null) // asynchronous close()?
+                    return null; // discard
+                j = in.available();
+            }
+            while (j > 0) {
                 a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
-                n += in.read(a, n, j);
+                synchronized (closeLock) {
+                    if (buf == null) // asynchronous close()?
+                        return null; // discard
+                    n += in.read(a, n, j);
+                    j = in.available();
+                }
             }
-            return (a == null || n == a.length) ? a : Arrays.copyOf(a, n);
+            return (a == null) ?
+                    ProcessBuilder.NullInputStream.INSTANCE :
+                    new ByteArrayInputStream(n == a.length ? a : Arrays.copyOf(a, n));
         }
 
         /** Called by the process reaper thread when the process exits. */
         synchronized void processExited() {
-            // Most BufferedInputStream methods are synchronized, but close()
-            // is not, and so we have to handle concurrent racing close().
             try {
                 InputStream in = this.in;
                 if (in != null) {
-                    byte[] stragglers = drainInputStream(in);
+                    InputStream stragglers = drainInputStream(in);
                     in.close();
-                    this.in = (stragglers == null) ?
-                        ProcessBuilder.NullInputStream.INSTANCE :
-                        new ByteArrayInputStream(stragglers);
-                    if (buf == null) // asynchronous close()?
-                        this.in = null;
+                    this.in = stragglers;
                 }
-            } catch (IOException ignored) {
-                // probably an asynchronous close().
+            } catch (IOException ignored) { }
+        }
+
+        @Override
+        public void close() throws IOException {
+            // BufferedInputStream#close() is not synchronized unlike most other methods.
+            // Synchronizing helps avoid racing with drainInputStream().
+            synchronized (closeLock) {
+                super.close();
             }
         }
     }
--- a/jdk/src/solaris/classes/java/net/DefaultInterface.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/java/net/DefaultInterface.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XButtonPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCanvasPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCheckboxPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XChoicePeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XLabelPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuItemPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/font/FontConfigManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/font/XMap.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/jules/JulesAATileGenerator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/MaskTileManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRBackend.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRBackendNative.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRColor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRCompositeManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRPaints.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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/GnomeFileTypeDetector.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -70,12 +70,12 @@
                 // GIO may access file so need permission check
                 path.checkRead();
                 byte[] type = probeUsingGio(buffer.address());
-                return (type == null) ? null : new String(type);
+                return (type == null) ? null : Util.toString(type);
             } else {
                 byte[] type = probeUsingGnomeVfs(buffer.address());
                 if (type == null)
                     return null;
-                String s = new String(type);
+                String s = Util.toString(type);
                 return s.equals(GNOME_VFS_MIME_TYPE_UNKNOWN) ? null : s;
             }
         } finally {
--- a/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -51,7 +51,7 @@
     private static final String HIDDEN_NAME = "hidden";
 
     private static final String DOS_XATTR_NAME = "user.DOSATTRIB";
-    private static final byte[] DOS_XATTR_NAME_AS_BYTES = DOS_XATTR_NAME.getBytes();
+    private static final byte[] DOS_XATTR_NAME_AS_BYTES = Util.toBytes(DOS_XATTR_NAME);
 
     private static final int DOS_XATTR_READONLY = 0x01;
     private static final int DOS_XATTR_HIDDEN   = 0x02;
@@ -225,7 +225,7 @@
                 byte[] buf = new byte[len];
                 unsafe.copyMemory(null, buffer.address(), buf,
                     Unsafe.ARRAY_BYTE_BASE_OFFSET, len);
-                String value = new String(buf); // platform encoding
+                String value = Util.toString(buf);
 
                 // should be something like 0x20
                 if (value.length() >= 3 && value.startsWith("0x")) {
@@ -263,7 +263,7 @@
                 newValue &= ~flag;
             }
             if (newValue != oldValue) {
-                byte[] value = ("0x" + Integer.toHexString(newValue)).getBytes();
+                byte[] value = Util.toBytes("0x" + Integer.toHexString(newValue));
                 NativeBuffer buffer = NativeBuffers.asNativeBuffer(value);
                 try {
                     LinuxNativeDispatcher.fsetxattr(fd, DOS_XATTR_NAME_AS_BYTES,
--- a/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java	Mon Nov 11 16:20:48 2013 +0100
@@ -98,7 +98,8 @@
             int fd = path.openForAttributeAccess(false);
             try {
                 // fgetxattr returns size if called with size==0
-                LinuxNativeDispatcher.fgetxattr(fd, "user.java".getBytes(), 0L, 0);
+                byte[] name = Util.toBytes("user.java");
+                LinuxNativeDispatcher.fgetxattr(fd, name, 0L, 0);
                 return true;
             } catch (UnixException e) {
                 // attribute does not exist
--- a/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java	Mon Nov 11 16:20:48 2013 +0100
@@ -78,7 +78,7 @@
     Iterable<UnixMountEntry> getMountEntries(String fstab) {
         ArrayList<UnixMountEntry> entries = new ArrayList<>();
         try {
-            long fp = setmntent(fstab.getBytes(), "r".getBytes());
+            long fp = setmntent(Util.toBytes(fstab), Util.toBytes("r"));
             try {
                 for (;;) {
                     UnixMountEntry entry = new UnixMountEntry();
--- a/jdk/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -53,7 +53,7 @@
         if (name == null)
             throw new NullPointerException("'name' is null");
         name = USER_NAMESPACE + name;
-        byte[] bytes = name.getBytes();
+        byte[] bytes = Util.toBytes(name);
         if (bytes.length > XATTR_NAME_MAX) {
             throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "'" + name + "' is too big");
@@ -72,7 +72,7 @@
                 byte[] value = new byte[len];
                 unsafe.copyMemory(null, address+start, value,
                     Unsafe.ARRAY_BYTE_BASE_OFFSET, len);
-                String s = new String(value);
+                String s = Util.toString(value);
                 if (s.startsWith(USER_NAMESPACE)) {
                     s = s.substring(USER_NAMESPACE.length());
                     list.add(s);
--- a/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java	Mon Nov 11 16:20:48 2013 +0100
@@ -42,9 +42,11 @@
 class SolarisUserDefinedFileAttributeView
     extends AbstractUserDefinedFileAttributeView
 {
+    private static final byte[] HERE = { '.' };
+
     private byte[] nameAsBytes(UnixPath file, String name) throws IOException {
-        byte[] bytes = name.getBytes();
-        //  "", "." and ".." not allowed
+        byte[] bytes = Util.toBytes(name);
+        // "", "." and ".." not allowed
         if (bytes.length == 0 || bytes[0] == '.') {
             if (bytes.length <= 1 ||
                 (bytes.length == 2 && bytes[1] == '.'))
@@ -73,7 +75,7 @@
         try {
             try {
                 // open extended attribute directory
-                int dfd = openat(fd, ".".getBytes(), (O_RDONLY|O_XATTR), 0);
+                int dfd = openat(fd, HERE, (O_RDONLY|O_XATTR), 0);
                 long dp;
                 try {
                     dp = fdopendir(dfd);
@@ -87,7 +89,7 @@
                 try {
                     byte[] name;
                     while ((name = readdir(dp)) != null) {
-                        String s = new String(name);
+                        String s = Util.toString(name);
                         if (!s.equals(".") && !s.equals(".."))
                             list.add(s);
                     }
@@ -217,7 +219,7 @@
 
         int fd = file.openForAttributeAccess(followLinks);
         try {
-            int dfd = openat(fd, ".".getBytes(), (O_RDONLY|O_XATTR), 0);
+            int dfd = openat(fd, HERE, (O_RDONLY|O_XATTR), 0);
             try {
                 unlinkat(dfd, nameAsBytes(file,name), 0);
             } finally {
@@ -243,7 +245,7 @@
     static void copyExtendedAttributes(int ofd, int nfd) {
         try {
             // open extended attribute directory
-            int dfd = openat(ofd, ".".getBytes(), (O_RDONLY|O_XATTR), 0);
+            int dfd = openat(ofd, HERE, (O_RDONLY|O_XATTR), 0);
             long dp = 0L;
             try {
                 dp = fdopendir(dfd);
--- a/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/UnixException.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixException.java	Mon Nov 11 16:20:48 2013 +0100
@@ -61,7 +61,7 @@
         if (msg != null) {
             return msg;
         } else {
-            return new String(UnixNativeDispatcher.strerror(errno()));
+            return Util.toString(UnixNativeDispatcher.strerror(errno()));
         }
     }
 
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java	Mon Nov 11 16:20:48 2013 +0100
@@ -196,7 +196,7 @@
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder(new String(entry.dir()));
+        StringBuilder sb = new StringBuilder(Util.toString(entry.dir()));
         sb.append(" (");
         sb.append(entry.name());
         sb.append(")");
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java	Mon Nov 11 16:20:48 2013 +0100
@@ -49,7 +49,7 @@
     // package-private
     UnixFileSystem(UnixFileSystemProvider provider, String dir) {
         this.provider = provider;
-        this.defaultDirectory = UnixPath.normalizeAndCheck(dir).getBytes();
+        this.defaultDirectory = Util.toBytes(UnixPath.normalizeAndCheck(dir));
         if (this.defaultDirectory[0] != '/') {
             throw new RuntimeException("default directory must be absolute");
         }
@@ -204,7 +204,7 @@
                 SecurityManager sm = System.getSecurityManager();
                 if (sm != null) {
                     try {
-                        sm.checkRead(new String(entry.dir()));
+                        sm.checkRead(Util.toString(entry.dir()));
                     } catch (SecurityException x) {
                         continue;
                     }
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixMountEntry.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixMountEntry.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,12 +43,12 @@
     }
 
     String name() {
-        return new String(name);
+        return Util.toString(name);
     }
 
     String fstype() {
         if (fstypeAsString == null)
-            fstypeAsString = new String(fstype);
+            fstypeAsString = Util.toString(fstype);
         return fstypeAsString;
     }
 
@@ -65,7 +65,7 @@
      */
     boolean hasOption(String requested) {
         if (optionsAsString == null)
-            optionsAsString = new String(opts);
+            optionsAsString = Util.toString(opts);
         for (String opt: Util.split(optionsAsString, ',')) {
             if (opt.equals(requested))
                 return true;
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java	Mon Nov 11 16:20:48 2013 +0100
@@ -100,7 +100,7 @@
      */
     static long fopen(UnixPath filename, String mode) throws UnixException {
         NativeBuffer pathBuffer = copyToNativeBuffer(filename);
-        NativeBuffer modeBuffer = NativeBuffers.asNativeBuffer(mode.getBytes());
+        NativeBuffer modeBuffer = NativeBuffers.asNativeBuffer(Util.toBytes(mode));
         try {
             return fopen0(pathBuffer.address(), modeBuffer.address());
         } finally {
@@ -473,7 +473,7 @@
      * @return  passwd->pw_uid
      */
     static int getpwnam(String name) throws UnixException {
-        NativeBuffer buffer = NativeBuffers.asNativeBuffer(name.getBytes());
+        NativeBuffer buffer = NativeBuffers.asNativeBuffer(Util.toBytes(name));
         try {
             return getpwnam0(buffer.address());
         } finally {
@@ -488,7 +488,7 @@
      * @return  group->gr_name
      */
     static int getgrnam(String name) throws UnixException {
-        NativeBuffer buffer = NativeBuffers.asNativeBuffer(name.getBytes());
+        NativeBuffer buffer = NativeBuffers.asNativeBuffer(Util.toBytes(name));
         try {
             return getgrnam0(buffer.address());
         } finally {
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java	Mon Nov 11 16:20:48 2013 +0100
@@ -120,7 +120,7 @@
         SoftReference<CharsetEncoder> ref = encoder.get();
         CharsetEncoder ce = (ref != null) ? ref.get() : null;
         if (ce == null) {
-            ce = Charset.defaultCharset().newEncoder()
+            ce = Util.jnuEncoding().newEncoder()
                 .onMalformedInput(CodingErrorAction.REPORT)
                 .onUnmappableCharacter(CodingErrorAction.REPORT);
             encoder.set(new SoftReference<CharsetEncoder>(ce));
@@ -186,7 +186,7 @@
     // use this path for permission checks
     String getPathForPermissionCheck() {
         if (getFileSystem().needToResolveAgainstDefaultDirectory()) {
-            return new String(getByteArrayForSysCalls());
+            return Util.toString(getByteArrayForSysCalls());
         } else {
             return toString();
         }
@@ -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 {
@@ -758,7 +758,7 @@
     public String toString() {
         // OK if two or more threads create a String
         if (stringValue == null) {
-            stringValue = fs.normalizeJavaPath(new String(path));     // platform encoding
+            stringValue = fs.normalizeJavaPath(Util.toString(path));     // platform encoding
         }
         return stringValue;
     }
--- a/jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/nio/fs/UnixUserPrincipals.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/nio/fs/UnixUserPrincipals.java	Mon Nov 11 16:20:48 2013 +0100
@@ -115,7 +115,7 @@
     static User fromUid(int uid) {
         String name = null;
         try {
-            name = new String(getpwuid(uid));
+            name = Util.toString(getpwuid(uid));
         } catch (UnixException x) {
             name = Integer.toString(uid);
         }
@@ -126,7 +126,7 @@
     static Group fromGid(int gid) {
         String name = null;
         try {
-            name = new String(getgrgid(gid));
+            name = Util.toString(getgrgid(gid));
         } catch (UnixException x) {
             name = Integer.toString(gid);
         }
--- a/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/demo/jni/Poller/Poller.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_Ports.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_Ports.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_SolarisOS_PCM.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_SolarisOS_Utils.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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/java/lang/java_props_macosx.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/java/lang/java_props_macosx.c	Mon Nov 11 16:20:48 2013 +0100
@@ -106,6 +106,12 @@
 }
 
 int isInAquaSession() {
+    // environment variable to bypass the aqua session check
+    char *ev = getenv("AWT_FORCE_HEADFUL");
+    if (ev && (strncasecmp(ev, "true", 4) == 0)) {
+        // if "true" then tell the caller we're in an Aqua session without actually checking
+        return 1;
+    }
     // Is the WindowServer available?
     SecuritySessionId session_id;
     SessionAttributeBits session_info;
--- a/jdk/src/solaris/native/java/net/NetworkInterface.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/java/net/NetworkInterface.c	Mon Nov 11 16:20:48 2013 +0100
@@ -170,31 +170,56 @@
 JNIEXPORT void JNICALL
 Java_java_net_NetworkInterface_init(JNIEnv *env, jclass cls) {
     ni_class = (*env)->FindClass(env,"java/net/NetworkInterface");
+    CHECK_NULL(ni_class);
     ni_class = (*env)->NewGlobalRef(env, ni_class);
+    CHECK_NULL(ni_class);
     ni_nameID = (*env)->GetFieldID(env, ni_class,"name", "Ljava/lang/String;");
+    CHECK_NULL(ni_nameID);
     ni_indexID = (*env)->GetFieldID(env, ni_class, "index", "I");
+    CHECK_NULL(ni_indexID);
     ni_addrsID = (*env)->GetFieldID(env, ni_class, "addrs", "[Ljava/net/InetAddress;");
+    CHECK_NULL(ni_addrsID);
     ni_bindsID = (*env)->GetFieldID(env, ni_class, "bindings", "[Ljava/net/InterfaceAddress;");
+    CHECK_NULL(ni_bindsID);
     ni_descID = (*env)->GetFieldID(env, ni_class, "displayName", "Ljava/lang/String;");
+    CHECK_NULL(ni_descID);
     ni_virutalID = (*env)->GetFieldID(env, ni_class, "virtual", "Z");
+    CHECK_NULL(ni_virutalID);
     ni_childsID = (*env)->GetFieldID(env, ni_class, "childs", "[Ljava/net/NetworkInterface;");
+    CHECK_NULL(ni_childsID);
     ni_parentID = (*env)->GetFieldID(env, ni_class, "parent", "Ljava/net/NetworkInterface;");
+    CHECK_NULL(ni_parentID);
     ni_ctrID = (*env)->GetMethodID(env, ni_class, "<init>", "()V");
+    CHECK_NULL(ni_ctrID);
 
     ni_iacls = (*env)->FindClass(env, "java/net/InetAddress");
+    CHECK_NULL(ni_iacls);
     ni_iacls = (*env)->NewGlobalRef(env, ni_iacls);
+    CHECK_NULL(ni_iacls);
     ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address");
+    CHECK_NULL(ni_ia4cls);
     ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls);
+    CHECK_NULL(ni_ia4cls);
     ni_ia6cls = (*env)->FindClass(env, "java/net/Inet6Address");
+    CHECK_NULL(ni_ia6cls);
     ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls);
+    CHECK_NULL(ni_ia6cls);
     ni_ibcls = (*env)->FindClass(env, "java/net/InterfaceAddress");
+    CHECK_NULL(ni_ibcls);
     ni_ibcls = (*env)->NewGlobalRef(env, ni_ibcls);
+    CHECK_NULL(ni_ibcls);
     ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "<init>", "()V");
+    CHECK_NULL(ni_ia4ctrID);
     ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "<init>", "()V");
+    CHECK_NULL(ni_ia6ctrID);
     ni_ibctrID = (*env)->GetMethodID(env, ni_ibcls, "<init>", "()V");
+    CHECK_NULL(ni_ibctrID);
     ni_ibaddressID = (*env)->GetFieldID(env, ni_ibcls, "address", "Ljava/net/InetAddress;");
+    CHECK_NULL(ni_ibaddressID);
     ni_ib4broadcastID = (*env)->GetFieldID(env, ni_ibcls, "broadcast", "Ljava/net/Inet4Address;");
+    CHECK_NULL(ni_ib4broadcastID);
     ni_ib4maskID = (*env)->GetFieldID(env, ni_ibcls, "maskLength", "S");
+    CHECK_NULL(ni_ib4maskID);
     ni_defaultIndexID = (*env)->GetStaticFieldID(env, ni_class, "defaultIndex", "I");
 }
 
--- a/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/sun/awt/multiVis.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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/net/spi/DefaultProxySelector.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 #include "sun_net_spi_DefaultProxySelector.h"
 #include <dlfcn.h>
 #include <stdio.h>
+#include <stdlib.h>
 #if defined(__linux__) || defined(_ALLBSD_SOURCE)
 #include <string.h>
 #else
@@ -60,6 +61,10 @@
  * - /system/proxy/no_proxy_for                 list
  * - /system/proxy/gopher_host                  string
  * - /system/proxy/gopher_port                  int
+ *
+ * The following keys are not used in the new gnome 3
+ * - /system/http_proxy/use_http_proxy
+ * - /system/http_proxy/use_same_proxy
  */
 typedef void* gconf_client_get_default_func();
 typedef char* gconf_client_get_string_func(void *, char *, void**);
@@ -74,6 +79,36 @@
 gconf_init_func* my_gconf_init_func = NULL;
 g_type_init_func* my_g_type_init_func = NULL;
 
+
+/*
+ * GProxyResolver provides synchronous and asynchronous network
+ * proxy resolution. It is based on GSettings, which is the standard
+ * of Gnome 3, to get system settings.
+ *
+ * In the current implementation, GProxyResolver has a higher priority
+ * than the old GConf. And we only resolve the proxy synchronously. In
+ * the future, we can also do the asynchronous network proxy resolution
+ * if necessary.
+ *
+ */
+typedef struct _GProxyResolver GProxyResolver;
+typedef struct _GSocketConnectable GSocketConnectable;
+typedef struct GError GError;
+typedef GProxyResolver* g_proxy_resolver_get_default_func();
+typedef char** g_proxy_resolver_lookup_func();
+typedef GSocketConnectable* g_network_address_parse_uri_func();
+typedef const char* g_network_address_get_hostname_func();
+typedef unsigned short g_network_address_get_port_func();
+typedef void g_strfreev_func();
+
+static g_proxy_resolver_get_default_func* g_proxy_resolver_get_default = NULL;
+static g_proxy_resolver_lookup_func* g_proxy_resolver_lookup = NULL;
+static g_network_address_parse_uri_func* g_network_address_parse_uri = NULL;
+static g_network_address_get_hostname_func* g_network_address_get_hostname = NULL;
+static g_network_address_get_port_func* g_network_address_get_port = NULL;
+static g_strfreev_func* g_strfreev = NULL;
+
+
 static jclass proxy_class;
 static jclass isaddr_class;
 static jclass ptype_class;
@@ -83,11 +118,363 @@
 static jfieldID ptype_httpID;
 static jfieldID ptype_socksID;
 
-static int gconf_ver = 0;
+
 static void* gconf_client = NULL;
 
+static int use_gproxyResolver = 0;
+static int use_gconf = 0;
+
 #define CHECK_NULL(X) { if ((X) == NULL) fprintf (stderr,"JNI errror at line %d\n", __LINE__); }
 
+
+static int initGConf() {
+    /**
+     * Let's try to load GConf-2 library
+     */
+    if (dlopen(JNI_LIB_NAME("gconf-2"), RTLD_GLOBAL | RTLD_LAZY) != NULL ||
+        dlopen(VERSIONED_JNI_LIB_NAME("gconf-2", "4"),
+               RTLD_GLOBAL | RTLD_LAZY) != NULL)
+    {
+        /*
+         * Now let's get pointer to the functions we need.
+         */
+        my_g_type_init_func =
+                (g_type_init_func*)dlsym(RTLD_DEFAULT, "g_type_init");
+        my_get_default_func =
+                (gconf_client_get_default_func*)dlsym(RTLD_DEFAULT,
+                        "gconf_client_get_default");
+
+        if (my_g_type_init_func != NULL && my_get_default_func != NULL) {
+            /**
+             * Try to connect to GConf.
+             */
+            (*my_g_type_init_func)();
+            gconf_client = (*my_get_default_func)();
+            if (gconf_client != NULL) {
+                my_get_string_func =
+                        (gconf_client_get_string_func*)dlsym(RTLD_DEFAULT,
+                                "gconf_client_get_string");
+                my_get_int_func =
+                        (gconf_client_get_int_func*)dlsym(RTLD_DEFAULT,
+                                "gconf_client_get_int");
+                my_get_bool_func =
+                        (gconf_client_get_bool_func*)dlsym(RTLD_DEFAULT,
+                                "gconf_client_get_bool");
+                if (my_get_int_func != NULL && my_get_string_func != NULL &&
+                        my_get_bool_func != NULL)
+                {
+                    /**
+                     * We did get all we need. Let's enable the System Proxy Settings.
+                     */
+                    return 1;
+                }
+            }
+        }
+    }
+    return 0;
+}
+
+static jobject getProxyByGConf(JNIEnv *env, const char* cproto,
+                               const char* chost)
+{
+    char *phost = NULL;
+    char *mode = NULL;
+    int pport = 0;
+    int use_proxy = 0;
+    int use_same_proxy = 0;
+    jobject isa = NULL;
+    jobject proxy = NULL;
+    jobject type_proxy = NULL;
+
+    // We only check manual proxy configurations
+    mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
+    if (mode && !strcasecmp(mode, "manual")) {
+        /*
+         * Even though /system/http_proxy/use_same_proxy is no longer used,
+         * its value is set to false in gnome 3. So it is not harmful to check
+         * it first in case jdk is used with an old gnome.
+         */
+        use_same_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_same_proxy", NULL);
+        if (use_same_proxy) {
+            phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL);
+            pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL);
+            use_proxy = (phost != NULL && pport != 0);
+            if (use_proxy)
+                type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
+        }
+
+        if (!use_proxy) {
+            /**
+             * HTTP:
+             * /system/http_proxy/use_http_proxy (boolean) - it's no longer used
+             * /system/http_proxy/host (string)
+             * /system/http_proxy/port (integer)
+             */
+            if (strcasecmp(cproto, "http") == 0) {
+                phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL);
+                pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL);
+                use_proxy = (phost != NULL && pport != 0);
+                if (use_proxy)
+                    type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
+            }
+
+            /**
+             * HTTPS:
+             * /system/proxy/mode (string) [ "manual" means use proxy settings ]
+             * /system/proxy/secure_host (string)
+             * /system/proxy/secure_port (integer)
+             */
+            if (strcasecmp(cproto, "https") == 0) {
+                phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL);
+                pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL);
+                use_proxy = (phost != NULL && pport != 0);
+                if (use_proxy)
+                    type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
+            }
+
+            /**
+             * FTP:
+             * /system/proxy/mode (string) [ "manual" means use proxy settings ]
+             * /system/proxy/ftp_host (string)
+             * /system/proxy/ftp_port (integer)
+             */
+            if (strcasecmp(cproto, "ftp") == 0) {
+                phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL);
+                pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL);
+                use_proxy = (phost != NULL && pport != 0);
+                if (use_proxy)
+                    type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
+            }
+
+            /**
+             * GOPHER:
+             * /system/proxy/mode (string) [ "manual" means use proxy settings ]
+             * /system/proxy/gopher_host (string)
+             * /system/proxy/gopher_port (integer)
+             */
+            if (strcasecmp(cproto, "gopher") == 0) {
+                phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL);
+                pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL);
+                use_proxy = (phost != NULL && pport != 0);
+                if (use_proxy)
+                    type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
+            }
+
+            /**
+             * SOCKS:
+             * /system/proxy/mode (string) [ "manual" means use proxy settings ]
+             * /system/proxy/socks_host (string)
+             * /system/proxy/socks_port (integer)
+             */
+            if (strcasecmp(cproto, "socks") == 0) {
+                phost = (*my_get_string_func)(gconf_client, "/system/proxy/socks_host", NULL);
+                pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL);
+                use_proxy = (phost != NULL && pport != 0);
+                if (use_proxy)
+                    type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_socksID);
+            }
+        }
+    }
+
+    if (use_proxy) {
+        jstring jhost;
+        char *noproxyfor;
+        char *s;
+
+        /**
+         * check for the exclude list (aka "No Proxy For" list).
+         * It's a list of comma separated suffixes (e.g. domain name).
+         */
+        noproxyfor = (*my_get_string_func)(gconf_client, "/system/proxy/no_proxy_for", NULL);
+        if (noproxyfor != NULL) {
+            char *tmpbuf[512];
+            s = strtok_r(noproxyfor, ", ", tmpbuf);
+
+            while (s != NULL && strlen(s) <= strlen(chost)) {
+                if (strcasecmp(chost+(strlen(chost) - strlen(s)), s) == 0) {
+                    /**
+                     * the URL host name matches with one of the sufixes,
+                     * therefore we have to use a direct connection.
+                     */
+                    use_proxy = 0;
+                    break;
+                }
+                s = strtok_r(NULL, ", ", tmpbuf);
+            }
+        }
+        if (use_proxy) {
+            CHECK_NULL(type_proxy);
+            jhost = (*env)->NewStringUTF(env, phost);
+            isa = (*env)->CallStaticObjectMethod(env, isaddr_class, isaddr_createUnresolvedID, jhost, pport);
+            proxy = (*env)->NewObject(env, proxy_class, proxy_ctrID, type_proxy, isa);
+        }
+    }
+
+    return proxy;
+}
+
+static int initGProxyResolver() {
+    void *gio_handle;
+
+    gio_handle = dlopen("libgio-2.0.so", RTLD_LAZY);
+    if (!gio_handle) {
+        gio_handle = dlopen("libgio-2.0.so.0", RTLD_LAZY);
+        if (!gio_handle) {
+            return 0;
+        }
+    }
+
+    my_g_type_init_func = (g_type_init_func*)dlsym(gio_handle, "g_type_init");
+
+    g_proxy_resolver_get_default =
+            (g_proxy_resolver_get_default_func*)dlsym(gio_handle,
+                    "g_proxy_resolver_get_default");
+
+    g_proxy_resolver_lookup =
+            (g_proxy_resolver_lookup_func*)dlsym(gio_handle,
+                    "g_proxy_resolver_lookup");
+
+    g_network_address_parse_uri =
+            (g_network_address_parse_uri_func*)dlsym(gio_handle,
+                    "g_network_address_parse_uri");
+
+    g_network_address_get_hostname =
+            (g_network_address_get_hostname_func*)dlsym(gio_handle,
+                    "g_network_address_get_hostname");
+
+    g_network_address_get_port =
+            (g_network_address_get_port_func*)dlsym(gio_handle,
+                    "g_network_address_get_port");
+
+    g_strfreev = (g_strfreev_func*)dlsym(gio_handle, "g_strfreev");
+
+    if (!my_g_type_init_func ||
+        !g_proxy_resolver_get_default ||
+        !g_proxy_resolver_lookup ||
+        !g_network_address_parse_uri ||
+        !g_network_address_get_hostname ||
+        !g_network_address_get_port ||
+        !g_strfreev)
+    {
+        dlclose(gio_handle);
+        return 0;
+    }
+
+    (*my_g_type_init_func)();
+    return 1;
+}
+
+static jobject getProxyByGProxyResolver(JNIEnv *env, const char* cproto,
+                                        const char* chost)
+{
+    GProxyResolver* resolver = NULL;
+    char** proxies = NULL;
+    GError *error = NULL;
+
+    size_t protoLen = 0;
+    size_t hostLen = 0;
+    char* uri = NULL;
+
+    jobject objProxy = NULL;
+
+    resolver = (*g_proxy_resolver_get_default)();
+    if (resolver == NULL) {
+        return NULL;
+    }
+
+    // Construct the uri, cproto + "://" + chost
+    protoLen = strlen(cproto);
+    hostLen = strlen(chost);
+    uri = malloc(protoLen + hostLen + 4);
+    if (!uri) {
+        // Out of memory
+        return NULL;
+    }
+    memcpy(uri, cproto, protoLen);
+    memcpy(uri + protoLen, "://", 3);
+    memcpy(uri + protoLen + 3, chost, hostLen + 1);
+
+    /*
+     * Looks into the system proxy configuration to determine what proxy,
+     * if any, to use to connect to uri. The returned proxy URIs are of
+     * the form <protocol>://[user[:password]@]host:port or direct://,
+     * where <protocol> could be http, rtsp, socks or other proxying protocol.
+     * direct:// is used when no proxy is needed.
+     */
+    proxies = (*g_proxy_resolver_lookup)(resolver, uri, NULL, &error);
+    free(uri);
+
+    if (proxies) {
+        if (!error) {
+            int i;
+            for(i = 0; proxies[i] && !objProxy; i++) {
+                if (strcmp(proxies[i], "direct://")) {
+                    GSocketConnectable* conn =
+                            (*g_network_address_parse_uri)(proxies[i], 0,
+                                                           &error);
+                    if (conn && !error) {
+                        const char* phost = NULL;
+                        unsigned short pport = 0;
+                        phost = (*g_network_address_get_hostname)(conn);
+                        pport = (*g_network_address_get_port)(conn);
+                        if (phost && pport > 0) {
+                            jobject type_proxy = NULL;
+                            jstring jhost = NULL;
+                            jobject isa = NULL;
+                            jfieldID ptype_ID = ptype_httpID;
+                            if (!strncmp(proxies[i], "socks", 5)) {
+                                ptype_ID = ptype_socksID;
+                            }
+
+                            type_proxy = (*env)->GetStaticObjectField(env,
+                                    ptype_class, ptype_ID);
+                            CHECK_NULL(type_proxy);
+                            jhost = (*env)->NewStringUTF(env, phost);
+                            CHECK_NULL(jhost);
+                            isa = (*env)->CallStaticObjectMethod(env,
+                                    isaddr_class, isaddr_createUnresolvedID,
+                                    jhost, pport);
+                            CHECK_NULL(isa);
+                            objProxy = (*env)->NewObject(env, proxy_class,
+                                    proxy_ctrID, type_proxy, isa);
+                        }
+                    }
+                }
+            }
+        }
+        (*g_strfreev)(proxies);
+    }
+
+    return objProxy;
+}
+
+static void initJavaClass(JNIEnv *env) {
+    jclass cls = NULL;
+    CHECK_NULL(cls = (*env)->FindClass(env,"java/net/Proxy"));
+    proxy_class = (*env)->NewGlobalRef(env, cls);
+    CHECK_NULL(cls = (*env)->FindClass(env,"java/net/Proxy$Type"));
+    ptype_class = (*env)->NewGlobalRef(env, cls);
+    CHECK_NULL(cls = (*env)->FindClass(env, "java/net/InetSocketAddress"));
+    isaddr_class = (*env)->NewGlobalRef(env, cls);
+    proxy_ctrID = (*env)->GetMethodID(env, proxy_class, "<init>",
+            "(Ljava/net/Proxy$Type;Ljava/net/SocketAddress;)V");
+    CHECK_NULL(proxy_ctrID);
+    pr_no_proxyID = (*env)->GetStaticFieldID(env, proxy_class, "NO_PROXY",
+            "Ljava/net/Proxy;");
+    CHECK_NULL(pr_no_proxyID);
+    ptype_httpID = (*env)->GetStaticFieldID(env, ptype_class, "HTTP",
+            "Ljava/net/Proxy$Type;");
+    CHECK_NULL(ptype_httpID);
+    ptype_socksID = (*env)->GetStaticFieldID(env, ptype_class, "SOCKS",
+            "Ljava/net/Proxy$Type;");
+    CHECK_NULL(ptype_socksID);
+    isaddr_createUnresolvedID = (*env)->GetStaticMethodID(env, isaddr_class,
+            "createUnresolved",
+            "(Ljava/lang/String;I)Ljava/net/InetSocketAddress;");
+    CHECK_NULL(isaddr_createUnresolvedID);
+}
+
+
 /*
  * Class:     sun_net_spi_DefaultProxySelector
  * Method:    init
@@ -95,57 +482,17 @@
  */
 JNIEXPORT jboolean JNICALL
 Java_sun_net_spi_DefaultProxySelector_init(JNIEnv *env, jclass clazz) {
-  jclass cls = NULL;
-  CHECK_NULL(cls = (*env)->FindClass(env,"java/net/Proxy"));
-  proxy_class = (*env)->NewGlobalRef(env, cls);
-  CHECK_NULL(cls = (*env)->FindClass(env,"java/net/Proxy$Type"));
-  ptype_class = (*env)->NewGlobalRef(env, cls);
-  CHECK_NULL(cls = (*env)->FindClass(env, "java/net/InetSocketAddress"));
-  isaddr_class = (*env)->NewGlobalRef(env, cls);
-  proxy_ctrID = (*env)->GetMethodID(env, proxy_class, "<init>", "(Ljava/net/Proxy$Type;Ljava/net/SocketAddress;)V");
-  pr_no_proxyID = (*env)->GetStaticFieldID(env, proxy_class, "NO_PROXY", "Ljava/net/Proxy;");
-  ptype_httpID = (*env)->GetStaticFieldID(env, ptype_class, "HTTP", "Ljava/net/Proxy$Type;");
-  ptype_socksID = (*env)->GetStaticFieldID(env, ptype_class, "SOCKS", "Ljava/net/Proxy$Type;");
-  isaddr_createUnresolvedID = (*env)->GetStaticMethodID(env, isaddr_class, "createUnresolved", "(Ljava/lang/String;I)Ljava/net/InetSocketAddress;");
+    use_gproxyResolver = initGProxyResolver();
+    if (!use_gproxyResolver)
+        use_gconf = initGConf();
 
-  /**
-   * Let's try to load le GConf-2 library
-   */
-  if (dlopen(JNI_LIB_NAME("gconf-2"), RTLD_GLOBAL | RTLD_LAZY) != NULL ||
-      dlopen(VERSIONED_JNI_LIB_NAME("gconf-2", "4"),
-             RTLD_GLOBAL | RTLD_LAZY) != NULL) {
-    gconf_ver = 2;
-  }
-  if (gconf_ver > 0) {
-    /*
-     * Now let's get pointer to the functions we need.
-     */
-    my_g_type_init_func = (g_type_init_func*) dlsym(RTLD_DEFAULT, "g_type_init");
-    my_get_default_func = (gconf_client_get_default_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_default");
-    if (my_g_type_init_func != NULL && my_get_default_func != NULL) {
-      /**
-       * Try to connect to GConf.
-       */
-      (*my_g_type_init_func)();
-      gconf_client = (*my_get_default_func)();
-      if (gconf_client != NULL) {
-        my_get_string_func = (gconf_client_get_string_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_string");
-        my_get_int_func = (gconf_client_get_int_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_int");
-        my_get_bool_func = (gconf_client_get_bool_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_bool");
-        if (my_get_int_func != NULL && my_get_string_func != NULL &&
-            my_get_bool_func != NULL) {
-          /**
-           * We did get all we need. Let's enable the System Proxy Settings.
-           */
-          return JNI_TRUE;
-        }
-      }
-    }
-  }
-  return JNI_FALSE;
+    if (use_gproxyResolver || use_gconf) {
+        initJavaClass(env);
+        return JNI_TRUE;
+    } else
+        return JNI_FALSE;
 }
 
-
 /*
  * Class:     sun_net_spi_DefaultProxySelector
  * Method:    getSystemProxy
@@ -157,179 +504,35 @@
                                                      jstring proto,
                                                      jstring host)
 {
-  char *phost = NULL;
-  char *mode = NULL;
-  int pport = 0;
-  int use_proxy = 0;
-  int use_same_proxy = 0;
-  const char* urlhost;
-  jobject isa = NULL;
-  jobject proxy = NULL;
-  jobject type_proxy = NULL;
-  jobject no_proxy = NULL;
-  const char *cproto;
-  jboolean isCopy;
-
-  if (gconf_ver > 0) {
-    if (gconf_client == NULL) {
-      (*my_g_type_init_func)();
-      gconf_client = (*my_get_default_func)();
-    }
-    if (gconf_client != NULL) {
-      cproto = (*env)->GetStringUTFChars(env, proto, &isCopy);
-      if (cproto != NULL) {
-        /**
-         * We will have to check protocol by protocol as they do use different
-         * entries.
-         */
-
-        use_same_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_same_proxy", NULL);
-        if (use_same_proxy) {
-          use_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_http_proxy", NULL);
-          if (use_proxy) {
-            phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL);
-            pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL);
-          }
-        }
+    const char* cproto;
+    const char* chost;
 
-        /**
-         * HTTP:
-         * /system/http_proxy/use_http_proxy (boolean)
-         * /system/http_proxy/host (string)
-         * /system/http_proxy/port (integer)
-         */
-        if (strcasecmp(cproto, "http") == 0) {
-          use_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_http_proxy", NULL);
-          if (use_proxy) {
-            if (!use_same_proxy) {
-              phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL);
-              pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL);
-            }
-            CHECK_NULL(type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID));
-          }
-        }
+    jboolean isProtoCopy;
+    jboolean isHostCopy;
 
-        /**
-         * HTTPS:
-         * /system/proxy/mode (string) [ "manual" means use proxy settings ]
-         * /system/proxy/secure_host (string)
-         * /system/proxy/secure_port (integer)
-         */
-        if (strcasecmp(cproto, "https") == 0) {
-          mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
-          if (mode != NULL && (strcasecmp(mode,"manual") == 0)) {
-            if (!use_same_proxy) {
-              phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL);
-              pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL);
-            }
-            use_proxy = (phost != NULL);
-            if (use_proxy)
-              type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
-          }
-        }
+    jobject proxy = NULL;
+
+    cproto = (*env)->GetStringUTFChars(env, proto, &isProtoCopy);
 
-        /**
-         * FTP:
-         * /system/proxy/mode (string) [ "manual" means use proxy settings ]
-         * /system/proxy/ftp_host (string)
-         * /system/proxy/ftp_port (integer)
-         */
-        if (strcasecmp(cproto, "ftp") == 0) {
-          mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
-          if (mode != NULL && (strcasecmp(mode,"manual") == 0)) {
-            if (!use_same_proxy) {
-              phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL);
-              pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL);
-            }
-            use_proxy = (phost != NULL);
-            if (use_proxy)
-              type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
-          }
-        }
-
-        /**
-         * GOPHER:
-         * /system/proxy/mode (string) [ "manual" means use proxy settings ]
-         * /system/proxy/gopher_host (string)
-         * /system/proxy/gopher_port (integer)
-         */
-        if (strcasecmp(cproto, "gopher") == 0) {
-          mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
-          if (mode != NULL && (strcasecmp(mode,"manual") == 0)) {
-            if (!use_same_proxy) {
-              phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL);
-              pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL);
-            }
-            use_proxy = (phost != NULL);
-            if (use_proxy)
-              type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
-          }
-        }
+    if (cproto != NULL && (use_gproxyResolver || use_gconf)) {
+        chost = (*env)->GetStringUTFChars(env, host, &isHostCopy);
+        if (chost != NULL) {
+            if (use_gproxyResolver)
+                proxy = getProxyByGProxyResolver(env, cproto, chost);
+            else if (use_gconf)
+                proxy = getProxyByGConf(env, cproto, chost);
 
-        /**
-         * SOCKS:
-         * /system/proxy/mode (string) [ "manual" means use proxy settings ]
-         * /system/proxy/socks_host (string)
-         * /system/proxy/socks_port (integer)
-         */
-        if (strcasecmp(cproto, "socks") == 0) {
-          mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
-          if (mode != NULL && (strcasecmp(mode,"manual") == 0)) {
-            if (!use_same_proxy) {
-              phost = (*my_get_string_func)(gconf_client, "/system/proxy/socks_host", NULL);
-              pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL);
-            }
-            use_proxy = (phost != NULL);
-            if (use_proxy)
-              type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_socksID);
-          }
+            if (isHostCopy == JNI_TRUE)
+                (*env)->ReleaseStringUTFChars(env, host, chost);
         }
-
-        if (isCopy == JNI_TRUE)
-          (*env)->ReleaseStringUTFChars(env, proto, cproto);
-
-        if (use_proxy && (phost != NULL)) {
-          jstring jhost;
-          char *noproxyfor;
-          char *s;
+        if (isProtoCopy == JNI_TRUE)
+            (*env)->ReleaseStringUTFChars(env, proto, cproto);
+    }
 
-          /**
-           * check for the exclude list (aka "No Proxy For" list).
-           * It's a list of comma separated suffixes (e.g. domain name).
-           */
-          noproxyfor = (*my_get_string_func)(gconf_client, "/system/proxy/no_proxy_for", NULL);
-          if (noproxyfor != NULL) {
-            char *tmpbuf[512];
+    if (proxy == NULL) {
+        CHECK_NULL(proxy = (*env)->GetStaticObjectField(env, proxy_class,
+                                                        pr_no_proxyID));
+    }
+    return proxy;
+}
 
-            s = strtok_r(noproxyfor, ", ", tmpbuf);
-            urlhost = (*env)->GetStringUTFChars(env, host, &isCopy);
-            if (urlhost != NULL) {
-              while (s != NULL && strlen(s) <= strlen(urlhost)) {
-                if (strcasecmp(urlhost+(strlen(urlhost) - strlen(s)), s) == 0) {
-                  /**
-                   * the URL host name matches with one of the sufixes,
-                   * therefore we have to use a direct connection.
-                   */
-                  use_proxy = 0;
-                  break;
-                }
-                s = strtok_r(NULL, ", ", tmpbuf);
-              }
-              if (isCopy == JNI_TRUE)
-                (*env)->ReleaseStringUTFChars(env, host, urlhost);
-            }
-          }
-          if (use_proxy) {
-            jhost = (*env)->NewStringUTF(env, phost);
-            isa = (*env)->CallStaticObjectMethod(env, isaddr_class, isaddr_createUnresolvedID, jhost, pport);
-            proxy = (*env)->NewObject(env, proxy_class, proxy_ctrID, type_proxy, isa);
-            return proxy;
-          }
-        }
-      }
-    }
-  }
-
-  CHECK_NULL(no_proxy = (*env)->GetStaticObjectField(env, proxy_class, pr_no_proxyID));
-  return no_proxy;
-}
--- a/jdk/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/solaris/native/sun/xawt/awt_Desktop.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryAttachingConnector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/com/sun/tools/jdi/SharedMemoryListeningConnector.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/java/net/DefaultInterface.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/awt/windows/WLightweightFramePeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/awt/windows/WRobotPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Klist.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/java/io/canonicalize_md.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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/Inet6AddressImpl.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/java/net/Inet6AddressImpl.c	Mon Nov 11 16:20:48 2013 +0100
@@ -131,18 +131,20 @@
 
     error = getaddrinfo(hostname, NULL, &hints, &res);
 
-    if (WSAGetLastError() == WSATRY_AGAIN) {
-        NET_ThrowByNameWithLastError(env,
-                                     JNU_JAVANETPKG "UnknownHostException",
-                                     hostname);
-        JNU_ReleaseStringPlatformChars(env, host, hostname);
-        return NULL;
-    } else if (error) {
-        /* report error */
-        JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException",
-                        (char *)hostname);
-        JNU_ReleaseStringPlatformChars(env, host, hostname);
-        return NULL;
+    if (error) {
+        if (WSAGetLastError() == WSATRY_AGAIN) {
+            NET_ThrowByNameWithLastError(env,
+                                         JNU_JAVANETPKG "UnknownHostException",
+                                         hostname);
+            JNU_ReleaseStringPlatformChars(env, host, hostname);
+            return NULL;
+        } else {
+            /* report error */
+            JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException",
+                            (char *)hostname);
+            JNU_ReleaseStringPlatformChars(env, host, hostname);
+            return NULL;
+        }
     } else {
         int i = 0;
         int inetCount = 0, inet6Count = 0, inetIndex, inet6Index;
--- a/jdk/src/windows/native/java/net/NetworkInterface.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/java/net/NetworkInterface.c	Mon Nov 11 16:20:48 2013 +0100
@@ -500,32 +500,52 @@
      * Get the various JNI ids that we require
      */
     ni_class = (*env)->NewGlobalRef(env, cls);
+    CHECK_NULL(ni_class);
     ni_nameID = (*env)->GetFieldID(env, ni_class, "name", "Ljava/lang/String;");
+    CHECK_NULL(ni_nameID);
     ni_displayNameID = (*env)->GetFieldID(env, ni_class, "displayName", "Ljava/lang/String;");
+    CHECK_NULL(ni_displayNameID);
     ni_indexID = (*env)->GetFieldID(env, ni_class, "index", "I");
+    CHECK_NULL(ni_indexID);
     ni_addrsID = (*env)->GetFieldID(env, ni_class, "addrs", "[Ljava/net/InetAddress;");
+    CHECK_NULL(ni_addrsID);
     ni_bindsID = (*env)->GetFieldID(env, ni_class, "bindings", "[Ljava/net/InterfaceAddress;");
+    CHECK_NULL(ni_bindsID);
     ni_childsID = (*env)->GetFieldID(env, ni_class, "childs", "[Ljava/net/NetworkInterface;");
+    CHECK_NULL(ni_childsID);
     ni_ctor = (*env)->GetMethodID(env, ni_class, "<init>", "()V");
+    CHECK_NULL(ni_ctor);
 
     ni_iacls = (*env)->FindClass(env, "java/net/InetAddress");
+    CHECK_NULL(ni_iacls);
     ni_iacls = (*env)->NewGlobalRef(env, ni_iacls);
+    CHECK_NULL(ni_iacls);
 
     ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address");
+    CHECK_NULL(ni_ia4cls);
     ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls);
+    CHECK_NULL(ni_ia4cls);
     ni_ia4Ctor = (*env)->GetMethodID(env, ni_ia4cls, "<init>", "()V");
+    CHECK_NULL(ni_ia4Ctor);
 
     ni_ia6cls = (*env)->FindClass(env, "java/net/Inet6Address");
+    CHECK_NULL(ni_ia6cls);
     ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls);
+    CHECK_NULL(ni_ia6cls);
     ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "<init>", "()V");
+    CHECK_NULL(ni_ia6ctrID);
 
     ni_ibcls = (*env)->FindClass(env, "java/net/InterfaceAddress");
+    CHECK_NULL(ni_ibcls);
     ni_ibcls = (*env)->NewGlobalRef(env, ni_ibcls);
+    CHECK_NULL(ni_ibcls);
     ni_ibctrID = (*env)->GetMethodID(env, ni_ibcls, "<init>", "()V");
+    CHECK_NULL(ni_ibctrID);
     ni_ibaddressID = (*env)->GetFieldID(env, ni_ibcls, "address", "Ljava/net/InetAddress;");
+    CHECK_NULL(ni_ibaddressID);
     ni_ibbroadcastID = (*env)->GetFieldID(env, ni_ibcls, "broadcast", "Ljava/net/Inet4Address;");
+    CHECK_NULL(ni_ibbroadcastID);
     ni_ibmaskID = (*env)->GetFieldID(env, ni_ibcls, "maskLength", "S");
-
 }
 
 /*
--- a/jdk/src/windows/native/java/net/icmp.h	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/java/net/icmp.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/font/fontpath.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DBadHardware.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DTextRenderer.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/nio/ch/SocketChannelImpl.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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/nio/ch/SocketDispatcher.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/nio/ch/SocketDispatcher.c	Mon Nov 11 16:20:48 2013 +0100
@@ -192,45 +192,66 @@
                                          jobject fdo, jlong address, jint len)
 {
     /* set up */
-    int i = 0;
+    int next_index, next_offset, ret=0;
     DWORD written = 0;
     jint fd = fdval(env, fdo);
     struct iovec *iovp = (struct iovec *)address;
     WSABUF *bufs = malloc(len * sizeof(WSABUF));
-    jint rem = MAX_BUFFER_SIZE;
+    jlong count = 0;
 
     if (bufs == 0) {
         JNU_ThrowOutOfMemoryError(env, 0);
         return IOS_THROWN;
     }
 
-    /* copy iovec into WSABUF */
-    for(i=0; i<len; i++) {
-        jint iov_len = iovp[i].iov_len;
-        if (iov_len > rem)
-            iov_len = rem;
-        bufs[i].buf = (char *)iovp[i].iov_base;
-        bufs[i].len = (u_long)iov_len;
-        rem -= iov_len;
-        if (rem == 0) {
-            len = i+1;
+    // next buffer and offset to consume
+    next_index = 0;
+    next_offset = 0;
+
+    while (next_index  < len) {
+        DWORD buf_count = 0;
+
+        /* Prepare the WSABUF array to a maximum total size of MAX_BUFFER_SIZE */
+        jint rem = MAX_BUFFER_SIZE;
+        while (next_index < len && rem > 0) {
+            jint iov_len = iovp[next_index].iov_len - next_offset;
+            char* ptr = (char *)iovp[next_index].iov_base;
+            ptr += next_offset;
+            if (iov_len > rem) {
+                iov_len = rem;
+                next_offset += rem;
+            } else {
+                next_index ++;
+                next_offset = 0;
+            }
+
+            bufs[buf_count].buf = ptr;
+            bufs[buf_count].len = (u_long)iov_len;
+            buf_count++;
+
+            rem -= iov_len;
+        }
+
+        /* write the buffers */
+        ret = WSASend((SOCKET)fd,           /* Socket */
+                              bufs,         /* pointers to the buffers */
+                              buf_count,    /* number of buffers to process */
+                              &written,     /* receives number of bytes written */
+                              0,            /* no flags */
+                              0,            /* no overlapped sockets */
+                              0);           /* no completion routine */
+
+        if (ret == SOCKET_ERROR) {
             break;
         }
+
+        count += written;
     }
 
-    /* read into the buffers */
-    i = WSASend((SOCKET)fd, /* Socket */
-            bufs,           /* pointers to the buffers */
-            (DWORD)len,     /* number of buffers to process */
-            &written,       /* receives number of bytes written */
-            0,              /* no flags */
-            0,              /* no overlapped sockets */
-            0);             /* no completion routine */
-
     /* clean up */
     free(bufs);
 
-    if (i != 0) {
+    if (ret == SOCKET_ERROR && count == 0) {
         int theErr = (jint)WSAGetLastError();
         if (theErr == WSAEWOULDBLOCK) {
             return IOS_UNAVAILABLE;
@@ -239,7 +260,7 @@
         return IOS_THROWN;
     }
 
-    return convertLongReturnVal(env, (jlong)written, JNI_FALSE);
+    return convertLongReturnVal(env, count, JNI_FALSE);
 }
 
 JNIEXPORT void JNICALL
--- a/jdk/src/windows/native/sun/security/krb5/NativeCreds.c	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/security/krb5/NativeCreds.c	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/ThemeReader.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Choice.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Dialog.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Font.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Robot.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Robot.h	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp	Mon Nov 11 16:20:48 2013 +0100
@@ -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;
             }
--- a/jdk/test/ProblemList.txt	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/ProblemList.txt	Mon Nov 11 16:20:48 2013 +0100
@@ -134,10 +134,6 @@
 # 8021230
 java/lang/ThreadLocal/ThreadLocalSupplierTest.java              generic-all
 
-# 8023201
-java/lang/instrument/RetransformBigClass.sh                     generic-all
-java/lang/instrument/RedefineBigClass.sh                        generic-all
-
 # 8026502
 java/lang/invoke/MethodHandleConstants.java                     generic-all
 
@@ -186,9 +182,6 @@
 # Filed 7036666
 com/sun/net/httpserver/Test9a.java                              generic-all
 
-# 7079145 java/net/ipv6tests/UdpTest.java hang at IPv6 only data exchange
-java/net/ipv6tests/UdpTest.java                                 linux-all
-
 # 7102670
 java/net/InetAddress/CheckJNI.java                              linux-all
 
@@ -273,14 +266,8 @@
 sun/security/pkcs11/Secmod/AddPrivateKey.java			linux-all
 sun/security/pkcs11/Secmod/TrustAnchors.java 			linux-all
 
-# 7041639, Solaris DSA keypair generation bug (Note: jdk_util also affected)
+# 7041639, Solaris DSA keypair generation bug
 java/security/KeyPairGenerator/SolarisShortDSA.java             solaris-all
-sun/security/tools/jarsigner/onlymanifest.sh                    solaris-all
-sun/security/tools/jarsigner/ts.sh                              solaris-all
-sun/security/tools/keytool/emptysubject.sh                      solaris-all
-sun/security/tools/keytool/importreadall.sh                     solaris-all
-sun/security/tools/keytool/readjar.sh                           solaris-all
-sun/security/tools/keytool/selfissued.sh                        solaris-all
 sun/security/tools/keytool/standard.sh                          solaris-all
 
 # 8000439: NPG: REGRESSION : sun/security/krb5/auto/MaxRetries.java fails with timeout
@@ -348,7 +335,7 @@
 # Filed 6772009
 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
 
-# 7041639, Solaris DSA keypair generation bug
-java/util/TimeZone/TimeZoneDatePermissionCheck.sh               solaris-all
+# 8026772: test/sun/util/resources/TimeZone/Bug6317929.java failing
+sun/util/resources/TimeZone/Bug6317929.java                     generic-all
 
 ############################################################################
--- a/jdk/test/TEST.groups	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/TEST.groups	Mon Nov 11 16:20:48 2013 +0100
@@ -325,7 +325,8 @@
   jdk/lambda/separate/Compiler.java \
   sun/management/jdp/JdpTest.sh \
   sun/management/jmxremote/bootstrap/JvmstatCountersTest.java \
-  sun/management/jmxremote/bootstrap/LocalManagementTest.sh \
+  sun/management/jmxremote/bootstrap/LocalManagementTest.java \
+  sun/management/jmxremote/bootstrap/CustomLauncherTest.java \
   sun/misc/JarIndex/metaInfFilenames/Basic.java \
   sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java \
   sun/reflect/CallerSensitive/CallerSensitiveFinder.java \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/corba/5036554/JavaBug.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package bug;
+
+public class JavaBug {
+    public static void main(String[] args) {
+        try {
+            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
+            org.omg.CORBA.Any any = orb.create_any();
+            myStringHelper.insert(any, "hello");
+            System.out.println("Any: " + myStringHelper.extract(any));
+        } catch( Exception e ) {
+            e.printStackTrace();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/corba/5036554/README	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+Bug # 5036554 unmarshal error on CORBA alias type in CORBA any
+
+Platform : ALL 
+
+Testcase directory :  <.../corba>
+
+Test Procedure : <STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
+Step 1: create a file bug.idl with the following content:
+
+// IDL file bug.idl
+module bug {
+    typedef string myString;
+};
+
+Step 2: Translate bug.idl with the command: idlj bug.idl
+This will create the file bug/myStringHelper.java
+
+Step 3:
+Create the file JavaBug.java in directory bug with the following content:
+
+// Java file JavaBug.java
+package bug;
+
+public class JavaBug {
+    public static void main(String[] args) {
+        try {
+            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
+            org.omg.CORBA.Any any = orb.create_any();
+            myStringHelper.insert(any, "hello");
+            System.out.println("Any: " + myStringHelper.extract(any));
+        } catch( Exception e ) {
+            e.printStackTrace();
+        }
+    }
+}  
+
+Step 4:
+Compile all java files with the command: javac -d . bug\*.java
+
+Step 5:
+Execute the program with the command: java -cp . bug/JavaBug
+
+Step 6: Note the null pointer exception in the the output!
+
+
+Without Fix behaviour :  <java.lang.NullPointerException
+        at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:290)
+        at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
+        at bug.myStringHelper.insert(myStringHelper.java:20)
+        at bug.JavaBug.main(JavaBug.java:8)>
+        
+With Fix behaviour :  <The output message printed on the console: "Any: hello">
+
+Other Comments :  <Test case is automated.>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,112 @@
+#!/bin/sh
+#
+# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# @test  
+# @bug 5036554 6357706
+# @summary unmarshal error on CORBA alias type in CORBA any
+# @run shell TestCorbaBug.sh
+
+if [ "${TESTSRC}" = "" ]
+then TESTSRC=.
+fi
+
+if [ "${TESTJAVA}" = "" ]
+then
+  PARENT=`dirname \`which java\``
+  TESTJAVA=`dirname ${PARENT}`
+  echo "TESTJAVA not set, selecting " ${TESTJAVA}
+  echo "If this is incorrect, try setting the variable manually."
+fi
+
+if [ "${TESTCLASSES}" = "" ]
+then
+  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    PS=":"
+    FS="/"
+    ;;
+  CYGWIN* )
+    PS=";"
+    FS="/"
+    ;;
+  Windows* )
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+CLASSPATH=.${PS}${TESTCLASSES}; export CLASSPATH
+
+THIS_DIR=`pwd`
+
+${TESTJAVA}${FS}bin${FS}java -version
+
+mkdir bug
+
+cp ${TESTSRC}${FS}bug.idl .
+${TESTJAVA}${FS}bin${FS}idlj bug.idl
+
+cp ${TESTSRC}${FS}JavaBug.java bug
+
+chmod -fR 777 bug
+
+${TESTJAVA}${FS}bin${FS}javac -d . bug${FS}*.java
+
+${TESTJAVA}${FS}bin${FS}java -cp . bug/JavaBug > test.out 2>&1 
+
+grep "NullPointerException" test.out
+
+ERROR=$?
+
+cat test.out
+
+if [ $ERROR = 0 ]
+then
+    echo "Test Failed"
+    exit 1
+fi
+
+grep "Any: hello" test.out
+
+STATUS=$?
+
+if [ $STATUS = 0 ]
+then
+    echo "Test Passed"
+    exit 0
+else
+    echo "Invalid output"
+    cat test.out
+    exit 2
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/corba/5036554/bug.idl	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,4 @@
+// IDL file bug.idl
+module bug {
+    typedef string myString;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/java/swing/plaf/windows/8016551/bug8016551.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/com/sun/jdi/GetUninitializedStringValue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 8021897
+ *  @summary Test getting the value for an uninitialized String object
+ *
+ *  @author Staffan Larsen
+ *
+ *  @run build TestScaffold VMConnection TargetListener TargetAdapter
+ *  @run compile -g GetUninitializedStringValue.java
+ *  @run main GetUninitializedStringValue
+ */
+import com.sun.jdi.ReferenceType;
+import com.sun.jdi.StackFrame;
+import com.sun.jdi.StringReference;
+import com.sun.jdi.ThreadReference;
+import com.sun.jdi.event.BreakpointEvent;
+
+ /********** target program **********/
+
+class GetUninitializedStringValueTarg {
+    public static void main(String[] args) {
+        new String("foo");
+        System.out.println("Goodbye from GetUninitializedStringValueTarg!");
+    }
+}
+
+ /********** test program **********/
+
+public class GetUninitializedStringValue extends TestScaffold {
+    ReferenceType targetClass;
+    ThreadReference mainThread;
+
+    GetUninitializedStringValue (String args[]) {
+        super(args);
+    }
+
+    public static void main(String[] args)
+        throws Exception
+    {
+        new GetUninitializedStringValue (args).startTests();
+    }
+
+    /********** test core **********/
+
+    protected void runTests()
+        throws Exception
+    {
+        /*
+         * Run to String.<init>
+         */
+        startUp("GetUninitializedStringValueTarg");
+        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");
+
+        /*
+         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
+         */
+        StackFrame frame = bpe.thread().frame(0);
+        StringReference sr = (StringReference)frame.thisObject();
+        if (!sr.value().equals("")) {
+            throw new Exception("Unexpected value for the uninitialized String");
+        }
+
+        /*
+         * resume the target listening for events
+         */
+        listenUntilVMDisconnect();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/jdi/LambdaBreakpointTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+/********** LINE NUMBER SENSITIVE! *****************************************************************/
+
+/**
+ *  @test
+ *  @summary Test setting breakpoints on lambda calls
+ *
+ *  @author Staffan Larsen
+ *
+ *  @run build TestScaffold VMConnection TargetListener TargetAdapter
+ *  @run compile -g LambdaBreakpointTest.java
+ *  @run main LambdaBreakpointTest
+ */
+import java.util.List;
+
+import com.sun.jdi.LocalVariable;
+import com.sun.jdi.Location;
+import com.sun.jdi.Method;
+import com.sun.jdi.ObjectReference;
+import com.sun.jdi.ReferenceType;
+import com.sun.jdi.StackFrame;
+import com.sun.jdi.StringReference;
+import com.sun.jdi.ThreadReference;
+import com.sun.jdi.event.BreakpointEvent;
+import com.sun.jdi.event.StepEvent;
+
+ /********** target program **********/
+
+class LambdaBreakpointTestTarg {
+
+    static int[] breakpointLines = {
+            62, 66, 63, 64, 65, 67
+    };
+
+    public static void main(String[] args) {
+        test();
+    }
+
+    private static void test() {
+        Runnable r = () -> {                          // B1: L62
+            String from = "lambda";                   // B3: L63
+            System.out.println("Hello from " + from); // B4: L64
+        };                                            // B5: L65
+        r.run();                                      // B2: L66
+        System.out.println("Goodbye.");               // B6: L67
+    }
+}
+
+
+ /********** test program **********/
+
+public class LambdaBreakpointTest extends TestScaffold {
+
+    LambdaBreakpointTest (String args[]) {
+        super(args);
+    }
+
+    public static void main(String[] args)
+        throws Exception
+    {
+        new LambdaBreakpointTest (args).startTests();
+    }
+
+    /********** test core **********/
+
+    protected void runTests()
+        throws Exception
+    {
+        startToMain("LambdaBreakpointTestTarg");
+
+        // Put a breakpoint on each location in the order they should happen
+        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
+            System.out.println("Running to line: " + line);
+            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
+            int stoppedAt = be.location().lineNumber();
+            System.out.println("Stopped at line: " + stoppedAt);
+            if (stoppedAt != line) {
+                throw new Exception("Stopped on the wrong line: "
+                        + stoppedAt + " != " + line);
+            }
+        }
+
+        /*
+         * resume the target listening for events
+         */
+        listenUntilVMDisconnect();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/jdi/LambdaStepTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ *  @test
+ *  @summary Test stepping through lambdas
+ *
+ *  @author Staffan Larsen
+ *
+ *  @run build TestScaffold VMConnection TargetListener TargetAdapter
+ *  @run compile -g LambdaStepTest.java
+ *  @run main LambdaStepTest
+ */
+import com.sun.jdi.LocalVariable;
+import com.sun.jdi.ObjectReference;
+import com.sun.jdi.ReferenceType;
+import com.sun.jdi.StackFrame;
+import com.sun.jdi.StringReference;
+import com.sun.jdi.ThreadReference;
+import com.sun.jdi.event.BreakpointEvent;
+import com.sun.jdi.event.StepEvent;
+
+ /********** target program **********/
+
+interface DefaultTest {
+    default void defaultMethod() {
+        String from = "default";
+        System.out.println("Hello from " + from);
+    }
+}
+class LambdaStepTestTarg implements DefaultTest {
+    private void test() {
+        String from = "test";
+        System.out.println("Hello from " + from);
+    }
+    private static void instanceTest() {
+        LambdaStepTestTarg l = new LambdaStepTestTarg();
+        l.test();
+    }
+    private static void lambdaTest() {
+        Runnable r = () -> {
+            String from = "lambda";
+            System.out.println("Hello from " + from);
+        };
+        r.run();
+    }
+    private static void defaultTest() {
+        LambdaStepTestTarg l = new LambdaStepTestTarg();
+        l.defaultMethod();
+    }
+    public static void main(String[] args) {
+        instanceTest();
+        lambdaTest();
+        defaultTest();
+        System.out.println("Goodbye from LambdaStepTestTarg!");
+    }
+}
+
+
+ /********** test program **********/
+
+public class LambdaStepTest extends TestScaffold {
+    LambdaStepTest (String args[]) {
+        super(args);
+    }
+
+    public static void main(String[] args)
+        throws Exception
+    {
+        new LambdaStepTest (args).startTests();
+    }
+
+    /********** test core **********/
+
+    protected void runTests()
+        throws Exception
+    {
+        // ## Normal instance method
+
+        BreakpointEvent bpe = startTo("LambdaStepTestTarg", "instanceTest", "()V");
+        ThreadReference thread = bpe.thread();
+
+        // step over allocation
+        StepEvent se = stepOverLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // step into test();
+        se = stepIntoLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // step over variable initialization
+        se = stepOverLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // get value of variable "from"
+        StackFrame frame = se.thread().frame(0);
+        LocalVariable lv = frame.visibleVariableByName("from");
+        System.out.println(lv);
+        StringReference sr = (StringReference) frame.getValue(lv);
+        if (!sr.value().equals("test")) {
+            throw new Exception("Unexpected variable value in instanceTest: "+sr.value());
+        }
+
+
+        // ## Lambda method
+
+        bpe = resumeTo("LambdaStepTestTarg", "lambdaTest", "()V");
+        thread = bpe.thread();
+
+        // step over allocation
+        se = stepOverLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // step into run() of the lambda
+        se = stepIntoLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // step over variable initialization
+        se = stepOverLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // get value of variable "from"
+        frame = se.thread().frame(0);
+        lv = frame.visibleVariableByName("from");
+        System.out.println(lv);
+        sr = (StringReference) frame.getValue(lv);
+        if (!sr.value().equals("lambda")) {
+            throw new Exception("Unexpected variable value in lambdaTest: "+sr.value());
+        }
+
+
+        // ## Default method
+
+        bpe = resumeTo("LambdaStepTestTarg", "defaultTest", "()V");
+        thread = bpe.thread();
+
+        // step over allocation
+        se = stepOverLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // step into defaultMethod()
+        se = stepIntoLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // step over variable initialization
+        se = stepOverLine(thread);
+        System.out.println(se.thread().frame(0));
+
+        // get value of variable "from"
+        frame = se.thread().frame(0);
+        lv = frame.visibleVariableByName("from");
+        System.out.println(lv);
+        sr = (StringReference) frame.getValue(lv);
+        if (!sr.value().equals("default")) {
+            throw new Exception("Unexpected variable value in lambdaTest: "+sr.value());
+        }
+
+
+        /*
+         * resume the target listening for events
+         */
+        listenUntilVMDisconnect();
+
+    }
+}
--- a/jdk/test/com/sun/jdi/MethodEntryExitEvents.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/com/sun/jdi/MethodEntryExitEvents.java	Mon Nov 11 16:20:48 2013 +0100
@@ -108,14 +108,11 @@
     final int expectedExitCount = 1 + (15 * 3);
     int methodExitCount = 0;
 
-    /*
-     * Class patterns for which we don't want events (copied
-     * from the "Trace.java" example):
-     *     http://java.sun.com/javase/technologies/core/toolsapis/jpda/
-     */
-    private String[] excludes = {"java.*", "javax.*", "sun.*",
-                                 "com.sun.*", "com.oracle.*",
-                                 "oracle.*", "jdk.internal.*"};
+    // Classes which we are interested in
+    private List includes = Arrays.asList(new String[] {
+        "MethodEntryExitEventsDebugee",
+        "t2"
+    });
 
     MethodEntryExitEvents (String args[]) {
         super(args);
@@ -161,6 +158,10 @@
         str.disable();
     }
     public void methodEntered(MethodEntryEvent event) {
+        if (!includes.contains(event.method().declaringType().name())) {
+            return;
+        }
+
         if (! finishedCounting) {
             // We have to count the entry to loopComplete, but
             // not the exit
@@ -176,6 +177,10 @@
     }
 
     public void methodExited(MethodExitEvent event) {
+        if (!includes.contains(event.method().declaringType().name())) {
+            return;
+        }
+
         if (! finishedCounting){
             methodExitCount++;
             System.out.print  (" Method exit  number: ");
@@ -214,6 +219,10 @@
         connect((String[]) argList.toArray(args2));
         waitForVMStart();
 
+        // Determine main thread
+        ClassPrepareEvent e = resumeToPrepareOf("MethodEntryExitEventsDebugee");
+        mainThread = e.thread();
+
         try {
 
             /*
@@ -223,6 +232,7 @@
                 eventRequestManager().createExceptionRequest(null, // refType (null == all instances)
                                                              true, // notifyCaught
                                                              true);// notifyUncaught
+            exceptionRequest.addThreadFilter(mainThread);
             exceptionRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
             exceptionRequest.enable();
 
@@ -231,9 +241,7 @@
              */
             MethodEntryRequest entryRequest =
                eventRequestManager().createMethodEntryRequest();
-            for (int i=0; i<excludes.length; ++i) {
-                entryRequest.addClassExclusionFilter(excludes[i]);
-            }
+            entryRequest.addThreadFilter(mainThread);
             entryRequest.setSuspendPolicy(sessionSuspendPolicy);
             entryRequest.enable();
 
@@ -242,10 +250,7 @@
              */
             MethodExitRequest exitRequest =
                 eventRequestManager().createMethodExitRequest();
-
-            for (int i=0; i<excludes.length; ++i) {
-                exitRequest.addClassExclusionFilter(excludes[i]);
-            }
+            exitRequest.addThreadFilter(mainThread);
             exitRequest.setSuspendPolicy(sessionSuspendPolicy);
             exitRequest.enable();
 
--- a/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -209,18 +209,13 @@
 
 
 public class MethodExitReturnValuesTest extends TestScaffold {
-
-    /*
-     * Class patterns for which we don't want events (copied
-     * from the "Trace.java" example):
-     *     http://java.sun.com/javase/technologies/core/toolsapis/jpda/
-     */
-    private String[] excludes = {
-        "javax.*",
-        "sun.*",
-        "com.sun.*",
-        "com.oracle.*",
-        "oracle.*"};
+    // Classes which we are interested in
+    private List includes = Arrays.asList(new String[] {
+        "MethodExitReturnValuesTarg",
+        "java.lang.reflect.Array",
+        "java.lang.StrictMath",
+        "java.lang.String"
+    });
 
     static VirtualMachineManager vmm ;
     ClassType targetClass;
@@ -487,6 +482,11 @@
     // This is the MethodExitEvent handler.
     public void methodExited(MethodExitEvent event) {
         String origMethodName = event.method().name();
+
+        if (!includes.contains(event.method().declaringType().name())) {
+            return;
+        }
+
         if (vmm.majorInterfaceVersion() >= 1 &&
             vmm.minorInterfaceVersion() >= 6 &&
             vm().canGetMethodReturnValues()) {
@@ -560,10 +560,8 @@
          */
         MethodExitRequest exitRequest =
             eventRequestManager().createMethodExitRequest();
+        exitRequest.addThreadFilter(mainThread);
 
-        for (int i=0; i<excludes.length; ++i) {
-            exitRequest.addClassExclusionFilter(excludes[i]);
-        }
         int sessionSuspendPolicy = EventRequest.SUSPEND_ALL;
         //sessionSuspendPolicy = EventRequest.SUSPEND_EVENT_THREAD;
         //sessionSuspendPolicy = EventRequest.SUSPEND_NONE;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ *  @test
+ *  @bug 7105883
+ *  @summary Ensure that JDWP doesn't crash with a null thread group name
+ *
+ *  @run build TestScaffold VMConnection TargetListener TargetAdapter
+ *  @run main NullThreadGroupNameTest
+ */
+import com.sun.jdi.*;
+import com.sun.jdi.connect.*;
+import com.sun.jdi.event.*;
+import com.sun.jdi.request.*;
+import com.sun.jdi.VMDisconnectedException;
+import java.util.concurrent.CountDownLatch;
+import java.util.*;
+
+class DebugTarget {
+    public final static String DEBUG_THREAD_NAME = "DebugThread";
+
+    public static void main(String[] args) throws Exception {
+        DebugThread thread = new DebugThread();
+        thread.start();
+        thread.runningLatch.await();
+        breakpointHere();
+        thread.breakpointLatch.countDown();
+    }
+
+    public static void breakpointHere() {
+        System.out.println("Breakpoint finished!");
+    }
+
+    static class DebugThread extends Thread {
+        final CountDownLatch runningLatch = new CountDownLatch(1);
+        final CountDownLatch breakpointLatch = new CountDownLatch(1);
+
+        public DebugThread() {
+            super(new ThreadGroup(null), DEBUG_THREAD_NAME);
+        }
+
+        public void run() {
+            runningLatch.countDown();
+            try {
+                breakpointLatch.await();
+            } catch (InterruptedException ie) {
+                ie.printStackTrace();
+            }
+        }
+    }
+}
+
+public class NullThreadGroupNameTest extends TestScaffold {
+
+    NullThreadGroupNameTest(String args[]) {
+        super(args);
+    }
+
+    public static void main(String[] args) throws Exception {
+        new NullThreadGroupNameTest(args).startTests();
+    }
+
+    protected void runTests() throws Exception {
+        startTo("DebugTarget", "breakpointHere", "()V");
+
+        ThreadReference thread = findThread(DebugTarget.DEBUG_THREAD_NAME);
+        assertThreadGroupName(thread.threadGroup(), "");
+
+        listenUntilVMDisconnect();
+    }
+
+    private ThreadReference findThread(String name) {
+        for (ThreadReference thread : vm().allThreads()) {
+            if (name.equals(thread.name())) {
+                return thread;
+            }
+        }
+        throw new NoSuchElementException("Couldn't find " + name);
+    }
+
+    private void assertThreadGroupName(ThreadGroupReference threadGroup, String expectedName) {
+        try {
+            String name = threadGroup.name();
+            if (!expectedName.equals(name)) {
+                throw new AssertionError("Unexpected thread group name '" + name + "'");
+            }
+        } catch (VMDisconnectedException vmde) {
+            throw new AssertionError("Likely JVM crash with null thread group name", vmde);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/jmx/snmp/NoInfoLeakTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+/* @test
+ * @bug 8026028
+ * @summary Tests no leak of internal info
+ * @author Shanliang JIANG
+ * @run clean NoInfoLeakTest
+ * @run build NoInfoLeakTest
+ * @run main NoInfoLeakTest
+ */
+
+import com.sun.jmx.snmp.SnmpString;
+import com.sun.jmx.snmp.agent.SnmpMib;
+import com.sun.jmx.snmp.agent.SnmpMibTable;
+import com.sun.jmx.snmp.daemon.CommunicatorServer;
+import com.sun.jmx.snmp.daemon.SnmpAdaptorServer;
+import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+public class NoInfoLeakTest {
+    public static void main(String[] args) throws Exception {
+        boolean ok = true;
+        ok &= snmpStringTest();
+        ok &= snmpMibTest();
+        ok &= communicatorServerTest();
+
+        if (!ok) {
+            throw new RuntimeException("Some tests are failed!");
+        }
+    }
+
+    private static boolean snmpStringTest() {
+        System.out.println("\n---NoInfoLeakTest-snmpStringTest: testing the method byteValue()...");
+        boolean passed = true;
+
+        byte[] mine = new byte[]{1,1,1,};
+        SnmpString ss = new SnmpString(mine);
+        byte[] got = ss.byteValue();
+        got[0]=0;
+
+        if (ss.byteValue()[0] == 0) {
+            System.err.println("Failed: SnmpString.byteValue() returns an internal mutable object value");
+            passed = false;
+        } else {
+            System.out.println("---NoInfoLeakTest-snmpStringTest done.");
+        }
+        return passed;
+    }
+
+    private static boolean snmpMibTest() {
+        boolean passed = true;
+        System.out.println("\n---NoInfoLeakTest-snmpMibTest: testing the method "
+                + "SnmpMib.getRootOid()...");
+        SnmpMib mib = new MySnmpMib();
+
+        if (mib.getRootOid() == mib.getRootOid()) {
+            System.err.println("Failed: SnmpMib.getRootOid() returns an internal"
+                    + " mutable object value "+mib.getRootOid());
+        } else {
+            System.out.println("---NoInfoLeakTest-snmpMibTest done.");
+        }
+        return passed;
+    }
+
+    private static boolean communicatorServerTest() {
+        boolean passed = true;
+        System.out.println("\n---NoInfoLeakTest-communicatorServerTest: testing the method CommunicatorServer.getNotificationInfo()...");
+        CommunicatorServer server = new SnmpAdaptorServer();
+        MBeanNotificationInfo[] notifs = server.getNotificationInfo();
+
+        assert notifs.length > 0 && notifs[0] != null; // the current implementation ensures this
+        notifs[0] = null;
+        if (server.getNotificationInfo()[0] == null) {
+            System.err.println("Failed: CommunicatorServer.getNotificationInfo()"
+                    + " returns an internal mutable object value");
+            passed = false;
+        } else {
+            System.out.println("---NoInfoLeakTest-communicatorServerTest done.");
+        }
+        return passed;
+    }
+
+    private static class MySnmpMib extends SnmpMib {
+        @Override
+        public void registerTableMeta(String name, SnmpMibTable table) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public SnmpMibTable getRegisteredTableMeta(String name) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void init() throws IllegalAccessException {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Frame/MaximizedByPlatform/MaximizedByPlatform.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/awt/PrintJob/SaveDialogTitleTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/awt/print/PrinterJob/PrintLatinCJKTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/beans/Introspector/TestTypeResolver.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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/io/File/NulFile.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/io/File/NulFile.java	Mon Nov 11 16:20:48 2013 +0100
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 8003992
+ * @bug 8003992 8027155
  * @summary Test a file whose path name is embedded with NUL character, and
  *          ensure it is handled correctly.
  * @author Dan Xu
@@ -613,7 +613,7 @@
                 File.createTempFile(prefix, suffix, directory);
             } catch (IOException ex) {
                 String err = "Unable to create temporary file";
-                if (err.equals(ex.getMessage()))
+                if (ex.getMessage() != null && ex.getMessage().startsWith(err))
                     exceptionThrown = true;
                 else {
                     throw new RuntimeException("Get IOException with message, "
--- a/jdk/test/java/lang/ProcessBuilder/InheritIOEHandle.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/ProcessBuilder/InheritIOEHandle.java	Mon Nov 11 16:20:48 2013 +0100
@@ -35,21 +35,22 @@
 
 public class InheritIOEHandle {
     private static enum APP {
-        B, C;
+        A, B, C;
     }
-    private static File stopC = new File(".\\StopC.txt");
+
+    private static File stopC = new File("StopC.txt");
     private static String SIGNAL = "After call child process";
     private static String JAVA_EXE = System.getProperty("java.home")
-        + File.separator + "bin"
-        + File.separator + "java";
+            + File.separator + "bin"
+            + File.separator + "java";
 
     private static String[] getCommandArray(String processName) {
         String[] cmdArray = {
-            JAVA_EXE,
-            "-cp",
-            System.getProperty("java.class.path"),
-            InheritIOEHandle.class.getName(),
-            processName
+                JAVA_EXE,
+                "-cp",
+                System.getProperty("java.class.path"),
+                InheritIOEHandle.class.getName(),
+                processName
         };
         return cmdArray;
     }
@@ -59,19 +60,18 @@
             return;
         }
 
-        if (args.length > 0) {
-            APP app = APP.valueOf(args[0]);
-            switch (app) {
+        APP app = (args.length > 0) ? APP.valueOf(args[0]) : APP.A;
+        switch (app) {
+            case A:
+                performA();
+                break;
             case B:
                 performB();
                 break;
             case C:
                 performC();
                 break;
-            }
-            return;
         }
-        performA();
     }
 
     private static void performA() {
@@ -87,25 +87,40 @@
             process.getOutputStream().close();
             process.getErrorStream().close();
 
-            try (BufferedReader in = new BufferedReader( new InputStreamReader(
-                         process.getInputStream(), "utf-8")))
+            boolean isSignalReceived = false;
+            try (BufferedReader in = new BufferedReader(new InputStreamReader(
+                    process.getInputStream(), "utf-8")))
             {
                 String result;
                 while ((result = in.readLine()) != null) {
-                    if (!SIGNAL.equals(result)) {
-                        throw new Error("Catastrophe in process B! Bad output.");
+                    if (SIGNAL.equals(result)) {
+                        isSignalReceived = true;
+                        break;
+                    } else {
+                        throw new RuntimeException("Catastrophe in process B! Bad output.");
                     }
                 }
+
+            }
+            if (!isSignalReceived) {
+                throw new RuntimeException("Signal from B was not received");
             }
 
             // If JDK-7147084 is not fixed that point is unreachable.
-
+            System.out.println("Received signal from B, creating file StopC");
             // write signal file
-            stopC.createNewFile();
+            boolean isFileStopC = stopC.createNewFile();
+            if (!isFileStopC) {
+                throw new RuntimeException("Signal file StopC.txt was not created. TEST or INFRA bug");
+            }
+
+            process.waitFor();
 
             System.err.println("Read stream finished.");
         } catch (IOException ex) {
-            throw new Error("Catastrophe in process A!", ex);
+            throw new RuntimeException("Catastrophe in process A!", ex);
+        } catch (InterruptedException ex) {
+            throw new RuntimeException("A was interrupted while waiting for B", ex);
         }
     }
 
@@ -121,27 +136,31 @@
             process.getErrorStream().close();
 
             System.out.println(SIGNAL);
+            process.waitFor();
 
             // JDK-7147084 subject:
             // Process C inherits the [System.out] handle and
             // handle close in B does not finalize the streaming for A.
             // (handle reference count > 1).
         } catch (IOException ex) {
-            throw new Error("Catastrophe in process B!", ex);
+            throw new RuntimeException("Catastrophe in process B!", ex);
+        } catch (InterruptedException ex) {
+            throw new RuntimeException("B was interrupted while waiting for C", ex);
         }
     }
 
     private static void performC() {
         // If JDK-7147084 is not fixed the loop is 5min long.
-        for (int i = 0; i < 5*60; ++i) {
+        for (int i = 0; i < 5 * 60; ++i) {
             try {
                 Thread.sleep(1000);
-                // check for sucess
-                if (stopC.exists())
-                    break;
             } catch (InterruptedException ex) {
                 // that is ok. Longer sleep - better effect.
             }
+            // check for success
+            if (stopC.exists()) {
+                break;
+            }
         }
     }
 }
--- a/jdk/test/java/lang/ProcessBuilder/SiblingIOEHandle.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/ProcessBuilder/SiblingIOEHandle.java	Mon Nov 11 16:20:48 2013 +0100
@@ -37,21 +37,22 @@
 
 public class SiblingIOEHandle {
     private static enum APP {
-        B, C;
+        A, B, C;
     }
+
     private static File stopC = new File(".\\StopCs.txt");
     private static String SIGNAL = "B child reported.";
     private static String JAVA_EXE = System.getProperty("java.home")
-        + File.separator + "bin"
-        + File.separator + "java";
+            + File.separator + "bin"
+            + File.separator + "java";
 
     private static String[] getCommandArray(String processName) {
         String[] cmdArray = {
-            JAVA_EXE,
-            "-cp",
-            System.getProperty("java.class.path"),
-            SiblingIOEHandle.class.getName(),
-            processName
+                JAVA_EXE,
+                "-cp",
+                System.getProperty("java.class.path"),
+                SiblingIOEHandle.class.getName(),
+                processName
         };
         return cmdArray;
     }
@@ -61,20 +62,19 @@
             return;
         }
 
-        if (args.length > 0) {
-            APP app = APP.valueOf(args[0]);
-            switch (app) {
+        APP app = (args.length > 0) ? APP.valueOf(args[0]) : APP.A;
+        switch (app) {
+            case A:
+                performA(true);
+                performA(false);
+                break;
             case B:
                 performB();
                 break;
             case C:
                 performC();
                 break;
-            }
-            return;
         }
-        performA(true);
-        performA(false);
     }
 
     static boolean procClaunched = false;
@@ -86,6 +86,7 @@
             // that was long enough
         }
     }
+
     private static boolean waitBarrier(CyclicBarrier barrier) {
         while (true) try {
             barrier.await();
@@ -98,6 +99,36 @@
         }
     }
 
+    private static class ProcessC implements Runnable {
+        private CyclicBarrier barrier;
+        private Process processC;
+
+        public ProcessC(CyclicBarrier barrier) {
+            this.barrier = barrier;
+        }
+
+        @Override
+        public void run() {
+            try {
+                if (waitBarrier(barrier)) {
+                    waitAbit();
+                    // Run process C next to B ASAP to make an attempt
+                    // to capture the B-process IOE handles in C process.
+                    ProcessBuilder builderC = new ProcessBuilder(
+                            getCommandArray(APP.C.name()));
+                    processC = builderC.start();
+                    procClaunched = true;
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+
+        public void waitFor() throws InterruptedException {
+            processC.waitFor();
+        }
+    }
+
     private static void performA(boolean fileOut) {
         try {
             stopC.delete();
@@ -112,26 +143,13 @@
             builderB.redirectErrorStream(true);
 
             final CyclicBarrier barrier = new CyclicBarrier(2);
-            Thread procCRunner = new Thread(new Runnable() {
-                @Override public void run() {
-                    try {
-                        if (waitBarrier(barrier)) {
-                            waitAbit();
-                            // Run process C next to B ASAP to make an attempt
-                            // to capture the B-process IOE handles in C process.
-                            Runtime.getRuntime().exec(getCommandArray(APP.C.name()));
-                            procClaunched = true;
-                        }
-                    } catch (IOException ex) {
-                        ex.printStackTrace();
-                    }
-                }
-            });
+            //Create process C in a new thread
+            ProcessC processC = new ProcessC(barrier);
+            Thread procCRunner = new Thread(processC);
             procCRunner.start();
 
-
             if (!waitBarrier(barrier)) {
-                throw new Error("Catastrophe in process A! Synchronization failed.");
+                throw new RuntimeException("Catastrophe in process A! Synchronization failed.");
             }
             // Run process B first.
             Process processB = builderB.start();
@@ -144,7 +162,7 @@
             }
 
             if (!procClaunched) {
-                throw new Error("Catastrophe in process A! C was not launched.");
+                throw new RuntimeException("Catastrophe in process A! C was not launched.");
             }
 
             processB.getOutputStream().close();
@@ -154,25 +172,30 @@
                 try {
                     processB.waitFor();
                 } catch (InterruptedException ex) {
-                    throw new Error("Catastrophe in process B! B hung up.");
+                    throw new RuntimeException("Catastrophe in process B! B hung up.");
                 }
                 System.err.println("Trying to delete [outB.txt].");
                 if (!outB.delete()) {
-                    throw new Error("Greedy brother C deadlock! File share.");
+                    throw new RuntimeException("Greedy brother C deadlock! File share.");
                 }
                 System.err.println("Succeeded in delete [outB.txt].");
             } else {
                 System.err.println("Read stream start.");
-                try (BufferedReader in = new BufferedReader( new InputStreamReader(
-                             processB.getInputStream(), "utf-8")))
-                {
+                boolean isSignalReceived = false;
+                try (BufferedReader in = new BufferedReader(new InputStreamReader(
+                        processB.getInputStream(), "utf-8"))) {
                     String result;
                     while ((result = in.readLine()) != null) {
-                        if (!SIGNAL.equals(result)) {
-                            throw new Error("Catastrophe in process B! Bad output.");
+                        if (SIGNAL.equals(result)) {
+                            isSignalReceived = true;
+                        } else {
+                            throw new RuntimeException("Catastrophe in process B! Bad output.");
                         }
                     }
                 }
+                if (!isSignalReceived) {
+                    throw new RuntimeException("Signal from B was not received");
+                }
                 System.err.println("Read stream finished.");
             }
             // If JDK-6921885 is not fixed that point is unreachable.
@@ -180,8 +203,11 @@
 
             // write signal file to stop C process.
             stopC.createNewFile();
+            processC.waitFor();
         } catch (IOException ex) {
-            throw new Error("Catastrophe in process A!", ex);
+            throw new RuntimeException("Catastrophe in process A!", ex);
+        } catch (InterruptedException ex) {
+            throw new RuntimeException("Process A was interrupted while waiting for C", ex);
         }
     }
 
@@ -191,7 +217,7 @@
 
     private static void performC() {
         // If JDK-7147084 is not fixed the loop is 5min long.
-        for (int i = 0; i < 5*60; ++i) {
+        for (int i = 0; i < 5 * 60; ++i) {
             try {
                 Thread.sleep(1000);
                 // check for sucess
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/Runtime/exec/CloseRace.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,146 @@
+/*
+ * 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 8024521
+ * @summary Closing ProcessPipeInputStream at the time the process exits is racy
+ *          and leads to the data corruption.
+ * @library /lib/testlibrary
+ * @run main/othervm/timeout=80 CloseRace
+ */
+
+/**
+ * This test has a little chance to catch the race during the given default
+ * time gap of 20 seconds. To increase the time gap, set the system property
+ * CloseRaceTimeGap=N to the number of seconds.
+ * Jtreg's timeoutFactor should also be set appropriately.
+ *
+ * For example, to run the test for 10 minutes:
+ * > jtreg \
+ *       -testjdk:$(PATH_TO_TESTED_JDK) \
+ *       -timeoutFactor:10 \
+ *       -DCloseRaceTimeGap=600 \
+ *       $(PATH_TO_TESTED_JDK_SOURCE)/test/java/lang/Runtime/exec/CloseRace.java
+ */
+
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import jdk.testlibrary.OutputAnalyzer;
+import static jdk.testlibrary.ProcessTools.*;
+
+public class CloseRace {
+
+    public static void main(String args[]) throws Exception {
+        ProcessBuilder pb = createJavaProcessBuilder("-Xmx64M", "CloseRace$Child",
+                System.getProperty("CloseRaceTimeGap", "20"));
+        OutputAnalyzer oa = new OutputAnalyzer(pb.start());
+        oa.stderrShouldNotContain("java.lang.OutOfMemoryError");
+    }
+
+    public static class Child {
+        private static final String BIG_FILE = "bigfile";
+        private static final String SMALL_FILE = "smallfile";
+        private static int timeGap = 20; // seconds
+
+        public static void main(String args[]) throws Exception {
+            if (args.length > 0) {
+                try {
+                    timeGap = Integer.parseUnsignedInt(args[0]);
+                    timeGap = Integer.max(timeGap, 10);
+                    timeGap = Integer.min(timeGap, 10 * 60 * 60); // no more than 10 hours
+                } catch (NumberFormatException ignore) {}
+            }
+            try (RandomAccessFile f = new RandomAccessFile(BIG_FILE, "rw")) {
+                f.setLength(1024 * 1024 * 1024); // 1 Gb, greater than max heap size
+            }
+            try (FileOutputStream fs = new FileOutputStream(SMALL_FILE);
+                 PrintStream ps = new PrintStream(fs)) {
+                for (int i = 0; i < 128; ++i)
+                    ps.println("line of text");
+            }
+
+            List<Thread> threads = new LinkedList<>();
+            for (int i = 0; i < 99; ++i) {
+                Thread t = new Thread (new OpenLoop());
+                t.start();
+                threads.add(t);
+            }
+            Thread t2 = new Thread (new ExecLoop());
+            t2.start();
+            threads.add(t2);
+
+            Thread.sleep(timeGap);
+
+            for (Thread t : threads) {
+                t.interrupt();
+                t.join();
+            }
+        }
+
+        private static class OpenLoop implements Runnable {
+            public void run() {
+                final Path bigFilePath = Paths.get(BIG_FILE);
+                while (!Thread.interrupted()) {
+                    try (InputStream in = Files.newInputStream(bigFilePath)) {
+                        // Widen the race window by sleeping 1ms
+                        Thread.sleep(1);
+                    } catch (InterruptedException e) {
+                        break;
+                    } catch (Exception e) {
+                        System.err.println(e);
+                    }
+                }
+            }
+        }
+
+        private static class ExecLoop implements Runnable {
+            public void run() {
+                List<String> command = new ArrayList<>(
+                        Arrays.asList("/bin/cat", SMALL_FILE));
+                while (!Thread.interrupted()) {
+                    try {
+                        ProcessBuilder builder = new ProcessBuilder(command);
+                        final Process process = builder.start();
+                        InputStream is = process.getInputStream();
+                        InputStreamReader isr = new InputStreamReader(is);
+                        BufferedReader br = new BufferedReader(isr);
+                        while (br.readLine() != null) {}
+                        process.waitFor();
+                        isr.close();
+                    } catch (InterruptedException e) {
+                        break;
+                    } catch (Exception e) {
+                        System.err.println(e);
+                    }
+                }
+            }
+        }
+    }
+}
--- a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java	Mon Nov 11 16:20:48 2013 +0100
@@ -57,6 +57,7 @@
         "com.sun.jmx.",
         "com.sun.media.sound.",
         "com.sun.proxy.",
+        "com.sun.corba.se.",
         "com.sun.org.apache.bcel.internal.",
         "com.sun.org.apache.regexp.internal.",
         "com.sun.org.apache.xerces.internal.",
--- a/jdk/test/java/lang/String/ToLowerCase.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/String/ToLowerCase.java	Mon Nov 11 16:20:48 2013 +0100
@@ -23,7 +23,7 @@
 
 /*
     @test
-    @bug 4217441 4533872 4900935
+    @bug 4217441 4533872 4900935 8020037
     @summary toLowerCase should lower-case Greek Sigma correctly depending
              on the context (final/non-final).  Also it should handle
              Locale specific (lt, tr, and az) lowercasings and supplementary
@@ -69,10 +69,11 @@
         test("\u00CD", Locale.US, "\u00ED");
         test("\u0128", Locale.US, "\u0129");
 
-        // I-dot tests (Turkish and Azeri)
+        // I-dot tests
         test("\u0130", turkish, "i");
         test("\u0130", az, "i");
-        test("\u0130", Locale.US, "i\u0307");
+        test("\u0130", lt, "i");
+        test("\u0130", Locale.US, "i");
 
         // Remove dot_above in the sequence I + dot_above (Turkish and Azeri)
         test("I\u0307", turkish, "i");
--- a/jdk/test/java/lang/Thread/ThreadStateTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/Thread/ThreadStateTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -30,7 +30,7 @@
  * @author  Mandy Chung
  *
  * @build ThreadStateTest
- * @run main ThreadStateTest
+ * @run main/othervm -Xmixed ThreadStateTest
  */
 
 import java.util.concurrent.locks.LockSupport;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/repeatingAnnotations/InheritedAssociatedAnnotations.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,120 @@
+/*
+ * 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     8027170
+ * @summary getAnnotationsByType needs to take the class hierarchy into account
+ *          when determining which annotations are associated with a given
+ *          class.
+ * @run main InheritedAssociatedAnnotations
+ */
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.Arrays;
+
+public class InheritedAssociatedAnnotations {
+
+    public static void main(String[] args) {
+        checkAssociated(A3.class);
+        checkAssociated(B3.class);
+        checkAssociated(C3.class);
+        checkAssociated(D3.class);
+    }
+
+    private static void checkAssociated(AnnotatedElement ae) {
+        Ann[] actual = ae.getAnnotationsByType(Ann.class);
+        Ann[] expected = ae.getAnnotation(ExpectedAssociated.class).value();
+
+        if (!Arrays.equals(actual, expected)) {
+            throw new RuntimeException(String.format(
+                    "Test failed for %s: Expected %s but got %s.",
+                    ae,
+                    Arrays.toString(expected),
+                    Arrays.toString(actual)));
+        }
+    }
+
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface ExpectedAssociated {
+    Ann[] value();
+}
+
+
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Repeatable(AnnCont.class)
+@interface Ann {
+    int value();
+}
+
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@interface AnnCont {
+    Ann[] value();
+}
+
+
+@Ann(10)
+class A1 {}
+
+@Ann(20)
+class A2 extends A1 {}
+
+@ExpectedAssociated({@Ann(20)})
+class A3 extends A2 {}
+
+
+@Ann(10) @Ann(11)
+class B1 {}
+
+@Ann(20)
+class B2 extends B1 {}
+
+@ExpectedAssociated({@Ann(20)})
+class B3 extends B2 {}
+
+
+@Ann(10)
+class C1 {}
+
+@Ann(20) @Ann(21)
+class C2 extends C1 {}
+
+@ExpectedAssociated({@Ann(20), @Ann(21)})
+class C3 extends C2 {}
+
+
+@Ann(10) @Ann(11)
+class D1 {}
+
+@Ann(20) @Ann(21)
+class D2 extends D1 {}
+
+@ExpectedAssociated({@Ann(20), @Ann(21)})
+class D3 extends D2 {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/repeatingAnnotations/NonInheritableContainee.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 8019420
+ * @summary Repeatable non-inheritable annotation types are mishandled by Core Reflection
+ */
+
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+public class NonInheritableContainee {
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Repeatable(InheritedAnnotationContainer.class)
+    @interface NonInheritedAnnotationRepeated {
+        String name();
+    }
+
+    @Inherited
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface InheritedAnnotationContainer {
+        NonInheritedAnnotationRepeated[] value();
+    }
+
+    @NonInheritedAnnotationRepeated(name="A")
+    @NonInheritedAnnotationRepeated(name="B")
+    class Parent {}
+    class Sample extends Parent {}
+
+
+    public static void main(String[] args) {
+
+        Annotation[] anns = Sample.class.getAnnotationsByType(
+                NonInheritedAnnotationRepeated.class);
+
+        if (anns.length != 0)
+            throw new RuntimeException("Non-@Inherited containees should not " +
+                    "be inherited even though its container is @Inherited.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/repeatingAnnotations/OrderUnitTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,74 @@
+/*
+ * 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     8004912
+ * @summary Unit test for order of annotations returned by get[Declared]AnnotationsByType.
+ *
+ * @run main OrderUnitTest
+ */
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+public class OrderUnitTest {
+
+    public static void main(String[] args) {
+        testOrder(Case1.class);
+        testOrder(Case2.class);
+    }
+
+    private static void testOrder(AnnotatedElement e) {
+        Annotation[] decl = e.getDeclaredAnnotations();
+        Foo[] declByType = e.getDeclaredAnnotationsByType(Foo.class);
+
+        if (decl[0] instanceof Foo != declByType[0].isDirect() ||
+            decl[1] instanceof Foo != declByType[1].isDirect()) {
+            throw new RuntimeException("Order of directly / indirectly present " +
+                    "annotations from getDeclaredAnnotationsByType does not " +
+                    "match order from getDeclaredAnnotations.");
+        }
+    }
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface FooContainer {
+    Foo[] value();
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(FooContainer.class)
+@interface Foo {
+    boolean isDirect();
+}
+
+
+@Foo(isDirect = true) @FooContainer({@Foo(isDirect = false)})
+class Case1 {
+}
+
+
+@FooContainer({@Foo(isDirect = false)}) @Foo(isDirect = true)
+class Case2 {
+}
--- a/jdk/test/java/lang/annotation/repeatingAnnotations/RepeatedUnitTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/annotation/repeatingAnnotations/RepeatedUnitTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     7154390 8005712 8007278
+ * @bug     7154390 8005712 8007278 8004912
  * @summary Unit test for repeated annotation reflection
  *
  * @compile RepeatedUnitTest.java subpackage/package-info.java subpackage/Container.java subpackage/Containee.java subpackage/NonRepeated.java subpackage/InheritedContainee.java subpackage/InheritedContainer.java subpackage/InheritedNonRepeated.java
@@ -51,6 +51,12 @@
         inheritedMe3();
         inheritedMe4();
 
+        inheritedMe5();    // ContainerOnSuperSingleOnSub
+        inheritedMe6();    // RepeatableOnSuperSingleOnSub
+        inheritedMe7();    // SingleAnnoOnSuperContainerOnSub
+        inheritedMe8();    // SingleOnSuperRepeatableOnSub
+
+
         // CONSTRUCTOR
         checkMultiplier(Me1.class.getConstructor(new Class[0]), 10);
 
@@ -159,6 +165,30 @@
         check(e.getAnnotationsByType(NonRepeated.class)[0].value() == 1000);
     }
 
+    static void inheritedMe5() {
+        AnnotatedElement e = Me5.class;
+        check(2 == e.getAnnotations().length);
+        check(1 == countAnnotation(e, InheritedContainee.class));
+    }
+
+    static void inheritedMe6() {
+        AnnotatedElement e = Me6.class;
+        check(2 == e.getAnnotations().length);
+        check(1 == countAnnotation(e, InheritedContainee.class));
+    }
+
+    static void inheritedMe7() {
+        AnnotatedElement e = Me7.class;
+        check(2 == e.getAnnotations().length);
+        check(2 == countAnnotation(e, InheritedContainee.class));
+    }
+
+    static void inheritedMe8() {
+        AnnotatedElement e = Me8.class;
+        check(2 == e.getAnnotations().length);
+        check(2 == countAnnotation(e, InheritedContainee.class));
+    }
+
     static void checkMultiplier(AnnotatedElement e, int m) {
         // Basic sanity of non-repeating getAnnotation(Class)
         check(e.getAnnotation(NonRepeated.class).value() == 5 * m);
@@ -252,3 +282,31 @@
 @InheritedContainee(1000) @InheritedContainee(2000) @InheritedContainee(3000) @InheritedContainee(4000)
 @Containee(1000) @Containee(2000) @Containee(3000) @Containee(4000)
 class Me4 extends Father {}
+
+
+@InheritedContainer({@InheritedContainee(1), @InheritedContainee(2)})
+class SuperOf5 {}
+
+@InheritedContainee(3)
+class Me5 extends SuperOf5{}
+
+
+@InheritedContainee(1) @InheritedContainee(2)
+class SuperOf6 {}
+
+@InheritedContainee(3)
+class Me6 extends SuperOf6 {}
+
+
+@InheritedContainee(1)
+class SuperOf7 {}
+
+@InheritedContainer({@InheritedContainee(2), @InheritedContainee(3)})
+class Me7 extends SuperOf7 {}
+
+
+@InheritedContainee(1)
+class SuperOf8 {}
+
+@InheritedContainee(2) @InheritedContainee(3)
+class Me8 extends SuperOf8 {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,147 @@
+/*
+ * 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 8023651
+ * @summary Test that the receiver annotations and the return annotations of
+ *          constructors behave correctly.
+ * @run testng ConstructorReceiverTest
+ */
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.Arrays;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.*;
+
+public class ConstructorReceiverTest {
+    // Format is {
+    //   { Class to get ctor for,
+    //       ctor param class,
+    //       value of anno of return type,
+    //       value of anno for receiver or null if there should be no receiver anno
+    //    },
+    //    ...
+    // }
+    public static final Object[][] TESTS = {
+        { ConstructorReceiverTest.class, null, Integer.valueOf(5), null },
+        { ConstructorReceiverTest.Middle.class, ConstructorReceiverTest.class, Integer.valueOf(10), Integer.valueOf(15) },
+        { ConstructorReceiverTest.Middle.Inner.class, ConstructorReceiverTest.Middle.class, Integer.valueOf(100), Integer.valueOf(150) },
+        { ConstructorReceiverTest.Middle.Inner.Innermost.class, ConstructorReceiverTest.Middle.Inner.class, Integer.valueOf(1000), Integer.valueOf(1500) },
+        { ConstructorReceiverTest.Middle.InnerNoReceiver.class, ConstructorReceiverTest.Middle.class, Integer.valueOf(300), null },
+        { ConstructorReceiverTest.Nested.class, null, Integer.valueOf(20), null },
+        { ConstructorReceiverTest.Nested.NestedMiddle.class, ConstructorReceiverTest.Nested.class, Integer.valueOf(200), Integer.valueOf(250)},
+        { ConstructorReceiverTest.Nested.NestedMiddle.NestedInner.class, ConstructorReceiverTest.Nested.NestedMiddle.class, Integer.valueOf(2000), Integer.valueOf(2500)},
+        { ConstructorReceiverTest.Nested.NestedMiddle.NestedInnerNoReceiver.class, ConstructorReceiverTest.Nested.NestedMiddle.class, Integer.valueOf(4000), null},
+    };
+
+    @DataProvider
+    public Object[][] data() { return TESTS; }
+
+    @Test(dataProvider = "data")
+    public void testAnnotatedReciver(Class<?> toTest, Class<?> ctorParamType,
+            Integer returnVal, Integer receiverVal) throws NoSuchMethodException {
+        Constructor c;
+        if (ctorParamType == null)
+            c = toTest.getDeclaredConstructor();
+        else
+            c = toTest.getDeclaredConstructor(ctorParamType);
+
+        AnnotatedType annotatedReceiverType = c.getAnnotatedReceiverType();
+        Annotation[] receiverAnnotations = annotatedReceiverType.getAnnotations();
+
+        if (receiverVal == null) {
+            assertEquals(receiverAnnotations.length, 0, Arrays.asList(receiverAnnotations).toString() +
+                    " should be empty. Looking at 'length': ");
+            return;
+        }
+
+        assertEquals(receiverAnnotations.length, 1, "expecting a 1 element array. Looking at 'length': ");
+        assertEquals(((Annot)receiverAnnotations[0]).value(), receiverVal.intValue(), " wrong annotation found. Found " +
+                receiverAnnotations[0] +
+                " should find @Annot with value=" +
+                receiverVal);
+    }
+
+    @Test(dataProvider = "data")
+    public void testAnnotatedReturn(Class<?> toTest, Class<?> ctorParamType,
+            Integer returnVal, Integer receiverVal) throws NoSuchMethodException {
+        Constructor c;
+        if (ctorParamType == null)
+            c = toTest.getDeclaredConstructor();
+        else
+            c = toTest.getDeclaredConstructor(ctorParamType);
+
+        AnnotatedType annotatedReturnType = c.getAnnotatedReturnType();
+        Annotation[] returnAnnotations = annotatedReturnType.getAnnotations();
+
+        assertEquals(returnAnnotations.length, 1, "expecting a 1 element array. Looking at 'length': ");
+        assertEquals(((Annot)returnAnnotations[0]).value(), returnVal.intValue(), " wrong annotation found. Found " +
+                returnAnnotations[0] +
+                " should find @Annot with value=" +
+                returnVal);
+    }
+
+    @Annot(5) ConstructorReceiverTest() {}
+
+    private class Middle {
+        @Annot(10) public Middle(@Annot(15) ConstructorReceiverTest ConstructorReceiverTest.this) {}
+
+        public class Inner {
+            @Annot(100) Inner(@Annot(150) Middle Middle.this) {}
+
+            class Innermost {
+                @Annot(1000) private Innermost(@Annot(1500) Inner Inner.this) {}
+            }
+        }
+
+        class InnerNoReceiver {
+            @Annot(300) InnerNoReceiver(Middle Middle.this) {}
+        }
+    }
+
+    public static class Nested {
+        @Annot(20) public Nested() {}
+
+        class NestedMiddle {
+            @Annot(200) public NestedMiddle(@Annot(250) Nested Nested.this) {}
+
+            class NestedInner {
+                @Annot(2000) public NestedInner(@Annot(2500) NestedMiddle NestedMiddle.this) {}
+            }
+
+            class NestedInnerNoReceiver {
+                @Annot(4000) public NestedInnerNoReceiver() {}
+            }
+        }
+    }
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.TYPE_USE)
+    public static @interface Annot {
+        int value();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/instrument/NMTHelper.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import sun.management.ManagementFactoryHelper;
+import com.sun.management.DiagnosticCommandMBean;
+
+public class NMTHelper
+{
+    public static void baseline() {
+        executeDcmd("vmNativeMemory", "baseline");
+    }
+
+    // Total:  reserved=3484685KB  +293KB, committed=266629KB +293KB
+    private static Pattern totalLine = Pattern.compile("^Total:  reserved=\\d+KB  .*KB, committed=\\d+KB (.*)KB$");
+
+    public static long committedDiff() throws Exception {
+        String res = (String) executeDcmd("vmNativeMemory", "detail.diff");
+        String[] lines = res.split("\n");
+        for (String line : lines) {
+            Matcher matcher = totalLine.matcher(line);
+            if (matcher.matches()) {
+                String committed = matcher.group(1);
+                return Long.parseLong(committed);
+            }
+        }
+        throw new Exception("Could not find the Total line in the NMT output.");
+    }
+
+    private static String executeDcmd(String cmd, String ... args) {
+        DiagnosticCommandMBean dcmd = ManagementFactoryHelper.getDiagnosticCommandMBean();
+        Object[] dcmdArgs = {args};
+        String[] signature = {String[].class.getName()};
+
+        try {
+            System.out.print("> " + cmd + " ");
+            for (String s : args) {
+                System.out.print(s + " ");
+            }
+            System.out.println(":");
+            String result = (String) dcmd.invoke(cmd, dcmdArgs, signature);
+            System.out.println(result);
+            return result;
+        } catch(Exception ex) {
+            ex.printStackTrace();
+        }
+        return null;
+    }
+}
--- a/jdk/test/java/lang/instrument/RedefineBigClass.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/instrument/RedefineBigClass.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -58,11 +58,19 @@
 JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
+# Does this VM support the 'detail' level of NMT?
+"${JAVA}" ${TESTVMOPTS} -XX:NativeMemoryTracking=detail -version
+if [ "$?" = 0 ]; then
+    NMT=-XX:NativeMemoryTracking=detail
+else
+    NMT=-XX:NativeMemoryTracking=summary
+fi
+
 "${JAVA}" ${TESTVMOPTS} \
-    -XX:TraceRedefineClasses=3 \
+    -XX:TraceRedefineClasses=3 ${NMT} \
     -javaagent:RedefineBigClassAgent.jar=BigClass.class \
     -classpath "${TESTCLASSES}" RedefineBigClassApp \
-    > output.log 2>&1
+    > output.log 2>&1 
 result=$?
 
 cat output.log
--- a/jdk/test/java/lang/instrument/RedefineBigClassApp.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/instrument/RedefineBigClassApp.java	Mon Nov 11 16:20:48 2013 +0100
@@ -26,16 +26,23 @@
 public class RedefineBigClassApp {
     /**
      * Memory leak is assumed, if application consumes more than specified amount of memory during its execution.
-     * The number is given in Kb.
+     * The number is given in KB.
      */
-    private static final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb
+    private static final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32MB
 
     public static void main(String[] args) throws Exception {
         System.out.println("Creating instance of " +
             RedefineBigClassAgent.clz);
         RedefineBigClassAgent.clz.newInstance();
 
-        long vMemBefore = getVMemSize();
+        // Do a short warmup before creating the NMT baseline
+        try {
+            Thread.sleep(5 * 1000);
+        } catch (InterruptedException ie) {
+        }
+
+        NMTHelper.baseline();
+
         int count = 0;
         while (!RedefineBigClassAgent.doneRedefining) {
             System.out.println("App loop count: " + ++count);
@@ -46,39 +53,12 @@
         }
         System.out.println("App looped  " + count + " times.");
 
-        long vMemAfter = getVMemSize();
-        if (vMemBefore == 0 || vMemAfter == 0) {
-            System.err.println("WARNING: Cannot perform memory leak detection on this OS");
-        } else {
-            long vMemDelta = vMemAfter - vMemBefore;
-            if (vMemDelta > MEM_LEAK_THRESHOLD) {
-                System.err.println("FAIL: Virtual memory usage increased by " + vMemDelta + "Kb " +
-                        "(greater than " + MEM_LEAK_THRESHOLD + "Kb)");
-                System.exit(1);
-            }
-            System.err.println("PASS: Virtual memory usage increased by " + vMemDelta + "Kb " +
-                    "(not greater than " + MEM_LEAK_THRESHOLD + "Kb)");
+        long committedDiff = NMTHelper.committedDiff();
+        if (committedDiff > MEM_LEAK_THRESHOLD) {
+            throw new Exception("FAIL: Committed memory usage increased by " + committedDiff + "KB " +
+                               "(greater than " + MEM_LEAK_THRESHOLD + "KB)");
         }
-        System.exit(0);
-    }
-
-    /**
-     * Return size of virtual memory allocated to the process in Kb.
-     * Linux specific. On other platforms and in case of any errors return 0.
-     */
-    private static long getVMemSize() {
-
-        // Refer to the Linux proc(5) man page for details about /proc/self/stat file
-        //
-        // In short, this file contains status information about the current process
-        // written in one line. The fields are separated with spaces.
-        // The 23rd field is defined as 'vsize %lu   Virtual memory size in bytes'
-
-        try (FileReader fileReader = new FileReader("/proc/self/stat");
-             BufferedReader bufferedReader = new BufferedReader(fileReader)) {
-            String line = bufferedReader.readLine();
-            return Long.parseLong(line.split(" ")[22]) / 1024;
-        } catch (Exception ex) {}
-        return 0;
+        System.err.println("PASS: Committed memory usage increased by " + committedDiff + "KB " +
+                           "(not greater than " + MEM_LEAK_THRESHOLD + "KB)");
     }
 }
--- a/jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -62,6 +62,10 @@
     RedefineMethodInBacktraceTarget.java
 "${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodInBacktraceTarget.java
 
+cp "${TESTSRC}"/RedefineMethodInBacktraceTargetB_2.java \
+    RedefineMethodInBacktraceTargetB.java
+"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodInBacktraceTargetB.java
+
 "${JAVA}" ${TESTVMOPTS} -javaagent:RedefineMethodInBacktraceAgent.jar \
     -classpath "${TESTCLASSES}" RedefineMethodInBacktraceApp > output.log 2>&1
 RUN_RESULT=$?
--- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java	Mon Nov 11 16:20:48 2013 +0100
@@ -21,12 +21,17 @@
  * questions.
  */
 
+import com.sun.management.DiagnosticCommandMBean;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
 import java.lang.instrument.ClassDefinition;
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadInfo;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.util.concurrent.CountDownLatch;
+import sun.management.ManagementFactoryHelper;
 
 /**
  * When an exception is thrown, the JVM collects just enough information
@@ -49,8 +54,12 @@
         System.exit(0);
     }
 
+    public static CountDownLatch stop = new CountDownLatch(1);
+    public static CountDownLatch called = new CountDownLatch(1);
+
     private void doTest() throws Exception {
         doMethodInBacktraceTest();
+        doMethodInBacktraceTestB();
     }
 
     private void doMethodInBacktraceTest() throws Exception {
@@ -63,6 +72,36 @@
         touchRedefinedMethodInBacktrace(t);
     }
 
+    private void doMethodInBacktraceTestB() throws Exception {
+        // Start a thread which blocks in method
+        Thread t = new Thread(RedefineMethodInBacktraceTargetB::methodToRedefine);
+        t.setDaemon(true);
+        t.start();
+
+        // Wait here until the new thread is in the method we want to redefine
+        called.await();
+
+        // Now redefine the class while the method is still on the stack of the new thread
+        doRedefine(RedefineMethodInBacktraceTargetB.class);
+
+        // Do thread dumps in two different ways (to exercise different code paths)
+        // while the old class is still on the stack
+
+        ThreadInfo[] tis = ManagementFactory.getThreadMXBean().dumpAllThreads(false, false);
+        for(ThreadInfo ti : tis) {
+            System.out.println(ti);
+        }
+
+        String[] threadPrintArgs = {};
+        Object[] dcmdArgs = {threadPrintArgs};
+        String[] signature = {String[].class.getName()};
+        DiagnosticCommandMBean dcmd = ManagementFactoryHelper.getDiagnosticCommandMBean();
+        System.out.println(dcmd.invoke("threadPrint", dcmdArgs, signature));
+
+        // release the thread
+        stop.countDown();
+    }
+
     private static Throwable getThrowableFromMethodToRedefine() throws Exception {
         Class<RedefineMethodInBacktraceTarget> c =
                 RedefineMethodInBacktraceTarget.class;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+/**
+ * The first version of this class. The second version is in
+ * RedefineMethodInBacktraceTargetB_2.java.
+ */
+public class RedefineMethodInBacktraceTargetB {
+    public static void methodToRedefine() {
+        try {
+            // signal that we are here
+            RedefineMethodInBacktraceApp.called.countDown();
+
+            // wait until test is done
+            RedefineMethodInBacktraceApp.stop.await();
+        } catch (InterruptedException ex) {
+            // ignore, test will fail
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+/**
+ * This is the second version of this class. The first version is in
+ * RedefineMethodInBacktraceTargetB.java.
+ */
+public class RedefineMethodInBacktraceTargetB {
+    public static void methodToRedefine() {
+    }
+}
--- a/jdk/test/java/lang/instrument/RetransformBigClass.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/instrument/RetransformBigClass.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -58,8 +58,16 @@
 JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
+# Does this VM support the 'detail' level of NMT?
+"${JAVA}" ${TESTVMOPTS} -XX:NativeMemoryTracking=detail -version
+if [ "$?" = 0 ]; then
+    NMT=-XX:NativeMemoryTracking=detail
+else
+    NMT=-XX:NativeMemoryTracking=summary
+fi
+
 "${JAVA}" ${TESTVMOPTS} \
-    -XX:TraceRedefineClasses=3 \
+    -XX:TraceRedefineClasses=3 ${NMT} \
     -javaagent:RetransformBigClassAgent.jar=BigClass.class \
     -classpath "${TESTCLASSES}" RetransformBigClassApp \
     > output.log 2>&1
--- a/jdk/test/java/lang/instrument/RetransformBigClassApp.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/instrument/RetransformBigClassApp.java	Mon Nov 11 16:20:48 2013 +0100
@@ -26,16 +26,23 @@
 public class RetransformBigClassApp {
     /**
      * Memory leak is assumed, if application consumes more than specified amount of memory during its execution.
-     * The number is given in Kb.
+     * The number is given in KB.
      */
-    private static final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb
+    private static final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32MB
 
     public static void main(String[] args) throws Exception {
         System.out.println("Creating instance of " +
             RetransformBigClassAgent.clz);
         RetransformBigClassAgent.clz.newInstance();
 
-        long vMemBefore = getVMemSize();
+        // Do a short warmup before creating the NMT baseline
+        try {
+            Thread.sleep(5 * 1000);
+        } catch (InterruptedException ie) {
+        }
+
+        NMTHelper.baseline();
+
         int count = 0;
         while (!RetransformBigClassAgent.doneRetransforming) {
             System.out.println("App loop count: " + ++count);
@@ -46,39 +53,12 @@
         }
         System.out.println("App looped  " + count + " times.");
 
-        long vMemAfter = getVMemSize();
-        if (vMemBefore == 0 || vMemAfter == 0) {
-            System.err.println("WARNING: Cannot perform memory leak detection on this OS");
-        } else {
-            long vMemDelta = vMemAfter - vMemBefore;
-            if (vMemDelta > MEM_LEAK_THRESHOLD) {
-                System.err.println("FAIL: Virtual memory usage increased by " + vMemDelta + "Kb " +
-                        "(greater than " + MEM_LEAK_THRESHOLD + "Kb)");
-                System.exit(1);
-            }
-            System.err.println("PASS: Virtual memory usage increased by " + vMemDelta + "Kb " +
-                    "(not greater than " + MEM_LEAK_THRESHOLD + "Kb)");
+        long committedDiff = NMTHelper.committedDiff();
+        if (committedDiff > MEM_LEAK_THRESHOLD) {
+            throw new Exception("FAIL: Committed memory usage increased by " + committedDiff + "KB " +
+                               "(greater than " + MEM_LEAK_THRESHOLD + "KB)");
         }
-        System.exit(0);
-    }
-
-    /**
-     * Return size of virtual memory allocated to the process in Kb.
-     * Linux specific. On other platforms and in case of any errors return 0.
-     */
-    private static long getVMemSize() {
-
-        // Refer to the Linux proc(5) man page for details about /proc/self/stat file
-        //
-        // In short, this file contains status information about the current process
-        // written in one line. The fields are separated with spaces.
-        // The 23rd field is defined as 'vsize %lu   Virtual memory size in bytes'
-
-        try (FileReader fileReader = new FileReader("/proc/self/stat");
-             BufferedReader bufferedReader = new BufferedReader(fileReader)) {
-            String line = bufferedReader.readLine();
-            return Long.parseLong(line.split(" ")[22]) / 1024;
-        } catch (Exception ex) {}
-        return 0;
+        System.err.println("PASS: Committed memory usage increased by " + committedDiff + "KB " +
+                           "(not greater than " + MEM_LEAK_THRESHOLD + "KB)");
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/lambda/DupIntf.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8025868
+ * @summary Lambda class can be generated with duplicate interfaces (ClassFormatError)
+ * @run main DupIntf
+ */
+
+interface SAM<P1> {
+    P1 m();
+}
+
+interface Other { }
+
+public class DupIntf {
+    public static void main(String argv[]) {
+        SAM<?> sam = (SAM<?> & Other) () -> "Pass.";
+        System.out.println(sam.m());
+    }
+}
--- a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java	Mon Nov 11 16:20:48 2013 +0100
@@ -28,10 +28,10 @@
  *                             ClassLoadingMXBean.getTotalLoadedClassCount()
  *                             ClassLoadingMXBean.getUnloadedClassCount()
  * @author  Alexei Guibadoulline
+ * @run main/othervm LoadCounts
  */
 
 import java.lang.management.*;
-import java.util.*;
 
 public class LoadCounts {
     private static ClassLoadingMXBean mbean
@@ -55,13 +55,15 @@
             throw new RuntimeException("getLoadedClassCount() > "
                                      + "getTotalLoadedClassCount()");
 
-        if (classesNowPrev + 4 != classesNow)
+        if (classesNowPrev + 4 > classesNow)
             throw new RuntimeException("Number of loaded classes is "
+                                     + "expected to be at least "
                                      + (classesNowPrev + 4) + ", but "
                                      + "MBean.getLoadedClassCount() returned "
                                      + classesNow);
-        if (classesTotalPrev + 4 != classesTotal)
+        if (classesTotalPrev + 4 > classesTotal)
             throw new RuntimeException("Total number of loaded classes is "
+                                     + "expected to be at least "
                                      + (classesTotalPrev + 4) + ", but "
                                      + "MBean.getTotalLoadedClassCount() "
                                      + "returned " + classesTotal);
@@ -95,13 +97,15 @@
 
         // Expected 2 classes got loaded since they are loaded by
         // same defining class loader
-        if (classesNowPrev + 2 != classesNow)
-            throw new RuntimeException("Expected Number of loaded classes is "
+        if (classesNowPrev + 2 > classesNow)
+            throw new RuntimeException("Number of loaded classes is "
+                                     + "expected to be at least "
                                      + (classesNowPrev + 4) + ", but "
                                      + "MBean.getLoadedClassCount() returned "
                                      + classesNow);
-        if (classesTotalPrev + 2 != classesTotal)
+        if (classesTotalPrev + 2 > classesTotal)
             throw new RuntimeException("Total number of loaded classes is "
+                                     + "expected to be at least "
                                      + (classesTotalPrev + 4) + ", but "
                                      + "MBean.getTotalLoadedClassCount() "
                                      + "returned " + classesTotal);
--- a/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@
 import static java.lang.management.ManagementFactory.*;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import com.sun.management.GcInfo;
 
 public class ProxyTypeMapping {
@@ -162,23 +161,23 @@
     }
 
     private static void checkMemoryUsage() throws Exception {
-        // sanity check to have non-zero usage
+        // sanity check to have non-negative usage
         MemoryUsage u1 = memory.getHeapMemoryUsage();
         MemoryUsage u2 = memory.getNonHeapMemoryUsage();
         MemoryUsage u3 = heapPool.getUsage();
         MemoryUsage u4 = nonHeapPool.getUsage();
-        if (u1.getCommitted() <= 0 ||
-            u2.getCommitted() <= 0 ||
-            u3.getCommitted() <= 0 ||
-            u4.getCommitted() <= 0) {
+        if (u1.getCommitted() < 0 ||
+            u2.getCommitted() < 0 ||
+            u3.getCommitted() < 0 ||
+            u4.getCommitted() < 0) {
             throw new RuntimeException("TEST FAILED: " +
-                " expected non-zero committed usage");
+                " expected non-negative committed usage");
         }
         memory.gc();
         MemoryUsage u5 = heapPool.getCollectionUsage();
-        if (u5.getCommitted() <= 0) {
+        if (u5.getCommitted() < 0) {
             throw new RuntimeException("TEST FAILED: " +
-                " expected non-zero committed collected usage");
+                " expected non-negative committed collected usage");
         }
     }
 
--- a/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug     5024531
- * @summary Validata open types mapped for the MXBeans in the platform
+ * @summary Validate open types mapped for the MXBeans in the platform
  *          MBeanServer.
  * @author  Mandy Chung
  *
@@ -38,7 +38,6 @@
 import static java.lang.management.ManagementFactory.*;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import com.sun.management.GcInfo;
 
 public class ValidateOpenTypes {
@@ -178,23 +177,23 @@
     }
 
     private static void checkMemoryUsage() throws Exception {
-        // sanity check to have non-zero usage
+        // sanity check to have non-negative usage
         Object u1 = server.getAttribute(memory, "HeapMemoryUsage");
         Object u2 = server.getAttribute(memory, "NonHeapMemoryUsage");
         Object u3 = server.getAttribute(heapPool, "Usage");
         Object u4 = server.getAttribute(nonHeapPool, "Usage");
-        if (getCommitted(u1) <= 0 ||
-            getCommitted(u2) <= 0 ||
-            getCommitted(u3) <= 0 ||
-            getCommitted(u4) <= 0) {
+        if (getCommitted(u1) < 0 ||
+            getCommitted(u2) < 0 ||
+            getCommitted(u3) < 0 ||
+            getCommitted(u4) < 0) {
             throw new RuntimeException("TEST FAILED: " +
-                " expected non-zero committed usage");
+                " expected non-negative committed usage");
         }
         server.invoke(memory, "gc", new Object[0], new String[0]);
         Object u5 = server.getAttribute(heapPool, "CollectionUsage");
-        if (getCommitted(u5) <= 0) {
+        if (getCommitted(u5) < 0) {
             throw new RuntimeException("TEST FAILED: " +
-                " expected non-zero committed collected usage");
+                " expected non-negative committed collected usage");
         }
     }
 
--- a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
  *          MemoryPoolMXBean.isCollectionThresholdExceeded().
  * @author  Mandy Chung
  *
- * @run main ThresholdTest
+ * @run main/othervm ThresholdTest
  */
 
 import java.lang.management.*;
@@ -36,6 +36,9 @@
 
 public class ThresholdTest {
     public static void main(String args[]) throws Exception {
+        long[] bigObject = new long[1000000];
+
+        System.gc(); // force an initial full-gc
         List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
         try {
             for (MemoryPoolMXBean p : pools) {
@@ -82,6 +85,10 @@
         }
 
         p.setUsageThreshold(1);
+        // force a full gc to minimize the likelihood of running GC
+        // between getting the usage and checking the threshold
+        System.gc();
+
         MemoryUsage u = p.getUsage();
         if (u.getUsed() >= 1) {
             if (!p.isUsageThresholdExceeded()) {
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,6 @@
  */
 
 import java.lang.management.*;
-import java.util.concurrent.locks.LockSupport;
 
 public class ThreadBlockedCount {
     final static long EXPECTED_BLOCKED_COUNT = 3;
@@ -101,6 +100,7 @@
                         System.err.println("Unexpected exception.");
                         e.printStackTrace(System.err);
                         testFailed = true;
+                        break;
                     }
                 }
 
@@ -127,6 +127,7 @@
                         System.err.println("Unexpected exception.");
                         e.printStackTrace(System.err);
                         testFailed = true;
+                        break;
                     }
                 }
 
@@ -153,6 +154,7 @@
                         System.err.println("Unexpected exception.");
                         e.printStackTrace(System.err);
                         testFailed = true;
+                        break;
                     }
                 }
 
@@ -166,15 +168,25 @@
                 }
             }
 
-            // Check the mbean now
-            ThreadInfo ti = mbean.getThreadInfo(Thread.currentThread().
-                                                getId());
-            long count = ti.getBlockedCount();
-
+            // wait for the thread stats to be updated for 10 seconds
+            for (int i = 0; i < 100; i++) {
+                if (getBlockedCount() == EXPECTED_BLOCKED_COUNT) {
+                    return;
+                }
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException e) {
+                    System.err.println("Unexpected exception.");
+                    e.printStackTrace(System.err);
+                    testFailed = true;
+                    return;
+                }
+            }
+            long count = getBlockedCount();
             if (count != EXPECTED_BLOCKED_COUNT) {
                 System.err.println("TEST FAILED: Blocked thread has " + count +
-                                   " blocked counts. Expected " +
-                                   EXPECTED_BLOCKED_COUNT);
+                                    " blocked counts. Expected " +
+                                    EXPECTED_BLOCKED_COUNT);
                 testFailed = true;
             }
         } // run()
@@ -195,6 +207,7 @@
                     System.err.println("Unexpected exception.");
                     e.printStackTrace(System.err);
                     testFailed = true;
+                    break;
                 }
                 ThreadInfo info = mbean.getThreadInfo(blocked.getId());
                 threadBlocked = (info.getThreadState() == Thread.State.BLOCKED);
@@ -233,4 +246,13 @@
 
         } // run()
     } // BlockedThread
+
+    private static long getBlockedCount() {
+        long count;
+        // Check the mbean now
+        ThreadInfo ti = mbean.getThreadInfo(Thread.currentThread().
+                getId());
+        count = ti.getBlockedCount();
+        return count;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/reflect/AnnotatedElement/TestAnnotatedElementDefaults.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,339 @@
+/*
+ * 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 8005294
+ * @summary Check behavior of default methods of AnnotatedElement
+ * @author Joseph D. Darcy
+ */
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ * For annotation type tokens including, null, DirectlyPresent.class,
+ * IndirectlyPresent.class, etc. the behavior of
+ * AnnotedElementDelegate.foo(arg) is compared for equality to
+ * baseAnnotatedElement.foo(arg) on various kinds of annotated
+ * elements.
+ */
+public class TestAnnotatedElementDefaults {
+    public static void main(String... args) throws SecurityException {
+        int failures = 0;
+
+        for (AnnotatedElement annotElement : elementsToTest()) {
+            System.out.println(annotElement);
+            AnnotatedElementDelegate delegate = new AnnotatedElementDelegate(annotElement);
+            failures += testNullHandling(delegate);
+            for (Class<? extends Annotation> annotType : annotationsToTest()) {
+                failures += AnnotatedElementDelegate.testDelegate(delegate, annotType);
+            }
+        }
+
+        if (failures > 0) {
+            System.err.printf("%d failures%n", failures);
+            throw new RuntimeException();
+        }
+    }
+
+    private static List<AnnotatedElement> elementsToTest() {
+        List<AnnotatedElement> annotatedElements = new ArrayList<>();
+        annotatedElements.add(TestClass1Super.class);
+        annotatedElements.add(TestClass1.class);
+        for (Method method : TestClass1.class.getDeclaredMethods()) {
+            annotatedElements.add(method);
+        }
+        return annotatedElements;
+    }
+
+    private static List<Class<? extends Annotation>> annotationsToTest() {
+        List<Class<? extends Annotation>> annotations = new ArrayList<>();
+        annotations.add(Missing.class);
+
+        annotations.add(MissingRepeatable.class);
+
+        annotations.add(DirectlyPresent.class);
+
+        annotations.add(IndirectlyPresent.class);
+        annotations.add(IndirectlyPresentContainer.class);
+
+        annotations.add(DirectlyAndIndirectlyPresent.class);
+        annotations.add(DirectlyAndIndirectlyPresentContainer.class);
+
+        annotations.add(AssociatedDirectOnSuperClass.class);
+        annotations.add(AssociatedDirectOnSuperClassContainer.class);
+
+        annotations.add(AssociatedDirectOnSuperClassIndirectOnSubclass.class);
+        annotations.add(AssociatedDirectOnSuperClassIndirectOnSubclassContainer.class);
+
+        annotations.add(AssociatedIndirectOnSuperClassDirectOnSubclass.class);
+        annotations.add(AssociatedIndirectOnSuperClassDirectOnSubclassContainer.class);
+        return annotations;
+    }
+
+    private static int testNullHandling(AnnotatedElementDelegate delegate) {
+        int failures = 0;
+        try {
+            Object result = delegate.getDeclaredAnnotationsByType(null);
+            failures++;
+        } catch (NullPointerException npe) {
+            ; // Expected
+        }
+
+        try {
+            Object result = delegate.getAnnotationsByType(null);
+            failures++;
+        } catch (NullPointerException npe) {
+            ; // Expected
+        }
+
+        try {
+            Object result = delegate.getDeclaredAnnotation(null);
+            failures++;
+        } catch (NullPointerException npe) {
+            ; // Expected
+        }
+
+        return failures;
+    }
+
+}
+
+// -----------------------------------------------------
+
+@AssociatedDirectOnSuperClass(123)
+@AssociatedIndirectOnSuperClass(234) @AssociatedIndirectOnSuperClass(345)
+@AssociatedDirectOnSuperClassIndirectOnSubclass(987)
+@AssociatedIndirectOnSuperClassDirectOnSubclass(1111) @AssociatedIndirectOnSuperClassDirectOnSubclass(2222)
+class TestClass1Super {}
+
+@DirectlyPresent(1)
+@IndirectlyPresent(10) @IndirectlyPresent(11)
+@AssociatedDirectOnSuperClassIndirectOnSubclass(876) @AssociatedDirectOnSuperClassIndirectOnSubclass(765)
+@AssociatedIndirectOnSuperClassDirectOnSubclass(3333)
+class TestClass1 extends TestClass1Super {
+
+    @DirectlyPresent(2)
+    @IndirectlyPresentContainer({@IndirectlyPresent(12)})
+    @DirectlyAndIndirectlyPresentContainer({@DirectlyAndIndirectlyPresent(84), @DirectlyAndIndirectlyPresent(96)})
+    public void foo() {return ;}
+
+    @IndirectlyPresentContainer({})
+    @DirectlyAndIndirectlyPresentContainer({@DirectlyAndIndirectlyPresent(11), @DirectlyAndIndirectlyPresent(22)})
+    @DirectlyAndIndirectlyPresent(33)
+    public void bar()  {return ;}
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Missing {
+    int value();
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(MissingRepeatableContainer.class)
+@interface MissingRepeatable {
+    int value();
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface MissingRepeatableContainer {
+    MissingRepeatable[] value();
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface DirectlyPresent {
+    int value();
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(IndirectlyPresentContainer.class)
+@interface IndirectlyPresent {
+    int value();
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface IndirectlyPresentContainer {
+    IndirectlyPresent[] value();
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(DirectlyAndIndirectlyPresentContainer.class)
+@interface DirectlyAndIndirectlyPresent {
+    int value();
+
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface DirectlyAndIndirectlyPresentContainer {
+    DirectlyAndIndirectlyPresent[] value();
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(AssociatedDirectOnSuperClassContainer.class)
+@interface AssociatedDirectOnSuperClass {
+    int value();
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AssociatedDirectOnSuperClassContainer {
+    AssociatedDirectOnSuperClass[] value();
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(AssociatedIndirectOnSuperClassContainer.class)
+@interface AssociatedIndirectOnSuperClass {
+    int value();
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AssociatedIndirectOnSuperClassContainer {
+    AssociatedIndirectOnSuperClass[] value();
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(AssociatedDirectOnSuperClassIndirectOnSubclassContainer.class)
+@interface  AssociatedDirectOnSuperClassIndirectOnSubclass {
+    int value();
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AssociatedDirectOnSuperClassIndirectOnSubclassContainer {
+    AssociatedDirectOnSuperClassIndirectOnSubclass[] value();
+}
+
+// -----------------------------------------------------
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(AssociatedIndirectOnSuperClassDirectOnSubclassContainer.class)
+@interface  AssociatedIndirectOnSuperClassDirectOnSubclass {
+    int value();
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AssociatedIndirectOnSuperClassDirectOnSubclassContainer {
+    AssociatedIndirectOnSuperClassDirectOnSubclass[] value();
+}
+
+// -----------------------------------------------------
+
+/**
+ * Helper class to ease calling the default methods of {@code
+ * AnnotatedElement} and comparing the results to other
+ * implementation.
+ */
+class AnnotatedElementDelegate implements AnnotatedElement {
+    private AnnotatedElement base;
+
+    public AnnotatedElementDelegate(AnnotatedElement base) {
+        Objects.requireNonNull(base);
+        this.base = base;
+    }
+
+    // Delegate to base implemenetation of AnnotatedElement methods
+    // without defaults.
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        return base.getAnnotation(annotationClass);
+    }
+
+    @Override
+    public Annotation[] getAnnotations() {
+        return base.getAnnotations();
+    }
+
+    @Override
+    public Annotation[] getDeclaredAnnotations() {
+        return base.getDeclaredAnnotations();
+    }
+
+    public AnnotatedElement getBase() {
+        return base;
+    }
+
+    static int testDelegate(AnnotatedElementDelegate delegate,
+                            Class<? extends Annotation> annotationClass) {
+        int failures = 0;
+        AnnotatedElement base = delegate.getBase();
+
+        // System.out.println("\tTesting " + delegate + "\ton\t" + annotationClass);
+
+        // <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass)
+        failures += annotationArrayCheck(delegate.getDeclaredAnnotationsByType(annotationClass),
+                                         base.getDeclaredAnnotationsByType(annotationClass),
+                                         annotationClass,
+                                         "Equality failure on getDeclaredAnnotationsByType(%s) on %s)%n");
+
+        // <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass)
+        failures += annotationArrayCheck(delegate.getAnnotationsByType(annotationClass),
+                                         base.getAnnotationsByType(annotationClass),
+                                         annotationClass,
+                                         "Equality failure on getAnnotationsByType(%s) on %s)%n");
+
+        // <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass)
+        if (!Objects.equals(delegate.getDeclaredAnnotation(annotationClass),
+                            base.getDeclaredAnnotation(annotationClass))) {
+            failures++;
+            System.err.printf("Equality failure on getDeclaredAnnotation(%s) on %s)%n",
+                              annotationClass, delegate);
+        }
+        return failures;
+    }
+    private static <T extends Annotation> int annotationArrayCheck(T[] delegate,
+                                                           T[] base,
+                                                           Class<? extends Annotation> annotationClass,
+                                                           String message) {
+        int failures = 0;
+
+        if (!Objects.deepEquals(delegate,base)) {
+            failures = 1;
+
+            System.err.printf(message,
+                              annotationClass,
+                              delegate);
+
+            System.err.println("Base result:\t" + Arrays.toString(base));
+            System.err.println("Delegate result:\t " + Arrays.toString(delegate));
+            System.err.println();
+        }
+
+        return failures;
+    }
+}
--- a/jdk/test/java/lang/reflect/DefaultStaticTest/DefaultStaticInvokeTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/reflect/DefaultStaticTest/DefaultStaticInvokeTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -44,30 +44,86 @@
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.fail;
 import org.testng.annotations.Test;
 
 import static helper.Mod.*;
 import static helper.Declared.*;
 import helper.Mod;
 
+
 public class DefaultStaticInvokeTest {
 
+    // getMethods(): Make sure getMethods returns the expected methods.
     @Test(dataProvider = "testCasesAll",
             dataProviderClass = DefaultStaticTestData.class)
     public void testGetMethods(String testTarget, Object param)
             throws Exception {
-        // test the methods retrieved by getMethods()
         testMethods(ALL_METHODS, testTarget, param);
     }
 
+
+    // getDeclaredMethods(): Make sure getDeclaredMethods returns the expected methods.
     @Test(dataProvider = "testCasesAll",
             dataProviderClass = DefaultStaticTestData.class)
     public void testGetDeclaredMethods(String testTarget, Object param)
             throws Exception {
-        // test the methods retrieved by getDeclaredMethods()
         testMethods(DECLARED_ONLY, testTarget, param);
     }
 
+
+    // getMethod(): Make sure that getMethod finds all methods it should find.
+    @Test(dataProvider = "testCasesAll",
+            dataProviderClass = DefaultStaticTestData.class)
+    public void testGetMethod(String testTarget, Object param)
+            throws Exception {
+
+        Class<?> typeUnderTest = Class.forName(testTarget);
+
+        MethodDesc[] descs = typeUnderTest.getAnnotationsByType(MethodDesc.class);
+
+        for (MethodDesc desc : descs) {
+            assertTrue(isFoundByGetMethod(typeUnderTest,
+                                          desc.name(),
+                                          argTypes(param)));
+        }
+    }
+
+
+    // getMethod(): Make sure that getMethod does *not* find certain methods.
+    @Test(dataProvider = "testCasesAll",
+            dataProviderClass = DefaultStaticTestData.class)
+    public void testGetMethodSuperInterfaces(String testTarget, Object param)
+            throws Exception {
+
+        // Make sure static methods in superinterfaces are not found (unless the type under
+        // test declares a static method with the same signature).
+
+        Class<?> typeUnderTest = Class.forName(testTarget);
+
+        for (Class<?> interfaze : typeUnderTest.getInterfaces()) {
+
+            for (MethodDesc desc : interfaze.getAnnotationsByType(MethodDesc.class)) {
+
+                boolean isStatic = desc.mod() == STATIC;
+
+                boolean declaredInThisType = isMethodDeclared(typeUnderTest,
+                                                              desc.name());
+
+                boolean expectedToBeFound = !isStatic || declaredInThisType;
+
+                if (expectedToBeFound)
+                    continue; // already tested in testGetMethod()
+
+                assertFalse(isFoundByGetMethod(typeUnderTest,
+                                               desc.name(),
+                                               argTypes(param)));
+            }
+        }
+    }
+
+
+    // Method.invoke(): Make sure Method.invoke returns the expected value.
     @Test(dataProvider = "testCasesAll",
             dataProviderClass = DefaultStaticTestData.class)
     public void testMethodInvoke(String testTarget, Object param)
@@ -78,11 +134,13 @@
         // test the method retrieved by Class.getMethod(String, Object[])
         for (MethodDesc toTest : expectedMethods) {
             String name = toTest.name();
-            Method m = getTestMethod(typeUnderTest, name, param);
+            Method m = typeUnderTest.getMethod(name, argTypes(param));
             testThisMethod(toTest, m, typeUnderTest, param);
         }
     }
 
+
+    // MethodHandle.invoke(): Make sure MethodHandle.invoke returns the expected value.
     @Test(dataProvider = "testCasesAll",
             dataProviderClass = DefaultStaticTestData.class)
     public void testMethodHandleInvoke(String testTarget, Object param)
@@ -116,6 +174,7 @@
 
     }
 
+    // Lookup.findStatic / .findVirtual: Make sure IllegalAccessException is thrown as expected.
     @Test(dataProvider = "testClasses",
             dataProviderClass = DefaultStaticTestData.class)
     public void testIAE(String testTarget, Object param)
@@ -128,7 +187,7 @@
             String mName = toTest.name();
             Mod mod = toTest.mod();
             if (mod != STATIC && typeUnderTest.isInterface()) {
-                return;
+                continue;
             }
             Exception caught = null;
             try {
@@ -136,10 +195,12 @@
             } catch (Exception e) {
                 caught = e;
             }
-            assertTrue(caught != null);
+            assertNotNull(caught);
             assertEquals(caught.getClass(), IllegalAccessException.class);
         }
     }
+
+
     private static final String[] OBJECT_METHOD_NAMES = {
         "equals",
         "hashCode",
@@ -192,15 +253,15 @@
                 myMethods.put(mName, m);
             }
         }
-        assertEquals(expectedMethods.length, myMethods.size());
+
+        assertEquals(myMethods.size(), expectedMethods.length);
 
         for (MethodDesc toTest : expectedMethods) {
 
             String name = toTest.name();
-            Method candidate = myMethods.get(name);
+            Method candidate = myMethods.remove(name);
 
             assertNotNull(candidate);
-            myMethods.remove(name);
 
             testThisMethod(toTest, candidate, typeUnderTest, param);
 
@@ -210,6 +271,7 @@
         assertTrue(myMethods.isEmpty());
     }
 
+
     private void testThisMethod(MethodDesc toTest, Method method,
             Class<?> typeUnderTest, Object param) throws Exception {
         // Test modifiers, and invoke
@@ -256,37 +318,52 @@
                 assertFalse(method.isDefault());
                 break;
             default:
-                assertFalse(true); //this should never happen
+                fail(); //this should never happen
                 break;
         }
 
     }
 
+
+    private boolean isMethodDeclared(Class<?> type, String name) {
+        MethodDesc[] methDescs = type.getAnnotationsByType(MethodDesc.class);
+        for (MethodDesc desc : methDescs) {
+            if (desc.declared() == YES && desc.name().equals(name))
+                return true;
+        }
+        return false;
+    }
+
+
+    private boolean isFoundByGetMethod(Class<?> c, String method, Class<?>... argTypes) {
+        try {
+            c.getMethod(method, argTypes);
+            return true;
+        } catch (NoSuchMethodException notFound) {
+            return false;
+        }
+    }
+
+
+    private Class<?>[] argTypes(Object param) {
+        return param == null ? new Class[0] : new Class[] { Object.class };
+    }
+
+
     private Object tryInvoke(Method m, Class<?> receiverType, Object param)
             throws Exception {
         Object receiver = receiverType == null ? null : receiverType.newInstance();
-        Object result = null;
-        if (param == null) {
-            result = m.invoke(receiver);
-        } else {
-            result = m.invoke(receiver, param);
-        }
-        return result;
+        Object[] args = param == null ? new Object[0] : new Object[] { param };
+        return m.invoke(receiver, args);
     }
 
-    private Method getTestMethod(Class clazz, String methodName, Object param)
-            throws NoSuchMethodException {
-        Class[] paramsType = (param != null)
-                ? new Class[]{Object.class}
-                : new Class[]{};
-        return clazz.getMethod(methodName, paramsType);
-    }
 
     private MethodHandle getTestMH(Class clazz, String methodName, Object param)
             throws Exception {
         return getTestMH(clazz, methodName, param, false);
     }
 
+
     private MethodHandle getTestMH(Class clazz, String methodName,
             Object param, boolean isNegativeTest)
             throws Exception {
--- a/jdk/test/java/lang/reflect/DefaultStaticTest/DefaultStaticTestData.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/lang/reflect/DefaultStaticTest/DefaultStaticTestData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -172,7 +172,7 @@
 
 @MethodDesc(name = "defaultMethod", retval = "TestIF8.TestClass8", mod = DEFAULT, declared = NO)
 class TestClass8<T> implements TestIF8<T> {
-};
+}
 
 @MethodDesc(name = "defaultMethod", retval = "TestIF9.defaultMethod", mod = DEFAULT, declared = YES)
 interface TestIF9 extends TestIF1 {
@@ -218,7 +218,6 @@
 }
 
 @MethodDesc(name = "defaultMethod", retval = "TestIF12.defaultMethod", mod = DEFAULT, declared = YES)
-@MethodDesc(name = "staticMethod", retval = "TestIF2.staticMethod", mod = STATIC, declared = NO)
 interface TestIF12 extends TestIF2 {
 
     default String defaultMethod() {
@@ -299,7 +298,7 @@
 
 @MethodDesc(name = "defaultMethod", retval = "TestIF16.defaultMethod", mod = DEFAULT, declared = NO)
 class TestClass16 implements TestIF16 {
-};
+}
 
 @MethodDesc(name = "defaultMethod", retval = "TestIF17.defaultMethod", mod = DEFAULT, declared = YES)
 @MethodDesc(name = "staticMethod", retval = "TestIF17.staticMethod", mod = STATIC, declared = YES)
@@ -318,6 +317,12 @@
 class TestClass17 implements TestIF17 {
 }
 
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF17.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass18 extends TestClass17 {
+}
+
+
 @Retention(RetentionPolicy.RUNTIME)
 @Repeatable(MethodDescs.class)
 @interface MethodDesc {
@@ -332,6 +337,41 @@
     MethodDesc[] value();
 }
 
+//Diamond Case for static method
+@MethodDesc(name = "staticMethod", retval = "TestIF2A.staticMethod", mod = STATIC, declared = YES)
+interface TestIF2A extends TestIF2 {
+    static String staticMethod() {
+        return "TestIF2A.staticMethod";
+    }
+}
+
+@MethodDesc(name = "method", retval = "", mod = ABSTRACT, declared = YES)
+interface TestIF2B extends TestIF2 {
+    String method();
+}
+
+@MethodDesc(name = "method", retval = "", mod = ABSTRACT, declared = YES)
+interface TestIF18 extends TestIF10, TestIF2A {
+    String method();
+}
+
+@MethodDesc(name = "method", retval = "", mod = ABSTRACT, declared = NO)
+@MethodDesc(name = "defaultMethod", retval = "TestIF12.defaultMethod", mod = DEFAULT, declared = NO)
+interface TestIF19 extends TestIF12, TestIF2B {
+}
+
+@MethodDesc(name = "staticMethod", retval = "TestIF20.staticMethod", mod = STATIC, declared = YES)
+@MethodDesc(name = "defaultMethod", retval = "TestIF12.defaultMethod", mod = DEFAULT, declared = NO)
+interface TestIF20 extends TestIF12, TestIF2A {
+    static String staticMethod() {
+        return "TestIF20.staticMethod";
+    }
+}
+
+@MethodDesc(name = "method", retval = "", mod = ABSTRACT, declared = NO)
+interface TestIF21 extends TestIF2A, TestIF2B {
+}
+
 public class DefaultStaticTestData {
 
     /**
@@ -343,22 +383,23 @@
     static Object[][] testClasses() {
         return new Object[][]{
             {"TestClass1", null},
-            //{"TestClass2", null}, @ignore due to JDK-8009411
+            {"TestClass2", null},
             {"TestClass3", null},
-            //{"TestClass4", null}, @ignore due to JDK-8009411
-            //{"TestClass5", null}, @ignore due to JDK-8009411
-            //{"TestClass6", null}, @ignore due to JDK-8009411
+            {"TestClass4", null},
+            {"TestClass5", null},
+            {"TestClass6", null},
             {"TestClass7", "TestIF7.TestClass7"},
             {"TestClass8", "TestIF8.TestClass8"},
             {"TestClass9", null},
             {"TestClass91", null},
-            //{"TestClass11", null}, @ignore due to JDK-8009411
-            //{"TestClass12", null}, @ignore due to JDK-8009411
+            {"TestClass11", null},
+            {"TestClass12", null},
             {"TestClass13", null},
             {"TestClass14", null},
             {"TestClass15", null},
-            {"TestClass16", null}
-        //{"TestClass17", null} @ignore due to JDK-8009411
+            {"TestClass16", null},
+            {"TestClass17", null},
+            {"TestClass18", null},
         };
     }
 
@@ -372,6 +413,8 @@
         return new Object[][]{
             {"TestIF1", null},
             {"TestIF2", null},
+            {"TestIF2A", null},
+            {"TestIF2B", null},
             {"TestIF3", null},
             {"TestIF4", null},
             {"TestIF5", null},
@@ -388,7 +431,12 @@
             {"TestIF1D", null},
             {"TestIF15", null},
             {"TestIF16", null},
-            {"TestIF17", null},};
+            {"TestIF17", null},
+            {"TestIF18", null},
+            {"TestIF19", null},
+            {"TestIF20", null},
+            {"TestIF21", null},
+        };
     }
 
     @DataProvider
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/reflect/Method/InterfaceStatic/StaticInterfaceMethodInWayOfDefault.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,183 @@
+/*
+ * 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 8009411
+ * @summary Test that a static method on an interface doesn't hide a default
+ *          method with the same name and signature in a separate compilation
+ *          scenario.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.concurrent.Callable;
+
+import sun.misc.IOUtils;
+
+public class StaticInterfaceMethodInWayOfDefault {
+    public interface A_v1 {
+    }
+
+    public interface A_v2 {
+        default void m() {
+            System.err.println("A.m() called");
+        }
+    }
+
+    public interface B  extends A_v1 {
+        static void m() {
+            System.err.println("B.m() called");
+        }
+    }
+
+    public interface C_v1 extends B {
+        default void m() {
+            System.err.println("C.m() called");
+        }
+    }
+
+    public interface C_v2 extends B {
+    }
+
+    public static class TestTask implements Callable<String> {
+        @Override
+        public String call() {
+            try {
+                Method m = C_v1.class.getMethod("m", (Class<?>[])null);
+                return  m.getDeclaringClass().getSimpleName();
+            } catch (NoSuchMethodException e) {
+                System.err.println("Couldn't find method");
+                return "ERROR";
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        int errors = 0;
+        Callable<String> v1Task = new TestTask();
+
+        ClassLoader v2Loader = new V2ClassLoader(
+            StaticInterfaceMethodInWayOfDefault.class.getClassLoader());
+        Callable<String> v2Task = (Callable<String>) Class.forName(
+            TestTask.class.getName(),
+            true,
+            v2Loader).newInstance();
+
+        System.err.println("Running using _v1 classes:");
+        String res = v1Task.call();
+        if(!res.equals("C_v1")) {
+            System.err.println("Got wrong method, expecting C_v1, got: " + res);
+            errors++;
+        }
+
+        System.err.println("Running using _v2 classes:");
+        res = v2Task.call();
+        if(!res.equals("A_v1")) {
+            System.err.println("Got wrong method, expecting A_v1, got: " + res);
+            errors++;
+        }
+
+        if (errors != 0)
+            throw new RuntimeException("Errors found, check log for details");
+    }
+
+    /**
+     * A ClassLoader implementation that loads alternative implementations of
+     * classes. If class name ends with "_v1" it locates instead a class with
+     * name ending with "_v2" and loads that class instead.
+     */
+    static class V2ClassLoader extends ClassLoader {
+        V2ClassLoader(ClassLoader parent) {
+            super(parent);
+        }
+
+        @Override
+        protected Class<?> loadClass(String name, boolean resolve)
+            throws ClassNotFoundException {
+            if (name.indexOf('.') < 0) { // root package is our class
+                synchronized (getClassLoadingLock(name)) {
+                    // First, check if the class has already been loaded
+                    Class<?> c = findLoadedClass(name);
+                    if (c == null) {
+                        c = findClass(name);
+                    }
+                    if (resolve) {
+                        resolveClass(c);
+                    }
+                    return c;
+                }
+            }
+            else { // not our class
+                return super.loadClass(name, resolve);
+            }
+        }
+
+        @Override
+        protected Class<?> findClass(String name)
+            throws ClassNotFoundException {
+            // special class name -> replace it with alternative name
+            if (name.endsWith("_v1")) {
+                String altName = name.substring(0, name.length() - 3) + "_v2";
+                String altPath = altName.replace('.', '/').concat(".class");
+                try (InputStream is = getResourceAsStream(altPath)) {
+                    if (is != null) {
+                        byte[] bytes = IOUtils.readFully(is, -1, true);
+                        // patch class bytes to contain original name
+                        for (int i = 0; i < bytes.length - 2; i++) {
+                            if (bytes[i] == '_' &&
+                                bytes[i + 1] == 'v' &&
+                                bytes[i + 2] == '2') {
+                                bytes[i + 2] = '1';
+                            }
+                        }
+                        return defineClass(name, bytes, 0, bytes.length);
+                    }
+                    else {
+                        throw new ClassNotFoundException(name);
+                    }
+                }
+                catch (IOException e) {
+                    throw new ClassNotFoundException(name, e);
+                }
+            }
+            else { // not special class name -> just load the class
+                String path = name.replace('.', '/').concat(".class");
+                try (InputStream is = getResourceAsStream(path)) {
+                    if (is != null) {
+                        byte[] bytes = IOUtils.readFully(is, -1, true);
+                        return defineClass(name, bytes, 0, bytes.length);
+                    }
+                    else {
+                        throw new ClassNotFoundException(name);
+                    }
+                }
+                catch (IOException e) {
+                    throw new ClassNotFoundException(name, e);
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/math/BigInteger/BitLengthOverflow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+/*
+ * @ test
+ * @bug 6910473
+ * @summary Test that bitLength() is not negative
+ * @author Dmitry Nadezhin
+ */
+import java.math.BigInteger;
+
+public class BitLengthOverflow {
+
+    public static void main(String[] args) {
+
+        try {
+            BigInteger x = BigInteger.ONE.shiftLeft(Integer.MAX_VALUE); // x = pow(2,Integer.MAX_VALUE)
+            if (x.bitLength() != (1L << 31))
+                throw new RuntimeException("Incorrect bitLength() " + x.bitLength());
+            System.out.println("Surprisingly passed with correct bitLength() " + x.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+            System.out.println("Overflow is reported by ArithmeticException, as expected");
+        } catch (OutOfMemoryError e) {
+            // possible
+            System.out.println("OutOfMemoryError");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/math/BigInteger/DivisionOverflow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 8022780
+ * @summary Test division of large values
+ * @author Dmitry Nadezhin
+ */
+import java.math.BigInteger;
+
+public class DivisionOverflow {
+
+    public static void main(String[] args) {
+        try {
+            BigInteger a = BigInteger.ONE.shiftLeft(2147483646);
+            BigInteger b = BigInteger.ONE.shiftLeft(1568);
+            BigInteger[] qr = a.divideAndRemainder(b);
+            BigInteger q = qr[0];
+            BigInteger r = qr[1];
+            if (!r.equals(BigInteger.ZERO))
+                throw new RuntimeException("Incorrect singum() of remainder " + r.signum());
+            if (q.bitLength() != 2147482079)
+                throw new RuntimeException("Incorrect bitLength() of quotient " + q.bitLength());
+            System.out.println("Division of large values passed without overflow.");
+        } catch (OutOfMemoryError e) {
+            // possible
+            System.out.println("OutOfMemoryError");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/math/BigInteger/DoubleValueOverflow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+/*
+ * @ test
+ * @bug 8021203
+ * @summary Test that doubleValue() doesn't overflow
+ * @author Dmitry Nadezhin
+ */
+import java.math.BigInteger;
+
+public class DoubleValueOverflow {
+
+    public static void main(String[] args) {
+
+        try {
+            BigInteger x = BigInteger.valueOf(2).shiftLeft(Integer.MAX_VALUE); // x = pow(2,pow(2,31))
+            if (x.doubleValue() != Double.POSITIVE_INFINITY)
+                throw new RuntimeException("Incorrect doubleValue() " + x.doubleValue());
+            System.out.println("Passed with correct result");
+        } catch (ArithmeticException e) {
+            // expected
+            System.out.println("Overflow is reported by ArithmeticException, as expected");
+        } catch (OutOfMemoryError e) {
+            // possible
+            System.out.println("OutOfMemoryError");
+        }
+    }
+}
--- a/jdk/test/java/math/BigInteger/ExtremeShiftingTests.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/math/BigInteger/ExtremeShiftingTests.java	Mon Nov 11 16:20:48 2013 +0100
@@ -27,22 +27,41 @@
  * @summary Tests of shiftLeft and shiftRight on Integer.MIN_VALUE
  * @author Joseph D. Darcy
  */
+import java.math.BigInteger;
 import static java.math.BigInteger.*;
 
 public class ExtremeShiftingTests {
     public static void main(String... args) {
+        BigInteger bi = ONE.shiftLeft(Integer.MIN_VALUE);
+        if (!bi.equals(ZERO))
+            throw new RuntimeException("1 << " + Integer.MIN_VALUE);
+
+        bi = ZERO.shiftLeft(Integer.MIN_VALUE);
+        if (!bi.equals(ZERO))
+            throw new RuntimeException("0 << " + Integer.MIN_VALUE);
+
+        bi = BigInteger.valueOf(-1);
+        bi = bi.shiftLeft(Integer.MIN_VALUE);
+        if (!bi.equals(BigInteger.valueOf(-1)))
+            throw new RuntimeException("-1 << " + Integer.MIN_VALUE);
+
         try {
-            ONE.shiftLeft(Integer.MIN_VALUE);
-            throw new RuntimeException("Should not reach here.");
+            ONE.shiftRight(Integer.MIN_VALUE);
+            throw new RuntimeException("1 >> " + Integer.MIN_VALUE);
         } catch (ArithmeticException ae) {
             ; // Expected
         }
 
+        bi = ZERO.shiftRight(Integer.MIN_VALUE);
+        if (!bi.equals(ZERO))
+            throw new RuntimeException("0 >> " + Integer.MIN_VALUE);
+
         try {
-            ONE.shiftRight(Integer.MIN_VALUE);
-            throw new RuntimeException("Should not reach here.");
+            BigInteger.valueOf(-1).shiftRight(Integer.MIN_VALUE);
+            throw new RuntimeException("-1 >> " + Integer.MIN_VALUE);
         } catch (ArithmeticException ae) {
             ; // Expected
         }
+
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/math/BigInteger/StringConstructorOverflow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+/*
+ * @ test
+ * @bug 8021204
+ * @summary Test constructor BigInteger(String val, int radix) on very long string
+ * @author Dmitry Nadezhin
+ */
+import java.math.BigInteger;
+
+public class StringConstructorOverflow {
+
+    // String with hexadecimal value pow(2,pow(2,34))+1
+    private static String makeLongHexString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append('1');
+        for (int i = 0; i < (1 << 30) - 1; i++) {
+            sb.append('0');
+        }
+        sb.append('1');
+        return sb.toString();
+    }
+
+    public static void main(String[] args) {
+        try {
+            BigInteger bi = new BigInteger(makeLongHexString(), 16);
+            if (bi.compareTo(BigInteger.ONE) <= 0)
+                throw new RuntimeException("Incorrect result " + bi.toString());
+        } catch (ArithmeticException e) {
+            // expected
+            System.out.println("Overflow is reported by ArithmeticException, as expected");
+        } catch (OutOfMemoryError e) {
+            // possible
+            System.out.println("OutOfMemoryError");
+            System.out.println("Run jtreg with -javaoption:-Xmx8g");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/math/BigInteger/SymmetricRangeTests.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,662 @@
+/*
+ * 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.
+ */
+
+/*
+ * This test is intentionally ignored because of huge memory requirements
+ * @ test
+ * @run main/timeout=180/othervm -Xmx8g SymmetricRangeTests
+ * @bug 6910473 8021204 8021203 9005933
+ * @summary Test range of BigInteger values
+ * @author Dmitry Nadezhin
+ */
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Arrays;
+import java.util.Random;
+import java.math.BigInteger;
+
+public class SymmetricRangeTests {
+
+    private static final BigInteger MAX_VALUE = makeMaxValue();
+    private static final BigInteger MIN_VALUE = MAX_VALUE.negate();
+
+    private static BigInteger makeMaxValue() {
+        byte[] ba = new byte[1 << 28];
+        Arrays.fill(ba, (byte) 0xFF);
+        ba[0] = (byte) 0x7F;
+        return new BigInteger(ba);
+    }
+
+    private static void check(String msg, BigInteger actual, BigInteger expected) {
+        if (!actual.equals(expected)) {
+            throw new RuntimeException(msg + ".bitLength()=" + actual.bitLength());
+        }
+    }
+
+    private static void check(String msg, double actual, double expected) {
+        if (actual != expected) {
+            throw new RuntimeException(msg + "=" + actual);
+        }
+    }
+
+    private static void check(String msg, float actual, float expected) {
+        if (actual != expected) {
+            throw new RuntimeException(msg + "=" + actual);
+        }
+    }
+
+    private static void check(String msg, long actual, long expected) {
+        if (actual != expected) {
+            throw new RuntimeException(msg + "=" + actual);
+        }
+    }
+
+    private static void check(String msg, int actual, int expected) {
+        if (actual != expected) {
+            throw new RuntimeException(msg + "=" + actual);
+        }
+    }
+
+    private static void testOverflowInMakePositive() {
+        System.out.println("Testing overflow in BigInteger.makePositive");
+        byte[] ba = new byte[Integer.MAX_VALUE - 2];
+        ba[0] = (byte) 0x80;
+        try {
+            BigInteger actual = new BigInteger(ba);
+            throw new RuntimeException("new BigInteger(ba).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testBug8021204() {
+        System.out.println("Testing Bug 8021204");
+        StringBuilder sb = new StringBuilder();
+        sb.append('1');
+        for (int i = 0; i < (1 << 30) - 1; i++) {
+            sb.append('0');
+        }
+        sb.append('1');
+        String s = sb.toString();
+        sb = null;
+        try {
+            BigInteger actual = new BigInteger(s, 16);
+            throw new RuntimeException("new BigInteger(\"1000...001\").bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testOverflowInBitSieve() {
+        System.out.println("Testing overflow in BitSieve.sieveSingle");
+        int bitLength = (5 << 27) - 1;
+        try {
+            Random rnd = new Random();
+            BigInteger actual = new BigInteger(bitLength, 0, rnd);
+            throw new RuntimeException("new BigInteger(bitLength, 0, null).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+        try {
+            BigInteger bi = BigInteger.ONE.shiftLeft(bitLength - 1).subtract(BigInteger.ONE);
+            BigInteger actual = bi.nextProbablePrime();
+            throw new RuntimeException("bi.nextActualPrime().bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testAdd() {
+        System.out.println("Testing BigInteger.add");
+        try {
+            BigInteger actual = MAX_VALUE.add(BigInteger.ONE);
+            throw new RuntimeException("BigInteger.MAX_VALUE.add(BigInteger.ONE).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testSubtract() {
+        System.out.println("Testing BigInteger.subtract");
+        try {
+            BigInteger actual = MIN_VALUE.subtract(BigInteger.ONE);
+            throw new RuntimeException("BigInteger.MIN_VALUE.subtract(BigInteger.ONE).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testMultiply() {
+        System.out.println("Testing BigInteger.multiply");
+        int py = 2000;
+        int px = Integer.MAX_VALUE - py;
+        BigInteger x = BigInteger.ONE.shiftLeft(px);
+        BigInteger y = BigInteger.ONE.shiftLeft(py);
+        try {
+            BigInteger actual = x.multiply(y);
+            throw new RuntimeException("(1 << " + px + " ) * (1 << " + py + ").bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testDivide() {
+        System.out.println("Testing BigInteger.divide");
+        check("BigInteger.MIN_VALUE.divide(BigInteger.valueOf(-1))",
+                MIN_VALUE.divide(BigInteger.valueOf(-1)), MAX_VALUE);
+        check("BigInteger.MIN_VALUE.divide(BigInteger.ONE)",
+                MIN_VALUE.divide(BigInteger.ONE), MIN_VALUE);
+    }
+
+    private static void testDivideAndRemainder(String msg, BigInteger dividend, BigInteger divisor,
+            BigInteger expectedQuotent, BigInteger expectedRemainder) {
+        BigInteger[] qr = dividend.divideAndRemainder(divisor);
+        check(msg + "[0]", qr[0], expectedQuotent);
+        check(msg + "[1]", qr[1], expectedRemainder);
+    }
+
+    private static void testDivideAndRemainder() {
+        System.out.println("Testing BigInteger.divideAndRemainder");
+        testDivideAndRemainder("BigInteger.MIN_VALUE.divideAndRemainder(BigInteger.valueOf(-1))",
+                MIN_VALUE, BigInteger.valueOf(-1),
+                MAX_VALUE,
+                BigInteger.ZERO);
+    }
+
+    private static void testBug9005933() {
+        System.out.println("Testing Bug 9005933");
+        int dividendPow = 2147483646;
+        int divisorPow = 1568;
+        BigInteger dividend = BigInteger.ONE.shiftLeft(dividendPow);
+        BigInteger divisor = BigInteger.ONE.shiftLeft(divisorPow);
+        testDivideAndRemainder("(1 << " + dividendPow + ").divideAndRemainder(1 << " + divisorPow + ")",
+                dividend, divisor,
+                BigInteger.ONE.shiftLeft(dividendPow - divisorPow),
+                BigInteger.ZERO);
+    }
+
+    private static void testRemainder() {
+        System.out.println("Testing BigInteger.remainder");
+        check("BigInteger.MIN_VALUE.remainder(BigInteger.valueOf(-1))",
+                MIN_VALUE.remainder(BigInteger.valueOf(-1)), BigInteger.ZERO);
+    }
+
+    private static void testPow() {
+        System.out.println("Testing BigInteger.pow");
+        check("BigInteger.MIN_VALUE.pow(1)",
+                MIN_VALUE.pow(1), MIN_VALUE);
+        try {
+            BigInteger actual = BigInteger.valueOf(4).pow(Integer.MAX_VALUE);
+            throw new RuntimeException("BigInteger.valueOf(4).pow(Integer.MAX_VALUE).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testGcd() {
+        System.out.println("Testing BigInteger.gcd");
+        check("BigInteger.MIN_VALUE.gcd(BigInteger.MIN_VALUE)",
+                MIN_VALUE.gcd(MIN_VALUE), MAX_VALUE);
+        check("BigInteger.MIN_VALUE.gcd(BigInteger.ZERO)",
+                MIN_VALUE.gcd(BigInteger.ZERO), MAX_VALUE);
+        check("BigInteger.ZERO.gcd(MIN_VALUE)",
+                BigInteger.ZERO.gcd(MIN_VALUE), MAX_VALUE);
+    }
+
+    private static void testAbs() {
+        System.out.println("Testing BigInteger.abs");
+        check("BigInteger.MIN_VALUE.abs()",
+                MIN_VALUE.abs(), MAX_VALUE);
+        check("BigInteger.MAX_VALUE.abs()",
+                MAX_VALUE.abs(), MAX_VALUE);
+    }
+
+    private static void testNegate() {
+        System.out.println("Testing BigInteger.negate");
+        check("BigInteger.MIN_VALUE.negate()",
+                MIN_VALUE.negate(), MAX_VALUE);
+        check("BigInteger.MAX_VALUE.negate()",
+                MAX_VALUE.negate(), MIN_VALUE);
+    }
+
+    private static void testMod() {
+        System.out.println("Testing BigInteger.mod");
+        check("BigInteger.MIN_VALUE.mod(BigInteger.MAX_VALUE)",
+                MIN_VALUE.mod(MAX_VALUE), BigInteger.ZERO);
+        check("BigInteger.MAX_VALUE.mod(BigInteger.MAX_VALUE)",
+                MIN_VALUE.mod(MAX_VALUE), BigInteger.ZERO);
+    }
+
+    private static void testModPow() {
+        System.out.println("Testing BigInteger.modPow");
+        BigInteger x = BigInteger.valueOf(3);
+        BigInteger m = BigInteger.valueOf(-4).subtract(MIN_VALUE);
+        check("BigInteger.valueOf(3).modPow(BigInteger.ONE, m)",
+                x.modPow(BigInteger.ONE, m), x);
+    }
+
+    // slow test
+    private static void testModInverse() {
+        System.out.println("Testing BigInteger.modInverse");
+        check("BigInteger.MIN_VALUE.modInverse(BigInteger.MAX_VALUE)",
+                MIN_VALUE.modInverse(MAX_VALUE), MAX_VALUE.subtract(BigInteger.ONE));
+    }
+
+    private static void testShiftLeft() {
+        System.out.println("Testing BigInteger.shiftLeft");
+        try {
+            BigInteger actual = MIN_VALUE.shiftLeft(1);
+            throw new RuntimeException("BigInteger.MIN_VALUE.shiftLeft(1).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+        try {
+            BigInteger actual = MAX_VALUE.shiftLeft(1);
+            throw new RuntimeException("BigInteger.MAX_VALUE.shiftLeft(1).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testShiftRight() {
+        System.out.println("Testing BigInteger.shiftRight");
+        try {
+            BigInteger actual = MIN_VALUE.shiftRight(-1);
+            throw new RuntimeException("BigInteger.MIN_VALUE.shiftRight(-1).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+        try {
+            BigInteger actual = MAX_VALUE.shiftRight(-1);
+            throw new RuntimeException("BigInteger.MAX_VALUE.shiftRight(-1).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testAnd() {
+        System.out.println("Testing BigInteger.and");
+        check("BigInteger.MIN_VALUE.and(BigInteger.MIN_VALUE)",
+                MIN_VALUE.and(MIN_VALUE), MIN_VALUE);
+        check("BigInteger.MAX_VALUE.and(BigInteger.MAX_VALUE)",
+                MAX_VALUE.and(MAX_VALUE), MAX_VALUE);
+        check("BigInteger.MIN_VALUE.and(BigInteger.MAX_VALUE)",
+                MIN_VALUE.and(MAX_VALUE), BigInteger.ONE);
+        try {
+            BigInteger actual = MIN_VALUE.and(BigInteger.valueOf(-2));
+            throw new RuntimeException("BigInteger.MIN_VALUE.and(-2)).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testOr() {
+        System.out.println("Testing BigInteger.or");
+        check("BigInteger.MIN_VALUE.or(BigInteger.MIN_VALUE)",
+                MIN_VALUE.or(MIN_VALUE), MIN_VALUE);
+        check("BigInteger.MAX_VALUE.or(BigInteger.MAX_VALUE)",
+                MAX_VALUE.or(MAX_VALUE), MAX_VALUE);
+        check("BigInteger.MIN_VALUE.and(BigInteger.MAX_VALUE)",
+                MIN_VALUE.or(MAX_VALUE), BigInteger.valueOf(-1));
+    }
+
+    private static void testXor() {
+        System.out.println("Testing BigInteger.xor");
+        check("BigInteger.MIN_VALUE.xor(BigInteger.MIN_VALUE)",
+                MIN_VALUE.xor(MIN_VALUE), BigInteger.ZERO);
+        check("BigInteger.MAX_VALUE.xor(BigInteger.MAX_VALUE)",
+                MAX_VALUE.xor(MAX_VALUE), BigInteger.ZERO);
+        check("BigInteger.MIN_VALUE.xor(BigInteger.MAX_VALUE)",
+                MIN_VALUE.xor(MAX_VALUE), BigInteger.valueOf(-2));
+        try {
+            BigInteger actual = MIN_VALUE.xor(BigInteger.ONE);
+            throw new RuntimeException("BigInteger.MIN_VALUE.xor(BigInteger.ONE)).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testNot() {
+        System.out.println("Testing BigInteger.not");
+        check("BigInteger.MIN_VALUE.not()",
+                MIN_VALUE.not(), MAX_VALUE.subtract(BigInteger.ONE));
+        try {
+            BigInteger actual = MAX_VALUE.not();
+            throw new RuntimeException("BigInteger.MAX_VALUE.not()).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testSetBit() {
+        System.out.println("Testing BigInteger.setBit");
+        check("BigInteger.MIN_VALUE.setBit(" + Integer.MAX_VALUE + ")",
+                MIN_VALUE.setBit(Integer.MAX_VALUE), MIN_VALUE);
+        try {
+            BigInteger actual = MAX_VALUE.setBit(Integer.MAX_VALUE);
+            throw new RuntimeException("BigInteger.MAX_VALUE.setBit(" + Integer.MAX_VALUE + ").bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testClearBit() {
+        System.out.println("Testing BigInteger.clearBit");
+        check("BigInteger.MAX_VALUE.clearBit(" + Integer.MAX_VALUE + ")",
+                MAX_VALUE.clearBit(Integer.MAX_VALUE), MAX_VALUE);
+        try {
+            BigInteger actual = MIN_VALUE.clearBit(Integer.MAX_VALUE);
+            throw new RuntimeException("BigInteger.MIN_VALUE.clearBit(" + Integer.MAX_VALUE + ").bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+        try {
+            BigInteger actual = MIN_VALUE.clearBit(0);
+            throw new RuntimeException("BigInteger.MIN_VALUE.clearBit(0).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testFlipBit() {
+        System.out.println("Testing BigInteger.flipBit");
+        try {
+            BigInteger actual = MIN_VALUE.flipBit(Integer.MAX_VALUE);
+            throw new RuntimeException("BigInteger.MIN_VALUE.flipBit(" + Integer.MAX_VALUE + ").bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+        try {
+            BigInteger actual = MIN_VALUE.flipBit(0);
+            throw new RuntimeException("BigInteger.MIN_VALUE.flipBit(0).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+        try {
+            BigInteger actual = MAX_VALUE.flipBit(Integer.MAX_VALUE);
+            throw new RuntimeException("BigInteger.MAX_VALUE.flipBit(" + Integer.MAX_VALUE + ").bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testGetLowestSetBit() {
+        System.out.println("Testing BigInteger.getLowestSetBit");
+        check("BigInteger.MIN_VALUE.getLowestSetBit()",
+                MIN_VALUE.getLowestSetBit(), 0);
+        check("BigInteger.MAX_VALUE.getLowestSetBit()",
+                MAX_VALUE.getLowestSetBit(), 0);
+    }
+
+    private static void testBitLength() {
+        System.out.println("Testing BigInteger.bitLength");
+        check("BigInteger.MIN_NEXT.bitLength()",
+                MIN_VALUE.bitLength(), Integer.MAX_VALUE);
+        check("BigInteger.MAX_VALUE.bitLength()",
+                MAX_VALUE.bitLength(), Integer.MAX_VALUE);
+    }
+
+    private static void testBitCount() {
+        System.out.println("Testing BigInteger.bitCount");
+        check("BigInteger.MIN_VALUE.bitCount()",
+                MIN_VALUE.bitCount(), Integer.MAX_VALUE - 1);
+        check("BigInteger.MAX_VALUE.bitCount()",
+                MAX_VALUE.bitCount(), Integer.MAX_VALUE);
+    }
+
+    private static void testToString(String msg, int radix, BigInteger bi, int length, String startsWith, char c) {
+        String s = bi.toString(radix);
+        if (s.length() != length) {
+            throw new RuntimeException(msg + ".length=" + s.length());
+        }
+        if (!s.startsWith(startsWith)) {
+            throw new RuntimeException(msg + "[0]=" + s.substring(0, startsWith.length()));
+        }
+        for (int i = startsWith.length(); i < s.length(); i++) {
+            if (s.charAt(i) != c) {
+                throw new RuntimeException(msg + "[" + i + "]='" + s.charAt(i) + "'");
+            }
+        }
+    }
+
+    private static void testToString() {
+        System.out.println("Testing BigInteger.toString");
+        testToString("BigInteger.MIN_VALUE.toString(16)=", 16,
+                BigInteger.valueOf(-1).shiftLeft(Integer.MAX_VALUE - 1),
+                (1 << 29) + 1, "-4", '0');
+    }
+
+    private static void testToByteArrayWithConstructor(String msg, BigInteger bi, int length, byte msb, byte b, byte lsb) {
+        byte[] ba = bi.toByteArray();
+        if (ba.length != length) {
+            throw new RuntimeException(msg + ".length=" + ba.length);
+        }
+        if (ba[0] != msb) {
+            throw new RuntimeException(msg + "[0]=" + ba[0]);
+        }
+        for (int i = 1; i < ba.length - 1; i++) {
+            if (ba[i] != b) {
+                throw new RuntimeException(msg + "[" + i + "]=" + ba[i]);
+            }
+        }
+        if (ba[ba.length - 1] != lsb) {
+            throw new RuntimeException(msg + "[" + (ba.length - 1) + "]=" + ba[ba.length - 1]);
+        }
+        BigInteger actual = new BigInteger(ba);
+        if (!actual.equals(bi)) {
+            throw new RuntimeException(msg + ".bitLength()=" + actual.bitLength());
+        }
+    }
+
+    private static void testToByteArrayWithConstructor() {
+        System.out.println("Testing BigInteger.toByteArray with constructor");
+        testToByteArrayWithConstructor("BigInteger.MIN_VALUE.toByteArray()",
+                MIN_VALUE, (1 << 28), (byte) 0x80, (byte) 0x00, (byte) 0x01);
+        testToByteArrayWithConstructor("BigInteger.MAX_VALUE.toByteArray()",
+                MAX_VALUE, (1 << 28), (byte) 0x7f, (byte) 0xff, (byte) 0xff);
+
+        byte[] ba = new byte[1 << 28];
+        ba[0] = (byte) 0x80;
+        try {
+            BigInteger actual = new BigInteger(-1, ba);
+            throw new RuntimeException("new BigInteger(-1, ba).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+        try {
+            BigInteger actual = new BigInteger(1, ba);
+            throw new RuntimeException("new BigInteger(1, ba).bitLength()=" + actual.bitLength());
+        } catch (ArithmeticException e) {
+            // expected
+        }
+    }
+
+    private static void testIntValue() {
+        System.out.println("Testing BigInteger.intValue");
+        check("BigInteger.MIN_VALUE.intValue()",
+                MIN_VALUE.intValue(), 1);
+        check("BigInteger.MAX_VALUE.floatValue()",
+                MAX_VALUE.intValue(), -1);
+    }
+
+    private static void testLongValue() {
+        System.out.println("Testing BigInteger.longValue");
+        check("BigInteger.MIN_VALUE.longValue()",
+                MIN_VALUE.longValue(), 1L);
+        check("BigInteger.MAX_VALUE.longValue()",
+                MAX_VALUE.longValue(), -1L);
+    }
+
+    private static void testFloatValue() {
+        System.out.println("Testing BigInteger.floatValue, Bug 8021203");
+        check("BigInteger.MIN_VALUE_.floatValue()",
+                MIN_VALUE.floatValue(), Float.NEGATIVE_INFINITY);
+        check("BigInteger.MAX_VALUE.floatValue()",
+                MAX_VALUE.floatValue(), Float.POSITIVE_INFINITY);
+    }
+
+    private static void testDoubleValue() {
+        System.out.println("Testing BigInteger.doubleValue, Bug 8021203");
+        check("BigInteger.MIN_VALUE.doubleValue()",
+                MIN_VALUE.doubleValue(), Double.NEGATIVE_INFINITY);
+        check("BigInteger.MAX_VALUE.doubleValue()",
+                MAX_VALUE.doubleValue(), Double.POSITIVE_INFINITY);
+    }
+
+    private static void testSerialization(String msg, BigInteger bi) {
+        try {
+            ByteArrayOutputStream baOut = new ByteArrayOutputStream((1 << 28) + 1000);
+            ObjectOutputStream out = new ObjectOutputStream(baOut);
+            out.writeObject(bi);
+            out.close();
+            out = null;
+            byte[] ba = baOut.toByteArray();
+            baOut = null;
+            ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(ba));
+            BigInteger actual = (BigInteger) in.readObject();
+            if (!actual.equals(bi)) {
+                throw new RuntimeException(msg + ".bitLength()=" + actual.bitLength());
+            }
+        } catch (IOException | ClassNotFoundException e) {
+            throw new RuntimeException(msg + " raised exception ", e);
+        }
+    }
+
+    private static void testSerialization() {
+        System.out.println("Testing BigInteger serialization");
+        testSerialization("BigInteger.MIN_VALUE.intValue()",
+                MIN_VALUE);
+        testSerialization("BigInteger.MAX_VALUE.floatValue()",
+                MAX_VALUE);
+    }
+
+    private static void testLongValueExact() {
+        System.out.println("Testing BigInteger.longValueExact");
+        try {
+            long actual = MIN_VALUE.longValueExact();
+            throw new RuntimeException("BigInteger.MIN_VALUE.longValueExact()= " + actual);
+        } catch (ArithmeticException e) {
+            // excpected
+        }
+        try {
+            long actual = MAX_VALUE.longValueExact();
+            throw new RuntimeException("BigInteger.MAX_VALUE.longValueExact()= " + actual);
+        } catch (ArithmeticException e) {
+            // excpected
+        }
+    }
+
+    private static void testIntValueExact() {
+        System.out.println("Testing BigInteger.intValueExact");
+        try {
+            long actual = MIN_VALUE.intValueExact();
+            throw new RuntimeException("BigInteger.MIN_VALUE.intValueExact()= " + actual);
+        } catch (ArithmeticException e) {
+            // excpected
+        }
+        try {
+            long actual = MAX_VALUE.intValueExact();
+            throw new RuntimeException("BigInteger.MAX_VALUE.intValueExact()= " + actual);
+        } catch (ArithmeticException e) {
+            // excpected
+        }
+    }
+
+    private static void testShortValueExact() {
+        System.out.println("Testing BigInteger.shortValueExact");
+        try {
+            long actual = MIN_VALUE.shortValueExact();
+            throw new RuntimeException("BigInteger.MIN_VALUE.shortValueExact()= " + actual);
+        } catch (ArithmeticException e) {
+            // excpected
+        }
+        try {
+            long actual = MAX_VALUE.shortValueExact();
+            throw new RuntimeException("BigInteger.MAX_VALUE.shortValueExact()= " + actual);
+        } catch (ArithmeticException e) {
+            // excpected
+        }
+    }
+
+    private static void testByteValueExact() {
+        System.out.println("Testing BigInteger.byteValueExact");
+        try {
+            long actual = MIN_VALUE.byteValueExact();
+            throw new RuntimeException("BigInteger.MIN_VALUE.byteValueExact()= " + actual);
+        } catch (ArithmeticException e) {
+            // excpected
+        }
+        try {
+            long actual = MAX_VALUE.byteValueExact();
+            throw new RuntimeException("BigInteger.MAX_VALUE.byteValueExact()= " + actual);
+        } catch (ArithmeticException e) {
+            // excpected
+        }
+    }
+
+    public static void main(String... args) {
+        testOverflowInMakePositive();
+        testBug8021204();
+        testOverflowInBitSieve();
+        testAdd();
+        testSubtract();
+        testMultiply();
+        testDivide();
+        testDivideAndRemainder();
+        testBug9005933();
+        testRemainder();
+        testPow();
+        testGcd();
+        testAbs();
+        testNegate();
+        testMod();
+        testModPow();
+//        testModInverse();
+        testShiftLeft();
+        testShiftRight();
+        testAnd();
+        testOr();
+        testXor();
+        testNot();
+        testSetBit();
+        testClearBit();
+        testFlipBit();
+        testGetLowestSetBit();
+        testBitLength();
+        testBitCount();
+        testToString();
+        testToByteArrayWithConstructor();
+        testIntValue();
+        testLongValue();
+        testFloatValue();
+        testDoubleValue();
+        testSerialization();
+        testLongValueExact();
+        testIntValueExact();
+        testShortValueExact();
+        testByteValueExact();
+    }
+}
--- a/jdk/test/java/net/Authenticator/B4769350.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/net/Authenticator/B4769350.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,7 @@
 
 /**
  * @test
- * @bug 4769350
- * @library ../../../sun/net/www/httptest/
- * @build HttpCallback TestHttpServer ClosedChannelList HttpTransaction AbstractCallback
+ * @bug 4769350 8017779
  * @run main/othervm B4769350 server
  * @run main/othervm B4769350 proxy
  * @summary proxy authentication username and password caching only works in serial case
@@ -34,8 +32,17 @@
  * tests may already have invoked the HTTP handler.
  */
 
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+import com.sun.net.httpserver.HttpServer;
 import java.io.*;
 import java.net.*;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 public class B4769350 {
 
@@ -43,13 +50,12 @@
     static boolean error = false;
 
     static void read (InputStream is) throws IOException {
-        int c;
-        while ((c=is.read()) != -1) {
+        while (is.read() != -1) {
             //System.out.write (c);
         }
     }
 
-    static class Client extends Thread {
+     static class Client extends Thread {
         String authority, path;
         boolean allowerror;
 
@@ -64,8 +70,8 @@
             try {
                 URI u = new URI ("http", authority, path, null, null);
                 URL url = u.toURL();
-                URLConnection urlc = url.openConnection ();
-                InputStream is = urlc.getInputStream ();
+                URLConnection urlc = url.openConnection();
+                InputStream is = urlc.getInputStream();
                 read (is);
                 is.close();
             } catch (URISyntaxException  e) {
@@ -73,7 +79,8 @@
                 error = true;
             } catch (IOException e) {
                 if (!allowerror) {
-                    System.out.println (Thread.currentThread().getName() + " " + e);
+                    System.out.println (Thread.currentThread().getName()
+                            + " " + e);
                     e.printStackTrace();
                     error = true;
                 }
@@ -81,55 +88,58 @@
         }
     }
 
-    static class CallBack extends AbstractCallback {
-
-        void errorReply (HttpTransaction req, String reply) throws IOException {
-            req.addResponseHeader ("Connection", "close");
-            req.addResponseHeader ("WWW-Authenticate", reply);
-            req.sendResponse (401, "Unauthorized");
-            req.orderlyClose();
-        }
+    class Server implements AutoCloseable {
+        HttpServer server;
+        Executor executor;
+        CyclicBarrier t1Cond1;
+        CyclicBarrier t1Cond2;
 
-        void proxyReply (HttpTransaction req, String reply) throws IOException {
-            req.addResponseHeader ("Proxy-Authenticate", reply);
-            req.sendResponse (407, "Proxy Authentication Required");
-        }
-
-        void okReply (HttpTransaction req) throws IOException {
-            req.addResponseHeader ("Connection", "close");
-            req.setResponseEntityBody ("Hello .");
-            req.sendResponse (200, "Ok");
-            req.orderlyClose();
+        public String getAddress() {
+            return server.getAddress().getHostName();
         }
 
-        public void request (HttpTransaction req, int count) {
+        public void startServer() {
+            InetSocketAddress addr = new InetSocketAddress(0);
+
             try {
-                URI uri = req.getRequestURI();
-                String path = uri.getPath();
-                if (path.endsWith ("/t1a")) {
-                    doT1a (req, count);
-                } else if (path.endsWith ("/t1b")) {
-                    doT1b (req, count);
-                } else if (path.endsWith ("/t1c")) {
-                    doT1c (req, count);
-                } else if (path.endsWith ("/t1d")) {
-                    doT1d (req, count);
-                } else if (path.endsWith ("/t2a")) {
-                    doT2a (req, count);
-                } else if (path.endsWith ("/t2b")) {
-                    doT2b (req, count);
-                } else if (path.endsWith ("/t3a")) {
-                    doT3a (req, count);
-                } else if (path.endsWith ("/t3b")) {
-                    doT3bc (req, count);
-                } else if (path.endsWith ("/t3c")) {
-                    doT3bc (req, count);
-                } else {
-                   System.out.println ("unexpected request URI");
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
+                server = HttpServer.create(addr, 0);
+            } catch (IOException ioe) {
+                throw new RuntimeException("Server could not be created");
             }
+            executor = Executors.newFixedThreadPool(10);
+            server.setExecutor(executor);
+            server.createContext("/test/realm1/t1a",
+                    new AuthenticationHandlerT1a() );
+            server.createContext("/test/realm2/t1b",
+                    new AuthenticationHandlerT1b());
+            server.createContext("/test/realm1/t1c",
+                    new AuthenticationHandlerT1c());
+            server.createContext("/test/realm2/t1d",
+                    new AuthenticationHandlerT1d());
+            server.createContext("/test/realm3/t2a",
+                    new AuthenticationHandlerT2a());
+            server.createContext("/test/realm3/t2b",
+                    new AuthenticationHandlerT2b());
+            server.createContext("/test/realm4/t3a",
+                    new AuthenticationHandlerT3a());
+            server.createContext("/test/realm4/t3b",
+                    new AuthenticationHandlerT3bc());
+            server.createContext("/test/realm4/t3c",
+                    new AuthenticationHandlerT3bc());
+            t1Cond1 = new CyclicBarrier(2);
+            t1Cond2 = new CyclicBarrier(2);
+            server.start();
+        }
+
+        public int getPort() {
+            return server.getAddress().getPort();
+        }
+
+        public void close() {
+            if (executor != null)
+                ((ExecutorService)executor).shutdownNow();
+            if (server != null)
+                server.stop(0);
         }
 
         /* T1 tests the client by sending 4 requests to 2 different realms
@@ -138,90 +148,158 @@
          * the second requests should be executed without calling the authenticator.
          * The test succeeds if the authenticator was only called twice.
          */
-        void doT1a (HttpTransaction req, int count) throws IOException {
-            switch (count) {
-            case 0:
-                errorReply (req, "Basic realm=\"realm1\"");
-                TestHttpServer.rendezvous ("one", 2);
-                break;
-            case 1:
-                TestHttpServer.waitForCondition ("cond2");
-                okReply (req);
-                break;
-            default:
-                System.out.println ("Unexpected request");
+        class AuthenticationHandlerT1a implements HttpHandler
+        {
+            volatile int count = -1;
+
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                count++;
+                try {
+                    switch(count) {
+                        case 0:
+                            AuthenticationHandler.errorReply(exchange,
+                                    "Basic realm=\"realm1\"");
+                            break;
+                        case 1:
+                            t1Cond1.await();
+                            t1cond2latch.await();
+                            AuthenticationHandler.okReply(exchange);
+                            break;
+                        default:
+                            System.out.println ("Unexpected request");
+                    }
+                } catch (InterruptedException |
+                                 BrokenBarrierException e)
+                        {
+                            throw new RuntimeException(e);
+                        }
+            }
+        }
+
+        class AuthenticationHandlerT1b implements HttpHandler
+        {
+            volatile int count = -1;
+
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                count++;
+                try {
+                    switch(count) {
+                        case 0:
+                            AuthenticationHandler.errorReply(exchange,
+                                    "Basic realm=\"realm2\"");
+                            break;
+                        case 1:
+                            t1Cond1.await();
+                            t1cond1latch.countDown();
+                            t1cond2latch.await();
+                            AuthenticationHandler.okReply(exchange);
+                            break;
+                        default:
+                            System.out.println ("Unexpected request");
+                    }
+                } catch (InterruptedException | BrokenBarrierException e) {
+                    throw new RuntimeException(e);
+                }
             }
         }
 
+        class AuthenticationHandlerT1c implements HttpHandler
+        {
+            volatile int count = -1;
 
-        void doT1b (HttpTransaction req, int count) throws IOException {
-            switch (count) {
-            case 0:
-                errorReply (req, "Basic realm=\"realm2\"");
-                TestHttpServer.rendezvous ("one", 2);
-                TestHttpServer.setCondition ("cond1");
-                break;
-            case 1:
-                TestHttpServer.waitForCondition ("cond2");
-                okReply (req);
-                break;
-            default:
-                System.out.println ("Unexpected request");
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                count++;
+                switch(count) {
+                    case 0:
+                        AuthenticationHandler.errorReply(exchange,
+                                "Basic realm=\"realm1\"");
+                        try {
+                            t1Cond2.await();
+                        } catch (InterruptedException |
+                                 BrokenBarrierException e)
+                        {
+                            throw new RuntimeException(e);
+                        }
+                        break;
+                    case 1:
+                        AuthenticationHandler.okReply(exchange);
+                        break;
+                    default:
+                        System.out.println ("Unexpected request");
+                }
             }
         }
 
-        void doT1c (HttpTransaction req, int count) throws IOException {
-            switch (count) {
-            case 0:
-                errorReply (req, "Basic realm=\"realm1\"");
-                TestHttpServer.rendezvous ("two", 2);
-                break;
-            case 1:
-                okReply (req);
-                break;
-            default:
-                System.out.println ("Unexpected request");
+        class AuthenticationHandlerT1d implements HttpHandler
+        {
+            volatile int count = -1;
+
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                count++;
+                switch(count) {
+                    case 0:
+                        AuthenticationHandler.errorReply(exchange,
+                                "Basic realm=\"realm2\"");
+                        try {
+                            t1Cond2.await();
+                        } catch (InterruptedException |
+                                 BrokenBarrierException e)
+                        {
+                            throw new RuntimeException(e);
+                        }
+                        t1cond2latch.countDown();
+                        break;
+                    case 1:
+                        AuthenticationHandler.okReply(exchange);
+                        break;
+                    default:
+                        System.out.println ("Unexpected request");
+                }
             }
         }
 
-        void doT1d (HttpTransaction req, int count) throws IOException {
-            switch (count) {
-            case 0:
-                errorReply (req, "Basic realm=\"realm2\"");
-                TestHttpServer.rendezvous ("two", 2);
-                TestHttpServer.setCondition ("cond2");
-                break;
-            case 1:
-                okReply (req);
-                break;
-            default:
-                System.out.println ("Unexpected request");
-            }
-        }
-
-
         /* T2 tests to check that if initial authentication fails, the second will
          * succeed, and the authenticator is called twice
          */
 
-        void doT2a (HttpTransaction req, int count) throws IOException {
-            /* This will be called several times */
-            if (count == 1) {
-                TestHttpServer.setCondition ("T2cond1");
+        class AuthenticationHandlerT2a implements HttpHandler
+        {
+            volatile int count = -1;
+
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                count++;
+                if (count == 1) {
+                    t2condlatch.countDown();
+                }
+                AuthenticationHandler.errorReply(exchange,
+                        "Basic realm=\"realm3\"");
+
             }
-            errorReply (req, "Basic realm=\"realm3\"");
         }
 
-        void doT2b (HttpTransaction req, int count) throws IOException {
-            switch (count) {
-            case 0:
-                errorReply (req, "Basic realm=\"realm3\"");
-                break;
-            case 1:
-                okReply (req);
-                break;
-            default:
-                System.out.println ("Unexpected request");
+         class AuthenticationHandlerT2b implements HttpHandler
+        {
+            volatile int count = -1;
+
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                count++;
+                switch(count) {
+                    case 0:
+                        AuthenticationHandler.errorReply(exchange,
+                                "Basic realm=\"realm3\"");
+                        break;
+                    case 1:
+                        AuthenticationHandler.okReply(exchange);
+                        break;
+                    default:
+                        System.out.println ("Unexpected request");
+                }
             }
         }
 
@@ -229,63 +307,117 @@
          * resource at same time. Authenticator should be called once for server
          * and once for proxy
          */
-        void doT3a (HttpTransaction req, int count) throws IOException {
-            switch (count) {
-            case 0:
-                proxyReply (req, "Basic realm=\"proxy\"");
-                TestHttpServer.setCondition ("T3cond1");
-                break;
-            case 1:
-                errorReply (req, "Basic realm=\"realm4\"");
-                break;
-            case 2:
-                okReply (req);
-                break;
-            default:
-                System.out.println ("Unexpected request");
+
+        class AuthenticationHandlerT3a implements HttpHandler
+        {
+            volatile int count = -1;
+
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                count++;
+                switch(count) {
+                    case 0:
+                        AuthenticationHandler.proxyReply(exchange,
+                                "Basic realm=\"proxy\"");
+                        break;
+                    case 1:
+                        t3cond1.countDown();
+                        AuthenticationHandler.errorReply(exchange,
+                                "Basic realm=\"realm4\"");
+                        break;
+                    case 2:
+                        AuthenticationHandler.okReply(exchange);
+                        break;
+                    default:
+                        System.out.println ("Unexpected request");
+                }
             }
         }
 
-        void doT3bc (HttpTransaction req, int count) throws IOException {
-            switch (count) {
-            case 0:
-                proxyReply (req, "Basic realm=\"proxy\"");
-                break;
-            case 1:
-                okReply (req);
-                break;
-            default:
-                System.out.println ("Unexpected request");
+        class AuthenticationHandlerT3bc implements HttpHandler
+        {
+            volatile int count = -1;
+
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                count++;
+                switch(count) {
+                    case 0:
+                        AuthenticationHandler.proxyReply(exchange,
+                                "Basic realm=\"proxy\"");
+                        break;
+                    case 1:
+                        AuthenticationHandler.okReply(exchange);
+                        break;
+                    default:
+                        System.out.println ("Unexpected request");
+                }
             }
         }
-    };
+    }
+
+    static class AuthenticationHandler {
+        static void errorReply(HttpExchange exchange, String reply)
+                throws IOException
+        {
+            exchange.getResponseHeaders().add("Connection", "close");
+            exchange.getResponseHeaders().add("WWW-Authenticate", reply);
+            exchange.sendResponseHeaders(401, 0);
+            exchange.close();
+        }
 
-    static TestHttpServer server;
+        static void proxyReply (HttpExchange exchange, String reply)
+                throws IOException
+        {
+            exchange.getResponseHeaders().add("Proxy-Authenticate", reply);
+            exchange.sendResponseHeaders(407, 0);
+        }
+
+        static void okReply (HttpExchange exchange) throws IOException {
+            exchange.getResponseHeaders().add("Connection", "close");
+            String response = "Hello .";
+            exchange.sendResponseHeaders(200, response.getBytes().length);
+            OutputStream os = exchange.getResponseBody();
+            os.write(response.getBytes());
+            os.close();
+            exchange.close();
+        }
+    }
+
+    static Server server;
     static MyAuthenticator auth = new MyAuthenticator ();
 
     static int redirects = 4;
 
     static Client c1,c2,c3,c4,c5,c6,c7,c8,c9;
 
-    static void doServerTests (String authority) throws Exception {
+    static CountDownLatch t1cond1latch;
+    static CountDownLatch t1cond2latch;
+    static CountDownLatch t2condlatch;
+    static CountDownLatch t3cond1;
+
+    static void doServerTests (String authority, Server server) throws Exception
+    {
         System.out.println ("Doing Server tests");
         System.out.println ("T1");
         c1 = new Client (authority, "/test/realm1/t1a", false);
         c2 = new Client (authority, "/test/realm2/t1b", false);
         c3 = new Client (authority, "/test/realm1/t1c", false);
         c4 = new Client (authority, "/test/realm2/t1d", false);
-
+        t1cond1latch = new CountDownLatch(1);
+        t1cond2latch = new CountDownLatch(1);
         c1.start(); c2.start();
-        TestHttpServer.waitForCondition ("cond1");
+        t1cond1latch.await();
         c3.start(); c4.start();
         c1.join(); c2.join(); c3.join(); c4.join();
 
         int f = auth.getCount();
         if (f != 2) {
-            except ("Authenticator was called "+f+" times. Should be 2");
+            except ("Authenticator was called "+f+" times. Should be 2",
+                    server);
         }
         if (error) {
-            except ("error occurred");
+            except ("error occurred", server);
         }
 
         auth.resetCount();
@@ -293,73 +425,71 @@
 
         c5 = new Client (authority, "/test/realm3/t2a", true);
         c6 = new Client (authority, "/test/realm3/t2b", false);
+        t2condlatch = new CountDownLatch(1);
         c5.start ();
-        TestHttpServer.waitForCondition ("T2cond1");
+        t2condlatch.await();
         c6.start ();
         c5.join(); c6.join();
 
         f = auth.getCount();
         if (f != redirects+1) {
-            except ("Authenticator was called "+f+" times. Should be: " + redirects+1);
+            except ("Authenticator was called "+f+" times. Should be: "
+                    + redirects+1, server);
         }
         if (error) {
-            except ("error occurred");
+            except ("error occurred", server);
         }
     }
 
-    static void doProxyTests (String authority) throws Exception {
+    static void doProxyTests (String authority, Server server) throws Exception
+    {
         System.out.println ("Doing Proxy tests");
         c7 = new Client (authority, "/test/realm4/t3a", false);
         c8 = new Client (authority, "/test/realm4/t3b", false);
         c9 = new Client (authority, "/test/realm4/t3c", false);
+        t3cond1 = new CountDownLatch(1);
         c7.start ();
-        TestHttpServer.waitForCondition ("T3cond1");
+        t3cond1.await();
         c8.start ();
         c9.start ();
         c7.join(); c8.join(); c9.join();
 
         int f = auth.getCount();
         if (f != 2) {
-            except ("Authenticator was called "+f+" times. Should be: " + 2);
+            except ("Authenticator was called "+f+" times. Should be: " + 2,
+                    server);
         }
         if (error) {
-            except ("error occurred");
+            except ("error occurred", server);
         }
     }
 
     public static void main (String[] args) throws Exception {
+        new B4769350().runTest(args[0].equals ("proxy"));
+    }
+
+    public void runTest(boolean proxy) throws Exception {
         System.setProperty ("http.maxRedirects", Integer.toString (redirects));
         System.setProperty ("http.auth.serializeRequests", "true");
         Authenticator.setDefault (auth);
-        boolean proxy = args[0].equals ("proxy");
-        try {
-            server = new TestHttpServer (new CallBack(), 10, 1, 0);
-            System.out.println ("Server: listening on port: " + server.getLocalPort());
+        try (Server server = new Server()) {
+            server.startServer();
+            System.out.println ("Server: listening on port: "
+                    + server.getPort());
             if (proxy) {
                 System.setProperty ("http.proxyHost", "localhost");
-                System.setProperty ("http.proxyPort",Integer.toString(server.getLocalPort()));
-                doProxyTests ("www.foo.com");
+                System.setProperty ("http.proxyPort",
+                        Integer.toString(server.getPort()));
+                doProxyTests ("www.foo.com", server);
             } else {
-                doServerTests ("localhost:"+server.getLocalPort());
+                doServerTests ("localhost:"+server.getPort(), server);
             }
-            server.terminate();
+        }
 
-        } catch (Exception e) {
-            if (server != null) {
-                server.terminate();
-            }
-            throw e;
-        }
     }
 
-    static void pause (int millis) {
-        try {
-            Thread.sleep (millis);
-        } catch (InterruptedException e) {}
-    }
-
-    public static void except (String s) {
-        server.terminate();
+    public static void except (String s, Server server) {
+        server.close();
         throw new RuntimeException (s);
     }
 
@@ -368,13 +498,10 @@
             super ();
         }
 
-        int count = 0;
+        volatile int count = 0;
 
+        @Override
         public PasswordAuthentication getPasswordAuthentication () {
-            //System.out.println ("Authenticator called: " + getRequestingPrompt());
-            //try {
-                //Thread.sleep (1000);
-            //} catch (InterruptedException e) {}
             PasswordAuthentication pw;
             pw = new PasswordAuthentication ("user", "pass1".toCharArray());
             count ++;
@@ -386,7 +513,8 @@
         }
 
         public int getCount () {
-            return (count);
+            return count;
         }
     }
 }
+
--- a/jdk/test/java/net/CookieHandler/TestHttpCookie.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/net/CookieHandler/TestHttpCookie.java	Mon Nov 11 16:20:48 2013 +0100
@@ -24,7 +24,7 @@
 /**
  * @test
  * @summary Unit test for java.net.HttpCookie
- * @bug 6244040 6277796 6277801 6277808 6294071 6692802 6790677 6901170
+ * @bug 6244040 6277796 6277801 6277808 6294071 6692802 6790677 6901170 8020758
  * @author Edward Wang
  */
 
@@ -381,6 +381,9 @@
         // CR 6692802: HttpOnly flag
         test("set-cookie: CUSTOMER=WILE_E_COYOTE;HttpOnly").httpOnly(true);
         test("set-cookie: CUSTOMER=WILE_E_COYOTE").httpOnly(false);
+
+        // space disallowed in name (both Netscape and RFC2965)
+        test("set-cookie: CUST OMER=WILE_E_COYOTE").nil();
     }
 
     static void header(String prompt) {
--- a/jdk/test/java/net/NetworkInterface/MemLeakTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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 8022584
- * @summary Some NetworkInterface methods can leak native memory
- * @run main/othervm/timeout=700 MemLeakTest
- */
-
-/* Note: the test can cause a memory leak that's why othervm option is required
- */
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.util.Collection;
-import java.util.Collections;
-
-public class MemLeakTest {
-
-    /**
-     * Memory leak is assumed, if application consumes more than specified amount of memory during its execution.
-     * The number is given in Kb.
-     */
-    private static final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb
-
-    public static void main(String[] args)
-            throws Exception {
-
-        if (!System.getProperty("os.name").equals("Linux")) {
-            System.out.println("Test only runs on Linux");
-            return;
-        }
-
-        // warm up
-        accessNetInterfaces(3);
-
-        long vMemBefore = getVMemSize();
-        accessNetInterfaces(500_000);
-        long vMemAfter = getVMemSize();
-
-        long vMemDelta = vMemAfter - vMemBefore;
-        if (vMemDelta > MEM_LEAK_THRESHOLD) {
-            throw new Exception("FAIL: Virtual memory usage increased by " + vMemDelta + "Kb " +
-                    "(greater than " + MEM_LEAK_THRESHOLD + "Kb)");
-        }
-
-        System.out.println("PASS: Virtual memory usage increased by " + vMemDelta + "Kb " +
-                "(not greater than " + MEM_LEAK_THRESHOLD + "Kb)");
-    }
-
-    private static void accessNetInterfaces(int times) {
-        try {
-            Collection<NetworkInterface> interfaces =
-                    Collections.list(NetworkInterface.getNetworkInterfaces());
-            for (int i = 0; i != times; ++i) {
-                for (NetworkInterface netInterface : interfaces) {
-                    netInterface.getMTU();
-                    netInterface.isLoopback();
-                    netInterface.isUp();
-                    netInterface.isPointToPoint();
-                    netInterface.supportsMulticast();
-                }
-            }
-        } catch (SocketException ignore) {}
-    }
-
-    /**
-     * Returns size of virtual memory allocated to the process in Kb.
-     * Linux specific. On other platforms and in case of any errors returns 0.
-     */
-    private static long getVMemSize() {
-
-        // Refer to the Linux proc(5) man page for details about /proc/self/stat file
-        //
-        // In short, this file contains status information about the current process
-        // written in one line. The fields are separated with spaces.
-        // The 23rd field is defined as 'vsize %lu   Virtual memory size in bytes'
-
-        try (FileReader fileReader = new FileReader("/proc/self/stat");
-             BufferedReader bufferedReader = new BufferedReader(fileReader)) {
-            String line = bufferedReader.readLine();
-            return Long.parseLong(line.split(" ")[22]) / 1024;
-        } catch (Exception ignore) {}
-        return 0;
-    }
-}
--- a/jdk/test/java/net/ProxySelector/SystemProxies.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/net/ProxySelector/SystemProxies.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,29 +33,39 @@
 
 public class SystemProxies {
 
-    static final String uriAuthority = "myMachine/";
+    static final String[] uriAuthority = { "myMachine/", "local", "localhost",
+                                           "127.0.0.1", "127.0.0.123",
+                                           "127.0.2.2", "127.3.3.3",
+                                           "128.0.0.1" };
     static final ProxySelector proxySel = ProxySelector.getDefault();
 
     public static void main(String[] args) {
         if (! "true".equals(System.getProperty("java.net.useSystemProxies"))) {
-            System.out.println("Usage: java -Djava.net.useSystemProxies SystemProxies");
+            System.out.println("Usage: java -Djava.net.useSystemProxies=true SystemProxies");
             return;
         }
 
         printProxies("http://");
         printProxies("https://");
         printProxies("ftp://");
+        printProxies("none://");
+        printProxies("gopher://");
+        printProxies("rtsp://");
+        printProxies("socket://");
     }
 
     static void printProxies(String proto) {
-        String uriStr =  proto + uriAuthority;
-        try {
-            List<Proxy> proxies = proxySel.select(new URI(uriStr));
-            System.out.println("Proxies returned for " + uriStr);
-            for (Proxy proxy : proxies)
-                System.out.println("\t" + proxy);
-        } catch (URISyntaxException e) {
-            System.err.println(e);
+        System.out.println("Protocol:" + proto);
+        for (String uri : uriAuthority) {
+            String uriStr =  proto + uri;
+            try {
+                List<Proxy> proxies = proxySel.select(new URI(uriStr));
+                System.out.println("\tProxies returned for " + uriStr);
+                for (Proxy proxy : proxies)
+                    System.out.println("\t\t" + proxy);
+            } catch (URISyntaxException e) {
+                System.err.println(e);
+            }
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/URLClassLoader/NullURLTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,175 @@
+/*
+ * 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 7179567
+ * @summary Test that URLClassLoader public constructors and factory methods
+ * throw NullPointerException when appropriate.
+ *
+ * Tests whether URLClassLoader public constructors and factory methods throw
+ * appropriate NullPointerExceptions for 1) a null URL array parameter, and
+ * 2) a non-null URL array containing a null element.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.jar.JarFile;
+
+public class NullURLTest {
+    JarFile jarFile;
+
+    public static void main(String[] args) throws Throwable {
+        new NullURLTest();
+    }
+
+    NullURLTest() throws Throwable {
+        File local = new File(System.getProperty("test.src", "."), "jars");
+        String path = "jar:file:"
+                + local.getPath()
+                + "/class_path_test.jar!/Foo.class";
+
+        URL validURL = new URL(path);
+        URL[] validURLArray = new URL[] { validURL, validURL };
+        URL[] invalidURLArray = new URL[] { validURL, null };
+
+        int failures = 0;
+        URLClassLoader loader;
+
+        try {
+            loader = new URLClassLoader(validURLArray);
+        } catch (Throwable t) {
+            System.err.println("URLClassLoader(validURLArray) threw " + t);
+            failures++;
+        }
+        try {
+            loader = new URLClassLoader(null);
+            System.err.println("URLClassLoader(null) did not throw NPE");
+            failures++;
+        } catch (NullPointerException e) {
+            // expected
+        }
+        // This section should be uncommented if 8026517 is fixed.
+//        try {
+//            loader = new URLClassLoader(invalidURLArray);
+//            System.err.println("URLClassLoader(invalidURLArray) did not throw NPE");
+//            failures++;
+//        } catch (NullPointerException e) {
+//            // expected
+//        }
+
+        try {
+            loader = new URLClassLoader(validURLArray, null);
+        } catch (Throwable t) {
+            System.err.println("URLClassLoader(validURLArray, null) threw " + t);
+            failures++;
+        }
+        try {
+            loader = new URLClassLoader(null, null);
+            System.err.println("URLClassLoader(null, null) did not throw NPE");
+            failures++;
+        } catch (NullPointerException e) {
+            // expected
+        }
+        // This section should be uncommented if 8026517 is fixed.
+//        try {
+//            loader = new URLClassLoader(invalidURLArray, null);
+//            System.err.println("URLClassLoader(invalidURLArray, null) did not throw NPE");
+//            failures++;
+//        } catch (NullPointerException e) {
+//            // expected
+//        }
+
+        try {
+            loader = new URLClassLoader(validURLArray, null, null);
+        } catch (Throwable t) {
+            System.err.println("URLClassLoader(validURLArray, null, null) threw " + t);
+            failures++;
+        }
+        try {
+            loader = new URLClassLoader(null, null, null);
+            System.err.println("URLClassLoader(null, null, null) did not throw NPE");
+            failures++;
+        } catch (NullPointerException e) {
+            // expected
+        }
+        // This section should be uncommented if 8026517 is fixed.
+//        try {
+//            loader = new URLClassLoader(invalidURLArray, null, null);
+//            System.err.println("URLClassLoader(invalidURLArray, null, null) did not throw NPE");
+//            failures++;
+//        } catch (NullPointerException e) {
+//            // expected
+//        }
+
+        try {
+            loader = URLClassLoader.newInstance(validURLArray);
+        } catch (Throwable t) {
+            System.err.println("URLClassLoader.newInstance(validURLArray) threw " + t);
+            failures++;
+        }
+        try {
+            loader = URLClassLoader.newInstance(null);
+            System.err.println("URLClassLoader.newInstance(null) did not throw NPE");
+            failures++;
+        } catch (NullPointerException e) {
+            // expected
+        }
+        // This section should be uncommented if 8026517 is fixed.
+//        try {
+//            loader = URLClassLoader.newInstance(invalidURLArray);
+//            System.err.println("URLClassLoader.newInstance(invalidURLArray) did not throw NPE");
+//            failures++;
+//        } catch (NullPointerException e) {
+//            // expected
+//        }
+
+        try {
+            loader = URLClassLoader.newInstance(validURLArray, null);
+        } catch (Throwable t) {
+            System.err.println("URLClassLoader.newInstance(validURLArray, null) threw " + t);
+            failures++;
+        }
+        try {
+            loader = URLClassLoader.newInstance(null, null);
+            System.err.println("URLClassLoader.newInstance(null, null) did not throw NPE");
+            failures++;
+        } catch (NullPointerException e) {
+            // expected
+        }
+        // This section should be uncommented if 8026517 is fixed.
+//        try {
+//            loader = URLClassLoader.newInstance(invalidURLArray, null);
+//            System.err.println("URLClassLoader.newInstance(invalidURLArray, null) did not throw NPE");
+//            failures++;
+//        } catch (NullPointerException e) {
+//            // expected
+//        }
+
+        if (failures != 0) {
+            throw new Exception("URLClassLoader NullURLTest had "+failures+" failures!");
+        }
+    }
+}
--- a/jdk/test/java/net/URLPermission/URLPermissionTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/net/URLPermission/URLPermissionTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -26,7 +26,7 @@
 
 /**
  * @test
- * @bug 8010464
+ * @bug 8010464 8027570
  */
 
 public class URLPermissionTest {
@@ -110,6 +110,28 @@
         return new ActionImpliesTest(arg1, arg2, expected);
     }
 
+    static class HashCodeTest extends Test {
+        String arg1, arg2;
+        int hash;
+
+        HashCodeTest(String arg1, String arg2, int hash) {
+            this.arg1 = arg1;
+            this.arg2 = arg2;
+            this.hash = hash;
+        }
+
+        @Override
+        boolean execute() {
+            URLPermission p = new URLPermission(arg1, arg2);
+            int h = p.hashCode();
+            return h == hash;
+        }
+    }
+
+    static HashCodeTest hashtest(String arg1, String arg2, int expected) {
+        return new HashCodeTest(arg1, arg2, expected);
+    }
+
     static class URLEqualityTest extends Test {
         String arg1, arg2;
 
@@ -178,6 +200,11 @@
         extest("http:")
     };
 
+    static Test[] hashTests = {
+        hashtest("http://www.foo.com/path", "GET:X-Foo", 388644203),
+        hashtest("http:*", "*:*", 3255810)
+    };
+
     static Test[] pathImplies2 = {
         imtest("http://[FE80::]:99", "http://[fe80:0::]:99", true),
 
@@ -326,6 +353,17 @@
 
         }
 
+        for (int i=0; i<hashTests.length; i++) {
+            HashCodeTest test = (HashCodeTest)hashTests[i];
+            boolean result = test.execute();
+            if (!result) {
+                System.out.printf ("test failed: %s %s %d\n", test.arg1, test.arg2, test.hash);
+                failed = true;
+            } else {
+                System.out.println ("hash test " + i + " OK");
+            }
+        }
+
         for (int i=0; i<exceptionTests.length; i++) {
             ExTest test = (ExTest)exceptionTests[i];
             boolean result = test.execute();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/LookupTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @compile -XDignore.symbol.file=true SimpleNameService.java
+ *                                     SimpleNameServiceDescriptor.java
+ * @run main/othervm/timeout=200 -Dsun.net.spi.nameservice.provider.1=simple,sun LookupTest
+ */
+
+/**
+ * This is a simple smoke test of the HttpURLPermission mechanism, which
+ * checks for either IOException (due to unknown host) or SecurityException
+ * due to lack of permission to connect
+ */
+
+import java.net.*;
+import java.io.*;
+
+public class LookupTest {
+
+    static void test(
+        String url, boolean throwsSecException, boolean throwsIOException)
+    {
+        try {
+            URL u = new URL(url);
+            System.err.println ("Connecting to " + u);
+            URLConnection urlc = u.openConnection();
+            InputStream is = urlc.getInputStream();
+        } catch (SecurityException e) {
+            if (!throwsSecException) {
+                throw new RuntimeException ("(1) was not expecting " + e);
+            }
+            return;
+        } catch (IOException ioe) {
+            if (!throwsIOException) {
+                throw new RuntimeException ("(2) was not expecting " + ioe);
+            }
+            return;
+        }
+        if (throwsSecException || throwsIOException) {
+            System.err.printf ("was expecting a %s\n", throwsSecException ?
+                "security exception" : "IOException");
+            throw new RuntimeException("was expecting an exception");
+        }
+    }
+
+    public static void main(String args[]) throws Exception {
+        SimpleNameService.put("allowedAndFound.com", "127.0.0.1");
+        SimpleNameService.put("notAllowedButFound.com", "99.99.99.99");
+        // name "notAllowedAndNotFound.com" is not in map
+        // name "allowedButNotfound.com" is not in map
+        startServer();
+
+        String policyFileName = "file://" + System.getProperty("test.src", ".") + "/policy";
+        System.err.println ("policy = " + policyFileName);
+
+        System.setProperty("java.security.policy", policyFileName);
+
+        System.setSecurityManager(new SecurityManager());
+
+        test("http://allowedAndFound.com:50100/foo", false, false);
+
+        test("http://notAllowedButFound.com:50100/foo", true, false);
+
+        test("http://allowedButNotfound.com:50100/foo", false, true);
+
+        test("http://notAllowedAndNotFound.com:50100/foo", true, false);
+    }
+
+    static Thread server;
+    static ServerSocket serverSocket;
+
+    static class Server extends Thread {
+        public void run() {
+            byte[] buf = new byte[1000];
+            try {
+                while (true) {
+                    Socket s = serverSocket.accept();
+                    InputStream i = s.getInputStream();
+                    i.read(buf);
+                    OutputStream o = s.getOutputStream();
+                    String rsp = "HTTP/1.1 200 Ok\r\n" +
+                        "Connection: close\r\nContent-length: 0\r\n\r\n";
+                    o.write(rsp.getBytes());
+                    o.close();
+                }
+            } catch (IOException e) {
+                return;
+            }
+            }
+    }
+
+    static void startServer() {
+        try {
+            serverSocket = new ServerSocket(50100);
+            server = new Server();
+            server.start();
+        } catch (Exception e) {
+            throw new RuntimeException ("Test failed to initialize");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,22 @@
+# 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.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+
+SimpleNameServiceDescriptor    # name service provider descriptor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/SimpleNameService.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2002, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * A simple name service based on an in-memory HashMap.
+ */
+import java.net.UnknownHostException;
+import java.net.InetAddress;
+import sun.net.spi.nameservice.*;
+import java.util.*;
+
+public final class SimpleNameService implements NameService {
+
+    private static LinkedHashMap hosts = new LinkedHashMap();
+
+    private static String addrToString(byte addr[]) {
+        return Byte.toString(addr[0]) + "." +
+               Byte.toString(addr[1]) + "." +
+               Byte.toString(addr[2]) + "." +
+               Byte.toString(addr[3]);
+    }
+
+    // ------------
+
+    public static void put(String host, String addr) {
+        hosts.put(host, addr);
+    }
+
+    public static void put(String host, byte addr[]) {
+        hosts.put(host, addrToString(addr));
+    }
+
+    public static void remove(String host) {
+        hosts.remove(host);
+    }
+
+    public static int entries () {
+        return hosts.size();
+    }
+
+    public static int lookupCalls() {
+        return lookupCalls;
+    }
+
+    static int lookupCalls = 0;
+
+    // ------------
+
+    public SimpleNameService() throws Exception {
+    }
+
+    public InetAddress[] lookupAllHostAddr(String host) throws UnknownHostException {
+
+        lookupCalls ++;
+
+        String value = (String)hosts.get(host);
+        if (value == null) {
+            throw new UnknownHostException(host);
+        }
+        StringTokenizer st = new StringTokenizer(value, ".");
+        byte addr[] = new byte[4];
+        for (int i=0; i<4; i++) {
+            addr[i] = (byte)Integer.parseInt(st.nextToken());
+        }
+        InetAddress[] res = new InetAddress[1];
+        res[0] = InetAddress.getByAddress(host, addr);
+        return res;
+    }
+
+    public String getHostByAddr(byte[] addr) throws UnknownHostException {
+        String addrString = addrToString(addr);
+        Iterator i = hosts.keySet().iterator();
+        while (i.hasNext()) {
+            String host = (String)i.next();
+            String value = (String)hosts.get(host);
+            if (value.equals(addrString)) {
+                return host;
+            }
+        }
+        throw new UnknownHostException();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/SimpleNameServiceDescriptor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2002, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Descriptor for the simple name service
+ */
+import sun.net.spi.nameservice.*;
+
+public final class SimpleNameServiceDescriptor implements NameServiceDescriptor {
+    /**
+     * Create a new instance of the corresponding name service.
+     */
+    public NameService createNameService() throws Exception {
+        return new SimpleNameService();
+    }
+
+    /**
+     * Returns this service provider's name
+     *
+     */
+    public String getProviderName() {
+        return "sun";
+    }
+
+    /**
+     * Returns this name service type
+     * "dns" "nis" etc
+     */
+    public String getType() {
+        return "simple";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/URLPermission/nstest/policy	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+//
+
+grant {
+    permission java.net.URLPermission "http://allowedAndFound.com:50100/-", "*:*";
+    permission java.net.URLPermission "http://allowedButNotfound.com:50100/-", "*:*";
+
+    // needed for HttpServer
+    permission "java.net.SocketPermission" "localhost:1024-", "resolve,accept";
+};
+
+// Normal permissions that aren't granted when run under jtreg
+
+grant codeBase "file:${{java.ext.dirs}}/*" {
+        permission java.security.AllPermission;
+};
+
+grant codeBase "file:${{java.home}}/jre/lib/rt.jar" {
+        permission java.security.AllPermission;
+};
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/nio/channels/FileChannel/InterruptMapDeadlock.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,155 @@
+/*
+ * 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 8024833
+ * @summary Tests interruption of threads mapping sections of a file channel in
+ *   an attempt to deadlock due to nesting of begin calls.
+ */
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.*;
+import java.nio.channels.FileChannel.MapMode;
+import java.nio.file.*;
+import java.util.concurrent.Semaphore;
+import static java.nio.file.StandardOpenOption.*;
+
+public class InterruptMapDeadlock {
+
+    static class Mapper extends Thread {
+        final FileChannel fc;
+        final Semaphore gate;
+        volatile Exception exception;
+
+        Mapper(FileChannel fc, Semaphore gate) {
+            this.fc = fc;
+            this.gate = gate;
+        }
+
+        @Override
+        public void run() {
+            try {
+                gate.acquireUninterruptibly();
+                fc.map(MapMode.READ_ONLY, 0, 1);
+                throw new Exception("Map succeeded");
+            } catch (IOException x) {
+                System.out.println(x.getClass() + " (expected)");
+            } catch (Exception unexpected) {
+                this.exception = unexpected;
+            }
+        }
+
+        Exception exception() {
+            return exception;
+        }
+
+        static Mapper startMapper(FileChannel fc, Semaphore gate) {
+            Mapper r = new Mapper(fc, gate);
+            r.setDaemon(true);
+            r.start();
+            return r;
+        }
+    }
+
+    static class Interruptor extends Thread {
+
+        final Mapper[] mappers;
+        final Semaphore gate;
+
+        Interruptor(Mapper[] mappers, Semaphore gate) {
+            this.mappers = mappers;
+            this.gate = gate;
+        }
+
+        public void run() {
+            gate.release(mappers.length);
+            for (Mapper m : mappers) {
+                m.interrupt();
+            }
+        }
+    }
+    // the number of mapper threads to start
+    private static final int MAPPER_COUNT = 4;
+
+    public static void main(String[] args) throws Exception {
+        Path file = Paths.get("data.txt");
+        FileChannel.open(file, CREATE, TRUNCATE_EXISTING, WRITE).close();
+
+        Mapper[] mappers = new Mapper[MAPPER_COUNT];
+
+        for (int i=1; i<=20; i++) {
+            System.out.format("Iteration: %s%n", i);
+
+            FileChannel fc = FileChannel.open(file);
+            boolean failed = false;
+
+            Semaphore gate = new Semaphore(0);
+            // start mapper threads
+            for (int j=0; j<MAPPER_COUNT; j++) {
+                mappers[j] = Mapper.startMapper(fc, gate);
+            }
+
+            // interrupt and wait for the mappers to terminate
+            Interruptor interruptor = new Interruptor(mappers, gate);
+            interruptor.start();
+            try {
+                interruptor.join(10000);
+                if (interruptor.isAlive()) {
+                    System.err.println("Interruptor thread did not terminate:");
+                    Throwable t = new Exception("Stack trace");
+                    t.setStackTrace(interruptor.getStackTrace());
+                    t.printStackTrace();
+                    failed = true;
+                }
+            } catch (InterruptedException x) {
+                System.err.println("Main thread was interrupted");
+                failed = true;
+            }
+
+            for (Mapper m: mappers) {
+                try {
+                    m.join(10000);
+                    Exception e = m.exception();
+                    if (e != null) {
+                        System.err.println("Mapper thread failed with: " + e);
+                        failed = true;
+                    } else if (m.isAlive()) {
+                        System.err.println("Mapper thread did not terminate:");
+                        Throwable t = new Exception("Stack trace");
+                        t.setStackTrace(m.getStackTrace());
+                        t.printStackTrace();
+                        failed = true;
+                    }
+                } catch (InterruptedException x) {
+                    System.err.println("Main thread was interrupted");
+                    failed = true;
+                }
+            }
+
+            if (failed)
+                throw new RuntimeException("Test failed - see log for details");
+            else
+                fc.close();
+        }
+    }
+}
--- a/jdk/test/java/nio/channels/SocketChannel/ShortWrite.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/nio/channels/SocketChannel/ShortWrite.java	Mon Nov 11 16:20:48 2013 +0100
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 7176630
+ * @bug 7176630 7074436
  * @summary Check for short writes on SocketChannels configured in blocking mode
  */
 
@@ -38,11 +38,12 @@
     static final Random rand = new Random();
 
     /**
-     * Returns a checksum on the remaining bytes in the given buffer.
+     * Returns a checksum on the remaining bytes in the given buffers.
      */
-    static long computeChecksum(ByteBuffer bb) {
+    static long computeChecksum(ByteBuffer... bufs) {
         CRC32 crc32 = new CRC32();
-        crc32.update(bb);
+        for (int i=0; i<bufs.length; i++)
+            crc32.update(bufs[i]);
         return crc32.getValue();
     }
 
@@ -71,15 +72,15 @@
     }
 
     /**
-     * Run test with a write of the given number of bytes.
+     * Exercise write(ByteBuffer) with given number of bytes.
      */
-    static void test(ExecutorService pool,
-                     SocketChannel source,
-                     SocketChannel sink,
-                     int size)
+    static void test1(ExecutorService pool,
+                      SocketChannel source,
+                      SocketChannel sink,
+                      int size)
         throws Exception
     {
-        System.out.println(size);
+        System.out.println("write(ByteBuffer), size=" + size);
 
         // random bytes in the buffer
         ByteBuffer buf = ByteBuffer.allocate(size);
@@ -101,6 +102,47 @@
             throw new RuntimeException("Checksum did not match");
     }
 
+    /**
+     * Exercise write(ByteBuffer[]) with buffers of the given sizes.
+     */
+    static void testN(ExecutorService pool,
+                      SocketChannel source,
+                      SocketChannel sink,
+                      int... sizes)
+        throws Exception
+    {
+        System.out.print("write(ByteBuffer[]), sizes=");
+        for (int size: sizes)
+            System.out.print(size + " ");
+        System.out.println();
+
+        int total = 0;
+        int len = sizes.length;
+        ByteBuffer[] bufs = new ByteBuffer[len];
+        for (int i=0; i<len; i++) {
+            int size = sizes[i];
+            ByteBuffer buf = ByteBuffer.allocate(size);
+            rand.nextBytes(buf.array());
+            bufs[i] = buf;
+            total += size;
+        }
+
+        // submit task to read the bytes
+        Future<Long> result = pool.submit(new Reader(sink, total));
+
+        // write the bytes
+        long n = source.write(bufs);
+        if (n != total)
+            throw new RuntimeException("Short write detected");
+
+        // check the bytes that were received match
+        for (int i=0; i<len; i++)
+            bufs[i].rewind();
+        long expected = computeChecksum(bufs);
+        long actual = result.get();
+        if (actual != expected)
+            throw new RuntimeException("Checksum did not match");
+    }
 
     public static void main(String[] args) throws Exception {
         ExecutorService pool = Executors.newSingleThreadExecutor();
@@ -114,17 +156,47 @@
                 try (SocketChannel source = SocketChannel.open(sa);
                      SocketChannel sink = ssc.accept())
                 {
-                    // run tests on sizes around 128k as that is the problem
-                    // area on Windows.
+                    // Exercise write(BufferBuffer) on sizes around 128k
                     int BOUNDARY = 128 * 1024;
                     for (int size=(BOUNDARY-2); size<=(BOUNDARY+2); size++) {
-                        test(pool, source, sink, size);
+                        test1(pool, source, sink, size);
+                    }
+
+                    // Exercise write(BufferBuffer) on random sizes
+                    for (int i=0; i<20; i++) {
+                        int size = rand.nextInt(1024*1024);
+                        test1(pool, source, sink, size);
                     }
 
-                    // run tests on random sizes
+                    // Exercise write(BufferBuffer[]) on sizes around 128k
+                    for (int i=BOUNDARY-2; i<=BOUNDARY+2; i++) {
+                        testN(pool, source, sink, i);
+                        testN(pool, source, sink, 0, i);
+                        testN(pool, source, sink, i, 0);
+                        for (int j=BOUNDARY-2; j<=BOUNDARY+2; j++) {
+                            testN(pool, source, sink, i, j);
+                            testN(pool, source, sink, 0, i, j);
+                            testN(pool, source, sink, i, 0, j);
+                            testN(pool, source, sink, i, j, 0);
+                            for (int k=BOUNDARY-2; k<=BOUNDARY+2; k++) {
+                                testN(pool, source, sink, i, j, k);
+                                testN(pool, source, sink, 0, i, j, k);
+                                testN(pool, source, sink, i, 0, j, k);
+                                testN(pool, source, sink, i, j, 0, k);
+                                testN(pool, source, sink, i, j, k, 0);
+                            }
+                        }
+                    }
+
+                    // Exercise write(BufferBuffer[]) on random sizes
+                    // (assumes IOV_MAX >= 8)
                     for (int i=0; i<20; i++) {
-                        int size = rand.nextInt(1024*1024);
-                        test(pool, source, sink, size);
+                        int n = rand.nextInt(9);
+                        int[] sizes = new int[n];
+                        for (int j=0; j<n; j++) {
+                            sizes[j] = rand.nextInt(1024*1024);
+                        }
+                        testN(pool, source, sink, sizes);
                     }
                 }
             }
--- a/jdk/test/java/nio/file/Files/StreamTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/nio/file/Files/StreamTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -23,6 +23,7 @@
 
 /* @test
  * @bug 8006884 8019526
+ * @library ..
  * @build PassThroughFileSystem FaultyFileSystem
  * @run testng StreamTest
  * @summary Unit test for java.nio.file.Files methods that return a Stream
--- a/jdk/test/java/security/Signature/SignatureGetAlgorithm.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/security/Signature/SignatureGetAlgorithm.java	Mon Nov 11 16:20:48 2013 +0100
@@ -49,7 +49,7 @@
 
     public static class TestProvider extends Provider {
         TestProvider() {
-            super("test", 1.0, "test");
+            super("testSignatureGetAlgorithm", 1.0, "test Signatures");
             put("Signature.MySignatureAlg",
                 "SignatureGetAlgorithm$MySignatureAlg");
         }
--- a/jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 6854712 7171570 8010748
+ * @bug 6854712 7171570 8010748 8025287
  * @summary Basic unit test for PKIXRevocationChecker
  */
 
@@ -44,6 +44,8 @@
         CertPathChecker cpc = cpv.getRevocationChecker();
         PKIXRevocationChecker prc = (PKIXRevocationChecker)cpc;
 
+        prc.init(false);
+
         System.out.println("Testing that get methods return null or " +
                            "empty lists/sets/maps");
         requireNull(prc.getOcspResponder(), "getOcspResponder()");
--- a/jdk/test/java/time/tck/java/time/TCKZoneId.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/time/tck/java/time/TCKZoneId.java	Mon Nov 11 16:20:48 2013 +0100
@@ -94,47 +94,6 @@
 public class TCKZoneId extends AbstractTCKTest {
 
     //-----------------------------------------------------------------------
-    // OLD_SHORT_IDS
-    //-----------------------------------------------------------------------
-    public void test_constant_OLD_IDS_PRE_2005() {
-        Map<String, String> ids = ZoneId.OLD_SHORT_IDS;
-        assertEquals(ids.get("EST"), "America/New_York");
-        assertEquals(ids.get("MST"), "America/Denver");
-        assertEquals(ids.get("HST"), "Pacific/Honolulu");
-        assertEquals(ids.get("ACT"), "Australia/Darwin");
-        assertEquals(ids.get("AET"), "Australia/Sydney");
-        assertEquals(ids.get("AGT"), "America/Argentina/Buenos_Aires");
-        assertEquals(ids.get("ART"), "Africa/Cairo");
-        assertEquals(ids.get("AST"), "America/Anchorage");
-        assertEquals(ids.get("BET"), "America/Sao_Paulo");
-        assertEquals(ids.get("BST"), "Asia/Dhaka");
-        assertEquals(ids.get("CAT"), "Africa/Harare");
-        assertEquals(ids.get("CNT"), "America/St_Johns");
-        assertEquals(ids.get("CST"), "America/Chicago");
-        assertEquals(ids.get("CTT"), "Asia/Shanghai");
-        assertEquals(ids.get("EAT"), "Africa/Addis_Ababa");
-        assertEquals(ids.get("ECT"), "Europe/Paris");
-        assertEquals(ids.get("IET"), "America/Indiana/Indianapolis");
-        assertEquals(ids.get("IST"), "Asia/Kolkata");
-        assertEquals(ids.get("JST"), "Asia/Tokyo");
-        assertEquals(ids.get("MIT"), "Pacific/Apia");
-        assertEquals(ids.get("NET"), "Asia/Yerevan");
-        assertEquals(ids.get("NST"), "Pacific/Auckland");
-        assertEquals(ids.get("PLT"), "Asia/Karachi");
-        assertEquals(ids.get("PNT"), "America/Phoenix");
-        assertEquals(ids.get("PRT"), "America/Puerto_Rico");
-        assertEquals(ids.get("PST"), "America/Los_Angeles");
-        assertEquals(ids.get("SST"), "Pacific/Guadalcanal");
-        assertEquals(ids.get("VST"), "Asia/Ho_Chi_Minh");
-    }
-
-    @Test(expectedExceptions=UnsupportedOperationException.class)
-    public void test_constant_OLD_IDS_PRE_2005_immutable() {
-        Map<String, String> ids = ZoneId.OLD_SHORT_IDS;
-        ids.clear();
-    }
-
-    //-----------------------------------------------------------------------
     // SHORT_IDS
     //-----------------------------------------------------------------------
     public void test_constant_OLD_IDS_POST_2005() {
--- a/jdk/test/java/time/tck/java/time/serial/TCKOffsetDateTimeSerialization.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/time/tck/java/time/serial/TCKOffsetDateTimeSerialization.java	Mon Nov 11 16:20:48 2013 +0100
@@ -59,9 +59,6 @@
  */
 package tck.java.time.serial;
 
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import tck.java.time.AbstractTCKTest;
 
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
@@ -69,6 +66,10 @@
 import java.time.OffsetDateTime;
 import java.time.ZoneOffset;
 
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import tck.java.time.AbstractTCKTest;
+
 /**
  * Test OffsetDateTime serialization.
  */
@@ -96,11 +97,6 @@
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (DataOutputStream dos = new DataOutputStream(baos) ) {
             dos.writeByte(10);       // java.time.Ser.OFFSET_DATE_TIME_TYPE
-        }
-        byte[] bytes = baos.toByteArray();
-        ByteArrayOutputStream baosDateTime = new ByteArrayOutputStream();
-        try (DataOutputStream dos = new DataOutputStream(baosDateTime) ) {
-            dos.writeByte(5);
             dos.writeInt(2012);
             dos.writeByte(9);
             dos.writeByte(16);
@@ -108,17 +104,11 @@
             dos.writeByte(17);
             dos.writeByte(59);
             dos.writeInt(464_000_000);
-        }
-        byte[] bytesDateTime = baosDateTime.toByteArray();
-        ByteArrayOutputStream baosOffset = new ByteArrayOutputStream();
-        try (DataOutputStream dos = new DataOutputStream(baosOffset) ) {
-            dos.writeByte(8);
             dos.writeByte(4);  // quarter hours stored: 3600 / 900
         }
-        byte[] bytesOffset = baosOffset.toByteArray();
+        byte[] bytes = baos.toByteArray();
         LocalDateTime ldt = LocalDateTime.of(2012, 9, 16, 22, 17, 59, 464_000_000);
-        assertSerializedBySer(OffsetDateTime.of(ldt, ZoneOffset.ofHours(1)), bytes, bytesDateTime, bytesOffset);
+        assertSerializedBySer(OffsetDateTime.of(ldt, ZoneOffset.ofHours(1)), bytes);
     }
 
-
 }
--- a/jdk/test/java/time/tck/java/time/serial/TCKOffsetTimeSerialization.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/time/tck/java/time/serial/TCKOffsetTimeSerialization.java	Mon Nov 11 16:20:48 2013 +0100
@@ -97,25 +97,14 @@
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (DataOutputStream dos = new DataOutputStream(baos) ) {
             dos.writeByte(9);       // java.time.Ser.OFFSET_TIME_TYPE
-        }
-        byte[] bytes = baos.toByteArray();
-        ByteArrayOutputStream baosTime = new ByteArrayOutputStream();
-        try (DataOutputStream dos = new DataOutputStream(baosTime) ) {
-            dos.writeByte(4);
             dos.writeByte(22);
             dos.writeByte(17);
             dos.writeByte(59);
             dos.writeInt(464_000_000);
-        }
-        byte[] bytesTime = baosTime.toByteArray();
-        ByteArrayOutputStream baosOffset = new ByteArrayOutputStream();
-        try (DataOutputStream dos = new DataOutputStream(baosOffset) ) {
-            dos.writeByte(8);
             dos.writeByte(4);  // quarter hours stored: 3600 / 900
         }
-        byte[] bytesOffset = baosOffset.toByteArray();
-        assertSerializedBySer(OffsetTime.of(22, 17, 59, 464_000_000, ZoneOffset.ofHours(1)), bytes,
-                bytesTime, bytesOffset);
+        byte[] bytes = baos.toByteArray();
+        assertSerializedBySer(OffsetTime.of(22, 17, 59, 464_000_000, ZoneOffset.ofHours(1)), bytes);
     }
 
 
--- a/jdk/test/java/time/test/java/time/format/TestReducedParser.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/time/test/java/time/format/TestReducedParser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -78,10 +78,12 @@
 import java.time.chrono.JapaneseChronology;
 import java.time.chrono.MinguoChronology;
 import java.time.chrono.ThaiBuddhistChronology;
+import java.time.chrono.ThaiBuddhistDate;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatterBuilder;
 import java.time.temporal.TemporalAccessor;
 import java.time.temporal.TemporalField;
+import java.time.temporal.TemporalQueries;
 
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
@@ -443,6 +445,52 @@
 
     }
 
+    @Test
+    public void test_reducedWithLateChronoChange() {
+        ThaiBuddhistDate date = ThaiBuddhistDate.of(2543, 1, 1);
+        DateTimeFormatter df
+                = new DateTimeFormatterBuilder()
+                        .appendValueReduced(YEAR, 2, 2, LocalDate.of(2000, 1, 1))
+                        .appendLiteral(" ")
+                        .appendChronologyId()
+                .toFormatter();
+        int expected = date.get(YEAR);
+        String input = df.format(date);
+
+        ParsePosition pos = new ParsePosition(0);
+        TemporalAccessor parsed = df.parseUnresolved(input, pos);
+        assertEquals(pos.getIndex(), input.length(), "Input not parsed completely");
+        assertEquals(pos.getErrorIndex(), -1, "Error index should be -1 (no-error)");
+        int actual = parsed.get(YEAR);
+        assertEquals(actual, expected,
+                String.format("Wrong date parsed, chrono: %s, input: %s",
+                parsed.query(TemporalQueries.chronology()), input));
+
+    }
+
+    @Test
+    public void test_reducedWithLateChronoChangeTwice() {
+        DateTimeFormatter df
+                = new DateTimeFormatterBuilder()
+                        .appendValueReduced(YEAR, 2, 2, LocalDate.of(2000, 1, 1))
+                        .appendLiteral(" ")
+                        .appendChronologyId()
+                        .appendLiteral(" ")
+                        .appendChronologyId()
+                .toFormatter();
+        int expected = 2044;
+        String input = "44 ThaiBuddhist ISO";
+        ParsePosition pos = new ParsePosition(0);
+        TemporalAccessor parsed = df.parseUnresolved(input, pos);
+        assertEquals(pos.getIndex(), input.length(), "Input not parsed completely: " + pos);
+        assertEquals(pos.getErrorIndex(), -1, "Error index should be -1 (no-error)");
+        int actual = parsed.get(YEAR);
+        assertEquals(actual, expected,
+                String.format("Wrong date parsed, chrono: %s, input: %s",
+                parsed.query(TemporalQueries.chronology()), input));
+
+    }
+
     //-----------------------------------------------------------------------
     // Class to structure the test data
     //-----------------------------------------------------------------------
--- a/jdk/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -112,13 +112,13 @@
     }
 
     private static Set<ZoneId> preferred = new HashSet<>(Arrays.asList(new ZoneId[] {
-        ZoneId.of("EST"),
+        ZoneId.of("EST", ZoneId.SHORT_IDS),
         ZoneId.of("Asia/Taipei"),
         ZoneId.of("CET"),
     }));
 
     private static Set<ZoneId> preferred_s = new HashSet<>(Arrays.asList(new ZoneId[] {
-         ZoneId.of("EST"),
+         ZoneId.of("EST", ZoneId.SHORT_IDS),
          ZoneId.of("CET"),
          ZoneId.of("Australia/South"),
          ZoneId.of("Australia/West"),
@@ -131,7 +131,7 @@
     Object[][] data_preferredZones() {
         return new Object[][] {
             {"America/New_York", "Eastern Standard Time", none,      Locale.ENGLISH, TextStyle.FULL},
-            {"EST",              "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
+//          {"EST",              "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
             {"Europe/Paris",     "Central European Time", none,      Locale.ENGLISH, TextStyle.FULL},
             {"CET",              "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
             {"Asia/Shanghai",    "China Standard Time",   none,      Locale.ENGLISH, TextStyle.FULL},
--- a/jdk/test/java/util/Base64/Base64GetEncoderTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/Base64/Base64GetEncoderTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -41,7 +41,7 @@
 public class Base64GetEncoderTest {
 
     public static void main(String args[]) throws Throwable {
-        final Base64.Encoder encoder = Base64.getEncoder(0, "$$$".getBytes(US_ASCII));
+        final Base64.Encoder encoder = Base64.getMimeEncoder(0, "$$$".getBytes(US_ASCII));
 
         testEncodeToString(encoder);
 
--- a/jdk/test/java/util/Base64/TestBase64.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/Base64/TestBase64.java	Mon Nov 11 16:20:48 2013 +0100
@@ -23,7 +23,7 @@
 
 /**
  * @test 4235519 8004212 8005394 8007298 8006295 8006315 8006530 8007379 8008925
- *       8014217
+ *       8014217 8025003
  * @summary tests java.util.Base64
  */
 
@@ -60,13 +60,13 @@
         byte[] nl_3 = new byte[] {'\n', '\r', '\n'};
         for (int i = 0; i < 10; i++) {
             int len = rnd.nextInt(200) + 4;
-            test(Base64.getEncoder(len, nl_1),
+            test(Base64.getMimeEncoder(len, nl_1),
                  Base64.getMimeDecoder(),
                  numRuns, numBytes);
-            test(Base64.getEncoder(len, nl_2),
+            test(Base64.getMimeEncoder(len, nl_2),
                  Base64.getMimeDecoder(),
                  numRuns, numBytes);
-            test(Base64.getEncoder(len, nl_3),
+            test(Base64.getMimeEncoder(len, nl_3),
                  Base64.getMimeDecoder(),
                  numRuns, numBytes);
         }
@@ -74,16 +74,16 @@
         testNull(Base64.getEncoder());
         testNull(Base64.getUrlEncoder());
         testNull(Base64.getMimeEncoder());
-        testNull(Base64.getEncoder(10, new byte[]{'\n'}));
+        testNull(Base64.getMimeEncoder(10, new byte[]{'\n'}));
         testNull(Base64.getDecoder());
         testNull(Base64.getUrlDecoder());
         testNull(Base64.getMimeDecoder());
-        checkNull(new Runnable() { public void run() { Base64.getEncoder(10, null); }});
+        checkNull(new Runnable() { public void run() { Base64.getMimeEncoder(10, null); }});
 
         testIOE(Base64.getEncoder());
         testIOE(Base64.getUrlEncoder());
         testIOE(Base64.getMimeEncoder());
-        testIOE(Base64.getEncoder(10, new byte[]{'\n'}));
+        testIOE(Base64.getMimeEncoder(10, new byte[]{'\n'}));
 
         byte[] src = new byte[1024];
         new Random().nextBytes(src);
@@ -93,7 +93,7 @@
         testIOE(Base64.getUrlDecoder(), Base64.getUrlEncoder().encode(src));
 
         // illegal line separator
-        checkIAE(new Runnable() { public void run() { Base64.getEncoder(10, new byte[]{'\r', 'N'}); }});
+        checkIAE(new Runnable() { public void run() { Base64.getMimeEncoder(10, new byte[]{'\r', 'N'}); }});
 
         // illegal base64 character
         decoded[2] = (byte)0xe0;
@@ -109,8 +109,6 @@
             Base64.getDecoder().decode(ByteBuffer.wrap(decoded), ByteBuffer.allocateDirect(1024)); }});
 
         // illegal ending unit
-        checkIAE(new Runnable() { public void run() { Base64.getMimeDecoder().decode("$=#"); }});
-
         checkIOE(new Testable() { public void test() throws IOException {
                                      byte[] bytes = "AA=".getBytes("ASCII");
                                      try (InputStream stream =
@@ -129,6 +127,10 @@
         testDecodeUnpadded();
         // test mime decoding with ignored character after padding
         testDecodeIgnoredAfterPadding();
+
+        // lenient mode for ending unit
+        testLenientPadding();
+
     }
 
     private static sun.misc.BASE64Encoder sunmisc = new sun.misc.BASE64Encoder();
@@ -436,6 +438,48 @@
         }
     }
 
+    private static void testLenientPadding() throws Throwable {
+        String[] data = new String[] {
+            "=",         "",        // unnecessary padding
+            "QUJD=",     "ABC",     //"ABC".encode() -> "QUJD"
+
+            "QQ=",       "A",       // incomplete padding
+            "QQ=N",      "A",       // incorrect padding
+            "QQ=?",      "A",
+            "QUJDQQ=",   "ABCA",
+            "QUJDQQ=N",  "ABCA",
+            "QUJDQQ=?",  "ABCA",
+
+            "QUI=X",     "AB",      // incorrect padding
+            "QUI=?",     "AB",      // incorrect padding
+        };
+        Base64.Decoder dec = Base64.getMimeDecoder();
+
+        for (int i = 0; i < data.length; i += 2) {
+            byte[] src = data[i].getBytes("ASCII");
+            byte[] expected = data[i + 1].getBytes("ASCII");
+            // decode(byte[])
+            byte[] ret = dec.decode(src);
+            checkEqual(ret, expected, "lenient padding decoding failed!");
+
+            // decode(String)
+            ret = dec.decode(data[i]);
+            checkEqual(ret, expected, "lenient padding decoding failed!");
+
+            // decode(ByteBuffer)
+            ByteBuffer srcBB = ByteBuffer.wrap(src);
+            ByteBuffer retBB = dec.decode(srcBB);
+            checkEqual(srcBB.remaining(), 0, "lenient padding decoding failed!");
+            checkEqual(Arrays.copyOf(retBB.array(), retBB.remaining()),
+                       expected, "lenient padding decoding failed!");
+
+            // wrap.decode(byte[])
+            ret = new byte[10];
+            int n = dec.wrap(new ByteArrayInputStream(src)).read(ret);
+            checkEqual(Arrays.copyOf(ret, n), expected, "lenient padding decoding failed!");
+        }
+    }
+
     private static void  testDecodeUnpadded() throws Throwable {
         byte[] srcA = new byte[] { 'Q', 'Q' };
         byte[] srcAA = new byte[] { 'Q', 'Q', 'E'};
--- a/jdk/test/java/util/Base64/TestBase64Golden.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/Base64/TestBase64Golden.java	Mon Nov 11 16:20:48 2013 +0100
@@ -230,7 +230,7 @@
             46, -97, -35, -44, 127, -60, -39, -4, -112, 34, -57, 47, -14, 67,
             40, 18, 90, -59, 68, 112, 23, 121, -91, 94, 35, 49, 104, 17, 30,
             -80, -104, -3, -53, 27, 38, -72, -47, 113, -52, 18, 5, -126 };
-        Encoder encoder = Base64.getEncoder(49, new byte[] { 0x7e });
+        Encoder encoder = Base64.getMimeEncoder(49, new byte[] { 0x7e });
         byte[] encoded = encoder.encode(src);
         Decoder decoder = Base64.getMimeDecoder();
         byte[] decoded = decoder.decode(encoded);
--- a/jdk/test/java/util/Calendar/JavatimeTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/Calendar/JavatimeTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -114,14 +114,14 @@
                 zidStr.equals("MST")) {
                 continue;
             }
-            ZoneId zid = ZoneId.of(zidStr, ZoneId.OLD_SHORT_IDS);
+            ZoneId zid = ZoneId.of(zidStr, ZoneId.SHORT_IDS);
             if (!zid.equals(TimeZone.getTimeZone(zid).toZoneId())) {
                 throw new RuntimeException("FAILED: zid -> tz -> zid :" + zidStr);
             }
             TimeZone tz = TimeZone.getTimeZone(zidStr);
             // no round-trip for alias and "GMT"
             if (!tz.equals(TimeZone.getTimeZone(tz.toZoneId())) &&
-                !ZoneId.OLD_SHORT_IDS.containsKey(zidStr) &&
+                !ZoneId.SHORT_IDS.containsKey(zidStr) &&
                 !zidStr.startsWith("GMT")) {
                 throw new RuntimeException("FAILED: tz -> zid -> tz :" + zidStr);
             }
--- a/jdk/test/java/util/Map/Defaults.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/Map/Defaults.java	Mon Nov 11 16:20:48 2013 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8010122 8004518 8024331
+ * @bug 8010122 8004518 8024331 8024688
  * @summary Test Map default methods
  * @author Mike Duigou
  * @run testng Defaults
@@ -36,8 +36,8 @@
 import java.util.Collections;
 import java.util.EnumMap;
 import java.util.HashMap;
+import java.util.Hashtable;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -288,19 +288,11 @@
         assertSame(map.get(EXTRA_KEY), EXTRA_VALUE);
     }
 
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeIfAbsentNPEHashMap() {
-        Object value = new HashMap().computeIfAbsent(KEYS[1], null);
-    }
-
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeIfAbsentNPEHashtable() {
-        Object value = new Hashtable().computeIfAbsent(KEYS[1], null);
-    }
-
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeIfAbsentNPETreeMap() {
-        Object value = new TreeMap().computeIfAbsent(KEYS[1], null);
+    @Test(dataProvider = "Map<IntegerEnum,String> rw=true keys=all values=all")
+    public void testComputeIfAbsentNullFunction(String description, Map<IntegerEnum, String> map) {
+        assertThrows( () -> { map.computeIfAbsent(KEYS[1], null);},
+                NullPointerException.class,
+                "Should throw NPE");
     }
 
     @Test(dataProvider = "Map<IntegerEnum,String> rw=true keys=withNull values=withNull")
@@ -343,22 +335,14 @@
         assertSame(map.get(EXTRA_KEY), null);
     }
 
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeIfPresentNPEHashMap() {
-        Object value = new HashMap().computeIfPresent(KEYS[1], null);
+    @Test(dataProvider = "Map<IntegerEnum,String> rw=true keys=all values=all")
+    public void testComputeIfPresentNullFunction(String description, Map<IntegerEnum, String> map) {
+        assertThrows( () -> { map.computeIfPresent(KEYS[1], null);},
+                NullPointerException.class,
+                "Should throw NPE");
     }
 
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeIfPresentNPEHashtable() {
-        Object value = new Hashtable().computeIfPresent(KEYS[1], null);
-    }
-
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeIfPresentNPETreeMap() {
-        Object value = new TreeMap().computeIfPresent(KEYS[1], null);
-    }
-
-    @Test(dataProvider = "Map<IntegerEnum,String> rw=true keys=withNull values=withNull")
+     @Test(dataProvider = "Map<IntegerEnum,String> rw=true keys=withNull values=withNull")
     public void testComputeNulls(String description, Map<IntegerEnum, String> map) {
         assertTrue(map.containsKey(null), "null key absent");
         assertNull(map.get(null), "value not null");
@@ -444,78 +428,86 @@
         assertSame(map.get(EXTRA_KEY), EXTRA_VALUE);
     }
 
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeNPEHashMap() {
-        Object value = new HashMap().compute(KEYS[1], null);
-    }
-
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeNPEHashtable() {
-        Object value = new Hashtable().compute(KEYS[1], null);
+    @Test(dataProvider = "Map<IntegerEnum,String> rw=true keys=all values=all")
+    public void testComputeNullFunction(String description, Map<IntegerEnum, String> map) {
+        assertThrows( () -> { map.compute(KEYS[1], null);},
+                NullPointerException.class,
+                "Should throw NPE");
     }
 
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testComputeNPETreeMap() {
-        Object value = new TreeMap().compute(KEYS[1], null);
-    }
+    @Test(dataProvider = "MergeCases")
+    private void testMerge(String description, Map<IntegerEnum, String> map, Merging.Value oldValue, Merging.Value newValue, Merging.Merger merger, Merging.Value put, Merging.Value result) {
+            // add and check initial conditions.
+            switch(oldValue) {
+                case ABSENT :
+                    map.remove(EXTRA_KEY);
+                    assertFalse(map.containsKey(EXTRA_KEY), "key not absent");
+                    break;
+                case NULL :
+                    map.put(EXTRA_KEY, null);
+                    assertTrue(map.containsKey(EXTRA_KEY), "key absent");
+                    assertNull(map.get(EXTRA_KEY), "wrong value");
+                    break;
+                case OLDVALUE :
+                    map.put(EXTRA_KEY, VALUES[1]);
+                    assertTrue(map.containsKey(EXTRA_KEY), "key absent");
+                    assertSame(map.get(EXTRA_KEY), VALUES[1], "wrong value");
+                    break;
+                default:
+                    fail("unexpected old value");
+            }
+
+            String returned = map.merge(EXTRA_KEY,
+                newValue == Merging.Value.NULL ? (String) null : VALUES[2],
+                merger
+                );
+
+            // check result
 
-    @Test(dataProvider = "Map<IntegerEnum,String> rw=true keys=withNull values=withNull")
-    public void testMergeNulls(String description, Map<IntegerEnum, String> map) {
-        assertTrue(map.containsKey(null), "null key absent");
-        assertNull(map.get(null), "value not null");
-        assertSame(map.merge(null, EXTRA_VALUE, (v, vv) -> {
-            assertNull(v);
-            assertSame(vv, EXTRA_VALUE);
-            return vv;
-        }), EXTRA_VALUE, description);
-        assertTrue(map.containsKey(null));
-        assertSame(map.get(null), EXTRA_VALUE, description);
+            switch(result) {
+                case NULL :
+                    assertNull(returned, "wrong value");
+                    break;
+                case NEWVALUE :
+                    assertSame(returned, VALUES[2], "wrong value");
+                    break;
+                case RESULT :
+                    assertSame(returned, VALUES[3], "wrong value");
+                    break;
+                default:
+                    fail("unexpected new value");
+            }
+
+            // check map
+            switch(put) {
+                case ABSENT :
+                    assertFalse(map.containsKey(EXTRA_KEY), "key not absent");
+                    break;
+                case NULL :
+                    assertTrue(map.containsKey(EXTRA_KEY), "key absent");
+                    assertNull(map.get(EXTRA_KEY), "wrong value");
+                    break;
+                case NEWVALUE :
+                    assertTrue(map.containsKey(EXTRA_KEY), "key absent");
+                    assertSame(map.get(EXTRA_KEY), VALUES[2], "wrong value");
+                    break;
+                case RESULT :
+                    assertTrue(map.containsKey(EXTRA_KEY), "key absent");
+                    assertSame(map.get(EXTRA_KEY), VALUES[3], "wrong value");
+                    break;
+                default:
+                    fail("unexpected new value");
+            }
     }
 
     @Test(dataProvider = "Map<IntegerEnum,String> rw=true keys=all values=all")
-    public void testMerge(String description, Map<IntegerEnum, String> map) {
-        assertTrue(map.containsKey(KEYS[1]));
-        Object value = map.get(KEYS[1]);
-        assertTrue(null == value || value == VALUES[1], description + String.valueOf(value));
-        assertSame(map.merge(KEYS[1], EXTRA_VALUE, (v, vv) -> {
-            assertSame(v, value);
-            assertSame(vv, EXTRA_VALUE);
-            return vv;
-        }), EXTRA_VALUE, description);
-        assertSame(map.get(KEYS[1]), EXTRA_VALUE, description);
-        assertNull(map.merge(KEYS[1], EXTRA_VALUE, (v, vv) -> {
-            assertSame(v, EXTRA_VALUE);
-            assertSame(vv, EXTRA_VALUE);
-            return null;
-        }), description);
-        assertFalse(map.containsKey(KEYS[1]));
-
-        assertFalse(map.containsKey(EXTRA_KEY));
-        assertSame(map.merge(EXTRA_KEY, EXTRA_VALUE, (v, vv) -> {
-            assertNull(v);
-            assertSame(vv, EXTRA_VALUE);
-            return EXTRA_VALUE;
-        }), EXTRA_VALUE);
-        assertTrue(map.containsKey(EXTRA_KEY));
-        assertSame(map.get(EXTRA_KEY), EXTRA_VALUE);
+    public void testMergeNullMerger(String description, Map<IntegerEnum, String> map) {
+        assertThrows( () -> { map.merge(KEYS[1], VALUES[1], null);},
+                NullPointerException.class,
+                "Should throw NPE");
     }
 
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testMergeNPEHashMap() {
-        Object value = new HashMap().merge(KEYS[1], VALUES[1], null);
-    }
-
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testMergeNPEHashtable() {
-        Object value = new Hashtable().merge(KEYS[1], VALUES[1], null);
-    }
-
-    @Test(expectedExceptions = {NullPointerException.class})
-    public void testMergeNPETreeMap() {
-        Object value = new TreeMap().merge(KEYS[1], VALUES[1], null);
-    }
-
-    enum IntegerEnum {
+    public enum IntegerEnum {
 
         e0, e1, e2, e3, e4, e5, e6, e7, e8, e9,
         e10, e11, e12, e13, e14, e15, e16, e17, e18, e19,
@@ -715,6 +707,89 @@
         return result;
     }
 
+    static class Merging {
+        public enum Value {
+            ABSENT,
+            NULL,
+            OLDVALUE,
+            NEWVALUE,
+            RESULT
+        }
+
+        public enum Merger implements BiFunction<String,String,String> {
+            UNUSED {
+                public String apply(String oldValue, String newValue) {
+                    fail("should not be called");
+                    return null;
+                }
+            },
+            NULL {
+                public String apply(String oldValue, String newValue) {
+                    return null;
+                }
+            },
+            RESULT {
+                public String apply(String oldValue, String newValue) {
+                    return VALUES[3];
+                }
+            },
+        }
+    }
+
+    @DataProvider(name = "MergeCases", parallel = true)
+    public Iterator<Object[]> mergeCasesProvider() {
+        Collection<Object[]> cases = new ArrayList<>();
+
+        cases.addAll(makeMergeTestCases());
+        cases.addAll(makeMergeNullValueTestCases());
+
+        return cases.iterator();
+    }
+
+    static Collection<Object[]> makeMergeTestCases() {
+        Collection<Object[]> cases = new ArrayList<>();
+
+        for( Object[] mapParams : makeAllRWMaps() ) {
+            cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.ABSENT, Merging.Value.NEWVALUE, Merging.Merger.UNUSED, Merging.Value.NEWVALUE, Merging.Value.NEWVALUE });
+        }
+
+        for( Object[] mapParams : makeAllRWMaps() ) {
+            cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.OLDVALUE, Merging.Value.NEWVALUE, Merging.Merger.NULL, Merging.Value.ABSENT, Merging.Value.NULL });
+        }
+
+        for( Object[] mapParams : makeAllRWMaps() ) {
+            cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.OLDVALUE, Merging.Value.NEWVALUE, Merging.Merger.RESULT, Merging.Value.RESULT, Merging.Value.RESULT });
+        }
+
+        return cases;
+    }
+
+    static Collection<Object[]> makeMergeNullValueTestCases() {
+        Collection<Object[]> cases = new ArrayList<>();
+
+        for( Object[] mapParams : makeAllRWMapsWithNulls() ) {
+            cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.OLDVALUE, Merging.Value.NULL, Merging.Merger.NULL, Merging.Value.ABSENT, Merging.Value.NULL });
+        }
+
+        for( Object[] mapParams : makeAllRWMapsWithNulls() ) {
+            cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.OLDVALUE, Merging.Value.NULL, Merging.Merger.RESULT, Merging.Value.RESULT, Merging.Value.RESULT });
+        }
+
+        for( Object[] mapParams : makeAllRWMapsWithNulls() ) {
+            cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.ABSENT, Merging.Value.NULL, Merging.Merger.UNUSED, Merging.Value.ABSENT, Merging.Value.NULL });
+        }
+
+        for( Object[] mapParams : makeAllRWMapsWithNulls() ) {
+            cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.NULL, Merging.Value.NULL, Merging.Merger.UNUSED, Merging.Value.ABSENT, Merging.Value.NULL });
+        }
+
+        for( Object[] mapParams : makeAllRWMapsWithNulls() ) {
+            cases.add(new Object[] { mapParams[0], mapParams[1], Merging.Value.NULL, Merging.Value.NEWVALUE, Merging.Merger.UNUSED, Merging.Value.NEWVALUE, Merging.Value.NEWVALUE });
+        }
+
+        return cases;
+    }
+
     public interface Thrower<T extends Throwable> {
 
         public void run() throws T;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Properties/LoadAndStoreXMLWithDefaults.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,171 @@
+/*
+ * 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.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+
+/**
+ * @test
+ * @bug 8016344
+ * @summary checks that Properties.storeToXML only stores properties locally
+ *          defined on the Properties object, excluding those that are inherited.
+ * @author danielfuchs
+ */
+public class LoadAndStoreXMLWithDefaults {
+
+    public static enum StoreMethod {
+        // Note: this case will test the default provider when available,
+        //       and the basic provider when it's not.
+        PROPERTIES {
+            @Override
+            public String writeToXML(Properties p) throws IOException {
+                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                p.storeToXML(baos, "Test 8016344");
+                return baos.toString();
+            }
+            @Override
+            public Properties loadFromXML(String xml, Properties defaults)
+                    throws IOException {
+                final ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes("UTF-8"));
+                Properties p = new Properties(defaults);
+                p.loadFromXML(bais);
+                return p;
+            }
+        },
+        // Note: this case always test the basic provider, which is always available.
+        //       so sometimes it's just a dup with the previous case...
+        BASICPROVIDER {
+            @Override
+            public String writeToXML(Properties p) throws IOException {
+                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                jdk.internal.util.xml.BasicXmlPropertiesProvider provider =
+                        new  jdk.internal.util.xml.BasicXmlPropertiesProvider();
+                provider.store(p, baos, "Test 8016344", "UTF-8");
+                return baos.toString();
+            }
+            @Override
+            public Properties loadFromXML(String xml, Properties defaults)
+                    throws IOException {
+                final ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes("UTF-8"));
+                Properties p = new Properties(defaults);
+                jdk.internal.util.xml.BasicXmlPropertiesProvider provider =
+                        new  jdk.internal.util.xml.BasicXmlPropertiesProvider();
+                provider.load(p, bais);
+                return p;
+            }
+        };
+        public abstract String writeToXML(Properties p) throws IOException;
+        public abstract Properties loadFromXML(String xml, Properties defaults)
+                    throws IOException;
+        public String displayName() {
+            switch(this) {
+                case PROPERTIES: return "Properties.storeToXML";
+                case BASICPROVIDER: return "BasicXmlPropertiesProvider.store";
+                default:
+                    throw new UnsupportedOperationException(this.name());
+            }
+        }
+    }
+
+    static enum Objects { OBJ1, OBJ2, OBJ3 };
+
+    public static void main(String[] args) throws IOException {
+        Properties p1 = new Properties();
+        p1.setProperty("p1.prop", "prop1-p1");
+        p1.setProperty("p1.and.p2.prop", "prop2-p1");
+        p1.setProperty("p1.and.p2.and.p3.prop", "prop3-p1");
+        Properties p2 = new Properties(p1);
+        p2.setProperty("p2.prop", "prop4-p2");
+        p2.setProperty("p1.and.p2.prop", "prop5-p2");
+        p2.setProperty("p1.and.p2.and.p3.prop", "prop6-p2");
+        p2.setProperty("p2.and.p3.prop", "prop7-p2");
+        Properties p3 = new Properties(p2);
+        p3.setProperty("p3.prop", "prop8-p3");
+        p3.setProperty("p1.and.p2.and.p3.prop", "prop9-p3");
+        p3.setProperty("p2.and.p3.prop", "prop10-p3");
+
+        for (StoreMethod m : StoreMethod.values()) {
+            System.out.println("Testing with " + m.displayName());
+            Properties P1 = m.loadFromXML(m.writeToXML(p1), null);
+            Properties P2 = m.loadFromXML(m.writeToXML(p2), P1);
+            Properties P3 = m.loadFromXML(m.writeToXML(p3), P2);
+
+            testResults(m, p1, P1, p2, P2, p3, P3);
+
+            // Now check that properties whose keys or values are objects
+            // are skipped.
+
+            System.out.println("Testing with " + m.displayName() + " and Objects");
+            P1.put("p1.object.prop", Objects.OBJ1);
+            P1.put(Objects.OBJ1, "p1.object.prop");
+            P1.put("p2.object.prop", "p2.object.prop");
+            P2.put("p2.object.prop", Objects.OBJ2);
+            P2.put(Objects.OBJ2, "p2.object.prop");
+            P3.put("p3.object.prop", Objects.OBJ3);
+            P3.put(Objects.OBJ3, "p3.object.prop");
+
+            Properties PP1 = m.loadFromXML(m.writeToXML(P1), null);
+            Properties PP2 = m.loadFromXML(m.writeToXML(P2), PP1);
+            Properties PP3 = m.loadFromXML(m.writeToXML(P3), PP2);
+
+            p1.setProperty("p2.object.prop", "p2.object.prop");
+            try {
+                testResults(m, p1, PP1, p2, PP2, p3, PP3);
+            } finally {
+                p1.remove("p2.object.prop");
+            }
+        }
+    }
+
+    public static void testResults(StoreMethod m, Properties... pps) {
+        for (int i=0 ; i < pps.length ; i += 2) {
+            if (!pps[i].equals(pps[i+1])) {
+                System.err.println(m.displayName() +": P" + (i/2+1)
+                        + " Reloaded properties differ from original");
+                System.err.println("\toriginal: " + pps[i]);
+                System.err.println("\treloaded: " + pps[i+1]);
+                throw new RuntimeException(m.displayName() +": P" + (i/2+1)
+                        + " Reloaded properties differ from original");
+            }
+            if (!pps[i].keySet().equals(pps[i+1].keySet())) {
+                System.err.println(m.displayName() +": P" + (i/2+1)
+                        + " Reloaded property names differ from original");
+                System.err.println("\toriginal: " + pps[i].keySet());
+                System.err.println("\treloaded: " + pps[i+1].keySet());
+                throw new RuntimeException(m.displayName() +": P" + (i/2+1)
+                        + " Reloaded property names differ from original");
+            }
+            if (!pps[i].stringPropertyNames().equals(pps[i+1].stringPropertyNames())) {
+                System.err.println(m.displayName() +": P" + (i/2+1)
+                        + " Reloaded string property names differ from original");
+                System.err.println("\toriginal: " + pps[i].stringPropertyNames());
+                System.err.println("\treloaded: " + pps[i+1].stringPropertyNames());
+                throw new RuntimeException(m.displayName() +": P" + (i/2+1)
+                        + " Reloaded string property names differ from original");
+            }
+        }
+    }
+
+}
--- a/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -40,6 +40,7 @@
 ${COMPILEJAVA}/bin/keytool ${TESTTOOLVMOPTS} -genkeypair -alias testcert \
   -keystore ${TESTCLASSES}/timezonedatetest.store \
   -storepass testpass -validity 360 \
+  -keyalg rsa \
   -dname "cn=Mark Wildebeest, ou=FreeSoft, o=Red Hat, c=NL" \
   -keypass testpass
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/concurrent/atomic/Serial.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,157 @@
+/*
+ * 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 8026344
+ * @summary Exercise classes in j.u.c.atomic that use serialization proxies
+ */
+
+import java.util.concurrent.atomic.DoubleAdder;
+import java.util.concurrent.atomic.DoubleAccumulator;
+import java.util.concurrent.atomic.LongAdder;
+import java.util.concurrent.atomic.LongAccumulator;
+import java.util.function.DoubleBinaryOperator;
+import java.util.function.LongBinaryOperator;
+import java.io.ByteArrayOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.IOException;
+
+/**
+ * Basic test to exercise the j.u.c.atomic classes that use serialization
+ * proxies.
+ */
+
+public class Serial {
+
+    public static void main(String[] args) {
+        testDoubleAdder();
+        testDoubleAccumulator();
+        testLongAdder();
+        testLongAccumulator();
+    }
+
+    static void testDoubleAdder() {
+        DoubleAdder a = new DoubleAdder();
+        a.add(20.1d);
+        DoubleAdder result = echo(a);
+        if (result.doubleValue() != a.doubleValue())
+            throw new RuntimeException("Unexpected doubleValue");
+
+        checkSerialClassName(a, "java.util.concurrent.atomic.DoubleAdder$SerializationProxy");
+    }
+
+    static void testDoubleAccumulator() {
+        DoubleBinaryOperator plus = (DoubleBinaryOperator & Serializable) (x, y) -> x + y;
+        DoubleAccumulator a = new DoubleAccumulator(plus, 13.9d);
+        a.accumulate(17.5d);
+        DoubleAccumulator result = echo(a);
+        if (result.get() != a.get())
+            throw new RuntimeException("Unexpected value");
+        a.reset();
+        result.reset();
+        if (result.get() != a.get())
+            throw new RuntimeException("Unexpected value after reset");
+
+        checkSerialClassName(a, "java.util.concurrent.atomic.DoubleAccumulator$SerializationProxy");
+    }
+
+    static void testLongAdder() {
+        LongAdder a = new LongAdder();
+        a.add(45);
+        LongAdder result = echo(a);
+        if (result.longValue() != a.longValue())
+            throw new RuntimeException("Unexpected longValue");
+
+        checkSerialClassName(a, "java.util.concurrent.atomic.LongAdder$SerializationProxy");
+    }
+
+    static void testLongAccumulator() {
+        LongBinaryOperator plus = (LongBinaryOperator & Serializable) (x, y) -> x + y;
+        LongAccumulator a = new LongAccumulator(plus, -2);
+        a.accumulate(34);
+        LongAccumulator result = echo(a);
+        if (result.get() != a.get())
+            throw new RuntimeException("Unexpected value");
+        a.reset();
+        result.reset();
+        if (result.get() != a.get())
+            throw new RuntimeException("Unexpected value after reset");
+
+        checkSerialClassName(a, "java.util.concurrent.atomic.LongAccumulator$SerializationProxy");
+    }
+
+    /**
+     * Serialize the given object, returning the reconstituted object.
+     */
+    @SuppressWarnings("unchecked")
+    static <T extends Serializable> T echo(T obj) {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        try (ObjectOutputStream oos = new ObjectOutputStream(out)) {
+            oos.writeObject(obj);
+        } catch (IOException e) {
+            throw new RuntimeException("Serialization failed: " + e);
+        }
+        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+        try (ObjectInputStream ois = new ObjectInputStream(in)) {
+            return (T) ois.readObject();
+        } catch (IOException | ClassNotFoundException e) {
+            throw new RuntimeException("Deserialization failed: " + e);
+        }
+    }
+
+    /**
+     * Checks that the given object serializes to the expected class.
+     */
+    static void checkSerialClassName(Serializable obj, String expected) {
+        String cn = serialClassName(obj);
+        if (!cn.equals(expected))
+            throw new RuntimeException(obj.getClass() + " serialized as " + cn
+                + ", expected " + expected);
+    }
+
+    /**
+     * Returns the class name that the given object serializes as.
+     */
+    static String serialClassName(Serializable obj) {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        try (ObjectOutputStream oos = new ObjectOutputStream(out)) {
+            oos.writeObject(obj);
+        } catch (IOException e) {
+            throw new RuntimeException("Serialization failed: " + e);
+        }
+        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+        try (DataInputStream dis = new DataInputStream(in)) {
+            dis.readShort();      // STREAM_MAGIC
+            dis.readShort();      // STREAM_VERSION
+            dis.readByte();       // TC_OBJECT
+            dis.readByte();       // TC_CLASSDESC
+            return dis.readUTF(); // className
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
--- a/jdk/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java	Mon Nov 11 16:20:48 2013 +0100
@@ -49,7 +49,7 @@
         new File("ks").delete();
         sun.security.tools.keytool.Main.main(
                 ("-keystore ks -storepass changeit -keypass changeit " +
-                        "-alias a -dname CN=A -genkeypair").split(" "));
+                        "-keyalg rsa -alias a -dname CN=A -genkeypair").split(" "));
         sun.security.tools.jarsigner.Main.main(
                 "-keystore ks -storepass changeit x.jar a".split(" "));
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/AnonymousLogger/TestAnonymousLogger.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.logging.Filter;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+import java.util.logging.SimpleFormatter;
+
+/**
+ * @test
+ * @bug 8026863
+ * @summary checks that anonymous logger setters work as expected when a
+ *          security manager is set, and checks that getters return expected
+ *          values.
+ * @run main/othervm TestAnonymousLogger
+ */
+public class TestAnonymousLogger {
+
+    final public static class TestHandler extends Handler {
+        @Override
+        public void publish(LogRecord record) {
+            System.out.println(new SimpleFormatter().format(record));
+        }
+        @Override
+        public void flush() {
+            System.out.flush();
+        }
+        @Override
+        public void close() {
+            flush();
+        }
+    }
+
+    final public static class TestFilter implements Filter {
+        @Override
+        public boolean isLoggable(LogRecord record) {
+            return true;
+        }
+    }
+
+    final public static class TestBundle extends ResourceBundle {
+        Set<String> keys = Collections.synchronizedSet(new LinkedHashSet<>());
+        @Override
+        protected Object handleGetObject(String key) {
+            keys.add(key);
+            return "[LOCALIZED] "+key;
+        }
+        @Override
+        public Enumeration<String> getKeys() {
+            return Collections.enumeration(keys);
+        }
+    }
+
+    public static void main(String[] args) {
+        System.setSecurityManager(new SecurityManager());
+        Logger anonymous = Logger.getAnonymousLogger();
+
+        final TestHandler handler = new TestHandler();
+        final TestFilter filter = new TestFilter();
+        final ResourceBundle bundle = ResourceBundle.getBundle(TestBundle.class.getName());
+        anonymous.setLevel(Level.FINEST);
+        anonymous.addHandler(handler);
+        anonymous.setFilter(filter);
+        anonymous.setUseParentHandlers(true);
+        anonymous.setResourceBundle(bundle);
+
+        if (anonymous.getLevel() != Level.FINEST) {
+            throw new RuntimeException("Unexpected level: " + anonymous.getLevel());
+        } else {
+            System.out.println("Got expected level: " + anonymous.getLevel());
+        }
+        if (!Arrays.asList(anonymous.getHandlers()).contains(handler)) {
+            throw new RuntimeException("Expected handler not found in: "
+                    + Arrays.asList(anonymous.getHandlers()));
+        } else {
+            System.out.println("Got expected handler in: " + Arrays.asList(anonymous.getHandlers()));
+        }
+        if (anonymous.getFilter() != filter) {
+            throw new RuntimeException("Unexpected filter: " + anonymous.getFilter());
+        } else {
+            System.out.println("Got expected filter: " + anonymous.getFilter());
+        }
+        if (!anonymous.getUseParentHandlers()) {
+            throw new RuntimeException("Unexpected flag: " + anonymous.getUseParentHandlers());
+        } else {
+            System.out.println("Got expected flag: " + anonymous.getUseParentHandlers());
+        }
+        if (anonymous.getResourceBundle() != bundle) {
+            throw new RuntimeException("Unexpected bundle: " + anonymous.getResourceBundle());
+        } else {
+            System.out.println("Got expected bundle: " + anonymous.getResourceBundle());
+        }
+        try {
+            anonymous.setParent(Logger.getLogger("foo.bar"));
+            throw new RuntimeException("Expected SecurityException not raised!");
+        } catch (SecurityException x) {
+            System.out.println("Got expected exception: " + x);
+        }
+        if (anonymous.getParent() != Logger.getLogger("")) {
+            throw new RuntimeException("Unexpected parent: " + anonymous.getParent());
+        } else {
+            System.out.println("Got expected parent: " + anonymous.getParent());
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/LogManager/RootLogger/setLevel/TestRootLoggerLevel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.security.Permission;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.logging.LoggingPermission;
+
+
+
+/**
+ * @test
+ * @bug 8023163
+ * @summary checks that Logger.getLogger("").setLevel() is working correctly.
+ * @build TestRootLoggerLevel
+ * @run main/othervm -Dtest.security=on TestRootLoggerLevel
+ * @run main/othervm -Dtest.security=off TestRootLoggerLevel
+ * @author danielfuchs
+ */
+public class TestRootLoggerLevel {
+
+    public static enum Loggers {
+        ROOT("", "root"),
+        GLOBAL(Logger.GLOBAL_LOGGER_NAME);
+
+        private final String name;
+        private final String displayName;
+        Loggers(String name) {
+            this(name, name);
+        }
+        Loggers(String name, String displayName) {
+            this.name = name;
+            this.displayName = displayName;
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        for (Loggers log : Loggers.values()) {
+            System.out.println(log.displayName + ": "
+                    + Logger.getLogger(log.name)
+                    + ": " + Logger.getLogger(log.name).getLevel());
+        }
+
+        if ("on".equals(System.getProperty("test.security","on"))) {
+            System.out.println("*** SecurityManager is ON");
+            Policy.setPolicy(new SimplePolicy());
+
+            System.setSecurityManager(new SecurityManager());
+        } else {
+            System.out.println("*** SecurityManager is OFF");
+        }
+
+        // Before the fix, setting the root logger level here had only
+        // a transient effect...
+        for (Loggers log : Loggers.values()) {
+            System.out.println("Logger.getLogger(\""
+                    + log.name
+                    + "\").setLevel(Level.FINEST);");
+            Logger.getLogger(log.name).setLevel(Level.FINEST);
+            System.out.println(log.displayName + ": "
+                    + Logger.getLogger(log.name)
+                    + ": " + Logger.getLogger(log.name).getLevel());
+
+            // At this point - the root logger should have a level which is
+            // FINEST - just check it here for sanity.
+            if (Logger.getLogger(log.name).getLevel() != Level.FINEST) {
+                throw new RuntimeException("Logger " + log.displayName
+                        + " level should be FINEST: "
+                        + Logger.getLogger(log.name).getLevel());
+            }
+        }
+        // Initializing some PlatformLogger caused the root logger
+        // level to be reset to INFO.
+        //
+        final Object platformLogger =
+                sun.util.logging.PlatformLogger.getLogger("java.foo");
+        System.out.println("Got platform logger: " + platformLogger);
+
+        for (Loggers log : Loggers.values()) {
+            // Check that the root logger still has the FINEST value assigned
+            // to it earlier.
+            System.out.println(log.displayName + ": "
+                    + Logger.getLogger(log.name)
+                    + ": " + Logger.getLogger(log.name).getLevel());
+
+            if (Logger.getLogger(log.name).getLevel() != Level.FINEST) {
+                throw new RuntimeException("Logger " + log.displayName
+                        + " level should be FINEST: "
+                        + Logger.getLogger(log.name).getLevel());
+            }
+        }
+
+     }
+
+    private static final class SimplePolicy extends Policy {
+        private final Permissions perms;
+
+        private static final Permissions permissions(Permission... perms) {
+            Permissions permissions = new Permissions();
+            for (Permission perm : perms) {
+                permissions.add(perm);
+            }
+            return permissions;
+        }
+
+        SimplePolicy() {
+            this(permissions(new LoggingPermission("control", null),
+                    new RuntimePermission("accessClassInPackage.sun.util.logging")
+            ));
+        }
+
+        SimplePolicy(Permissions perms) {
+            this.perms = perms;
+        }
+
+        @Override
+        public boolean implies(ProtectionDomain domain, Permission permission) {
+            return perms.implies(permission);
+        }
+
+    }
+
+}
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/lang/invoke/SerializedLambdaTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/lang/invoke/SerializedLambdaTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -22,9 +22,18 @@
  */
 package org.openjdk.tests.java.lang.invoke;
 
-import org.testng.annotations.Test;
-
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.lang.invoke.CallSite;
+import java.lang.invoke.LambdaMetafactory;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicLong;
@@ -34,6 +43,8 @@
 import java.util.function.Predicate;
 import java.util.function.Supplier;
 
+import org.testng.annotations.Test;
+
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
@@ -277,4 +288,66 @@
         LongConsumer lc = (LongConsumer & Serializable) a::addAndGet;
         assertSerial(lc, plc -> { plc.accept(3); });
     }
+
+    // Tests of direct use of metafactories
+
+    private static boolean foo(Object s) { return s != null && ((String) s).length() > 0; }
+    private static final MethodType predicateMT = MethodType.methodType(boolean.class, Object.class);
+    private static final MethodType stringPredicateMT = MethodType.methodType(boolean.class, String.class);
+    private static final Consumer<Predicate<String>> fooAsserter = x -> {
+        assertTrue(x.test("foo"));
+        assertFalse(x.test(""));
+        assertFalse(x.test(null));
+    };
+
+    // standard MF: nonserializable supertype
+    public void testDirectStdNonser() throws Throwable {
+        MethodHandle fooMH = MethodHandles.lookup().findStatic(SerializedLambdaTest.class, "foo", predicateMT);
+
+        // Standard metafactory, non-serializable target: not serializable
+        CallSite cs = LambdaMetafactory.metafactory(MethodHandles.lookup(),
+                                                    "test", MethodType.methodType(Predicate.class),
+                                                    predicateMT, fooMH, stringPredicateMT);
+        Predicate<String> p = (Predicate<String>) cs.getTarget().invokeExact();
+        assertNotSerial(p, fooAsserter);
+    }
+
+    // standard MF: serializable supertype
+    public void testDirectStdSer() throws Throwable {
+        MethodHandle fooMH = MethodHandles.lookup().findStatic(SerializedLambdaTest.class, "foo", predicateMT);
+
+        // Standard metafactory, serializable target: not serializable
+        CallSite cs = LambdaMetafactory.metafactory(MethodHandles.lookup(),
+                                                    "test", MethodType.methodType(SerPredicate.class),
+                                                    predicateMT, fooMH, stringPredicateMT);
+        assertNotSerial((SerPredicate<String>) cs.getTarget().invokeExact(), fooAsserter);
+    }
+
+    // alt MF: nonserializable supertype
+    public void testAltStdNonser() throws Throwable {
+        MethodHandle fooMH = MethodHandles.lookup().findStatic(SerializedLambdaTest.class, "foo", predicateMT);
+
+        // Alt metafactory, non-serializable target: not serializable
+        CallSite cs = LambdaMetafactory.altMetafactory(MethodHandles.lookup(),
+                                                       "test", MethodType.methodType(Predicate.class),
+                                                       predicateMT, fooMH, stringPredicateMT, 0);
+        assertNotSerial((Predicate<String>) cs.getTarget().invokeExact(), fooAsserter);
+    }
+
+    // alt MF: serializable supertype
+    public void testAltStdSer() throws Throwable {
+        MethodHandle fooMH = MethodHandles.lookup().findStatic(SerializedLambdaTest.class, "foo", predicateMT);
+
+        // Alt metafactory, serializable target, no FLAG_SERIALIZABLE: not serializable
+        CallSite cs = LambdaMetafactory.altMetafactory(MethodHandles.lookup(),
+                                                       "test", MethodType.methodType(SerPredicate.class),
+                                                       predicateMT, fooMH, stringPredicateMT, 0);
+        assertNotSerial((SerPredicate<String>) cs.getTarget().invokeExact(), fooAsserter);
+
+        // Alt metafactory, serializable marker, no FLAG_SERIALIZABLE: not serializable
+        cs = LambdaMetafactory.altMetafactory(MethodHandles.lookup(),
+                                              "test", MethodType.methodType(Predicate.class),
+                                              predicateMT, fooMH, stringPredicateMT, LambdaMetafactory.FLAG_MARKERS, 1, Serializable.class);
+        assertNotSerial((Predicate<String>) cs.getTarget().invokeExact(), fooAsserter);
+    }
 }
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -28,8 +28,10 @@
 import java.util.Collection;
 import java.util.Comparator;
 import java.util.List;
+import java.util.Optional;
 import java.util.Spliterator;
 import java.util.Spliterators;
+import java.util.concurrent.ThreadLocalRandom;
 import java.util.stream.*;
 
 import static java.util.stream.LambdaTestHelpers.*;
@@ -48,6 +50,17 @@
         assertCountSum(countTo(10).stream().distinct(), 10, 55);
     }
 
+    public void testWithUnorderedInfiniteStream() {
+        // These tests should short-circuit, otherwise will fail with a time-out
+        // or an OOME
+
+        Integer one = Stream.iterate(1, i -> i + 1).unordered().parallel().distinct().findAny().get();
+        assertEquals(one.intValue(), 1);
+
+        Optional<Integer> oi = ThreadLocalRandom.current().ints().boxed().parallel().distinct().findAny();
+        assertTrue(oi.isPresent());
+    }
+
     @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
     public void testOp(String name, TestData.OfRef<Integer> data) {
         Collection<Integer> result = exerciseOpsInt(data, Stream::distinct, IntStream::distinct, LongStream::distinct, DoubleStream::distinct);
--- a/jdk/test/java/util/zip/GZIP/GZIPInZip.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/java/util/zip/GZIP/GZIPInZip.java	Mon Nov 11 16:20:48 2013 +0100
@@ -22,15 +22,14 @@
  */
 
 /* @test
- * @bug 7021870 8023431
+ * @bug 7021870 8023431 8026756
  * @summary Reading last gzip chain member must not close the input stream.
  *          Garbage following gzip entry must be ignored.
  */
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
 import java.util.zip.ZipEntry;
@@ -40,9 +39,9 @@
 
 public class GZIPInZip {
 
-    private static volatile Throwable trouble;
+    public static void main(String[] args)
+            throws Throwable {
 
-    public static void main(String[] args) throws Throwable {
         doTest(false, false);
         doTest(false, true);
         doTest(true, false);
@@ -53,63 +52,46 @@
                                final boolean limitGISBuff)
             throws Throwable {
 
-        final PipedOutputStream pos = new PipedOutputStream();
-        final PipedInputStream pis = new PipedInputStream(pos);
+        byte[] buf;
+
+        try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
+             ZipOutputStream zos = new ZipOutputStream(baos)) {
+
+            final byte[] xbuf = { 'x' };
 
-        Thread compressor = new Thread() {
-            public void run() {
-                final byte[] xbuf = { 'x' };
-                try (ZipOutputStream zos = new ZipOutputStream(pos)) {
+            zos.putNextEntry(new ZipEntry("a.gz"));
+            GZIPOutputStream gos1 = new GZIPOutputStream(zos);
+            gos1.write(xbuf);
+            gos1.finish();
+            if (appendGarbage)
+                zos.write(xbuf);
+            zos.closeEntry();
 
-                    zos.putNextEntry(new ZipEntry("a.gz"));
-                    try (GZIPOutputStream gos1 = new GZIPOutputStream(zos)) {
-                        gos1.write(xbuf);
-                        gos1.finish();
-                    }
-                    if (appendGarbage)
-                        zos.write(xbuf);
+            zos.putNextEntry(new ZipEntry("b.gz"));
+            GZIPOutputStream gos2 = new GZIPOutputStream(zos);
+            gos2.write(xbuf);
+            gos2.finish();
+            zos.closeEntry();
 
-                    zos.closeEntry();
+            zos.flush();
+            buf = baos.toByteArray();
+        }
 
-                    zos.putNextEntry(new ZipEntry("b.gz"));
-                    try (GZIPOutputStream gos2 = new GZIPOutputStream(zos)) {
-                        gos2.write(xbuf);
-                        gos2.finish();
-                    }
-                    zos.closeEntry();
+        try (ByteArrayInputStream bais = new ByteArrayInputStream(buf);
+             ZipInputStream zis = new ZipInputStream(bais)) {
 
-                } catch (Throwable t) {
-                    trouble = t;
-                }
+            zis.getNextEntry();
+            GZIPInputStream gis1 = limitGISBuff ?
+                    new GZIPInputStream(zis, 4) :
+                    new GZIPInputStream(zis);
+            // try to read more than the entry has
+            gis1.skip(2);
+
+            try {
+                zis.getNextEntry();
+            } catch (IOException e) {
+                throw new RuntimeException("ZIP stream was prematurely closed", e);
             }
-        };
-
-        Thread uncompressor = new Thread() {
-            public void run() {
-                try (ZipInputStream zis = new ZipInputStream(pis)) {
-                    zis.getNextEntry();
-                    try (InputStream gis = limitGISBuff ?
-                            new GZIPInputStream(zis, 4) :
-                            new GZIPInputStream(zis)) {
-                        // try to read more than the entry has
-                        gis.skip(2);
-                    }
-
-                    try {
-                        zis.getNextEntry();
-                    } catch (IOException e) {
-                        throw new AssertionError("ZIP stream was prematurely closed");
-                    }
-                } catch (Throwable t) {
-                    trouble = t;
-                }
-            }
-        };
-
-        compressor.start(); uncompressor.start();
-        compressor.join();  uncompressor.join();
-
-        if (trouble != null)
-            throw trouble;
+        }
     }
 }
--- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,49 +25,48 @@
  * @test
  * @summary NPE IN RMIConnector.connect
  * @bug 6984520
+ * @library /java/rmi/testlibrary
  * @run clean RMIConnector_NPETest
+ * @run build TestLibrary RMID
  * @run build RMIConnector_NPETest
  * @run main RMIConnector_NPETest
  */
-
-import java.io.*;
-import java.lang.management.*;
-import java.rmi.registry.*;
+import java.io.IOException;
 import javax.management.*;
-import javax.management.remote.*;
 import javax.management.remote.rmi.*;
 
-public class RMIConnector_NPETest  {
-
+public class RMIConnector_NPETest {
     public static void main(String argv[]) throws Exception {
-        boolean testFailed = false;
-        String rmidCmd = System.getProperty("java.home") + File.separator +
-            "bin" + File.separator + "rmid -port 3333";
-        String stopRmidCmd = System.getProperty("java.home") + File.separator +
-                "bin" + File.separator + "rmid -stop -port 3333";
-    try {
-        //start an rmid daemon and give it some time
-        System.out.println("Starting rmid");
-        Runtime.getRuntime().exec(rmidCmd);
-        Thread.sleep(5000);
+        RMID rmid = RMID.createRMID();
+        rmid.start();
+        int rmidPort = rmid.getPort();
+        Exception failureCause = null;
+        RMIConnector agent = null;
 
-        MBeanServer mbs = MBeanServerFactory.createMBeanServer();
-        RMIJRMPServerImpl rmiserver = new RMIJRMPServerImpl(3333, null, null, null);
-        rmiserver.setMBeanServer(mbs);
-        RMIConnector agent = new RMIConnector(rmiserver, null);
-        agent.connect();
-    } catch(NullPointerException npe) {
-        npe.printStackTrace();
-        testFailed = true;
-    } catch (Exception e) {
-        // OK
-    } finally {
-        System.out.println("Stopping rmid");
-        Runtime.getRuntime().exec(stopRmidCmd);
+        try {
+            MBeanServer mbs = MBeanServerFactory.createMBeanServer();
+            RMIJRMPServerImpl rmiserver = new RMIJRMPServerImpl(rmidPort, null, null, null);
+            rmiserver.setMBeanServer(mbs);
+            agent = new RMIConnector(rmiserver, null);
+            agent.connect();
+        } catch (NullPointerException npe) {
+            failureCause = npe;
+        } catch (Exception e) {
+            // OK
+        } finally {
+            if (agent != null) {
+                try {
+                    agent.close();
+                } catch (IOException e) {
+                    // ignore
+                }
+            }
+            rmid.shutdown(rmidPort);
         }
 
-    if(testFailed)
-        throw new Exception("Test failed");
+        if (failureCause != null) {
+            TestLibrary.bomb("Test failed", failureCause);
+        }
 
     }
-}
+}
\ No newline at end of file
--- a/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,8 @@
 
 // java imports
 //
-import java.io.IOException;
 import java.net.MalformedURLException;
+import java.util.Map;
 
 // JMX imports
 //
@@ -44,7 +44,7 @@
 import javax.management.remote.JMXServiceURL;
 
 public class NotSerializableNotifTest {
-    private static MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer();
+    private static final MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer();
     private static ObjectName emitter;
     private static int port = 2468;
 
@@ -52,9 +52,19 @@
 
     private static final int sentNotifs = 10;
 
+    private static double timeoutFactor = 1.0;
+    private static final double defaultTimeout = 10;
+
     public static void main(String[] args) throws Exception {
         System.out.println(">>> Test to send a not serializable notification");
 
+        String timeoutVal = System.getProperty("test.timeout.factor");
+        if (timeoutVal != null) {
+            timeoutFactor = Double.parseDouble(
+                System.getProperty("test.timeout.factor")
+            );
+        }
+
         // IIOP fails on JDK1.4, see 5034318
         final String v = System.getProperty("java.version");
         float f = Float.parseFloat(v.substring(0, 3));
@@ -136,7 +146,8 @@
 
         // waiting ...
         synchronized (listener) {
-            for (int i=0; i<10; i++) {
+            int top = (int)Math.ceil(timeoutFactor * defaultTimeout);
+            for (int i=0; i<top; i++) {
                 if (listener.received() < sentNotifs) {
                     listener.wait(1000);
                 } else {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/print/TextFlavorTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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
--- a/jdk/test/javax/xml/jaxp/parsers/8022548/XOMParserTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/javax/xml/jaxp/parsers/8022548/XOMParserTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -65,7 +65,7 @@
 
             String inFilename = filePath + "/JDK8022548.xml";
             String xslFilename = filePath + "/JDK8022548.xsl";
-            String outFilename = filePath + "/JDK8022548.out";
+            String outFilename = "JDK8022548.out";
 
             StringWriter sw = new StringWriter();
             // Create transformer factory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/transform/jdk8004476/SecureProcessingTest.xml	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<helloWorld/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/transform/jdk8004476/TestBase.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+import java.security.Policy;
+
+/**
+ *
+ *
+ * @author huizhe.wang@oracle.com
+ */
+public class TestBase {
+    public static boolean isWindows = false;
+    static {
+        if (System.getProperty("os.name").indexOf("Windows")>-1) {
+            isWindows = true;
+        }
+    };
+
+    String filepath;
+    boolean hasSM;
+    String curDir;
+    Policy origPolicy;
+    String testName;
+    static String errMessage;
+
+    int passed = 0, failed = 0;
+
+    /**
+     * Creates a new instance of StreamReader
+     */
+    public TestBase(String name) {
+        testName = name;
+    }
+
+    //junit @Override
+    protected void setUp() {
+        if (System.getSecurityManager() != null) {
+            hasSM = true;
+            System.setSecurityManager(null);
+        }
+
+        filepath = System.getProperty("test.src");
+        if (filepath == null) {
+            //current directory
+            filepath = System.getProperty("user.dir");
+        }
+        origPolicy = Policy.getPolicy();
+
+    }
+
+    //junit @Override
+    public void tearDown() {
+        // turn off security manager and restore policy
+        System.setSecurityManager(null);
+        Policy.setPolicy(origPolicy);
+        if (hasSM) {
+            System.setSecurityManager(new SecurityManager());
+        }
+        System.out.println("\nNumber of tests passed: " + passed);
+        System.out.println("Number of tests failed: " + failed + "\n");
+
+        if (errMessage != null ) {
+            throw new RuntimeException(errMessage);
+        }
+    }
+
+    void fail(String errMsg) {
+        if (errMessage == null) {
+            errMessage = errMsg;
+        } else {
+            errMessage = errMessage + "\n" + errMsg;
+        }
+        failed++;
+    }
+
+    void success(String msg) {
+        passed++;
+        System.out.println(msg);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/transform/jdk8004476/XPathExFuncTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,287 @@
+/*
+ * 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 8004476
+ * @summary test XPath extension functions
+ * @run main/othervm XPathExFuncTest
+ */
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.security.AllPermission;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Iterator;
+import java.util.List;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPathFactoryConfigurationException;
+import javax.xml.xpath.XPathFunction;
+import javax.xml.xpath.XPathFunctionException;
+import javax.xml.xpath.XPathFunctionResolver;
+import org.w3c.dom.Document;
+
+/**
+ * test XPath extension functions
+ *
+ * @author huizhe.wang@oracle.com
+ */
+public class XPathExFuncTest extends TestBase {
+
+    final static String ENABLE_EXTENSION_FUNCTIONS = "http://www.oracle.com/xml/jaxp/properties/enableExtensionFunctions";
+    final static String CLASSNAME = "DocumentBuilderFactoryImpl";
+    final String XPATH_EXPRESSION = "ext:helloWorld()";
+
+    /**
+     * Creates a new instance of StreamReader
+     */
+    public XPathExFuncTest(String name) {
+        super(name);
+    }
+    boolean hasSM;
+    String xslFile, xslFileId;
+    String xmlFile, xmlFileId;
+
+    protected void setUp() {
+        super.setUp();
+        xmlFile = filepath + "/SecureProcessingTest.xml";
+
+    }
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) {
+        XPathExFuncTest test = new XPathExFuncTest("OneTest");
+        test.setUp();
+
+        test.testExtFunc();
+        test.testExtFuncNotAllowed();
+        test.testEnableExtFunc();
+        test.tearDown();
+
+    }
+
+    /**
+     * by default, extension function is enabled
+     */
+    public void testExtFunc() {
+
+        try {
+            evaluate(false);
+            System.out.println("testExtFunc: OK");
+        } catch (XPathFactoryConfigurationException e) {
+            fail(e.getMessage());
+        } catch (XPathExpressionException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    /**
+     * Security is enabled, extension function not allowed
+     */
+    public void testExtFuncNotAllowed() {
+        Policy p = new SimplePolicy(new AllPermission());
+        Policy.setPolicy(p);
+        System.setSecurityManager(new SecurityManager());
+
+        try {
+            evaluate(false);
+        } catch (XPathFactoryConfigurationException e) {
+            fail(e.getMessage());
+        } catch (XPathExpressionException ex) {
+            //expected since extension function is disallowed
+            System.out.println("testExtFuncNotAllowed: OK");
+        } finally {
+            System.setSecurityManager(null);
+        }
+    }
+
+    /**
+     * Security is enabled, use new feature: enableExtensionFunctions
+     */
+    public void testEnableExtFunc() {
+        Policy p = new SimplePolicy(new AllPermission());
+        Policy.setPolicy(p);
+        System.setSecurityManager(new SecurityManager());
+
+
+        try {
+            evaluate(true);
+            System.out.println("testEnableExt: OK");
+        } catch (XPathFactoryConfigurationException e) {
+            fail(e.getMessage());
+        } catch (XPathExpressionException e) {
+            fail(e.getMessage());
+        } finally {
+            System.setSecurityManager(null);
+        }
+    }
+
+    Document getDocument() {
+        // the xml source
+        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder documentBuilder = null;
+        Document document = null;
+
+        try {
+            documentBuilder = documentBuilderFactory.newDocumentBuilder();
+            InputStream xmlStream = new FileInputStream(xmlFile);
+            document = documentBuilder.parse(xmlStream);
+        } catch (Exception e) {
+            fail(e.toString());
+        }
+        return document;
+    }
+
+    void evaluate(boolean enableExt) throws XPathFactoryConfigurationException, XPathExpressionException {
+        Document document = getDocument();
+
+        XPathFactory xPathFactory = XPathFactory.newInstance();
+        /**
+         * Use of the extension function 'http://exslt.org/strings:tokenize' is
+         * not allowed when the secure processing feature is set to true.
+         * Attempt to use the new property to enable extension function
+         */
+        if (enableExt) {
+            boolean isExtensionSupported = enableExtensionFunction(xPathFactory);
+        }
+
+        xPathFactory.setXPathFunctionResolver(new MyXPathFunctionResolver());
+        if (System.getSecurityManager() == null) {
+            xPathFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+        }
+
+        XPath xPath = xPathFactory.newXPath();
+        xPath.setNamespaceContext(new MyNamespaceContext());
+
+        String xPathResult = xPath.evaluate(XPATH_EXPRESSION, document);
+        System.out.println(
+                "XPath result (enableExtensionFunction == " + enableExt + ") = \""
+                + xPathResult
+                + "\"");
+    }
+
+    public class MyXPathFunctionResolver
+            implements XPathFunctionResolver {
+
+        public XPathFunction resolveFunction(QName functionName, int arity) {
+
+            // not a real ewsolver, always return a default XPathFunction
+            return new MyXPathFunction();
+        }
+    }
+
+    public class MyXPathFunction
+            implements XPathFunction {
+
+        public Object evaluate(List list) throws XPathFunctionException {
+
+            return "Hello World";
+        }
+    }
+
+    public class MyNamespaceContext implements NamespaceContext {
+
+        public String getNamespaceURI(String prefix) {
+            if (prefix == null) {
+                throw new IllegalArgumentException("The prefix cannot be null.");
+            }
+
+            if (prefix.equals("ext")) {
+                return "http://ext.com";
+            } else {
+                return null;
+            }
+        }
+
+        public String getPrefix(String namespace) {
+
+            if (namespace == null) {
+                throw new IllegalArgumentException("The namespace uri cannot be null.");
+            }
+
+            if (namespace.equals("http://ext.com")) {
+                return "ext";
+            } else {
+                return null;
+            }
+        }
+
+        public Iterator getPrefixes(String namespace) {
+            return null;
+        }
+    }
+
+    boolean enableExtensionFunction(XPathFactory factory) {
+        boolean isSupported = true;
+        try {
+            factory.setFeature(ENABLE_EXTENSION_FUNCTIONS, true);
+        } catch (XPathFactoryConfigurationException ex) {
+            isSupported = false;
+        }
+        return isSupported;
+    }
+
+    class SimplePolicy extends Policy {
+
+        private final Permissions perms;
+
+        public SimplePolicy(Permission... permissions) {
+            perms = new Permissions();
+            for (Permission permission : permissions) {
+                perms.add(permission);
+            }
+        }
+
+        @Override
+        public PermissionCollection getPermissions(CodeSource cs) {
+            return perms;
+        }
+
+        @Override
+        public PermissionCollection getPermissions(ProtectionDomain pd) {
+            return perms;
+        }
+
+        @Override
+        public boolean implies(ProtectionDomain pd, Permission p) {
+            return perms.implies(p);
+        }
+
+        //for older jdk
+        @Override
+        public void refresh() {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/transform/jdk8004476/XSLTExFuncTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,248 @@
+/*
+ * 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 8004476
+ * @summary test XSLT extension functions
+ * @run main/othervm XSLTExFuncTest
+ */
+
+import java.io.StringWriter;
+import java.security.AllPermission;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import javax.xml.transform.*;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import org.xml.sax.InputSource;
+
+/**
+ * test XSLT extension functions
+ *
+ * @author huizhe.wang@oracle.com
+ */
+public class XSLTExFuncTest extends TestBase {
+
+    final static String ENABLE_EXTENSION_FUNCTIONS = "http://www.oracle.com/xml/jaxp/properties/enableExtensionFunctions";
+    final static String CLASSNAME = "DocumentBuilderFactoryImpl";
+
+    /**
+     * Creates a new instance of StreamReader
+     */
+    public XSLTExFuncTest(String name) {
+        super(name);
+    }
+    boolean hasSM;
+    String xslFile, xslFileId;
+    String xmlFile, xmlFileId;
+
+    protected void setUp() {
+        super.setUp();
+        xmlFile = filepath + "/tokenize.xml";
+        xslFile = filepath + "/tokenize.xsl";
+
+        /**
+         * if (isWindows) { xslFile = "/" + xslFile; }
+         *
+         */
+        xslFileId = "file://" + xslFile;
+    }
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) {
+        XSLTExFuncTest test = new XSLTExFuncTest("OneTest");
+        test.setUp();
+
+        test.testExtFunc();
+        test.testExtFuncNotAllowed();
+        test.testEnableExtFunc();
+        test.testTemplatesEnableExtFunc();
+        test.tearDown();
+
+    }
+
+    /**
+     * by default, extension function is enabled
+     */
+    public void testExtFunc() {
+        TransformerFactory factory = TransformerFactory.newInstance();
+
+        try {
+            transform(factory);
+            System.out.println("testExtFunc: OK");
+        } catch (TransformerConfigurationException e) {
+            fail(e.getMessage());
+        } catch (TransformerException ex) {
+            fail(ex.getMessage());
+        }
+    }
+
+    /**
+     * Security is enabled, extension function not allowed
+     */
+    public void testExtFuncNotAllowed() {
+        Policy p = new SimplePolicy(new AllPermission());
+        Policy.setPolicy(p);
+        System.setSecurityManager(new SecurityManager());
+        TransformerFactory factory = TransformerFactory.newInstance();
+
+        try {
+            transform(factory);
+        } catch (TransformerConfigurationException e) {
+            fail(e.getMessage());
+        } catch (TransformerException ex) {
+            //expected since extension function is disallowed
+            System.out.println("testExtFuncNotAllowed: OK");
+        } finally {
+            System.setSecurityManager(null);
+        }
+    }
+
+    /**
+     * Security is enabled, use new feature: enableExtensionFunctions
+     */
+    public void testEnableExtFunc() {
+        Policy p = new SimplePolicy(new AllPermission());
+        Policy.setPolicy(p);
+        System.setSecurityManager(new SecurityManager());
+        TransformerFactory factory = TransformerFactory.newInstance();
+
+        /**
+         * Use of the extension function 'http://exslt.org/strings:tokenize' is
+         * not allowed when the secure processing feature is set to true.
+         * Attempt to use the new property to enable extension function
+         */
+        boolean isExtensionSupported = enableExtensionFunction(factory);
+
+        try {
+            transform(factory);
+            System.out.println("testEnableExt: OK");
+        } catch (TransformerConfigurationException e) {
+            fail(e.getMessage());
+        } catch (TransformerException e) {
+            fail(e.getMessage());
+        } finally {
+            System.setSecurityManager(null);
+        }
+    }
+
+    /**
+     * use Templates template = factory.newTemplates(new StreamSource( new
+     * FileInputStream(xslFilename))); // Use the template to create a
+     * transformer Transformer xformer = template.newTransformer();
+     *
+     * @param factory
+     * @return
+     */
+    /**
+     * Security is enabled, use new feature: enableExtensionFunctions Use the
+     * template to create a transformer
+     */
+    public void testTemplatesEnableExtFunc() {
+        Policy p = new SimplePolicy(new AllPermission());
+        Policy.setPolicy(p);
+        System.setSecurityManager(new SecurityManager());
+        TransformerFactory factory = TransformerFactory.newInstance();
+
+        /**
+         * Use of the extension function 'http://exslt.org/strings:tokenize' is
+         * not allowed when the secure processing feature is set to true.
+         * Attempt to use the new property to enable extension function
+         */
+        boolean isExtensionSupported = enableExtensionFunction(factory);
+
+        try {
+            SAXSource xslSource = new SAXSource(new InputSource(xslFile));
+            xslSource.setSystemId(xslFileId);
+            Templates template = factory.newTemplates(xslSource);
+            Transformer transformer = template.newTransformer();
+            StringWriter stringResult = new StringWriter();
+            Result result = new StreamResult(stringResult);
+            transformer.transform(new SAXSource(new InputSource(xmlFile)), result);
+            System.out.println("testTemplatesEnableExtFunc: OK");
+        } catch (TransformerConfigurationException e) {
+            fail(e.getMessage());
+        } catch (TransformerException e) {
+            fail(e.getMessage());
+        } finally {
+            System.setSecurityManager(null);
+        }
+    }
+
+    boolean enableExtensionFunction(TransformerFactory factory) {
+        boolean isSupported = true;
+        try {
+            factory.setFeature(ENABLE_EXTENSION_FUNCTIONS, true);
+        } catch (TransformerConfigurationException ex) {
+            isSupported = false;
+        }
+        return isSupported;
+    }
+
+    void transform(TransformerFactory factory) throws TransformerConfigurationException, TransformerException {
+        SAXSource xslSource = new SAXSource(new InputSource(xslFile));
+        xslSource.setSystemId(xslFileId);
+        Transformer transformer = factory.newTransformer(xslSource);
+        StringWriter stringResult = new StringWriter();
+        Result result = new StreamResult(stringResult);
+        transformer.transform(new SAXSource(new InputSource(xmlFile)), result);
+    }
+
+    class SimplePolicy extends Policy {
+
+        private final Permissions perms;
+
+        public SimplePolicy(Permission... permissions) {
+            perms = new Permissions();
+            for (Permission permission : permissions) {
+                perms.add(permission);
+            }
+        }
+
+        @Override
+        public PermissionCollection getPermissions(CodeSource cs) {
+            return perms;
+        }
+
+        @Override
+        public PermissionCollection getPermissions(ProtectionDomain pd) {
+            return perms;
+        }
+
+        @Override
+        public boolean implies(ProtectionDomain pd, Permission p) {
+            return perms.implies(p);
+        }
+
+        //for older jdk
+        @Override
+        public void refresh() {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/transform/jdk8004476/tokenize.xml	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html>
+<a>
+   <b>Is this EXSLT? No. no</b>
+   <c>Is this EXSLT? No. no</c>
+</a>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/jaxp/transform/jdk8004476/tokenize.xsl	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:str="http://exslt.org/strings"
+                xmlns:xalan="http://xml.apache.org/xalan"
+                version="1.0">
+<xsl:template match="a">
+   <xsl:apply-templates />
+</xsl:template>
+<xsl:template match="//a/c">
+   <xsl:value-of select="." />
+ -
+      <xsl:value-of select="str:tokenize(string(.), ' ')" />
+   <xsl:value-of select="str:tokenize(string(.), '')" />
+   <xsl:for-each select="str:tokenize(string(.), ' ')">
+      <xsl:value-of select="." />
+   </xsl:for-each>
+   <xsl:apply-templates select="*" />
+</xsl:template>
+<xsl:template match="//a/b">
+   <xsl:value-of select="." />
+ -
+      <xsl:value-of select="xalan:tokenize(string(.), ' ')" />
+   <xsl:value-of select="xalan:tokenize(string(.), '')" />
+   <xsl:for-each select="xalan:tokenize(string(.), ' ')">
+      <xsl:value-of select="." />
+   </xsl:for-each>
+   <xsl:apply-templates select="*" />
+</xsl:template>
+
+</xsl:stylesheet>
--- a/jdk/test/javax/xml/ws/clientjar/TestWsImport.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/javax/xml/ws/clientjar/TestWsImport.java	Mon Nov 11 16:20:48 2013 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8016271
+ * @bug 8016271 8026405
  * @summary wsimport -clientjar does not create portable jar on windows due to hardcoded '\'
  * @run main/othervm TestWsImport
  */
@@ -77,14 +77,14 @@
             String address = "http://localhost:" + port + "/hello";
 
             Service service = Service.create(new URL(address + "?wsdl"),
-                new QName("http://test/jaxws/sample/",
-                "TestService"));
+                new QName("http://test/jaxws/sample/", "TestService"));
 
             String[] wsargs = {
                 wsimport,
                 "-p",
                 "wstest",
                 "-J-Djavax.xml.accessExternalSchema=all",
+                "-J-Dcom.sun.tools.internal.ws.Invoker.noSystemProxies=true",
                 address + "?wsdl",
                 "-clientjar",
                 "wsjar.jar"
--- a/jdk/test/jdk/lambda/vm/DefaultMethodsTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,637 +0,0 @@
-/*
- * 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.
- */
-
-package vm;
-
-import java.lang.reflect.*;
-import java.util.*;
-import java.io.File;
-import java.io.IOException;
-
-import org.testng.annotations.Test;
-import separate.*;
-import separate.Compiler;
-
-import static org.testng.Assert.*;
-import static separate.SourceModel.*;
-import static separate.SourceModel.Class;
-
-@Test(groups = "vm")
-public class DefaultMethodsTest extends TestHarness {
-    public DefaultMethodsTest() {
-        super(false, false);
-    }
-
-    /**
-     * class C { public int m() { return 22; } }
-     *
-     * TEST: C c = new C(); c.m() == 22
-     */
-    public void testHarnessInvokeVirtual() {
-        Class C = new Class("C", ConcreteMethod.std("22"));
-        assertInvokeVirtualEquals(22, C);
-    }
-
-    /**
-     * interface I { int m(); }
-     * class C implements I { public int m() { return 33; } }
-     *
-     * TEST: I i = new C(); i.m() == 33;
-     */
-    public void testHarnessInvokeInterface() {
-        Interface I = new Interface("I", AbstractMethod.std());
-        Class C = new Class("C", I, ConcreteMethod.std("33"));
-        assertInvokeInterfaceEquals(33, C, I);
-    }
-
-    /**
-     * class C {}
-     *
-     * TEST: C c = new C(); c.m() throws NoSuchMethod
-     */
-    public void testHarnessThrows() {
-        Class C = new Class("C");
-        assertThrows(NoSuchMethodError.class, C);
-    }
-
-    /**
-     * interface I { int m() default { return 44; } }
-     * class C implements I {}
-     *
-     * TEST: C c = new C(); c.m() == 44;
-     * TEST: I i = new C(); i.m() == 44;
-     */
-    public void testBasicDefault() {
-        Interface I = new Interface("I", DefaultMethod.std("44"));
-        Class C = new Class("C", I);
-
-        assertInvokeVirtualEquals(44, C);
-        assertInvokeInterfaceEquals(44, C, I);
-    }
-
-    /**
-     * interface I { default int m() { return 44; } }
-     * interface J extends I {}
-     * interface K extends J {}
-     * class C implements K {}
-     *
-     * TEST: C c = new C(); c.m() == 44;
-     * TEST: I i = new C(); i.m() == 44;
-     */
-    public void testFarDefault() {
-        Interface I = new Interface("I", DefaultMethod.std("44"));
-        Interface J = new Interface("J", I);
-        Interface K = new Interface("K", J);
-        Class C = new Class("C", K);
-
-        assertInvokeVirtualEquals(44, C);
-        assertInvokeInterfaceEquals(44, C, K);
-    }
-
-    /**
-     * interface I { int m(); }
-     * interface J extends I { default int m() { return 44; } }
-     * interface K extends J {}
-     * class C implements K {}
-     *
-     * TEST: C c = new C(); c.m() == 44;
-     * TEST: K k = new C(); k.m() == 44;
-     */
-    public void testOverrideAbstract() {
-        Interface I = new Interface("I", AbstractMethod.std());
-        Interface J = new Interface("J", I, DefaultMethod.std("44"));
-        Interface K = new Interface("K", J);
-        Class C = new Class("C", K);
-
-        assertInvokeVirtualEquals(44, C);
-        assertInvokeInterfaceEquals(44, C, K);
-    }
-
-    /**
-     * interface I { int m() default { return 44; } }
-     * class C implements I { public int m() { return 55; } }
-     *
-     * TEST: C c = new C(); c.m() == 55;
-     * TEST: I i = new C(); i.m() == 55;
-     */
-    public void testExisting() {
-        Interface I = new Interface("I", DefaultMethod.std("44"));
-        Class C = new Class("C", I, ConcreteMethod.std("55"));
-
-        assertInvokeVirtualEquals(55, C);
-        assertInvokeInterfaceEquals(55, C, I);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * class B implements I {}
-     * class C extends B {}
-     *
-     * TEST: C c = new C(); c.m() == 99;
-     * TEST: I i = new C(); i.m() == 99;
-     */
-    public void testInherited() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Class B = new Class("B", I);
-        Class C = new Class("C", B);
-
-        assertInvokeVirtualEquals(99, C);
-        assertInvokeInterfaceEquals(99, C, I);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * class C { public int m() { return 11; } }
-     * class D extends C implements I {}
-     *
-     * TEST: D d = new D(); d.m() == 11;
-     * TEST: I i = new D(); i.m() == 11;
-     */
-    public void testExistingInherited() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Class C = new Class("C", ConcreteMethod.std("11"));
-        Class D = new Class("D", C, I);
-
-        assertInvokeVirtualEquals(11, D);
-        assertInvokeInterfaceEquals(11, D, I);
-    }
-
-    /**
-     * interface I { default int m() { return 44; } }
-     * class C implements I { public int m() { return 11; } }
-     * class D extends C { public int m() { return 22; } }
-     *
-     * TEST: D d = new D(); d.m() == 22;
-     * TEST: I i = new D(); i.m() == 22;
-     */
-    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"));
-
-        assertInvokeVirtualEquals(22, D);
-        assertInvokeInterfaceEquals(22, D, I);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * interface J { defaultint m() { return 88; } }
-     * class C implements I { public int m() { return 11; } }
-     * class D extends C { public int m() { return 22; } }
-     * class E extends D implements J {}
-     *
-     * TEST: E e = new E(); e.m() == 22;
-     * TEST: J j = new E(); j.m() == 22;
-     */
-    public void testExistingInheritedPlusDefault() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Interface J = new Interface("J", DefaultMethod.std("88"));
-        Class C = new Class("C", I, ConcreteMethod.std("11"));
-        Class D = new Class("D", C, ConcreteMethod.std("22"));
-        Class E = new Class("E", D, J);
-
-        assertInvokeVirtualEquals(22, E);
-        assertInvokeInterfaceEquals(22, E, J);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * class B implements I {}
-     * class C extends B { public int m() { return 77; } }
-     *
-     * TEST: C c = new C(); c.m() == 77;
-     * TEST: I i = new C(); i.m() == 77;
-     */
-    public void testInheritedWithConcrete() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Class B = new Class("B", I);
-        Class C = new Class("C", B, ConcreteMethod.std("77"));
-
-        assertInvokeVirtualEquals(77, C);
-        assertInvokeInterfaceEquals(77, C, I);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * class B implements I {}
-     * class C extends B implements I { public int m() { return 66; } }
-     *
-     * TEST: C c = new C(); c.m() == 66;
-     * TEST: I i = new C(); i.m() == 66;
-     */
-    public void testInheritedWithConcreteAndImpl() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Class B = new Class("B", I);
-        Class C = new Class("C", B, I, ConcreteMethod.std("66"));
-
-        assertInvokeVirtualEquals(66, C);
-        assertInvokeInterfaceEquals(66, C, I);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * interface J { default int m() { return 88; } }
-     * class C implements I, J {}
-     *
-     * TEST: C c = new C(); c.m() throws AME
-     */
-    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);
-    }
-
-    /**
-     * interface I { int m(); }
-     * interface J { default int m() { return 88; } }
-     * class C implements I, J {}
-     *
-     * TEST: C c = new C(); c.m() throws AME
-     */
-    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);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * interface J extends I { }
-     * interface K extends I { }
-     * class C implements J, K {}
-     *
-     * TEST: C c = new C(); c.m() == 99
-     * TEST: J j = new C(); j.m() == 99
-     * TEST: K k = new C(); k.m() == 99
-     * TEST: I i = new C(); i.m() == 99
-     */
-    public void testDiamond() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Interface J = new Interface("J", I);
-        Interface K = new Interface("K", I);
-        Class C = new Class("C", J, K);
-
-        assertInvokeVirtualEquals(99, C);
-        assertInvokeInterfaceEquals(99, C, J);
-        assertInvokeInterfaceEquals(99, C, K);
-        assertInvokeInterfaceEquals(99, C, I);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * interface J extends I { }
-     * interface K extends I { }
-     * interface L extends I { }
-     * interface M extends I { }
-     * class C implements I, J, K, L, M {}
-     *
-     * TEST: C c = new C(); c.m() == 99
-     * TEST: J j = new C(); j.m() == 99
-     * TEST: K k = new C(); k.m() == 99
-     * TEST: I i = new C(); i.m() == 99
-     * TEST: L l = new C(); l.m() == 99
-     * TEST: M m = new C(); m.m() == 99
-     */
-    public void testExpandedDiamond() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Interface J = new Interface("J", I);
-        Interface K = new Interface("K", I);
-        Interface L = new Interface("L", I);
-        Interface M = new Interface("M", L);
-        Class C = new Class("C", I, J, K, L, M);
-
-        assertInvokeVirtualEquals(99, C);
-        assertInvokeInterfaceEquals(99, C, J);
-        assertInvokeInterfaceEquals(99, C, K);
-        assertInvokeInterfaceEquals(99, C, I);
-        assertInvokeInterfaceEquals(99, C, L);
-        assertInvokeInterfaceEquals(99, C, M);
-    }
-
-    /**
-     * interface I { int m() default { return 99; } }
-     * interface J extends I { int m(); }
-     * class C implements J {}
-     *
-     * TEST: C c = new C(); c.m() throws AME
-     */
-    public void testReabstract() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Interface J = new Interface("J", I, AbstractMethod.std());
-        Class C = new Class("C", J);
-
-        assertThrows(AbstractMethodError.class, C);
-    }
-
-    /**
-     * interface I { default int m() { return 88; } }
-     * interface J extends I { default int m() { return 99; } }
-     * class C implements J {}
-     *
-     * TEST: C c = new C(); c.m() == 99;
-     * TEST: J j = new C(); j.m() == 99;
-     * TEST: I i = new C(); i.m() == 99;
-     */
-    public void testShadow() {
-        Interface I = new Interface("I", DefaultMethod.std("88"));
-        Interface J = new Interface("J", I, DefaultMethod.std("99"));
-        Class C = new Class("C", J);
-
-        assertInvokeVirtualEquals(99, C);
-        assertInvokeInterfaceEquals(99, C, J);
-        assertInvokeInterfaceEquals(99, C, I);
-    }
-
-    /**
-     * interface I { default int m() { return 88; } }
-     * interface J extends I { default int m() { return 99; } }
-     * class C implements I, J {}
-     *
-     * TEST: C c = new C(); c.m() == 99;
-     * TEST: J j = new C(); j.m() == 99;
-     * TEST: I i = new C(); i.m() == 99;
-     */
-    public void testDisqualified() {
-        Interface I = new Interface("I", DefaultMethod.std("88"));
-        Interface J = new Interface("J", I, DefaultMethod.std("99"));
-        Class C = new Class("C", I, J);
-
-        assertInvokeVirtualEquals(99, C);
-        assertInvokeInterfaceEquals(99, C, J);
-        assertInvokeInterfaceEquals(99, C, I);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * class C implements I {}
-     *
-     * TEST: C.class.getMethod("m").invoke(new C()) == 99
-     */
-    public void testReflectCall() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        //workaround accessibility issue when loading C with DirectedClassLoader
-        I.addAccessFlag(AccessFlag.PUBLIC);
-        Class C = new Class("C", I);
-
-        Compiler.Flags[] flags = this.verbose ?
-            new Compiler.Flags[] { Compiler.Flags.VERBOSE } :
-            new Compiler.Flags[] {};
-        Compiler compiler = new Compiler(flags);
-        java.lang.Class<?> cls = null;
-        try {
-            cls = compiler.compileAndLoad(C);
-        } catch (ClassNotFoundException e) {
-            fail("Could not load class");
-        }
-
-        java.lang.reflect.Method method = null;
-        try {
-            method = cls.getMethod(stdMethodName);
-        } catch (NoSuchMethodException e) {
-            fail("Could not find method in class");
-        }
-        assertNotNull(method);
-
-        Object c = null;
-        try {
-            c = cls.newInstance();
-        } catch (InstantiationException | IllegalAccessException e) {
-            fail("Could not create instance of class");
-        }
-        assertNotNull(c);
-
-        Integer res = null;
-        try {
-            res = (Integer)method.invoke(c);
-        } catch (IllegalAccessException |
-                 java.lang.reflect.InvocationTargetException e) {
-            fail("Could not invoke default instance method");
-        }
-        assertNotNull(res);
-
-        assertEquals(res.intValue(), 99);
-
-        compiler.cleanup();
-    }
-
-
-    /**
-     * interface J { default int m() { return 88; } }
-     * interface I extends J { default int m() { return J.super.m(); } }
-     * class C implements I {}
-     *
-     * TEST: C c = new C(); c.m() == 88;
-     * 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();"));
-        I.addCompilationDependency(J.findMethod(stdMethodName));
-        Class C = new Class("C", I);
-
-        assertInvokeVirtualEquals(88, C);
-        assertInvokeInterfaceEquals(88, C, I);
-    }
-
-    /**
-     * interface K { int m() default { return 99; } }
-     * interface L { int m() default { return 101; } }
-     * interface J extends K, L {}
-     * 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
-     */
-    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);
-        Interface I = new Interface("I", J, K, new DefaultMethod(
-            "int", stdMethodName, "return J.super.m();"));
-        Interface Jstub = new Interface("J", DefaultMethod.std("-1"));
-        I.addCompilationDependency(Jstub);
-        I.addCompilationDependency(Jstub.findMethod(stdMethodName));
-        Class C = new Class("C", I);
-
-        assertThrows(AbstractMethodError.class, C);
-    }
-
-    /**
-     * interface I { default int m() { return 99; } }
-     * 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
-     */
-    public void testSuperDisqual() {
-        Interface I = new Interface("I", DefaultMethod.std("99"));
-        Interface J = new Interface("J", I, DefaultMethod.std("55"));
-        Class C = new Class("C", I, J,
-            new ConcreteMethod("int", stdMethodName, "return I.super.m();",
-                AccessFlag.PUBLIC));
-        C.addCompilationDependency(I.findMethod(stdMethodName));
-
-        assertThrows(AbstractMethodError.class, C);
-    }
-
-    /**
-     * interface J { int m(); }
-     * interface I extends J { default int m() { return J.super.m(); } }
-     * class C implements I {}
-     *
-     * TEST: C c = new C(); c.m() throws AME
-     * TODO: add case for I i = new C(); i.m() throws AME
-     */
-    public void testSuperNull() {
-        Interface J = new Interface("J", AbstractMethod.std());
-        Interface I = new Interface("I", J, new DefaultMethod(
-            "int", stdMethodName, "return J.super.m();"));
-        Interface Jstub = new Interface("J", DefaultMethod.std("99"));
-        I.addCompilationDependency(Jstub);
-        I.addCompilationDependency(Jstub.findMethod(stdMethodName));
-        Class C = new Class("C", I);
-
-        assertThrows(AbstractMethodError.class, C);
-    }
-
-    /**
-     * interface J<T> { default int m(T t) { return 88; } }
-     * interface I extends J<String> {
-     *     int m(String s) default { return J.super.m(); }
-     * }
-     * class C implements I {}
-     *
-     * TEST: I i = new C(); i.m("") == 88;
-     */
-    public void testSuperGeneric() {
-        Interface J = new Interface("J", new TypeParameter("T"),
-            new DefaultMethod("int", stdMethodName, "return 88;",
-                new MethodParameter("T", "t")));
-        Interface I = new Interface("I", J.with("String"),
-            new DefaultMethod("int", stdMethodName, "return J.super.m(s);",
-                new MethodParameter("String", "s")));
-        I.addCompilationDependency(J.findMethod(stdMethodName));
-        Class C = new Class("C", I);
-
-        AbstractMethod pm = new AbstractMethod("int", stdMethodName,
-            new MethodParameter("String", "s"));
-
-        assertInvokeInterfaceEquals(
-            new Integer(88), C, new Extends(I), pm, "\"\"");
-    }
-
-    /**
-     * interface I<T> { int m(T t) default { return 44; } }
-     * interface J extends I<String> { int m(String s) default { return 55; } }
-     * class C implements I<String>, J {
-     *     public int m(String s) { return I.super.m(s); }
-     * }
-     *
-     * TEST: C c = new C(); c.m("string") throws AME
-     */
-    public void testSuperGenericDisqual() {
-        MethodParameter t = new MethodParameter("T", "t");
-        MethodParameter s = new MethodParameter("String", "s");
-
-        Interface I = new Interface("I", new TypeParameter("T"),
-            new DefaultMethod("int", stdMethodName, "return 44;", t));
-        Interface J = new Interface("J", I.with("String"),
-            new DefaultMethod("int", stdMethodName, "return 55;", s));
-        Class C = new Class("C", I.with("String"), J,
-            new ConcreteMethod("int", stdMethodName,
-                "return I.super.m(s);", AccessFlag.PUBLIC, s));
-        C.addCompilationDependency(I.findMethod(stdMethodName));
-
-        assertThrows(AbstractMethodError.class, C,
-            new ConcreteMethod(
-                "int", stdMethodName, "return -1;", AccessFlag.PUBLIC, s),
-            "-1", "\"string\"");
-    }
-
-    /**
-     * interface I { default Integer m() { return new Integer(88); } }
-     * class C { int m() { return 99; } }
-     * class D extends C implements I {}
-     * class S { Object foo() { return (new D()).m(); } // link sig: ()LInteger;
-     * TEST: S s = new S(); s.foo() == new Integer(88)
-     */
-    public void testNoCovarNoBridge() {
-        Interface I = new Interface("I", new DefaultMethod(
-            "Integer", "m", "return new Integer(88);"));
-        Class C = new Class("C", new ConcreteMethod(
-            "int", "m", "return 99;", AccessFlag.PUBLIC));
-        Class D = new Class("D", I, C);
-
-        ConcreteMethod DstubMethod = new ConcreteMethod(
-            "Integer", "m", "return null;", AccessFlag.PUBLIC);
-        Class Dstub = new Class("D", DstubMethod);
-
-        ConcreteMethod toCall = new ConcreteMethod(
-            "Object", "foo", "return (new D()).m();", AccessFlag.PUBLIC);
-        Class S = new Class("S", D, toCall);
-        S.addCompilationDependency(Dstub);
-        S.addCompilationDependency(DstubMethod);
-
-        assertInvokeVirtualEquals(new Integer(88), S, toCall, "null");
-    }
-
-    /**
-     * interface J { int m(); }
-     * interface I extends J { default int m() { return 99; } }
-     * class B implements J {}
-     * class C extends B implements I {}
-     * TEST: C c = new C(); c.m() == 99
-     *
-     * The point of this test is that B does not get default method analysis,
-     * and C does not generate any new miranda methods in the vtable.
-     * It verifies that default method analysis occurs when mirandas have been
-     * inherited and the supertypes don't have any overpass methods.
-     */
-    public void testNoNewMiranda() {
-        Interface J = new Interface("J", AbstractMethod.std());
-        Interface I = new Interface("I", J, DefaultMethod.std("99"));
-        Class B = new Class("B", J);
-        Class C = new Class("C", B, I);
-        assertInvokeVirtualEquals(99, C);
-    }
-
-    public void testStrictfpDefault() {
-        try {
-            java.lang.Class.forName("vm.StrictfpDefault");
-        } catch (Exception e) {
-            fail("Could not load class", e);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Asserts.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,395 @@
+/*
+ * 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 jdk.testlibrary;
+
+/**
+ * Asserts that can be used for verifying assumptions in tests.
+ *
+ * An assertion will throw a {@link RuntimeException} if the assertion isn't
+ * valid.  All the asserts can be imported into a test by using a static
+ * import:
+ *
+ * <pre>
+ * {@code
+ * import static com.oracle.java.testlibrary.Asserts.*;
+ * }
+ *
+ * Always provide a message describing the assumption if the line number of the
+ * failing assertion isn't enough to understand why the assumption failed. For
+ * example, if the assertion is in a loop or in a method that is called
+ * multiple times, then the line number won't provide enough context to
+ * understand the failure.
+ * </pre>
+ */
+public class Asserts {
+
+    /**
+     * Shorthand for {@link #assertLessThan(T, T)}.
+     *
+     * @see #assertLessThan(T, T)
+     */
+    public static <T extends Comparable<T>> void assertLT(T lhs, T rhs) {
+        assertLessThan(lhs, rhs);
+    }
+
+    /**
+     * Shorthand for {@link #assertLessThan(T, T, String)}.
+     *
+     * @see #assertLessThan(T, T, String)
+     */
+    public static <T extends Comparable<T>> void assertLT(T lhs, T rhs, String msg) {
+        assertLessThan(lhs, rhs, msg);
+    }
+
+    /**
+     * Calls {@link #assertLessThan(T, T, String)} with a default message.
+     *
+     * @see #assertLessThan(T, T, String)
+     */
+    public static <T extends Comparable<T>> void assertLessThan(T lhs, T rhs) {
+        String msg = "Expected that " + format(lhs) + " < " + format(rhs);
+        assertLessThan(lhs, rhs, msg);
+    }
+
+    /**
+     * Asserts that {@code lhs} is less than {@code rhs}.
+     *
+     * @param lhs The left hand side of the comparison.
+     * @param rhs The right hand side of the comparison.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static <T extends Comparable<T>>void assertLessThan(T lhs, T rhs, String msg) {
+        assertTrue(compare(lhs, rhs, msg) < 0, msg);
+    }
+
+    /**
+     * Shorthand for {@link #assertLessThanOrEqual(T, T)}.
+     *
+     * @see #assertLessThanOrEqual(T, T)
+     */
+    public static <T extends Comparable<T>> void assertLTE(T lhs, T rhs) {
+        assertLessThanOrEqual(lhs, rhs);
+    }
+
+    /**
+     * Shorthand for {@link #assertLessThanOrEqual(T, T, String)}.
+     *
+     * @see #assertLessThanOrEqual(T, T, String)
+     */
+    public static <T extends Comparable<T>> void assertLTE(T lhs, T rhs, String msg) {
+        assertLessThanOrEqual(lhs, rhs, msg);
+    }
+
+    /**
+     * Calls {@link #assertLessThanOrEqual(T, T, String)} with a default message.
+     *
+     * @see #assertLessThanOrEqual(T, T, String)
+     */
+    public static <T extends Comparable<T>> void assertLessThanOrEqual(T lhs, T rhs) {
+        String msg = "Expected that " + format(lhs) + " <= " + format(rhs);
+        assertLessThanOrEqual(lhs, rhs, msg);
+    }
+
+    /**
+     * Asserts that {@code lhs} is less than or equal to {@code rhs}.
+     *
+     * @param lhs The left hand side of the comparison.
+     * @param rhs The right hand side of the comparison.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static <T extends Comparable<T>> void assertLessThanOrEqual(T lhs, T rhs, String msg) {
+        assertTrue(compare(lhs, rhs, msg) <= 0, msg);
+    }
+
+    /**
+     * Shorthand for {@link #assertEquals(T, T)}.
+     *
+     * @see #assertEquals(T, T)
+     */
+    public static void assertEQ(Object lhs, Object rhs) {
+        assertEquals(lhs, rhs);
+    }
+
+    /**
+     * Shorthand for {@link #assertEquals(T, T, String)}.
+     *
+     * @see #assertEquals(T, T, String)
+     */
+    public static void assertEQ(Object lhs, Object rhs, String msg) {
+        assertEquals(lhs, rhs, msg);
+    }
+
+    /**
+     * Calls {@link #assertEquals(T, T, String)} with a default message.
+     *
+     * @see #assertEquals(T, T, String)
+     */
+    public static void assertEquals(Object lhs, Object rhs) {
+        String msg = "Expected " + format(lhs) + " to equal " + format(rhs);
+        assertEquals(lhs, rhs, msg);
+    }
+
+    /**
+     * Asserts that {@code lhs} is equal to {@code rhs}.
+     *
+     * @param lhs The left hand side of the comparison.
+     * @param rhs The right hand side of the comparison.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static void assertEquals(Object lhs, Object rhs, String msg) {
+        if (lhs == null) {
+            if (rhs != null) {
+                error(msg);
+            }
+        } else {
+            assertTrue(lhs.equals(rhs), msg);
+        }
+    }
+
+    /**
+     * Shorthand for {@link #assertGreaterThanOrEqual(T, T)}.
+     *
+     * @see #assertGreaterThanOrEqual(T, T)
+     */
+    public static <T extends Comparable<T>> void assertGTE(T lhs, T rhs) {
+        assertGreaterThanOrEqual(lhs, rhs);
+    }
+
+    /**
+     * Shorthand for {@link #assertGreaterThanOrEqual(T, T, String)}.
+     *
+     * @see #assertGreaterThanOrEqual(T, T, String)
+     */
+    public static <T extends Comparable<T>> void assertGTE(T lhs, T rhs, String msg) {
+        assertGreaterThanOrEqual(lhs, rhs, msg);
+    }
+
+    /**
+     * Calls {@link #assertGreaterThanOrEqual(T, T, String)} with a default message.
+     *
+     * @see #assertGreaterThanOrEqual(T, T, String)
+     */
+    public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T lhs, T rhs) {
+        String msg = "Expected that " + format(lhs) + " >= " + format(rhs);
+        assertGreaterThanOrEqual(lhs, rhs, msg);
+    }
+
+    /**
+     * Asserts that {@code lhs} is greater than or equal to {@code rhs}.
+     *
+     * @param lhs The left hand side of the comparison.
+     * @param rhs The right hand side of the comparison.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T lhs, T rhs, String msg) {
+        assertTrue(compare(lhs, rhs, msg) >= 0, msg);
+    }
+
+    /**
+     * Shorthand for {@link #assertGreaterThan(T, T)}.
+     *
+     * @see #assertGreaterThan(T, T)
+     */
+    public static <T extends Comparable<T>> void assertGT(T lhs, T rhs) {
+        assertGreaterThan(lhs, rhs);
+    }
+
+    /**
+     * Shorthand for {@link #assertGreaterThan(T, T, String)}.
+     *
+     * @see #assertGreaterThan(T, T, String)
+     */
+    public static <T extends Comparable<T>> void assertGT(T lhs, T rhs, String msg) {
+        assertGreaterThan(lhs, rhs, msg);
+    }
+
+    /**
+     * Calls {@link #assertGreaterThan(T, T, String)} with a default message.
+     *
+     * @see #assertGreaterThan(T, T, String)
+     */
+    public static <T extends Comparable<T>> void assertGreaterThan(T lhs, T rhs) {
+        String msg = "Expected that " + format(lhs) + " > " + format(rhs);
+        assertGreaterThan(lhs, rhs, msg);
+    }
+
+    /**
+     * Asserts that {@code lhs} is greater than {@code rhs}.
+     *
+     * @param lhs The left hand side of the comparison.
+     * @param rhs The right hand side of the comparison.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static <T extends Comparable<T>> void assertGreaterThan(T lhs, T rhs, String msg) {
+        assertTrue(compare(lhs, rhs, msg) > 0, msg);
+    }
+
+    /**
+     * Shorthand for {@link #assertNotEquals(T, T)}.
+     *
+     * @see #assertNotEquals(T, T)
+     */
+    public static void assertNE(Object lhs, Object rhs) {
+        assertNotEquals(lhs, rhs);
+    }
+
+    /**
+     * Shorthand for {@link #assertNotEquals(T, T, String)}.
+     *
+     * @see #assertNotEquals(T, T, String)
+     */
+    public static void assertNE(Object lhs, Object rhs, String msg) {
+        assertNotEquals(lhs, rhs, msg);
+    }
+
+    /**
+     * Calls {@link #assertNotEquals(T, T, String)} with a default message.
+     *
+     * @see #assertNotEquals(T, T, String)
+     */
+    public static void assertNotEquals(Object lhs, Object rhs) {
+        String msg = "Expected " + format(lhs) + " to not equal " + format(rhs);
+        assertNotEquals(lhs, rhs, msg);
+    }
+
+    /**
+     * Asserts that {@code lhs} is not equal to {@code rhs}.
+     *
+     * @param lhs The left hand side of the comparison.
+     * @param rhs The right hand side of the comparison.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static void assertNotEquals(Object lhs, Object rhs, String msg) {
+        if (lhs == null) {
+            if (rhs == null) {
+                error(msg);
+            }
+        } else {
+            assertFalse(lhs.equals(rhs), msg);
+        }
+    }
+
+    /**
+     * Calls {@link #assertNull(Object, String)} with a default message.
+     *
+     * @see #assertNull(Object, String)
+     */
+    public static void assertNull(Object o) {
+        assertNull(o, "Expected " + format(o) + " to be null");
+    }
+
+    /**
+     * Asserts that {@code o} is null.
+     *
+     * @param o The reference assumed to be null.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static void assertNull(Object o, String msg) {
+        assertEquals(o, null, msg);
+    }
+
+    /**
+     * Calls {@link #assertNotNull(Object, String)} with a default message.
+     *
+     * @see #assertNotNull(Object, String)
+     */
+    public static void assertNotNull(Object o) {
+        assertNotNull(o, "Expected non null reference");
+    }
+
+    /**
+     * Asserts that {@code o} is <i>not</i> null.
+     *
+     * @param o The reference assumed <i>not</i> to be null,
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static void assertNotNull(Object o, String msg) {
+        assertNotEquals(o, null, msg);
+    }
+
+    /**
+     * Calls {@link #assertFalse(boolean, String)} with a default message.
+     *
+     * @see #assertFalse(boolean, String)
+     */
+    public static void assertFalse(boolean value) {
+        assertFalse(value, "Expected value to be false");
+    }
+
+    /**
+     * Asserts that {@code value} is {@code false}.
+     *
+     * @param value The value assumed to be false.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static void assertFalse(boolean value, String msg) {
+        assertTrue(!value, msg);
+    }
+
+    /**
+     * Calls {@link #assertTrue(boolean, String)} with a default message.
+     *
+     * @see #assertTrue(boolean, String)
+     */
+    public static void assertTrue(boolean value) {
+        assertTrue(value, "Expected value to be true");
+    }
+
+    /**
+     * Asserts that {@code value} is {@code true}.
+     *
+     * @param value The value assumed to be true.
+     * @param msg A description of the assumption.
+     * @throws RuntimeException if the assertion isn't valid.
+     */
+    public static void assertTrue(boolean value, String msg) {
+        if (!value) {
+            error(msg);
+        }
+    }
+
+    private static <T extends Comparable<T>> int compare(T lhs, T rhs, String msg) {
+        assertNotNull(lhs, msg);
+        assertNotNull(rhs, msg);
+        return lhs.compareTo(rhs);
+    }
+
+    private static String format(Object o) {
+        return o == null? "null" : o.toString();
+    }
+
+    private static void error(String msg) {
+        throw new RuntimeException(msg);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/JDKToolFinder.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.testlibrary;
+
+import java.io.FileNotFoundException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public final class JDKToolFinder {
+
+    private JDKToolFinder() {
+    }
+
+    /**
+     * Returns the full path to an executable in jdk/bin based on System
+     * property {@code test.jdk} or {@code compile.jdk} (both are set by the jtreg test suite)
+     *
+     * @return Full path to an executable in jdk/bin
+     */
+    public static String getJDKTool(String tool) {
+
+        // First try to find the executable in test.jdk
+        try {
+            return getTool(tool, "test.jdk");
+        } catch (FileNotFoundException e) {
+
+        }
+
+        // Now see if it's available in compile.jdk
+        try {
+            return getTool(tool, "compile.jdk");
+        } catch (FileNotFoundException e) {
+            throw new RuntimeException("Failed to find " + tool +
+                    ", looked in test.jdk (" + System.getProperty("test.jdk") +
+                    ") and compile.jdk (" + System.getProperty("compile.jdk") + ")");
+        }
+    }
+
+    /**
+     * Returns the full path to an executable in jdk/bin based on System
+     * property {@code compile.jdk}
+     *
+     * @return Full path to an executable in jdk/bin
+     */
+    public static String getCompileJDKTool(String tool) {
+        try {
+            return getTool(tool, "compile.jdk");
+        } catch (FileNotFoundException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Returns the full path to an executable in jdk/bin based on System
+     * property {@code test.jdk}
+     *
+     * @return Full path to an executable in jdk/bin
+     */
+    public static String getTestJDKTool(String tool) {
+        try {
+            return getTool(tool, "test.jdk");
+        } catch (FileNotFoundException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static String getTool(String tool, String property) throws FileNotFoundException {
+        String jdkPath = System.getProperty(property);
+
+        if (jdkPath == null) {
+            throw new RuntimeException(
+                    "System property '" + property + "' not set. This property is normally set by jtreg. "
+                    + "When running test separately, set this property using '-D" + property + "=/path/to/jdk'.");
+        }
+
+        Path toolName = Paths.get("bin", tool + (Platform.isWindows() ? ".exe" : ""));
+
+        Path jdkTool = Paths.get(jdkPath, toolName.toString());
+        if (!jdkTool.toFile().exists()) {
+            throw new FileNotFoundException("Could not find file " + jdkTool.toAbsolutePath());
+        }
+
+        return jdkTool.toAbsolutePath().toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/JDKToolLauncher.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,134 @@
+/*
+ * 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 jdk.testlibrary;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A utility for constructing command lines for starting JDK tool processes.
+ *
+ * The JDKToolLauncher can in particular be combined with a
+ * java.lang.ProcessBuilder to easily run a JDK tool. For example, the following
+ * code run {@code jmap -heap} against a process with GC logging turned on for
+ * the {@code jmap} process:
+ *
+ * <pre>
+ * {@code
+ * JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
+ *                                       .addVMArg("-XX:+PrintGC");
+ *                                       .addVMArg("-XX:+PrintGCDetails")
+ *                                       .addToolArg("-heap")
+ *                                       .addToolArg(pid);
+ * ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
+ * Process p = pb.start();
+ * }
+ * </pre>
+ */
+public class JDKToolLauncher {
+    private final String executable;
+    private final List<String> vmArgs = new ArrayList<String>();
+    private final List<String> toolArgs = new ArrayList<String>();
+
+    private JDKToolLauncher(String tool, boolean useCompilerJDK) {
+        if (useCompilerJDK) {
+            executable = JDKToolFinder.getJDKTool(tool);
+        } else {
+            executable = JDKToolFinder.getTestJDKTool(tool);
+        }
+        vmArgs.addAll(Arrays.asList(ProcessTools.getPlatformSpecificVMArgs()));
+    }
+
+    /**
+     * Creates a new JDKToolLauncher for the specified tool. Using tools path
+     * from the compiler JDK.
+     *
+     * @param tool
+     *            The name of the tool
+     * @return A new JDKToolLauncher
+     */
+    public static JDKToolLauncher create(String tool) {
+        return new JDKToolLauncher(tool, true);
+    }
+
+    /**
+     * Creates a new JDKToolLauncher for the specified tool in the Tested JDK.
+     *
+     * @param tool
+     *            The name of the tool
+     *
+     * @return A new JDKToolLauncher
+     */
+    public static JDKToolLauncher createUsingTestJDK(String tool) {
+        return new JDKToolLauncher(tool, false);
+    }
+
+    /**
+     * Adds an argument to the JVM running the tool.
+     *
+     * The JVM arguments are passed to the underlying JVM running the tool.
+     * Arguments will automatically be prepended with "-J".
+     *
+     * Any platform specific arguments required for running the tool are
+     * automatically added.
+     *
+     *
+     * @param arg
+     *            The argument to VM running the tool
+     * @return The JDKToolLauncher instance
+     */
+    public JDKToolLauncher addVMArg(String arg) {
+        vmArgs.add(arg);
+        return this;
+    }
+
+    /**
+     * Adds an argument to the tool.
+     *
+     * @param arg
+     *            The argument to the tool
+     * @return The JDKToolLauncher instance
+     */
+    public JDKToolLauncher addToolArg(String arg) {
+        toolArgs.add(arg);
+        return this;
+    }
+
+    /**
+     * Returns the command that can be used for running the tool.
+     *
+     * @return An array whose elements are the arguments of the command.
+     */
+    public String[] getCommand() {
+        List<String> command = new ArrayList<String>();
+        command.add(executable);
+        // Add -J in front of all vmArgs
+        for (String arg : vmArgs) {
+            command.add("-J" + arg);
+        }
+        command.addAll(toolArgs);
+        return command.toArray(new String[command.size()]);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Platform.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.testlibrary;
+
+public class Platform {
+    private static final String osName      = System.getProperty("os.name");
+    private static final String dataModel   = System.getProperty("sun.arch.data.model");
+    private static final String vmVersion   = System.getProperty("java.vm.version");
+    private static final String osArch      = System.getProperty("os.arch");
+
+    public static boolean is32bit() {
+        return dataModel.equals("32");
+    }
+
+    public static boolean is64bit() {
+        return dataModel.equals("64");
+    }
+
+    public static boolean isSolaris() {
+        return isOs("sunos");
+    }
+
+    public static boolean isWindows() {
+        return isOs("win");
+    }
+
+    public static boolean isOSX() {
+        return isOs("mac");
+    }
+
+    public static boolean isLinux() {
+        return isOs("linux");
+    }
+
+    private static boolean isOs(String osname) {
+        return osName.toLowerCase().startsWith(osname.toLowerCase());
+    }
+
+    public static String getOsName() {
+        return osName;
+    }
+
+    public static boolean isDebugBuild() {
+        return vmVersion.toLowerCase().contains("debug");
+    }
+
+    public static String getVMVersion() {
+        return vmVersion;
+    }
+
+    // Returns true for sparc and sparcv9.
+    public static boolean isSparc() {
+        return isArch("sparc");
+    }
+
+    public static boolean isARM() {
+        return isArch("arm");
+    }
+
+    public static boolean isPPC() {
+        return isArch("ppc");
+    }
+
+    public static boolean isX86() {
+        // On Linux it's 'i386', Windows 'x86'
+        return (isArch("i386") || isArch("x86"));
+    }
+
+    public static boolean isX64() {
+        // On OSX it's 'x86_64' and on other (Linux, Windows and Solaris) platforms it's 'amd64'
+        return (isArch("amd64") || isArch("x86_64"));
+    }
+
+    private static boolean isArch(String archname) {
+        return osArch.toLowerCase().startsWith(archname.toLowerCase());
+    }
+
+    public static String getOsArch() {
+        return osArch;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,151 @@
+/*
+ * 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 jdk.testlibrary;
+
+import static jdk.testlibrary.Asserts.assertNotEquals;
+import static jdk.testlibrary.Asserts.assertTrue;
+
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * The helper class for starting and stopping {@link Process} in a separate thread.
+ */
+public class ProcessThread extends TestThread {
+
+    /**
+     * Creates a new {@code ProcessThread} object.
+     *
+     * @param cmd The list of program and its arguments to pass to {@link ProcessBuilder}
+     */
+    public ProcessThread(List<String> cmd) {
+        super(new ProcessRunnable(cmd));
+    }
+
+    /**
+     * Creates a new {@code ProcessThread} object.
+     *
+     * @param cmd The string array of program and its arguments to pass to {@link ProcessBuilder}
+     */
+    public ProcessThread(String... cmd) {
+        super(new ProcessRunnable(cmd));
+    }
+
+    /**
+     * Creates a new {@code ProcessThread} object.
+     *
+     * @param threadName The name of thread
+     * @param cmd The list of program and its arguments to pass to {@link ProcessBuilder}
+     */
+    public ProcessThread(String threadName, List<String> cmd) {
+        super(new ProcessRunnable(cmd), threadName);
+    }
+
+    /**
+     * Creates a new {@code ProcessThread} object.
+     *
+     * @param threadName The name of thread
+     * @param cmd The string array of program and its arguments to pass to {@link ProcessBuilder}
+     */
+    public ProcessThread(String threadName, String... cmd) {
+        super(new ProcessRunnable(cmd), threadName);
+    }
+
+    /**
+     * Stops {@link Process} started by {@code ProcessRunnable}.
+     *
+     * @throws InterruptedException
+     */
+    public void stopProcess() throws InterruptedException {
+        ((ProcessRunnable) getRunnable()).stopProcess();
+    }
+
+    /**
+     * {@link Runnable} interface for starting and stopping {@link Process}.
+     */
+    static class ProcessRunnable extends XRun {
+
+        private final ProcessBuilder processBuilder;
+        private final CountDownLatch latch;
+        private volatile Process process;
+
+        /**
+         * Creates a new {@code ProcessRunnable} object.
+         *
+         * @param cmd The list of program and its arguments to to pass to {@link ProcessBuilder}
+         */
+        public ProcessRunnable(List<String> cmd) {
+            super();
+            this.processBuilder = new ProcessBuilder(cmd);
+            this.latch = new CountDownLatch(1);
+        }
+
+        /**
+         * Creates a new {@code ProcessRunnable} object.
+         *
+         * @param cmd The string array of program and its arguments to to pass to {@link ProcessBuilder}
+         */
+        public ProcessRunnable(String... cmd) {
+            super();
+            this.processBuilder = new ProcessBuilder(cmd);
+            this.latch = new CountDownLatch(1);
+        }
+
+        /**
+         * Starts the process in {@code ProcessThread}.
+         * All exceptions which occurs here will be caught and stored in {@code ProcessThread}.
+         *
+         * see {@link XRun}
+         */
+        @Override
+        public void xrun() throws Throwable {
+            this.process = processBuilder.start();
+            // Release when process is started
+            latch.countDown();
+
+            // Will block...
+            OutputAnalyzer output = new OutputAnalyzer(this.process);
+
+            assertTrue(output.getOutput().isEmpty(), "Should get an empty output, got: "
+                        + Utils.NEW_LINE + output.getOutput());
+            assertNotEquals(output.getExitValue(), 0,
+                    "Process exited with unexpected exit code");
+        }
+
+        /**
+         * Stops the process.
+         *
+         * @throws InterruptedException
+         */
+        public void stopProcess() throws InterruptedException {
+            // Wait until process is started
+            latch.await();
+            if (this.process != null) {
+                this.process.destroy();
+            }
+        }
+
+    }
+
+}
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Mon Nov 11 16:20:48 2013 +0100
@@ -25,24 +25,127 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.io.PrintWriter;
 import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.Phaser;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.function.Predicate;
 
 import sun.management.VMManagement;
 
 public final class ProcessTools {
+    private static final class LineForwarder extends StreamPumper.LinePump {
+        private final PrintStream ps;
+        private final String prefix;
+        LineForwarder(String prefix, PrintStream os) {
+            this.ps = os;
+            this.prefix = prefix;
+        }
+        @Override
+        protected void processLine(String line) {
+            ps.println("[" + prefix + "] " + line);
+        }
+    }
 
     private ProcessTools() {
     }
 
     /**
+     * <p>Starts a process from its builder.</p>
+     * <span>The default redirects of STDOUT and STDERR are started</span>
+     * @param name The process name
+     * @param processBuilder The process builder
+     * @return Returns the initialized process
+     * @throws IOException
+     */
+    public static Process startProcess(String name,
+                                       ProcessBuilder processBuilder)
+    throws IOException {
+        Process p = null;
+        try {
+            p = startProcess(name, processBuilder, null, -1, TimeUnit.NANOSECONDS);
+        } catch (InterruptedException | TimeoutException e) {
+            // can't ever happen
+        }
+        return p;
+    }
+
+    /**
+     * <p>Starts a process from its builder.</p>
+     * <span>The default redirects of STDOUT and STDERR are started</span>
+     * <p>
+     * It is possible to wait for the process to get to a warmed-up state
+     * via {@linkplain Predicate} condition on the STDOUT
+     * </p>
+     * @param name The process name
+     * @param processBuilder The process builder
+     * @param linePredicate The {@linkplain Predicate} to use on the STDOUT
+     *                      Used to determine the moment the target app is
+     *                      properly warmed-up.
+     *                      It can be null - in that case the warmup is skipped.
+     * @param timeout The timeout for the warmup waiting
+     * @param unit The timeout {@linkplain TimeUnit}
+     * @return Returns the initialized {@linkplain Process}
+     * @throws IOException
+     * @throws InterruptedException
+     * @throws TimeoutException
+     */
+    public static Process startProcess(String name,
+                                       ProcessBuilder processBuilder,
+                                       final Predicate<String> linePredicate,
+                                       long timeout,
+                                       TimeUnit unit)
+    throws IOException, InterruptedException, TimeoutException {
+        Process p = processBuilder.start();
+        StreamPumper stdout = new StreamPumper(p.getInputStream());
+        StreamPumper stderr = new StreamPumper(p.getErrorStream());
+
+        stdout.addPump(new LineForwarder(name, System.out));
+        stderr.addPump(new LineForwarder(name, System.err));
+        final Phaser phs = new Phaser(1);
+        if (linePredicate != null) {
+            stdout.addPump(new StreamPumper.LinePump() {
+                @Override
+                protected void processLine(String line) {
+                    if (linePredicate.test(line)) {
+                        if (phs.getRegisteredParties() > 0) {
+                            phs.arriveAndDeregister();
+                        }
+                    }
+                }
+            });
+        }
+        Future<Void> stdoutTask = stdout.process();
+        Future<Void> stderrTask = stderr.process();
+
+        try {
+            if (timeout > -1) {
+                phs.awaitAdvanceInterruptibly(0, timeout, unit);
+            }
+        } catch (TimeoutException | InterruptedException e) {
+            stdoutTask.cancel(true);
+            stderrTask.cancel(true);
+            throw e;
+        }
+
+        return p;
+    }
+
+    /**
      * Pumps stdout and stderr from running the process into a String.
      *
-     * @param processHandler
+     * @param processBuilder
      *            ProcessHandler to run.
      * @return Output from process.
      * @throws IOException
@@ -69,22 +172,19 @@
                 stdoutBuffer);
         StreamPumper errPumper = new StreamPumper(process.getErrorStream(),
                 stderrBuffer);
-        Thread outPumperThread = new Thread(outPumper);
-        Thread errPumperThread = new Thread(errPumper);
 
-        outPumperThread.setDaemon(true);
-        errPumperThread.setDaemon(true);
-
-        outPumperThread.start();
-        errPumperThread.start();
+        Future<Void> outTask = outPumper.process();
+        Future<Void> errTask = errPumper.process();
 
         try {
             process.waitFor();
-            outPumperThread.join();
-            errPumperThread.join();
+            outTask.get();
+            errTask.get();
         } catch (InterruptedException e) {
             Thread.currentThread().interrupt();
             return null;
+        } catch (ExecutionException e) {
+            throw new IOException(e);
         }
 
         return new OutputBuffer(stdoutBuffer.toString(),
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/StreamPumper.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/StreamPumper.java	Mon Nov 11 16:20:48 2013 +0100
@@ -23,16 +23,65 @@
 
 package jdk.testlibrary;
 
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 import java.io.InputStream;
 import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 public final class StreamPumper implements Runnable {
 
     private static final int BUF_SIZE = 256;
 
-    private final OutputStream out;
+    /**
+     * Pump will be called by the StreamPumper to process the incoming data
+     */
+    abstract public static class Pump {
+        abstract void register(StreamPumper d);
+    }
+
+    /**
+     * OutputStream -> Pump adapter
+     */
+    final public static class StreamPump extends Pump {
+        private final OutputStream out;
+        public StreamPump(OutputStream out) {
+            this.out = out;
+        }
+
+        @Override
+        void register(StreamPumper sp) {
+            sp.addOutputStream(out);
+        }
+    }
+
+    /**
+     * Used to process the incoming data line-by-line
+     */
+    abstract public static class LinePump extends Pump {
+        @Override
+        final void register(StreamPumper sp) {
+            sp.addLineProcessor(this);
+        }
+
+        abstract protected void processLine(String line);
+    }
+
     private final InputStream in;
+    private final Set<OutputStream> outStreams = new HashSet<>();
+    private final Set<LinePump> linePumps = new HashSet<>();
+
+    private final AtomicBoolean processing = new AtomicBoolean(false);
+    private final FutureTask<Void> processingTask = new FutureTask(this, null);
+
+    public StreamPumper(InputStream in) {
+        this.in = in;
+    }
 
     /**
      * Create a StreamPumper that reads from in and writes to out.
@@ -43,8 +92,8 @@
      *            The stream to write to.
      */
     public StreamPumper(InputStream in, OutputStream out) {
-        this.in = in;
-        this.out = out;
+        this(in);
+        this.addOutputStream(out);
     }
 
     /**
@@ -54,25 +103,97 @@
      */
     @Override
     public void run() {
-        int length;
-        InputStream localIn = in;
-        OutputStream localOut = out;
-        byte[] buffer = new byte[BUF_SIZE];
+        try (BufferedInputStream is = new BufferedInputStream(in)) {
+            ByteArrayOutputStream lineBos = new ByteArrayOutputStream();
+            byte[] buf = new byte[BUF_SIZE];
+            int len = 0;
+            int linelen = 0;
+
+            while ((len = is.read(buf)) > 0 && !Thread.interrupted()) {
+                for(OutputStream out : outStreams) {
+                    out.write(buf, 0, len);
+                }
+                if (!linePumps.isEmpty()) {
+                    int i = 0;
+                    int lastcrlf = -1;
+                    while (i < len) {
+                        if (buf[i] == '\n' || buf[i] == '\r') {
+                            int bufLinelen = i - lastcrlf - 1;
+                            if (bufLinelen > 0) {
+                                lineBos.write(buf, lastcrlf + 1, bufLinelen);
+                            }
+                            linelen += bufLinelen;
 
-        try {
-            while ((length = localIn.read(buffer)) > 0 && !Thread.interrupted()) {
-                localOut.write(buffer, 0, length);
+                            if (linelen > 0) {
+                                lineBos.flush();
+                                final String line = lineBos.toString();
+                                linePumps.stream().forEach((lp) -> {
+                                    lp.processLine(line);
+                                });
+                                lineBos.reset();
+                                linelen = 0;
+                            }
+                            lastcrlf = i;
+                        }
+
+                        i++;
+                    }
+                    if (lastcrlf == -1) {
+                        lineBos.write(buf, 0, len);
+                        linelen += len;
+                    } else if (lastcrlf < len - 1) {
+                        lineBos.write(buf, lastcrlf + 1, len - lastcrlf - 1);
+                        linelen += len - lastcrlf - 1;
+                    }
+                }
             }
+
         } catch (IOException e) {
-            // Just abort if something like this happens.
             e.printStackTrace();
         } finally {
+            for(OutputStream out : outStreams) {
+                try {
+                    out.flush();
+                } catch (IOException e) {}
+            }
             try {
-                localOut.flush();
                 in.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
+            } catch (IOException e) {}
         }
     }
+
+    final void addOutputStream(OutputStream out) {
+        outStreams.add(out);
+    }
+
+    final void addLineProcessor(LinePump lp) {
+        linePumps.add(lp);
+    }
+
+    final public StreamPumper addPump(Pump ... pump) {
+        if (processing.get()) {
+            throw new IllegalStateException("Can not modify pumper while " +
+                                            "processing is in progress");
+        }
+        for(Pump p : pump) {
+            p.register(this);
+        }
+        return this;
+    }
+
+    final public Future<Void> process() {
+        if (!processing.compareAndSet(false, true)) {
+            throw new IllegalStateException("Can not re-run the processing");
+        }
+        Thread t = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                processingTask.run();
+            }
+        });
+        t.setDaemon(true);
+        t.start();
+
+        return processingTask;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/TestThread.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,249 @@
+/*
+ * 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 jdk.testlibrary;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadInfo;
+import java.lang.management.ThreadMXBean;
+import java.util.concurrent.TimeoutException;
+
+/**
+ * Thread which catches exceptions thrown during the execution
+ * and stores them for later analysis.
+ *
+ * <pre>
+ * {@code
+ * TestThread thread = new TestThread(new XRun() {
+ *      public void run() {
+ *      // do something
+ *      }
+ * });
+ * thread.start();
+ * // do something
+ * Throwable uncaught = thread.getUncaught();
+ * }
+ * </pre>
+ */
+public class TestThread extends Thread {
+
+    private final Runnable runnable;
+    private volatile Throwable uncaught;
+
+    /**
+     * Returns {@link Runnable} the thread has been created with.
+     *
+     * @return The object whose {@code run} method is called
+     */
+    public Runnable getRunnable() {
+        return runnable;
+    }
+
+    /**
+     * Creates a new {@code TestThread} object.
+     *
+     * @param target The object whose {@code run} method is called
+     * @param name The thread name
+     */
+    public TestThread(Runnable target, String name) {
+        super(target, name);
+        this.runnable = target;
+    }
+
+    /**
+     * Creates a new {@code TestThread} object.
+     *
+     * @param target The object whose {@code run} method is called
+     */
+    public TestThread(Runnable target) {
+        super(target);
+        this.runnable = target;
+    }
+
+    /**
+     * Creates a new {@code TestThread} object.
+     *
+     * @param group The thread group
+     * @param target The object whose {@code run} method is called
+     * @param name The thread name
+     * @param stackSize Stack size
+     */
+    public TestThread(ThreadGroup group, Runnable target, String name,
+            long stackSize) {
+        super(group, target, name, stackSize);
+        this.runnable = target;
+    }
+
+    /**
+     * Creates a new {@code TestThread} object.
+     *
+     * @param group The thread group
+     * @param target The object whose {@code run} method is called
+     * @param name The thread name
+     */
+    public TestThread(ThreadGroup group, Runnable target, String name) {
+        super(group, target, name);
+        this.runnable = target;
+    }
+
+    /**
+     * Creates a new {@code TestThread} object.
+     *
+     * @param group The thread group
+     * @param target The object whose {@code run} method is called
+     */
+    public TestThread(ThreadGroup group, Runnable target) {
+        super(group, target);
+        this.runnable = target;
+    }
+
+    /**
+     * The thread executor.
+     */
+    @Override
+    public void run() {
+        try {
+            super.run();
+        } catch (Throwable t) {
+            uncaught = t;
+        }
+    }
+
+    /**
+     * Returns exception caught during the execution.
+     *
+     * @return {@link Throwable}
+     */
+    public Throwable getUncaught() {
+        return uncaught;
+    }
+
+    /**
+     * Waits for {@link TestThread} to die
+     * and throws exception caught during the execution.
+     *
+     * @throws InterruptedException
+     * @throws Throwable
+     */
+    public void joinAndThrow() throws InterruptedException, Throwable {
+        join();
+        if (uncaught != null) {
+            throw uncaught;
+        }
+    }
+
+    /**
+     * Waits during {@code timeout} for {@link TestThread} to die
+     * and throws exception caught during the execution.
+     *
+     * @param timeout The time to wait in milliseconds
+     * @throws InterruptedException
+     * @throws Throwable
+     */
+    public void joinAndThrow(long timeout) throws InterruptedException,
+            Throwable {
+        join(timeout);
+        if (isAlive()) {
+            throw new TimeoutException();
+        }
+        if (uncaught != null) {
+            throw uncaught;
+        }
+    }
+
+    /**
+     * Waits for {@link TestThread} to die
+     * and returns exception caught during the execution.
+     *
+     * @return Exception caught during the execution
+     * @throws InterruptedException
+     */
+    public Throwable joinAndReturn() throws InterruptedException {
+        join();
+        if (uncaught != null) {
+            return uncaught;
+        }
+        return null;
+    }
+
+    /**
+     * Waits during {@code timeout} for {@link TestThread} to die
+     * and returns exception caught during the execution.
+     *
+     * @param timeout The time to wait in milliseconds
+     * @return Exception caught during the execution
+     * @throws InterruptedException
+     */
+    public Throwable joinAndReturn(long timeout) throws InterruptedException {
+        join(timeout);
+        if (isAlive()) {
+            return new TimeoutException();
+        }
+        if (uncaught != null) {
+            return uncaught;
+        }
+        return null;
+    }
+
+    /**
+     * Waits until {@link TestThread} is in the certain {@link State}
+     * and blocking on {@code object}.
+     *
+     * @param state The thread state
+     * @param object The object to block on
+     */
+    public void waitUntilBlockingOnObject(Thread.State state, Object object) {
+        String want = object == null ? null : object.getClass().getName() + '@'
+                + Integer.toHexString(System.identityHashCode(object));
+        ThreadMXBean tmx = ManagementFactory.getThreadMXBean();
+        while (isAlive()) {
+            ThreadInfo ti = tmx.getThreadInfo(getId());
+            if (ti.getThreadState() == state
+                    && (want == null || want.equals(ti.getLockName()))) {
+                return;
+            }
+            try {
+                Thread.sleep(1);
+            } catch (InterruptedException e) {
+            }
+        }
+    }
+
+    /**
+     * Waits until {@link TestThread} is in native.
+     */
+    public void waitUntilInNative() {
+        ThreadMXBean tmx = ManagementFactory.getThreadMXBean();
+        while (isAlive()) {
+            ThreadInfo ti = tmx.getThreadInfo(getId());
+            if (ti.isInNative()) {
+                return;
+            }
+            try {
+                Thread.sleep(1);
+            } catch (InterruptedException e) {
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.testlibrary;
+
+import static jdk.testlibrary.Asserts.assertTrue;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Common library for various test helper functions.
+ */
+public final class Utils {
+
+    /**
+     * Returns the sequence used by operating system to separate lines.
+     */
+    public static final String NEW_LINE = System.getProperty("line.separator");
+
+    /**
+     * Returns the value of 'test.vm.opts'system property.
+     */
+    public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "");
+
+
+    private Utils() {
+        // Private constructor to prevent class instantiation
+    }
+
+    /**
+     * Returns the list of VM options.
+     *
+     * @return List of VM options
+     */
+    public static List<String> getVmOptions() {
+        return getVmOptions(false);
+    }
+
+    /**
+     * Returns the list of VM options with -J prefix.
+     *
+     * @return The list of VM options with -J prefix
+     */
+    public static List<String> getForwardVmOptions() {
+        return getVmOptions(true);
+    }
+
+    private static List<String> getVmOptions(boolean forward) {
+        List<String> optionsList = new ArrayList<>();
+        String options = VM_OPTIONS.trim();
+        if (!options.isEmpty()) {
+            options = options.replaceAll("\\s+", " ");
+            for (String option : options.split(" ")) {
+                if (forward) {
+                    optionsList.add("-J" + option);
+                } else {
+                    optionsList.add(option);
+                }
+            }
+        }
+
+        return optionsList;
+    }
+
+    /**
+     * Returns the free port on the local host.
+     * The function will spin until a valid port number is found.
+     *
+     * @return The port number
+     * @throws InterruptedException if any thread has interrupted the current thread
+     * @throws IOException if an I/O error occurs when opening the socket
+     */
+    public static int getFreePort() throws InterruptedException, IOException {
+        int port = -1;
+
+        while (port <= 0) {
+            Thread.sleep(100);
+
+            ServerSocket serverSocket = null;
+            try {
+                serverSocket = new ServerSocket(0);
+                port = serverSocket.getLocalPort();
+            } finally {
+                serverSocket.close();
+            }
+        }
+
+        return port;
+    }
+
+    /**
+     * Returns the name of the local host.
+     *
+     * @return The host name
+     * @throws UnknownHostException if IP address of a host could not be determined
+     */
+    public static String getHostname() throws UnknownHostException {
+        InetAddress inetAddress = InetAddress.getLocalHost();
+        String hostName = inetAddress.getHostName();
+
+        assertTrue((hostName != null && !hostName.isEmpty()),
+                "Cannot get hostname");
+
+        return hostName;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/XRun.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.testlibrary;
+
+/**
+ * This type serves no other purpose than to simply allow automatically running
+ * something in a thread, and have all exceptions propagated to
+ * RuntimeExceptions, which are thrown up to thread, which in turn should
+ * probably be a {@link TestThread} to they are stored.
+ */
+public abstract class XRun implements Runnable {
+
+    /**
+     * Invokes {@code xrun()} and throws all exceptions caught in it
+     * up to the thread.
+     */
+    public final void run() {
+        try {
+            xrun();
+        } catch (Error e) {
+            throw e;
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Throwable e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Override this method to implement what to run in the thread.
+     *
+     * @throws Throwable
+     */
+    protected abstract void xrun() throws Throwable;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/awt/AppContext/MultiThread/MultiThreadTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/java2d/DirectX/TransformedPaintTest/TransformedPaintTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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/jdk/test/sun/management/jdp/JdpClient.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/management/jdp/JdpClient.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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
@@ -35,8 +35,10 @@
 import java.nio.channels.Selector;
 import java.util.Collections;
 import java.util.Enumeration;
+import java.util.Map;
 import sun.management.jdp.JdpException;
 import sun.management.jdp.JdpJmxPacket;
+import sun.management.jdp.JdpPacketReader;
 
 public class JdpClient {
 
@@ -47,6 +49,31 @@
         private static int maxPacketCount = 1;
         private static int maxEmptyPacketCount = 10;
 
+        private void get(Map<?,?> map, String key)
+            throws JdpException {
+
+            if (map.get(key) == null) {
+                  throw new JdpException("Test failed, packet field " + key + " missed");
+            }
+        }
+
+        private void checkFieldPresence(JdpJmxPacket p)
+            throws IOException, JdpException {
+
+            byte[] b = p.getPacketData();
+
+            JdpPacketReader reader = new JdpPacketReader(b);
+            Map<String,String> pMap = reader.getDiscoveryDataAsMap();
+
+            get(pMap, JdpJmxPacket.UUID_KEY);
+            get(pMap, JdpJmxPacket.MAIN_CLASS_KEY);
+            get(pMap, JdpJmxPacket.JMX_SERVICE_URL_KEY);
+            // get(pMap, JdpJmxPacket.INSTANCE_NAME_KEY);
+            get(pMap, JdpJmxPacket.PROCESS_ID_KEY);
+            get(pMap, JdpJmxPacket.BROADCAST_INTERVAL_KEY);
+            get(pMap, JdpJmxPacket.RMI_HOSTNAME_KEY);
+        }
+
 
         PacketListener(DatagramChannel channel) {
             this.channel = channel;
@@ -67,6 +94,8 @@
                 try {
                     while (true) {
 
+                        // Use tcpdump -U -w - -s 1400 -c 2 -vv port 7095
+                        // to verify that correct packet being sent
                         sel.selectedKeys().clear();
                         buf.rewind();
 
@@ -87,10 +116,10 @@
                         buf.flip();
                         byte[] dgramData = new byte[buf.remaining()];
                         buf.get(dgramData);
-
                         try {
                             JdpJmxPacket packet = new JdpJmxPacket(dgramData);
                             JdpDoSomething.printJdpPacket(packet);
+                            checkFieldPresence(packet);
                             if(++count > maxPacketCount){
                                    break;
                             }
--- a/jdk/test/sun/management/jdp/JdpDoSomething.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/management/jdp/JdpDoSomething.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 public class JdpDoSomething {
 
     private static final String lockFileName = "JdpDoSomething.lck";
-    private static final boolean verbose=false;
+    private static final boolean verbose = false;
 
     public static boolean getVerbose(){
         return verbose;
@@ -52,6 +52,9 @@
             System.out.println("Jmx: " + p.getJmxServiceUrl());
             System.out.println("Main: " + p.getMainClass());
             System.out.println("InstanceName: " + p.getInstanceName());
+            System.out.println("ProccessId: " + p.getProcessId());
+            System.out.println("BroadcastInterval: " + p.getBroadcastInterval());
+            System.out.println("Rmi Hostname: " + p.getRmiHostname());
 
             System.out.flush();
         }
--- a/jdk/test/sun/management/jdp/JdpTest.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/management/jdp/JdpTest.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -1,6 +1,6 @@
 #!/bin/sh -x
 
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
 
     if [ ! -d ${_testclasses} ]
     then
-	  mkdir -p ${_testclasses}
+       mkdir -p ${_testclasses}
     fi
 
     rm -f ${_testclasses}/*.class
@@ -64,7 +64,7 @@
     # Compile testcase
     ${COMPILEJAVA}/bin/javac -XDignore.symbol.file -d ${_testclasses} \
                                              JdpUnitTest.java \
-                                             JdpDoSomething.java  \
+                                             JdpDoSomething.java \
                                              JdpClient.java
 
 
@@ -84,10 +84,10 @@
   ${TESTJAVA}/bin/java -server $* -cp ${_testclasses} ${testappname}  >> ${_logname} 2>&1 &
  _last_pid=$!
 
-# wait until VM is actually starts. 
+# wait until VM is actually starts.
 # please note, if vm doesn't start for some reason
 # jtreg kills the test by timeout. Don't file a bug.
-  cnt=1 
+  cnt=1
   while true
   do
     npid=`_get_pid`
@@ -135,7 +135,6 @@
     -Dcom.sun.management.jdp.port=${_port} \
     -Dcom.sun.management.jdp.address=${_ip} \
   JdpClient
-
 }
 
 
@@ -156,18 +155,20 @@
     _echo "**** Test one ****"
 
     _app_start JdpUnitTest \
-    -Dcom.sun.management.jdp.port=${_port} \
-    -Dcom.sun.management.jdp.address=${_ip} \
-    -Dcom.sun.management.jdp.pause=5
+        -Dcom.sun.management.jdp.port=${_port} \
+        -Dcom.sun.management.jdp.address=${_ip} \
+        -Dcom.sun.management.jdp.name=testme \
+        -Djava.rmi.server.hostname=localhost \
+        -Dcom.sun.management.jdp.pause=5
 
     res=`_testme`
 
     case "${res}" in
      OK*)
-	_echo "Passed"
+        _echo "Passed"
      ;;
      *)
-	_echo "Failed!"
+        _echo "Failed!"
      ;;
     esac
 
@@ -179,21 +180,23 @@
     _echo "**** Test two ****"
 
     _app_start JdpDoSomething \
-     -Dcom.sun.management.jdp.port=${_port} \
-     -Dcom.sun.management.jdp.address=${_ip} \
-     -Dcom.sun.management.jdp.pause=5 \
-     -Dcom.sun.management.jmxremote.port=${_jmxport} \
-     -Dcom.sun.management.jmxremote.authenticate=false \
-     -Dcom.sun.management.jmxremote.ssl=false
+        -Dcom.sun.management.jdp.port=${_port} \
+        -Dcom.sun.management.jdp.address=${_ip} \
+        -Dcom.sun.management.jdp.pause=5 \
+        -Dcom.sun.management.jdp.name=testme \
+        -Djava.rmi.server.hostname=localhost \
+        -Dcom.sun.management.jmxremote.port=${_jmxport} \
+        -Dcom.sun.management.jmxremote.authenticate=false \
+        -Dcom.sun.management.jmxremote.ssl=false
 
     res=`_testme`
 
     case "${res}" in
      OK*)
-	_echo "Passed"
+        _echo "Passed"
      ;;
      *)
-	_echo "Failed!"
+        _echo "Failed!"
      ;;
     esac
 
@@ -210,6 +213,7 @@
                 jdp.port=${_port} \
                 jdp.address=${_ip} \
                 jdp.pause=5 \
+                jdp.name=jcmdtest \
                 jmxremote.port=${_jmxport} \
                 jmxremote.authenticate=false \
                 jmxremote.ssl=false
@@ -218,10 +222,10 @@
 
     case "${res}" in
      OK*)
-	_echo "Passed"
+        _echo "Passed"
      ;;
      *)
-	_echo "Failed!"
+        _echo "Failed!"
      ;;
     esac
 
@@ -233,19 +237,21 @@
     _echo "**** Test four ****"
 
     _app_start JdpDoSomething \
-     -Dcom.sun.management.jmxremote.autodiscovery=true \
-     -Dcom.sun.management.jmxremote.port=${_jmxport} \
-     -Dcom.sun.management.jmxremote.authenticate=false \
-     -Dcom.sun.management.jmxremote.ssl=false
+        -Dcom.sun.management.jmxremote.autodiscovery=true \
+        -Dcom.sun.management.jdp.name=testme \
+        -Djava.rmi.server.hostname=localhost \
+        -Dcom.sun.management.jmxremote.port=${_jmxport} \
+        -Dcom.sun.management.jmxremote.authenticate=false \
+        -Dcom.sun.management.jmxremote.ssl=false
 
     res=`_testme`
 
     case "${res}" in
      OK*)
-	_echo "Passed"
+        _echo "Passed"
      ;;
      *)
-	_echo "Failed!"
+        _echo "Failed!"
      ;;
     esac
 
@@ -269,10 +275,10 @@
 
     case "${res}" in
      OK*)
-	_echo "Passed"
+        _echo "Passed"
      ;;
      *)
-	_echo "Failed!"
+        _echo "Failed!"
      ;;
     esac
 
@@ -300,28 +306,28 @@
 
 for parm in "$@"
 do
-   case $parm in
-  --verbose)      _verbose=yes  ;;
-  --jtreg)        _jtreg=yes    ;;
-  --no-compile)   _compile=no   ;;
-  --testsuite=*)  _testsuite=`_echo $parm | sed "s,^--.*=\(.*\),\1,"`  ;;
-  *)
-     echo "Undefined parameter $parm. Try --help for help"
-     exit
-   ;;
- esac
+  case $parm in
+      --verbose)      _verbose=yes  ;;
+      --jtreg)        _jtreg=yes    ;;
+      --no-compile)   _compile=no   ;;
+      --testsuite=*)  _testsuite=`_echo $parm | sed "s,^--.*=\(.*\),\1,"`  ;;
+      *)
+        echo "Undefined parameter $parm. Try --help for help"
+        exit
+      ;;
+  esac
 done
 
 if [ "${_compile}" = "yes" ]
 then
- _do_compile
+  _do_compile
 fi
 
 if [ "${_jtreg}" = "yes" ]
 then
- _testclasses=${TESTCLASSES}
- _testsrc=${TESTSRC}
- _logname="output.txt"
+  _testclasses=${TESTCLASSES}
+  _testsrc=${TESTSRC}
+  _logname="output.txt"
 fi
 
 # Make sure _tesclasses is absolute path
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,221 @@
+/*
+ * 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.File;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+import jdk.testlibrary.JdkFinder;
+import jdk.testlibrary.ProcessTools;
+
+/**
+ * @test
+ * @bug 6434402 8004926
+ * @library /lib/testlibrary
+ * @build TestManager TestApplication CustomLauncherTest
+ * @run main CustomLauncherTest
+ * @author Jaroslav Bachorik
+ */
+public class CustomLauncherTest {
+    private static final  String TEST_CLASSES = System.getProperty("test.classes");
+    private static final  String TEST_JDK = System.getProperty("test.jdk");
+
+    private static final  String TEST_SRC = System.getProperty("test.src");
+    private static final  String OSNAME = System.getProperty("os.name");
+    private static final  String ARCH;
+    private static final  String LIBARCH;
+
+    static {
+        // magic with os.arch
+        String osarch = System.getProperty("os.arch");
+        switch (osarch) {
+            case "i386":
+            case "i486":
+            case "i586":
+            case "i686":
+            case "i786":
+            case "i886":
+            case "i986": {
+                ARCH = "i586";
+                break;
+            }
+            case "x86_64":
+            case "amd64": {
+                ARCH = "amd64";
+                break;
+            }
+            default: {
+                ARCH = osarch;
+            }
+        }
+        LIBARCH = ARCH.equals("i586") ? "i386" : ARCH;
+    }
+
+    public static void main(String[] args) throws Exception {
+        if (TEST_CLASSES == null || TEST_CLASSES.isEmpty()) {
+            System.out.println("Test is designed to be run from jtreg only");
+            return;
+        }
+
+        String PLATFORM = "";
+        switch (OSNAME.toLowerCase()) {
+            case "linux": {
+                PLATFORM = "linux";
+                break;
+            }
+            case "sunos": {
+                PLATFORM = "solaris";
+                break;
+            }
+            default: {
+                System.out.println("Test not designed to run on this operating " +
+                                   "system (" + OSNAME + "), skipping...");
+                return;
+            }
+        }
+
+        String LAUNCHER = TEST_SRC + File.separator + PLATFORM + "-" + ARCH +
+                          File.separator + "launcher";
+
+        final FileSystem FS = FileSystems.getDefault();
+        final boolean hasLauncher = Files.isExecutable(FS.getPath(LAUNCHER));
+        if (!hasLauncher) {
+            System.out.println("Launcher [" + LAUNCHER + "] does not exist. Skipping the test.");
+            return;
+        }
+
+        Path libjvmPath = findLibjvm(FS);
+        if (libjvmPath == null) {
+            throw new Error("Unable to locate 'libjvm.so' in " + TEST_JDK);
+        }
+
+        Process serverPrc = null, clientPrc = null;
+
+        try {
+            System.out.println("Starting custom launcher:");
+            System.out.println("=========================");
+            System.out.println("  launcher  : " + LAUNCHER);
+            System.out.println("  libjvm    : " + libjvmPath.toString());
+            System.out.println("  classpath : " + TEST_CLASSES);
+            ProcessBuilder server = new ProcessBuilder(LAUNCHER, libjvmPath.toString(), TEST_CLASSES, "TestApplication");
+
+            final AtomicReference<String> port = new AtomicReference<>();
+            final AtomicReference<String> pid = new AtomicReference<>();
+
+            serverPrc = ProcessTools.startProcess(
+                "Launcher",
+                server,
+                (String line) -> {
+                    if (line.startsWith("port:")) {
+                         port.set(line.split("\\:")[1]);
+                     } else  if (line.startsWith("pid:")) {
+                         pid.set(line.split("\\:")[1]);
+                     } else if (line.startsWith("waiting")) {
+                         return true;
+                     }
+                     return false;
+                },
+                5,
+                TimeUnit.SECONDS
+            );
+
+            System.out.println("Attaching test manager:");
+            System.out.println("=========================");
+            System.out.println("  PID           : " + pid.get());
+            System.out.println("  shutdown port : " + port.get());
+
+            ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
+                "-cp",
+                TEST_CLASSES +
+                    File.pathSeparator +
+                    TEST_JDK +
+                    File.separator +
+                    "lib" +
+                    File.separator +
+                    "tools.jar",
+                "TestManager",
+                pid.get(),
+                port.get(),
+                "true"
+            );
+
+            clientPrc = ProcessTools.startProcess(
+                "TestManager",
+                client,
+                (String line) -> line.startsWith("Starting TestManager for PID"),
+                10,
+                TimeUnit.SECONDS
+            );
+
+            int clientExitCode = clientPrc.waitFor();
+            int serverExitCode = serverPrc.waitFor();
+
+            if (clientExitCode != 0 || serverExitCode != 0) {
+                throw new Error("Test failed");
+            }
+        } finally {
+            if (clientPrc != null) {
+                clientPrc.destroy();
+                clientPrc.waitFor();
+            }
+            if (serverPrc != null) {
+                serverPrc.destroy();
+                serverPrc.waitFor();
+            }
+        }
+    }
+
+    private static Path findLibjvm(FileSystem FS) {
+        Path libjvmPath = findLibjvm(FS.getPath(TEST_JDK, "jre", "lib", LIBARCH));
+        if (libjvmPath == null) {
+            libjvmPath = findLibjvm(FS.getPath(TEST_JDK, "lib", LIBARCH));
+        }
+        return libjvmPath;
+    }
+
+    private static Path findLibjvm(Path libPath) {
+        // ARCH/libjvm.so -> ARCH/server/libjvm.so -> ARCH/client/libjvm.so
+        Path libjvmPath = libPath.resolve("libjvm.so");
+        if (isFileOk(libjvmPath)) {
+            return libjvmPath;
+        }
+        libjvmPath = libPath.resolve("server/libjvm.so");
+        if (isFileOk(libjvmPath)) {
+            return libjvmPath;
+        }
+        libjvmPath = libPath.resolve("client/libjvm.so");
+        if (isFileOk(libPath)) {
+            return libjvmPath;
+        }
+
+        return null;
+    }
+
+    private static boolean isFileOk(Path path) {
+        return Files.isRegularFile(path) && Files.isReadable(path);
+    }
+}
--- a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute 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 6434402
-# @summary Start an application using a custom launcher and check that
-#          a management tool can connect.
-#
-# @build TestManager TestApplication
-# @run shell CustomLauncherTest.sh
-
-#
-# Check we are run from jtreg
-#
-if [ -z "${TESTCLASSES}" ]; then
-    echo "Test is designed to be run from jtreg only"
-    exit 0
-fi
-
-#
-# For now this test passes silently on Windows - this means the test only
-# has to locate libjvm.so. Also $! is not reliable on some releases of MKS.
-#{
-OS=`uname -s`
-if [ "$OS" != "Linux" -a "$OS" != "SunOS" ]; then
-    echo "Test not designed to run on this operating system, skipping..."
-    exit 0
-fi
-
-#
-# Locate the custom launcher for this platform
-#
-PLATFORM=unknown
-ARCH=unknown
-if [ "$OS" = "SunOS" ]; then
-    PLATFORM=solaris
-    case "`uname -p`" in
-	i[3-9]86)
-	    ARCH=i586
-	    ;;
-	sparc)
-	    ARCH=sparc
-	    ;;
-    esac
-else
-    PLATFORM=linux
-    case "`uname -m`" in
-	i[3-6]86)
-	    ARCH=i586
-	    ;;
-	x86_64)
-	    ARCH=amd64
-	    ;;
-    esac
-fi
-
-
-#
-# On x86 the native libraries are in lib/i386 for
-# compatability reasons
-#
-if [ "$ARCH" = "i586" ]; then
-    LIBARCH="i386"
-else
-    LIBARCH=$ARCH
-fi
-
-
-#
-# Check that a custom launcher exists for this platform
-#
-LAUNCHER="${TESTSRC}/${PLATFORM}-${ARCH}/launcher"
-if [ ! -x "${LAUNCHER}" ]; then
-    echo "${LAUNCHER} not found"
-    exit 0
-fi
-
-# 
-# Locate the libjvm.so library 
-#
-JVMLIB="${TESTJAVA}/jre/lib/${LIBARCH}/client/libjvm.so"
-if [ ! -f "${JVMLIB}" ]; then
-    JVMLIB="${TESTJAVA}/jre/lib/${LIBARCH}/server/libjvm.so"
-    if [ ! -f "${JVMLIB}" ]; then
-	JVMLIB="${TESTJAVA}/lib/${LIBARCH}/client/libjvm.so"
-	if [ ! -f "${JVMLIB}" ]; then
-	    JVMLIB="${TESTJAVA}/lib/${LIBARCH}/serevr/libjvm.so"
-	    if [ ! -f "${JVMLIB}" ]; then
-		echo "Unable to locate libjvm.so in ${TESTJAVA}"
-		exit 1
-	    fi
-	fi
-    fi
-fi
-
-#
-# Start the VM
-#
-outputfile=${TESTCLASSES}/Test.out
-rm -f ${outputfile}
-
-echo ''
-echo "Starting custom launcher..."
-echo " launcher: ${LAUNCHER}"
-echo "   libjvm: ${JVMLIB}"
-echo "classpath: ${TESTCLASSES}"
-
-
-${LAUNCHER} ${JVMLIB} ${TESTCLASSES} TestApplication > ${outputfile} &
-pid=$!
-
-# Wait for managed VM to startup (although this looks like a potentially
-# infinate loop, the framework will eventually kill it)
-echo "Waiting for TestAppication to test..."
-attempts=0
-while true; do
-    sleep 1
-    port=`tail -1 ${outputfile}`
-    if [ ! -z "$port" ]; then
-	# In case of errors wait time for output to be flushed
-	sleep 1
-	cat ${outputfile}
-	break
-    fi
-    attempts=`expr $attempts + 1`
-    echo "Waiting $attempts second(s) ..."
-done
-
-# Start the manager - this should connect to VM
-${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
-  TestManager $pid $port true
-if [ $? != 0 ]; then 
-    echo "Test failed"
-    exit 1
-fi
-exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,242 @@
+/*
+ * 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.File;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * @test
+ * @library /lib/testlibrary
+ * @bug 5016507 6173612 6319776 6342019 6484550 8004926
+ * @summary Start a managed VM and test that a management tool can connect
+ *          without connection or username/password details.
+ *          TestManager will attempt a connection to the address obtained from
+ *          both agent properties and jvmstat buffer.
+ * @build TestManager TestApplication
+ * @run main/timeout=300 LocalManagementTest
+ */
+
+import jdk.testlibrary.ProcessTools;
+
+public class LocalManagementTest {
+    private static final  String TEST_CLASSES = System.getProperty("test.classes");
+    private static final  String TEST_JDK = System.getProperty("test.jdk");
+
+    public static void main(String[] args) throws Exception {
+        int failures = 0;
+        for(Method m : LocalManagementTest.class.getDeclaredMethods()) {
+            if (Modifier.isStatic(m.getModifiers()) &&
+                m.getName().startsWith("test")) {
+                m.setAccessible(true);
+                try {
+                    System.out.println(m.getName());
+                    System.out.println("==========");
+                    Boolean rslt = (Boolean)m.invoke(null);
+                    if (!rslt) {
+                        System.err.println(m.getName() + " failed");
+                        failures++;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    failures++;
+                }
+            }
+        }
+        if (failures > 0) {
+            throw new Error("Test failed");
+        }
+    }
+
+    private static boolean test1() throws Exception {
+        return doTest("-Dcom.sun.management.jmxremote");
+    }
+
+    private static boolean test2() throws Exception {
+        Path agentPath = findAgent();
+        if (agentPath != null) {
+            String agent = agentPath.toString();
+            return doTest("-javaagent:" + agent);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * no args (blank) - manager should attach and start agent
+     */
+    private static boolean test3() throws Exception {
+        return doTest(null);
+    }
+
+    /**
+     * sanity check arguments to management-agent.jar
+     */
+    private static boolean test4() throws Exception {
+        Path agentPath = findAgent();
+        if (agentPath != null) {
+            ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(
+                "-javaagent:" + agentPath.toString() +
+                "=com.sun.management.jmxremote.port=7775," +
+                "com.sun.management.jmxremote.authenticate=false," +
+                "com.sun.management.jmxremote.ssl=false",
+                "-cp",
+                TEST_CLASSES,
+                "TestApplication",
+                "-exit"
+            );
+
+            Process prc = null;
+            try {
+                prc = ProcessTools.startProcess(
+                    "TestApplication",
+                    builder
+                );
+                int exitCode = prc.waitFor();
+                return exitCode == 0;
+            } finally {
+                if (prc != null) {
+                    prc.destroy();
+                    prc.waitFor();
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * use DNS-only name service
+     */
+    private static boolean test5() throws Exception {
+        return doTest("-Dsun.net.spi.namservice.provider.1=\"dns,sun\"");
+    }
+
+    private static Path findAgent() {
+        FileSystem FS = FileSystems.getDefault();
+        Path agentPath = FS.getPath(
+            TEST_JDK, "jre", "lib", "management-agent.jar"
+        );
+        if (!isFileOk(agentPath)) {
+            agentPath = FS.getPath(
+                TEST_JDK, "lib", "management-agent.jar"
+            );
+        }
+        if (!isFileOk(agentPath)) {
+            System.err.println("Can not locate management-agent.jar");
+            return null;
+        }
+        return agentPath;
+    }
+
+    private static boolean isFileOk(Path path) {
+        return Files.isRegularFile(path) && Files.isReadable(path);
+    }
+
+    private static boolean doTest(String arg) throws Exception {
+        List<String> args = new ArrayList<>();
+        args.add("-cp");
+        args.add(TEST_CLASSES);
+
+        if (arg != null) {
+            args.add(arg);
+        }
+        args.add("TestApplication");
+        ProcessBuilder server = ProcessTools.createJavaProcessBuilder(
+            args.toArray(new String[args.size()])
+        );
+
+        Process serverPrc = null, clientPrc = null;
+        try {
+            final AtomicReference<String> port = new AtomicReference<>();
+            final AtomicReference<String> pid = new AtomicReference<>();
+
+            serverPrc = ProcessTools.startProcess(
+                "TestApplication",
+                server,
+                (String line) -> {
+                    if (line.startsWith("port:")) {
+                         port.set(line.split("\\:")[1]);
+                     } else  if (line.startsWith("pid:")) {
+                         pid.set(line.split("\\:")[1]);
+                     } else if (line.startsWith("waiting")) {
+                         return true;
+                     }
+                     return false;
+                },
+                5,
+                TimeUnit.SECONDS
+            );
+
+            System.out.println("Attaching test manager:");
+            System.out.println("=========================");
+            System.out.println("  PID           : " + pid.get());
+            System.out.println("  shutdown port : " + port.get());
+
+            ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
+                "-cp",
+                TEST_CLASSES +
+                    File.pathSeparator +
+                    TEST_JDK +
+                    File.separator +
+                    "lib" +
+                    File.separator +
+                    "tools.jar",
+                "TestManager",
+                pid.get(),
+                port.get(),
+                "true"
+            );
+
+            clientPrc = ProcessTools.startProcess(
+                "TestManager",
+                client,
+                (String line) -> line.startsWith("Starting TestManager for PID"),
+                10,
+                TimeUnit.SECONDS
+            );
+
+            int clientExitCode = clientPrc.waitFor();
+            int serverExitCode = serverPrc.waitFor();
+            return clientExitCode == 0 && serverExitCode == 0;
+        } finally {
+            if (clientPrc != null) {
+                System.out.println("Stopping process " + clientPrc);
+                clientPrc.destroy();
+                clientPrc.waitFor();
+            }
+            if (serverPrc != null) {
+                System.out.println("Stopping process " + serverPrc);
+                serverPrc.destroy();
+                serverPrc.waitFor();
+            }
+        }
+    }
+}
\ No newline at end of file
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute 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 5016507 6173612 6319776 6342019 6484550
-# @summary Start a managed VM and test that a management tool can connect
-#          without connection or username/password details.
-#          TestManager will attempt a connection to the address obtained from 
-#          both agent properties and jvmstat buffer.
-#
-# @build TestManager TestApplication
-# @run shell/timeout=300 LocalManagementTest.sh
-
-
-doTest()
-{
-    echo ''
-
-    outputfile=${TESTCLASSES}/Test.out
-    rm -f ${outputfile}
-
-    # Start VM with given options
-    echo "+ $JAVA ${TESTVMOPTS} $1 Test"
-    $JAVA ${TESTVMOPTS} $1 TestApplication > ${outputfile}&
-    pid=$!
- 
-    # Wait for managed VM to startup
-    echo "Waiting for VM to startup..."
-    attempts=0
-    while true; do
-        sleep 1
-  	port=`tail -1 ${outputfile}`
-  	if [ ! -z "$port" ]; then
-     	    # In case of errors wait time for output to be flushed
-     	    sleep 1
-     	    cat ${outputfile}
-     	    break
-	fi
-      attempts=`expr $attempts + 1`
-      echo "Waiting $attempts second(s) ..."
-    done
-
-    # Start the manager - this should connect to VM
-    sh -xc "$JAVA ${TESTVMOPTS} -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
-        TestManager $pid $port"  2>&1
-    if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
-}
-
-
-# Check we are run from jtreg
-if [ -z "${TESTCLASSES}" ]; then
-    echo "Test is designed to be run from jtreg only"
-    exit 0
-fi
-
-# For now this test passes silently on Windows - there are 2 reasons
-# to skip it :-
-#
-# 1. No jstat instrumentation buffers if FAT32 so need
-#    -XX:+PerfBypassFileSystemCheck 
-# 2. $! is used to get the pid of the created process but it's not
-#    reliable on older versions of MKS. Also negative pids are returned
-#    on Windows 98.
-
-os=`uname -s`
-if [ "$os" != "Linux" -a "$os" != "SunOS" ]; then
-    echo "Test not designed to run on this operating system, skipping..."
-    exit 0
-fi
-
-JAVA=${TESTJAVA}/bin/java
-CLASSPATH=${TESTCLASSES}
-export CLASSPATH
-
-failures=0
-
-# Test 1 
-doTest "-Dcom.sun.management.jmxremote" 
-
-# Test 2
-AGENT="${TESTJAVA}/jre/lib/management-agent.jar"
-if [ ! -f ${AGENT} ]; then
-  AGENT="${TESTJAVA}/lib/management-agent.jar"
-fi
-doTest "-javaagent:${AGENT}" 
-
-# Test 3 - no args (blank) - manager should attach and start agent
-doTest " " 
-
-# Test 4 - sanity check arguments to management-agent.jar
-echo ' '
-sh -xc "${JAVA} ${TESTVMOPTS} -javaagent:${AGENT}=com.sun.management.jmxremote.port=7775,\
-com.sun.management.jmxremote.authenticate=false,com.sun.management.jmxremote.ssl=false \
-  TestApplication -exit" 2>&1
-if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
-
-# Test 5 - use DNS-only name service
-doTest "-Dsun.net.spi.namservice.provider.1=\"dns,sun\"" 
-
-#
-# Results
-#
-echo ''
-if [ $failures -gt 0 ];
-  then echo "$failures test(s) failed";
-  else echo "All test(s) passed"; fi
-exit $failures
-
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,15 @@
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.InputStream;
 import java.io.FilenameFilter;
 import java.io.IOException;
+import java.net.BindException;
+import java.net.ServerSocket;
+import java.rmi.server.ExportException;
 
 import java.util.Properties;
 import java.util.Iterator;
 import java.util.Set;
-import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
@@ -54,7 +55,7 @@
  * bootstrap & connection test will fail.</p>
  *
  * <p>The rmi port number can be specified with the "rmi.port" system property.
- * If not, this test will use 12424</p>
+ * If not, this test will use the first available port</p>
  *
  * <p>When called with some argument, the main() will interprete its args to
  * be Java M&M configuration file names. The filenames are expected to end
@@ -69,7 +70,8 @@
  * <p>Debug traces are logged in "sun.management.test"</p>
  **/
 public class RmiBootstrapTest {
-
+    // the number of consecutive ports to test for availability
+    private static final int PORT_TEST_LEN = 800;
     static TestLogger log =
         new TestLogger("RmiBootstrapTest");
 
@@ -78,6 +80,7 @@
      * to avoid falling into "port number already in use" problems.
      **/
     static int testPort = 0;
+    static int basePort = 0;
 
     /**
      * Default values for RMI configuration properties.
@@ -624,7 +627,7 @@
      * eventually cleans up by calling ConnectorBootstrap.terminate().
      * @return null if the test succeeds, an error message otherwise.
      **/
-    private String testConfiguration(File file,int port) {
+    private String testConfiguration(File file,int port) throws BindException {
 
         final String path;
         try {
@@ -644,7 +647,7 @@
         System.out.println("***");
 
         System.setProperty("com.sun.management.jmxremote.port",
-                           Integer.toString(port));
+                            Integer.toString(port));
         if (path != null)
             System.setProperty("com.sun.management.config.file", path);
         else
@@ -661,6 +664,11 @@
         try {
             cs = ConnectorBootstrap.initialize();
         } catch (AgentConfigurationError x) {
+            if (x.getCause() instanceof ExportException) {
+                if (x.getCause().getCause() instanceof BindException) {
+                    throw (BindException)x.getCause().getCause();
+                }
+            }
             final String err = "Failed to initialize connector:" +
                 "\n\tcom.sun.management.jmxremote.port=" + port +
                 ((path!=null)?"\n\tcom.sun.management.config.file="+path:
@@ -713,7 +721,15 @@
      * @return null if the test succeeds, an error message otherwise.
      **/
     private String testConfigurationKo(File conf,int port) {
-        final String errStr = testConfiguration(conf,port+testPort++);
+        String errStr = null;
+        for (int i = 0; i < PORT_TEST_LEN; i++) {
+            try {
+                errStr = testConfiguration(conf,port+testPort++);
+                break;
+            } catch (BindException e) {
+                // port conflict; try another port
+            }
+        }
         if (errStr == null) {
             return "Configuration " +
                 conf + " should have failed!";
@@ -733,11 +749,21 @@
      **/
     private String testConfigurationFile(String fileName) {
         File file = new File(fileName);
-        final String portStr = System.getProperty("rmi.port","12424");
-        final int port       = Integer.parseInt(portStr);
+        final String portStr = System.getProperty("rmi.port",null);
+        final int port       = portStr != null ?
+                                Integer.parseInt(portStr) : basePort;
 
         if (fileName.endsWith("ok.properties")) {
-            return testConfiguration(file,port+testPort++);
+            String errStr = null;
+            for (int i = 0; i < PORT_TEST_LEN; i++) {
+                try {
+                    errStr = testConfiguration(file,port+testPort++);
+                    return errStr;
+                } catch (BindException e) {
+                    // port conflict; try another port
+                }
+            }
+            return "Can not locate available port";
         }
         if (fileName.endsWith("ko.properties")) {
             return testConfigurationKo(file,port+testPort++);
@@ -752,8 +778,9 @@
      * @throws RuntimeException if the test fails.
      **/
     public void runko() {
-        final String portStr = System.getProperty("rmi.port","12424");
-        final int port       = Integer.parseInt(portStr);
+        final String portStr = System.getProperty("rmi.port",null);
+        final int port       = portStr != null ?
+                                Integer.parseInt(portStr) : basePort;
         final File[] conf = findConfigurationFilesKo();
         if ((conf == null)||(conf.length == 0))
             throw new RuntimeException("No configuration found");
@@ -774,15 +801,23 @@
      * @throws RuntimeException if the test fails.
      **/
     public void runok() {
-        final String portStr = System.getProperty("rmi.port","12424");
-        final int port       = Integer.parseInt(portStr);
+        final String portStr = System.getProperty("rmi.port",null);
+        final int port       = portStr != null ?
+                                Integer.parseInt(portStr) : basePort;
         final File[] conf = findConfigurationFilesOk();
         if ((conf == null)||(conf.length == 0))
             throw new RuntimeException("No configuration found");
 
-        String errStr;
+        String errStr = null;
         for (int i=0;i<conf.length;i++) {
-            errStr = testConfiguration(conf[i],port+testPort++);
+            for (int j = 0; j < PORT_TEST_LEN; i++) {
+                try {
+                    errStr = testConfiguration(conf[i],port+testPort++);
+                    break;
+                } catch (BindException e) {
+                    // port conflict; try another port
+                }
+            }
             if (errStr != null) {
                 throw new RuntimeException(errStr);
             }
@@ -835,7 +870,8 @@
      * Calls run(args[]).
      * exit(1) if the test fails.
      **/
-    public static void main(String args[]) {
+    public static void main(String args[]) throws Exception {
+        setupBasePort();
         RmiBootstrapTest manager = new RmiBootstrapTest();
         try {
             manager.run(args);
@@ -850,4 +886,9 @@
         System.out.println("**** Test  RmiBootstrap Passed ****");
     }
 
+    private static void setupBasePort() throws IOException {
+        try (ServerSocket s = new ServerSocket(0)) {
+            basePort = s.getLocalPort() + 1;
+        }
+    }
 }
--- a/jdk/test/sun/management/jmxremote/bootstrap/TestApplication.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/management/jmxremote/bootstrap/TestApplication.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,18 @@
 /*
  *
  *
- * A test "application" used by unit test LocalManagementTest.sh. This
- * application binds to some random port, prints the port number to
- * standard output, waits for somebody to connect, and then shuts down.
+ * A test "application" used by unit tests -
+ *   LocalManagementTest.java, CustomLauncherTest.java.
+ * This application binds to some random port, prints its pid and
+ * the port number to standard output, waits for somebody to connect,
+ * and then shuts down.
  */
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.net.Socket;
 
+import jdk.testlibrary.ProcessTools;
+
 public class TestApplication {
     public static void main(String[] args) throws IOException {
         // Some tests require the application to exit immediately
@@ -43,8 +47,17 @@
         ServerSocket ss = new ServerSocket(0);
         int port = ss.getLocalPort();
 
-        // signal test that we are started - do not remove this line!!
-        System.out.println(port);
+        int pid = -1;
+        try {
+            pid = ProcessTools.getProcessId();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        // signal test that we are started - do not remove these lines!!
+        System.out.println("port:" + port);
+        System.out.println("pid:" + pid);
+        System.out.println("waiting for the manager ...");
         System.out.flush();
 
         // wait for manager to connect
--- a/jdk/test/sun/management/jmxremote/bootstrap/TestManager.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/management/jmxremote/bootstrap/TestManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
 /*
  *
  *
- * A test "management tool" used by unit test LocalManagementTest.sh.
+ * A test "management tool" used by unit tests -
+ *   LocalManagementTest.java, CustomLauncherTest.java
  *
  * Usage:    java TestManager <pid> <port>
  *
@@ -32,8 +33,6 @@
  * TCP port is used to shutdown the application.
  */
 import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
 import javax.management.remote.JMXServiceURL;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXConnector;
@@ -43,7 +42,6 @@
 import java.net.InetSocketAddress;
 import java.io.File;
 import java.io.IOException;
-import java.util.Properties;
 
 // Sun specific
 import com.sun.tools.attach.VirtualMachine;
@@ -111,6 +109,8 @@
         "com.sun.management.jmxremote.localConnectorAddress";
     public static void main(String[] args) throws Exception {
         String pid = args[0]; // pid as a string
+        System.out.println("Starting TestManager for PID = " + pid);
+        System.out.flush();
         VirtualMachine vm = VirtualMachine.attach(pid);
 
         String agentPropLocalConnectorAddress = (String)
@@ -140,7 +140,6 @@
         System.out.println("Testing the connector address from jvmstat buffer");
         connect(pid, jvmstatLocalConnectorAddress);
 
-
         // Shutdown application
         int port = Integer.parseInt(args[1]);
         System.out.println("Shutdown process via TCP port: " + port);
Binary file jdk/test/sun/management/jmxremote/bootstrap/linux-amd64/launcher has changed
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -551,6 +551,11 @@
  esac 
 done
 
+if [ "${COMPILEJAVA}" = "" ]
+then 
+  COMPILEJAVA=${TESTJAVA}
+fi
+
 if [ ${_compile} = "yes" ]
 then
  _compile
--- a/jdk/test/sun/nio/cs/TestIBMBugs.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/nio/cs/TestIBMBugs.java	Mon Nov 11 16:20:48 2013 +0100
@@ -147,16 +147,17 @@
     }
 
     private static void bug6569191 () throws Exception {
-        byte[] bs = new byte[] { (byte)0x81, (byte)0xad,
-                                 (byte)0x81, (byte)0xae,
-                                 (byte)0x81, (byte)0xaf,
-                                 (byte)0x81, (byte)0xb0,
-                                 (byte)0x85, (byte)0x81,
-                                 (byte)0x85, (byte)0x87,
-                                 (byte)0x85, (byte)0xe0,
-                                 (byte)0x85, (byte)0xf0 };
+        byte[] bs = new byte[] { (byte)0x81, (byte)0xad,  // fffd ff6d
+                                 (byte)0x81, (byte)0xae,  // fffd ff6e
+                                 (byte)0x81, (byte)0xaf,  // fffd ff6f
+                                 (byte)0x81, (byte)0xb0,  // fffd ff70
+                                 (byte)0x85, (byte)0x81,  // fffd ->
+                                 (byte)0x85, (byte)0x87,  // 2266 ->
+                                 (byte)0x85, (byte)0xe0,  // 32a4 ->
+                                 (byte)0x85, (byte)0xf0 };// 7165 fffd
         String s = new String(bs, "Cp943");
-        if (!"\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd"
+        // see DoubleByte for how the unmappables are handled
+        if (!"\ufffd\uff6d\ufffd\uff6e\ufffd\uff6f\ufffd\uff70\ufffd\u2266\u32a4\u7165\ufffd"
             .equals(s))
             throw new Exception("Cp943 failed");
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/nio/cs/TestUnmappable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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.
+ */
+
+/*
+ * @test
+ * @bug 8008386
+ * @summary (cs) Unmappable leading should be decoded to replacement.
+ *          Tests for Shift_JIS and MS932 decoding
+ * @run main TestUnmappable
+ */
+
+import java.nio.*;
+import java.nio.charset.*;
+
+public class TestUnmappable {
+    public static void main(String args[]) throws Exception {
+
+        // illegal leading character test
+        byte[][] inputBytes = {
+                               // Shift_JIS
+                               {(byte)0xce, (byte)0xa0, (byte)0xce, (byte)0x7a},
+                               // MS932
+                               {(byte)0x3c, (byte)0x21, (byte)0x2d, (byte)0x2d,
+                                (byte)0xe5, (byte)0xaf, (byte)0xbe, (byte)0xe5,
+                                (byte)0xbf, (byte)0x9c, (byte)0x2d, (byte)0x2d,
+                                (byte)0x3e, (byte)0xd,  (byte)0xa },
+                               {(byte)0x81, (byte)0xad},
+                               // PCK
+                               {(byte)0xef, (byte)0x90},
+                               {(byte)0x91, (byte)0xfd}
+                              };
+
+        String[] charsets = { "Shift_JIS", "MS932", "PCK" };
+        String[] expectedStrings = {
+                                    // Shift_JIS
+                                    "0xce 0x3f 0xce 0x7a ",
+                                    // MS932
+                                    "0x3c 0x21 0x2d 0x2d 0xe5 0xaf 0xbe 0xe5 0xbf " +
+                                    "0x3f 0x2d 0x2d 0x3e 0xd 0xa ",
+                                    "0x3f 0xad ",
+                                    // PCK
+                                    "0x3f 0x3f ",
+                                    "0x3f "};
+
+        for (int i = 0; i < charsets.length; i++) {
+            String ret = new String(inputBytes[i], charsets[i]);
+            String bString = getByteString(ret.getBytes(Charset.forName(charsets[i])));
+            if (expectedStrings[i].length() != bString.length()
+               || ! expectedStrings[i].equals(bString)){
+                throw new Exception("ByteToChar for " + charsets[i]
+                    + " does not work correctly.\n" +
+                    "Expected: " + expectedStrings[i] + "\n" +
+                    "Received: " + bString);
+            }
+        }
+    }
+
+    private static String getByteString(byte[] bytes) {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < bytes.length; i++) {
+            sb.append("0x" + Integer.toHexString((int)(bytes[i] & 0xFF)) + " ");
+        }
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/reflect/Reflection/GetCallerClassWithDepth.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8025799
+ * @summary sun.reflect.Reflection.getCallerClass(int)
+ * @run main GetCallerClassWithDepth
+ */
+
+public class GetCallerClassWithDepth {
+    public static void main(String[] args) throws Exception {
+        Class<?> c = Test.test();
+        assertEquals(c, GetCallerClassWithDepth.class);
+        Class<?> caller = Test.caller();
+        assertEquals(caller, GetCallerClassWithDepth.class);
+        Test.selfTest();
+
+        try {
+            sun.reflect.Reflection.getCallerClass(-1);
+            throw new RuntimeException("getCallerClass(-1) should fail");
+        } catch (Error e) {
+            System.out.println("Expected: " + e.getMessage());
+        }
+    }
+
+    public Class<?> getCallerClass() {
+        // 0: Reflection 1: getCallerClass 2: Test.test 3: main
+        return sun.reflect.Reflection.getCallerClass(3);
+    }
+
+    static void assertEquals(Class<?> c, Class<?> expected) {
+        if (c != expected) {
+            throw new RuntimeException("Incorrect caller: " + c);
+        }
+    }
+
+    static class Test {
+        // Returns the caller of this method
+        public static Class<?> test() {
+            return new GetCallerClassWithDepth().getCallerClass();
+        }
+
+        // Returns the caller of this method
+        public static Class<?> caller() {
+            // 0: Reflection 1: Test.caller 2: main
+            return sun.reflect.Reflection.getCallerClass(2);
+        }
+        public static void selfTest() {
+            // 0: Reflection 1: Test.selfTest
+            Class<?> c = sun.reflect.Reflection.getCallerClass(1);
+            assertEquals(c, Test.class);
+            Inner1.deep();
+        }
+
+        static class Inner1 {
+            static void deep() {
+                 deeper();
+            }
+            static void deeper() {
+                 Inner2.deepest();
+            }
+            static class Inner2 {
+                static void deepest() {
+                    // 0: Reflection 1: deepest 2: deeper 3: deep 4: Test.selfTest
+                    Class<?> c = sun.reflect.Reflection.getCallerClass(4);
+                    assertEquals(c, Test.class);
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/rmi/transport/proxy/DisableHttpDefaultValue.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,68 @@
+/*
+ * 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 8023862
+ * @summary Verify that the default value of the java.rmi.server.disableHttp
+ *          has been changed from false to true.
+ * @compile -XDignore.symbol.file DisableHttpDefaultValue.java
+ *
+ * @run main/othervm                                     DisableHttpDefaultValue true
+ * @run main/othervm -Djava.rmi.server.disableHttp       DisableHttpDefaultValue false
+ * @run main/othervm -Djava.rmi.server.disableHttp=false DisableHttpDefaultValue false
+ * @run main/othervm -Djava.rmi.server.disableHttp=xyzzy DisableHttpDefaultValue false
+ * @run main/othervm -Djava.rmi.server.disableHttp=true  DisableHttpDefaultValue true
+ */
+
+import sun.rmi.transport.proxy.RMIMasterSocketFactory;
+
+public class DisableHttpDefaultValue {
+    /**
+     * Subclass RMIMasterSocketFactory to get access to
+     * protected field altFactoryList. This list has a
+     * zero size if proxying is disabled.
+     */
+    static class SocketFactory extends RMIMasterSocketFactory {
+        boolean proxyDisabled() {
+            return altFactoryList.size() == 0;
+        }
+    }
+
+    /**
+     * Takes a single arg, which is the expected boolean value of
+     * java.rmi.server.disableHttp.
+     */
+    public static void main(String[] args) throws Exception {
+        // Force there to be a proxy host, so that we are able to
+        // tell whether proxying is enabled or disabled.
+        System.setProperty("http.proxyHost", "proxy.example.com");
+
+        String propval = System.getProperty("java.rmi.server.disableHttp");
+        String propdisp = (propval == null) ? "null" : ("\"" + propval + "\"");
+        boolean expected = Boolean.parseBoolean(args[0]);
+        boolean actual = new SocketFactory().proxyDisabled();
+        System.out.printf("### prop=%s exp=%s act=%s%n", propdisp, expected, actual);
+        if (expected != actual)
+            throw new AssertionError();
+    }
+}
--- a/jdk/test/sun/security/pkcs12/PKCS12SameKeyId.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/pkcs12/PKCS12SameKeyId.java	Mon Nov 11 16:20:48 2013 +0100
@@ -60,7 +60,7 @@
         for (int i=0; i<SIZE; i++) {
             System.err.print(".");
             String cmd = "-keystore " + JKSFILE
-                    + " -storepass changeit -keypass changeit "
+                    + " -storepass changeit -keypass changeit -keyalg rsa "
                     + "-genkeypair -alias p" + i + " -dname CN=" + i;
             sun.security.tools.keytool.Main.main(cmd.split(" "));
         }
--- a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java	Mon Nov 11 16:20:48 2013 +0100
@@ -185,7 +185,7 @@
             DerOutputStream tstInfo2 = new DerOutputStream();
             tstInfo2.putOctetString(tstInfo.toByteArray());
 
-            Signature sig = Signature.getInstance("SHA1withDSA");
+            Signature sig = Signature.getInstance("SHA1withRSA");
             sig.initSign((PrivateKey)(ks.getKey(
                     alias, "changeit".toCharArray())));
             sig.update(tstInfo.toByteArray());
--- a/jdk/test/sun/security/tools/jarsigner/checkusage.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/checkusage.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -45,7 +45,7 @@
     ;;
 esac
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner"
 
--- a/jdk/test/sun/security/tools/jarsigner/collator.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/collator.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -47,7 +47,7 @@
 JFILE=collator.jar
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
-        -keystore $KS"
+        -keyalg rsa -keystore $KS"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner -keystore $KS -storepass changeit"
 
--- a/jdk/test/sun/security/tools/jarsigner/crl.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/crl.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -45,7 +45,7 @@
 
 KS=crl.jks
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS 2> /dev/null
 
--- a/jdk/test/sun/security/tools/jarsigner/jvindex.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/jvindex.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -47,7 +47,7 @@
 JFILE=jvindex.jar
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
-        -keystore $KS"
+        -keystore $KS -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner -keystore $KS -storepass changeit"
 
--- a/jdk/test/sun/security/tools/jarsigner/newsize7.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/newsize7.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -51,7 +51,7 @@
 
 KSFILE=ns7.jks
 
-KT="${TESTJAVA}${FS}bin${FS}keytool -keystore ns7.jks -storepass changeit -keypass changeit"
+KT="${TESTJAVA}${FS}bin${FS}keytool -keystore ns7.jks -storepass changeit -keypass changeit -keyalg rsa"
 JAR="${TESTJAVA}${FS}bin${FS}jar"
 JS="${TESTJAVA}${FS}bin${FS}jarsigner -keystore ns7.jks -storepass changeit"
 
--- a/jdk/test/sun/security/tools/jarsigner/onlymanifest.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/onlymanifest.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -46,7 +46,7 @@
 JFILE=onlymanifest.jar
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
-        -keystore $KS"
+        -keystore $KS -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
 
--- a/jdk/test/sun/security/tools/jarsigner/passtype.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/passtype.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -45,7 +45,7 @@
 KS=pt.jks
 JFILE=pt.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -keystore $KS -validity 300"
+KT="$TESTJAVA${FS}bin${FS}keytool -keystore $KS -validity 300 -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
 
--- a/jdk/test/sun/security/tools/jarsigner/samename.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/samename.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -47,7 +47,7 @@
 KS=samename.jks
 JFILE=em.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
 
--- a/jdk/test/sun/security/tools/jarsigner/ts.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/jarsigner/ts.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -53,7 +53,7 @@
 JAR="${TESTJAVA}${FS}bin${FS}jar"
 JAVA="${TESTJAVA}${FS}bin${FS}java"
 JAVAC="${TESTJAVA}${FS}bin${FS}javac"
-KT="${TESTJAVA}${FS}bin${FS}keytool -keystore tsks -storepass changeit -keypass changeit"
+KT="${TESTJAVA}${FS}bin${FS}keytool -keystore tsks -storepass changeit -keypass changeit -keyalg rsa"
 
 rm tsks
 echo Nothing > A
--- a/jdk/test/sun/security/tools/keytool/CloseFile.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/CloseFile.java	Mon Nov 11 16:20:48 2013 +0100
@@ -59,7 +59,7 @@
     }
 
     static void run(String s) throws Exception {
-        sun.security.tools.keytool.Main.main((s+" -debug").split(" "));
+        sun.security.tools.keytool.Main.main((s+" -debug -keyalg rsa").split(" "));
     }
     static void remove(String filename, boolean check) {
         new File(filename).delete();
--- a/jdk/test/sun/security/tools/keytool/ListKeychainStore.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/ListKeychainStore.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -71,6 +71,7 @@
         -storetype PKCS12 \
         -keystore $TEMPORARY_P12 \
         -storepass $PWD \
+        -keyalg rsa \
         -dname "CN=$i,OU=$i,O=$i,ST=$i,C=US" \
         -alias 7133495-$i
 
--- a/jdk/test/sun/security/tools/keytool/StartDateTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/StartDateTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -49,7 +49,7 @@
         new File("jks").delete();
 
         run("-keystore jks -storetype jks -storepass changeit -keypass changeit -alias me " +
-                "-genkeypair -dname CN=Haha -startdate +1y");
+                "-keyalg rsa -genkeypair -dname CN=Haha -startdate +1y");
         cal.setTime(getIssueDate());
         System.out.println(cal);
         if (cal.get(Calendar.YEAR) != year + 1) {
--- a/jdk/test/sun/security/tools/keytool/UnknownAndUnparseable.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/UnknownAndUnparseable.java	Mon Nov 11 16:20:48 2013 +0100
@@ -43,7 +43,7 @@
         // Create a cert with an unknown extension: 1.2.3.4, and an invalid
         // KeyUsage extension
         String genkey = s
-                + "-genkeypair -alias a -dname CN=A -ext 1.2.3.4=1234 "
+                + "-genkeypair -alias a -dname CN=A -ext 1.2.3.4=1234 -keyalg rsa "
                 + "-ext " + PKIXExtensions.KeyUsage_Id.toString() + "=5678";
         sun.security.tools.keytool.Main.main(genkey.split(" "));
 
--- a/jdk/test/sun/security/tools/keytool/emptysubject.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/emptysubject.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -45,7 +45,7 @@
 esac
 
 KS=emptysubject.jks
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS
 
--- a/jdk/test/sun/security/tools/keytool/importreadall.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/importreadall.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -49,7 +49,7 @@
     ;;
 esac
 
-KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -keystore importreadall.jks -storepass changeit -keypass changeit"
+KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -keystore importreadall.jks -storepass changeit -keypass changeit -keyalg rsa"
 
 # In case the test is run twice in the same directory
 
--- a/jdk/test/sun/security/tools/keytool/p12importks.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/p12importks.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -50,7 +50,7 @@
 
 rm jks 2> /dev/null
 $KT -genkeypair -keystore jks -storetype jks -alias me -dname CN=Me \
-	-storepass pass1111 -keypass pass1111 || exit 11
+	-keyalg rsa -storepass pass1111 -keypass pass1111 || exit 11
 
 # Cannot only change storepass
 rm p12 2> /dev/null
@@ -85,7 +85,7 @@
 
 rm jks 2> /dev/null
 $KT -genkeypair -keystore jks -storetype jks -alias me -dname CN=Me \
-	-storepass pass1111 -keypass pass2222 || exit 21
+	-keyalg rsa -storepass pass1111 -keypass pass2222 || exit 21
 
 # Can use old keypass as new storepass so new storepass and keypass are same
 rm p12 2> /dev/null
--- a/jdk/test/sun/security/tools/keytool/readjar.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/readjar.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -46,7 +46,7 @@
 KS=readjar.jks
 rm $KS
 $TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS}  -storepass changeit -keypass changeit -keystore $KS \
-        -alias x -dname CN=X -genkeypair
+        -keyalg rsa -alias x -dname CN=X -genkeypair
 $COMPILEJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS} cvf readjar.jar $KS
 $COMPILEJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -storepass changeit -keystore $KS readjar.jar x
 
--- a/jdk/test/sun/security/tools/keytool/selfissued.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/selfissued.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -45,7 +45,7 @@
 esac
 
 KS=selfsigned.jks
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS
 
--- a/jdk/test/sun/security/tools/keytool/trystore.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/tools/keytool/trystore.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -43,7 +43,7 @@
 
 rm trystore.jks 2> /dev/null
 
-KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -storetype jks -keystore trystore.jks"
+KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -storetype jks -keystore trystore.jks -keyalg rsa"
 $KEYTOOL -genkeypair -alias a -dname CN=A -storepass changeit -keypass changeit
 $KEYTOOL -genkeypair -alias b -dname CN=B -storepass changeit -keypass changeit
 
--- a/jdk/test/sun/security/validator/certreplace.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/validator/certreplace.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -48,7 +48,7 @@
 esac
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
-    -keypass changeit -keystore certreplace.jks"
+    -keypass changeit -keystore certreplace.jks -keyalg rsa"
 JAVAC=$COMPILEJAVA${FS}bin${FS}javac
 JAVA=$TESTJAVA${FS}bin${FS}java
 
--- a/jdk/test/sun/security/validator/samedn.sh	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/security/validator/samedn.sh	Mon Nov 11 16:20:48 2013 +0100
@@ -48,7 +48,7 @@
 esac
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
-    -keypass changeit -keystore samedn.jks"
+    -keypass changeit -keystore samedn.jks -keyalg rsa"
 JAVAC=$COMPILEJAVA${FS}bin${FS}javac
 JAVA=$TESTJAVA${FS}bin${FS}java
 
--- a/jdk/test/sun/text/resources/LocaleData	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/text/resources/LocaleData	Mon Nov 11 16:20:48 2013 +0100
@@ -7681,3 +7681,9 @@
 
 # bug 8021121
 CurrencyNames/lv_LV/EUR=\u20AC
+
+# bug # 6192407
+LocaleNames/ko/PT=\ud3ec\ub974\ud22c\uce7c
+
+# bug 6931564
+LocaleNames/sv/ZA=Sydafrika
--- a/jdk/test/sun/text/resources/LocaleDataTest.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/text/resources/LocaleDataTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -35,7 +35,7 @@
  *      6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
  *      6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
  *      7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509
- *      7114053 7074882 7040556 8013836 8021121
+ *      7114053 7074882 7040556 8013836 8021121 6192407 6931564
  * @summary Verify locale data
  *
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstatd/JstatGCUtilParser.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.Arrays;
+
+import jdk.testlibrary.Utils;
+import static jdk.testlibrary.Asserts.*;
+
+/**
+ * The helper class for parsing following output from command 'jstat -gcutil':
+ *
+ *  S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT     GCT
+ *  100.00   0.00  64.68  13.17  73.39  33.46      2    0.003     1    0.156    0.158
+ *  100.00   0.00  76.54  13.17  73.39  33.46      2    0.003     1    0.156    0.158
+ *  100.00   0.00  83.49  13.17  73.39  33.46      2    0.003     1    0.156    0.158
+ *  100.00   0.00  84.53  13.17  73.39  33.46      2    0.003     1    0.156    0.158
+ *  100.00   0.00  85.57  13.17  73.39  33.46      2    0.003     1    0.156    0.158
+ *
+ *  It will be verified that numerical values have defined types and are reasonable,
+ *  for example percentage should fit within 0-100 interval.
+ */
+public class JstatGCUtilParser {
+
+    public enum GcStatisticsType {
+        INTEGER, DOUBLE, PERCENTAGE, PERCENTAGE_OR_DASH;
+    }
+
+    public enum GcStatistics {
+        S0(GcStatisticsType.PERCENTAGE),
+        S1(GcStatisticsType.PERCENTAGE),
+        E(GcStatisticsType.PERCENTAGE),
+        O(GcStatisticsType.PERCENTAGE),
+        M(GcStatisticsType.PERCENTAGE),
+        CCS(GcStatisticsType.PERCENTAGE_OR_DASH),
+        YGC(GcStatisticsType.INTEGER),
+        YGCT(GcStatisticsType.DOUBLE),
+        FGC(GcStatisticsType.INTEGER),
+        FGCT(GcStatisticsType.DOUBLE),
+        GCT(GcStatisticsType.DOUBLE);
+
+        private final GcStatisticsType type;
+
+        private GcStatistics(GcStatisticsType type) {
+            this.type = type;
+        }
+
+        private GcStatisticsType getType() {
+            return type;
+        }
+
+        public static boolean isHeadline(String... valueArray) {
+            if (valueArray.length != values().length) {
+                return false;
+            }
+            int headersCount = 0;
+            for (int i = 0; i < values().length; i++) {
+                if (valueArray[i].equals(values()[i].toString())) {
+                    headersCount++;
+                }
+            }
+            if (headersCount != values().length) {
+                return false;
+            }
+            return true;
+        }
+
+        private static void verifyLength(String... valueArray) throws Exception {
+            assertEquals(valueArray.length, values().length,
+                    "Invalid number of data columns: " + Arrays.toString(valueArray));
+        }
+
+        public static void verify(String... valueArray) throws Exception {
+            verifyLength(valueArray);
+            for (int i = 0; i < values().length; i++) {
+                GcStatisticsType type = values()[i].getType();
+                String value = valueArray[i].trim();
+                if (type.equals(GcStatisticsType.INTEGER)) {
+                    Integer.parseInt(value);
+                    break;
+                }
+                if (type.equals(GcStatisticsType.DOUBLE)) {
+                    Double.parseDouble(value);
+                    break;
+                }
+                if (type.equals(GcStatisticsType.PERCENTAGE_OR_DASH) &&
+                        value.equals("-")) {
+                    break;
+                }
+                double percentage = Double.parseDouble(value);
+                assertTrue(0 <= percentage && percentage <= 100,
+                        "Not a percentage: " + value);
+            }
+        }
+
+    }
+
+    private final String output;
+
+    public JstatGCUtilParser(String output) {
+        this.output = output;
+    }
+
+    public String getOutput() {
+        return output;
+    }
+
+    /**
+     * The function will discard any lines that come before the header line.
+     * This can happen if the JVM outputs a warning message for some reason
+     * before running jstat.
+     */
+    public void parse(int samples) throws Exception {
+        boolean headlineFound = false;
+        int datalineCount = 0;
+
+        String[] lines = output.split(Utils.NEW_LINE);
+        for (String line : lines) {
+            line = line.replaceAll("\\s+", " ").trim();
+            String[] valueArray = line.split(" ");
+
+            if (!headlineFound) {
+                headlineFound = GcStatistics.isHeadline(valueArray);
+                continue;
+            }
+
+            GcStatistics.verify(valueArray);
+            datalineCount++;
+        }
+
+        assertTrue(headlineFound, "No or invalid headline found, expected: " +
+                Utils.NEW_LINE + Arrays.toString(GcStatistics.values()).replaceAll(",", " "));
+        assertEquals(samples, datalineCount,
+                "Expected " + samples + " samples, got " + datalineCount);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstatd/JstatdTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,356 @@
+/*
+ * 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.File;
+import java.net.UnknownHostException;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.util.Arrays;
+
+import static jdk.testlibrary.Asserts.*;
+import jdk.testlibrary.JDKToolLauncher;
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.ProcessThread;
+import jdk.testlibrary.TestThread;
+import jdk.testlibrary.Utils;
+
+/**
+ * The base class for tests of jstatd.
+ *
+ * The test sequence for TestJstatdDefaults for example is:
+ * <pre>
+ * {@code
+ * // start jstatd process
+ * jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy
+ *
+ * // run jps and verify its output
+ * jps -J-XX:+UsePerfData hostname
+ *
+ * // run jstat and verify its output
+ * jstat -J-XX:+UsePerfData -J-Duser.language=en -gcutil pid@hostname 250 5
+ *
+ * // stop jstatd process and verify that no unexpected exceptions have been thrown
+ * }
+ * </pre>
+ */
+public final class JstatdTest {
+
+    /**
+     * jstat gcutil option: takes JSTAT_GCUTIL_SAMPLES samples at
+     * JSTAT_GCUTIL_INTERVAL_MS millisecond intervals
+     */
+    private static final int JSTAT_GCUTIL_SAMPLES = 5;
+    private static final int JSTAT_GCUTIL_INTERVAL_MS = 250;
+    private static final String JPS_OUTPUT_REGEX = "^\\d+\\s*.*";
+
+    private boolean useDefaultPort = true;
+    private String port;
+    private String serverName;
+    private String jstatdPid;
+    private boolean withExternalRegistry = false;
+
+    public void setServerName(String serverName) {
+        this.serverName = serverName;
+    }
+
+    public void setUseDefaultPort(boolean useDefaultPort) {
+        this.useDefaultPort = useDefaultPort;
+    }
+
+    public void setWithExternalRegistry(boolean withExternalRegistry) {
+        this.withExternalRegistry = withExternalRegistry;
+    }
+
+    /**
+     * Parse pid from jps output
+     */
+    private String parsePid(String tool, OutputAnalyzer output) throws Exception {
+        String[] lines = output.getOutput().split(Utils.NEW_LINE);
+        String pid = null;
+        int count = 0;
+        String processName = tool;
+        if (tool == "rmiregistry") {
+            processName = "registryimpl";
+        }
+        for (String line : lines) {
+            if (line.toLowerCase().matches("^\\d+\\s{1}" + processName + "$")) {
+                pid = line.split(" ")[0];
+                count++;
+            }
+        }
+        if (count > 1) {
+            throw new Exception("Expected one " + tool
+                    + " process, got " + count + ". Test will be canceled.");
+        }
+
+        return pid;
+    }
+
+    private String getToolPid(String tool)
+            throws Exception {
+        OutputAnalyzer output = runJps();
+        return parsePid(tool, output);
+    }
+
+    private String waitOnTool(String tool, TestThread thread) throws Throwable {
+        while (true) {
+            String pid = getToolPid(tool);
+
+            if (pid != null) {
+                System.out.println(tool + " pid: " + pid);
+                return pid;
+            }
+
+            Throwable t = thread.getUncaught();
+            if (t != null) {
+                if (t.getMessage().contains(
+                        "java.rmi.server.ExportException: Port already in use")) {
+                    System.out.println("Port already in use. Trying to restart with a new one...");
+                    Thread.sleep(100);
+                    return null;
+                } else {
+                    // Something unexpected has happened
+                    throw new Throwable(t);
+                }
+            }
+
+            System.out.println("Waiting until " + tool + " is running...");
+            Thread.sleep(100);
+        }
+    }
+
+    private void log(String caption, String... cmd) {
+        System.out.println(Utils.NEW_LINE + caption + ":");
+        System.out.println(Arrays.toString(cmd).replace(",", ""));
+    }
+
+    private String getDestination() throws UnknownHostException {
+        String option = Utils.getHostname();
+        if (port != null) {
+            option += ":" + port;
+        }
+        if (serverName != null) {
+            option += "/" + serverName;
+        }
+        return option;
+    }
+
+    /**
+     * Depending on test settings command line can look like:
+     *
+     * jps -J-XX:+UsePerfData hostname
+     * jps -J-XX:+UsePerfData hostname:port
+     * jps -J-XX:+UsePerfData hostname/serverName
+     * jps -J-XX:+UsePerfData hostname:port/serverName
+     */
+    private OutputAnalyzer runJps() throws Exception {
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jps");
+        launcher.addVMArg("-XX:+UsePerfData");
+        launcher.addToolArg(getDestination());
+
+        String[] cmd = launcher.getCommand();
+        log("Start jps", cmd);
+
+        ProcessBuilder processBuilder = new ProcessBuilder(cmd);
+        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        System.out.println(output.getOutput());
+
+        return output;
+    }
+
+    /**
+     * Verifies output form jps contains pids and programs' name information.
+     * The function will discard any lines that come before the first line with pid.
+     * This can happen if the JVM outputs a warning message for some reason
+     * before running jps.
+     *
+     * The output can look like:
+     * 35536 Jstatd
+     * 35417 Main
+     * 31103 org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
+     */
+    private void verifyJpsOutput(OutputAnalyzer output) throws Exception {
+        output.shouldHaveExitValue(0);
+        assertFalse(output.getOutput().isEmpty(), "Output should not be empty");
+
+        boolean foundFirstLineWithPid = false;
+        String[] lines = output.getOutput().split(Utils.NEW_LINE);
+        for (String line : lines) {
+            if (!foundFirstLineWithPid) {
+                foundFirstLineWithPid = line.matches(JPS_OUTPUT_REGEX);
+                continue;
+            }
+            assertTrue(line.matches(JPS_OUTPUT_REGEX),
+                    "Output does not match the pattern" + Utils.NEW_LINE + line);
+        }
+        assertTrue(foundFirstLineWithPid, "Invalid output");
+    }
+
+    /**
+     * Depending on test settings command line can look like:
+     *
+     * jstat -J-XX:+UsePerfData -J-Duser.language=en -gcutil pid@hostname 250 5
+     * jstat -J-XX:+UsePerfData -J-Duser.language=en -gcutil pid@hostname:port 250 5
+     * jstat -J-XX:+UsePerfData -J-Duser.language=en -gcutil pid@hostname/serverName 250 5
+     * jstat -J-XX:+UsePerfData -J-Duser.language=en -gcutil pid@hostname:port/serverName 250 5
+     */
+    private OutputAnalyzer runJstat() throws Exception {
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jstat");
+        launcher.addVMArg("-XX:+UsePerfData");
+        launcher.addVMArg("-Duser.language=en");
+        launcher.addToolArg("-gcutil");
+        launcher.addToolArg(jstatdPid + "@" + getDestination());
+        launcher.addToolArg(Integer.toString(JSTAT_GCUTIL_INTERVAL_MS));
+        launcher.addToolArg(Integer.toString(JSTAT_GCUTIL_SAMPLES));
+
+        String[] cmd = launcher.getCommand();
+        log("Start jstat", cmd);
+
+        ProcessBuilder processBuilder = new ProcessBuilder(cmd);
+        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        System.out.println(output.getOutput());
+
+        return output;
+    }
+
+    private void verifyJstatOutput(OutputAnalyzer output)
+            throws Exception {
+        output.shouldHaveExitValue(0);
+        assertFalse(output.getOutput().isEmpty(), "Output should not be empty");
+
+        JstatGCUtilParser gcUtilParser = new JstatGCUtilParser(
+                output.getOutput());
+        gcUtilParser.parse(JSTAT_GCUTIL_SAMPLES);
+    }
+
+    private void runToolsAndVerify() throws Exception {
+        OutputAnalyzer output = runJps();
+        verifyJpsOutput(output);
+
+        output = runJstat();
+        verifyJstatOutput(output);
+    }
+
+    private Registry startRegistry()
+            throws InterruptedException, RemoteException {
+        Registry registry = null;
+        try {
+            System.out.println("Start rmiregistry on port " + port);
+            registry = LocateRegistry
+                    .createRegistry(Integer.parseInt(port));
+        } catch (RemoteException e) {
+            if (e.getMessage().contains("Port already in use")) {
+                System.out.println("Port already in use. Trying to restart with a new one...");
+                Thread.sleep(100);
+                return null;
+            } else {
+                throw e;
+            }
+        }
+        return registry;
+    }
+
+    private void cleanUpThread(ProcessThread thread) throws Throwable {
+        if (thread != null) {
+            thread.stopProcess();
+            thread.joinAndThrow();
+        }
+    }
+
+    /**
+     * Depending on test settings command line can look like:
+     *
+     * jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy
+     * jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy -p port
+     * jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy -n serverName
+     * jstatd -J-XX:+UsePerfData -J-Djava.security.policy=all.policy -p port -n serverName
+     */
+    private String[] getJstatdCmd() throws UnknownHostException {
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jstatd");
+        launcher.addVMArg("-XX:+UsePerfData");
+        String testSrc = System.getProperty("test.src");
+        File policy = new File(testSrc, "all.policy");
+        launcher.addVMArg("-Djava.security.policy=" + policy.getAbsolutePath());
+        if (port != null) {
+            launcher.addToolArg("-p");
+            launcher.addToolArg(port);
+        }
+        if (serverName != null) {
+            launcher.addToolArg("-n");
+            launcher.addToolArg(serverName);
+        }
+
+        String[] cmd = launcher.getCommand();
+        log("Start jstatd", cmd);
+        return cmd;
+    }
+
+    private ProcessThread tryToSetupJstatdProcess() throws Throwable {
+        ProcessThread jstatdThread = new ProcessThread("Jstatd-Thread",
+                getJstatdCmd());
+        try {
+            jstatdThread.start();
+            // Make sure jstatd is up and running
+            jstatdPid = waitOnTool("jstatd", jstatdThread);
+            if (jstatdPid == null) {
+                // The port is already in use. Cancel and try with new one.
+                jstatdThread.stopProcess();
+                jstatdThread.join();
+                return null;
+            }
+        } catch (Throwable t) {
+            // Something went wrong in the product - clean up!
+            cleanUpThread(jstatdThread);
+            throw t;
+        }
+
+        return jstatdThread;
+    }
+
+    public void doTest() throws Throwable {
+        ProcessThread jstatdThread = null;
+        try {
+            while (jstatdThread == null) {
+                if (!useDefaultPort || withExternalRegistry) {
+                    port = Integer.toString(Utils.getFreePort());
+                }
+
+                if (withExternalRegistry) {
+                    Registry registry = startRegistry();
+                    if (registry == null) {
+                        // The port is already in use. Cancel and try with new one.
+                        continue;
+                    }
+                }
+
+                jstatdThread = tryToSetupJstatdProcess();
+            }
+
+            runToolsAndVerify();
+        } finally {
+            cleanUpThread(jstatdThread);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,38 @@
+/*
+ * 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 4990825
+ * @library /lib/testlibrary
+ * @build JstatdTest JstatGCUtilParser
+ * @run main/timeout=60 TestJstatdDefaults
+ */
+public class TestJstatdDefaults {
+
+    public static void main(String[] args) throws Throwable {
+        JstatdTest test = new JstatdTest();
+        test.doTest();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4990825 7092186
+ * @library /lib/testlibrary
+ * @build JstatdTest JstatGCUtilParser
+ * @run main/timeout=60 TestJstatdExternalRegistry
+ */
+public class TestJstatdExternalRegistry {
+
+    public static void main(String[] args) throws Throwable {
+        JstatdTest test = new JstatdTest();
+        test.setWithExternalRegistry(true);
+        test.doTest();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstatd/TestJstatdPort.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4990825
+ * @library /lib/testlibrary
+ * @build JstatdTest JstatGCUtilParser
+ * @run main/timeout=60 TestJstatdPort
+ */
+public class TestJstatdPort {
+
+    public static void main(String[] args) throws Throwable {
+        JstatdTest test = new JstatdTest();
+        test.setUseDefaultPort(false);
+        test.doTest();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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 4990825
+ * @library /lib/testlibrary
+ * @build JstatdTest JstatGCUtilParser
+ * @run main/timeout=60 TestJstatdPortAndServer
+ */
+public class TestJstatdPortAndServer {
+
+    public static void main(String[] args) throws Throwable {
+        JstatdTest test = new JstatdTest();
+        test.setUseDefaultPort(false);
+        test.setServerName("TestJstatdServer");
+        test.doTest();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstatd/TestJstatdServer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4990825
+ * @library /lib/testlibrary
+ * @build JstatdTest JstatGCUtilParser
+ * @run main/timeout=60 TestJstatdServer
+ */
+public class TestJstatdServer {
+
+    public static void main(String[] args) throws Throwable {
+        JstatdTest test = new JstatdTest();
+        test.setServerName("TestJstatdServer");
+        test.doTest();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstatd/TestJstatdUsage.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,51 @@
+/*
+ * 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 jdk.testlibrary.JDKToolLauncher;
+import jdk.testlibrary.OutputAnalyzer;
+
+/*
+ * @test
+ * @bug 4990825
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.JDKToolLauncher jdk.testlibrary.OutputAnalyzer
+ * @run main TestJstatdUsage
+ */
+public class TestJstatdUsage {
+
+    public static void main(String[] args) throws Exception {
+        testUsage("-help");
+        testUsage("-?");
+    }
+
+    private static void testUsage(String option) throws Exception {
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jstatd");
+        launcher.addToolArg(option);
+        ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand());
+        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+
+        output.shouldContain("usage: jstatd [-nr] [-p port] [-n rminame]");
+        output.shouldHaveExitValue(1);
+    }
+
+}
--- a/jdk/test/sun/tools/jstatd/jpsOutput1.awk	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#
-BEGIN	{
-	    totallines=0; matched=0
-	}
-
-/^[0-9]+ [a-z|A-Z][a-z|A-Z|0-9|\$|\.]*$/	{
-	    matched++;
-	}
-
-/^[0-9]+ -- .*$/	{
-	    matched++;
-	}
-
-/^[0-9]+ $/	{
-	    matched++;
-	}
-
-	{ totallines++; print $0 }
-
-END	{
-	    if ((totallines > 0) && (matched == totallines)) {
-	        exit 0
-	    }
-	    else {
-	        exit 1
-	    }
-	}
--- a/jdk/test/sun/tools/jstatd/jstatGcutilOutput1.awk	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#
-# matching the following output specified as a pattern that verifies
-# that the numerical values conform to a specific pattern, rather than
-# specific values.
-#
-#  S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT     GCT   
-#  0.00 100.00  56.99   7.81  95.03  87.56      1    0.009     0    0.000    0.009
-#  0.00 100.00  63.64   7.81  95.03  87.56      1    0.009     0    0.000    0.009
-#  0.00 100.00  64.68   7.81  95.03  87.56      1    0.009     0    0.000    0.009
-#  0.00 100.00  65.73   7.81  95.03  87.56      1    0.009     0    0.000    0.009
-#  0.00 100.00  67.22   7.81  95.03  87.56      1    0.009     0    0.000    0.009
-
-BEGIN	{
-	    headerlines=0; datalines=0; totallines=0
-	}
-
-/^  S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT     GCT   $/	{
-	    headerlines++;
-	}
-
-/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/	{
-	    datalines++;
-	}
-
-	{ totallines++; print $0 }
-
-END	{
-	    if ((headerlines == 1) && (datalines == 5) && (totallines == 6)) {
-	        exit 0
-            }
-            else {
-	        exit 1
-            }
-	}
--- a/jdk/test/sun/tools/jstatd/jstatdDefaults.sh	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#
-# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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 4990825
-# @run shell/timeout=60 jstatdDefaults.sh
-# @summary Test functionality of 'jstatd &'
-
-. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh
-
-setup
-verify_os
-
-cleanup() {
-  kill_proc ${JSTATD_PID}
-}
-
-trap 'cleanup' 0 HUP INT QUIT TERM
-
-JSTATD="${TESTJAVA}/bin/jstatd"
-JPS="${TESTJAVA}/bin/jps"
-JSTAT="${TESTJAVA}/bin/jstat"
-
-HOSTNAME=`uname -n`
-
-JSTATD_OUT="jstatd_$$.out"
-
-${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy 2>&1 > ${JSTATD_OUT} &
-JSTATD_PID=$!
-
-echo "jstatd started as pid ${JSTATD_PID}"
-sleep 3
-
-${JPS} -J-XX:+UsePerfData ${HOSTNAME} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
-
-if [ $? -ne 0 ]
-then
-    echo "Output of jps differs from expected output. Failed."
-    cleanup
-    exit 1
-fi
-
-${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_PID}@${HOSTNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
-RC=$?
-
-if [ ${RC} -ne 0 ]
-then
-    echo "jstat output differs from expected output"
-fi
-
-if [ -s ${JSTATD_OUT} ]
-then
-    echo "jstatd generated the following, unexpected output:"
-    RC=1
-fi
-
-cleanup
-
-exit ${RC}
--- a/jdk/test/sun/tools/jstatd/jstatdExternalRegistry.sh	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-#
-# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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 4990825 7092186
-# @run shell/timeout=90 jstatdExternalRegistry.sh
-# @summary Test functionality of 'jstatd -p<port>&' with an external RMI registry
-
-. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh
-
-setup
-verify_os
-
-cleanup() {
-  kill_proc ${RMIREGISTRY_PID}
-  kill_proc ${JSTATD_PID}
-}
-
-trap 'cleanup' 0 HUP INT QUIT TERM
-
-RMIREGISTRY="${TESTJAVA}/bin/rmiregistry"
-JSTATD="${TESTJAVA}/bin/jstatd"
-JPS="${TESTJAVA}/bin/jps"
-JSTAT="${TESTJAVA}/bin/jstat"
-
-HOSTNAME=`uname -n`
-PORT=`freePort`
-if [ "${PORT}" = "0" ] ; then
-  echo "Cannot get free port"
-  exit 1
-fi
-
-RMIREGISTRY_OUT="rmiregistry_$$.out"
-JSTATD_OUT="jstatd_$$.out"
-
-${RMIREGISTRY} -J-XX:+UsePerfData ${PORT} > ${RMIREGISTRY_OUT} 2>&1 &
-RMIREGISTRY_PID=$!
-
-echo "rmiregistry started on port ${PORT} as pid ${RMIREGISTRY_PID}"
-sleep 3
-
-${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT} > ${JSTATD_OUT} 2>&1 &
-JSTATD_PID=$!
-
-echo "jstatd started as pid ${JSTATD_PID}"
-sleep 3
-
-${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
-
-if [ $? -ne 0 ]
-then
-    echo "Output of jps differs from expected output. Failed."
-    exit 1
-fi
-
-${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
-RC=$?
-
-if [ ${RC} -ne 0 ]
-then
-    echo "jstat output differs from expected output"
-fi
-
-if [ -s ${JSTATD_OUT} ]
-then
-    echo "jstatd generated unexpected output: see ${JSTATD_OUT}"
-    RC=1
-fi
-
-if [ -s ${RMIREGISTRY_OUT} ]
-then
-    echo "rmiregistry generated unexpected output: see ${RMIREGISTRY_OUT}"
-    RC=1
-fi
-
-exit ${RC}
--- a/jdk/test/sun/tools/jstatd/jstatdPort.sh	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#
-# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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 4990825
-# @run shell/timeout=60 jstatdPort.sh
-# @summary Test functionality of 'jstatd -p <port>&'
-
-. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh
-
-setup
-verify_os
-
-cleanup() {
-  kill_proc ${JSTATD_PID}
-}
-
-trap 'cleanup' 0 HUP INT QUIT TERM
-
-JSTATD="${TESTJAVA}/bin/jstatd"
-JPS="${TESTJAVA}/bin/jps"
-JSTAT="${TESTJAVA}/bin/jstat"
-
-HOSTNAME=`uname -n`
-PORT=`freePort`
-if [ "${PORT}" = "0" ] ; then
-  echo "Cannot get free port"
-  exit 1
-fi
-
-JSTATD_OUT="jstatd_$$.out"
-
-${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT} 2>&1 > ${JSTATD_OUT} &
-JSTATD_PID=$!
-
-echo "jstatd started as pid ${JSTATD_PID} on port ${PORT}"
-sleep 3
-
-${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT} 2>&1 | tee jps.out | awk -f ${TESTSRC}/jpsOutput1.awk
-
-if [ $? -ne 0 ]
-then
-    echo "Output of jps differs from expected output. Failed."
-    cleanup
-    exit 1
-fi
-
-${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
-RC=$?
-
-if [ ${RC} -ne 0 ]
-then
-    echo "jstat output differs from expected output"
-fi
-
-if [ -s ${JSTATD_OUT} ]
-then
-    echo "jstatd generated the following, unexpected output:"
-    RC=1
-fi
-
-cleanup
-
-exit ${RC}
--- a/jdk/test/sun/tools/jstatd/jstatdServerName.sh	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-#
-# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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 4990825
-# @run shell/timeout=90 jstatdServerName.sh
-# @summary Test functionality of 'jstatd -p <port> -n <servername>&'
-
-. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh
-
-setup
-verify_os
-
-cleanup() {
-  kill_proc ${JSTATD_1_PID}
-  kill_proc ${JSTATD_2_PID}
-}
-
-trap 'cleanup' 0 HUP INT QUIT TERM
-
-JSTATD="${TESTJAVA}/bin/jstatd"
-JPS="${TESTJAVA}/bin/jps"
-JSTAT="${TESTJAVA}/bin/jstat"
-
-HOSTNAME=`uname -n`
-PORT_1=`freePort`
-if [ "${PORT_1}" = "0" ] ; then
-  echo "ERROR: No free port"
-  exit 1
-fi
-PORT_2=`expr ${PORT_1} '+' 1`
-SERVERNAME="SecondJstatdServer"
-
-JSTATD_1_OUT="jstatd_$$_1.out"
-JSTATD_2_OUT="jstatd_$$_2.out"
-
-${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT_1} 2>&1 > ${JSTATD_1_OUT} &
-JSTATD_1_PID=$!
-
-echo "first jstatd started as pid ${JSTATD_1_PID} on port ${PORT_1} with default server name"
-sleep 3
-
-${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT_2} -n ${SERVERNAME} 2>&1 > ${JSTATD_2_OUT} &
-JSTATD_2_PID=$!
-
-echo "second jstatd started as pid ${JSTATD_2_PID} on port ${PORT_2} with name ${SERVERNAME}"
-sleep 3
-
-echo "running: ${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT_1}"
-${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT_1} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
-
-if [ $? -ne 0 ]
-then
-    echo "Output of jps differs from expected output. Failed."
-    cleanup
-    exit 1
-fi
-
-echo "running: ${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT_2}/${SERVERNAME}"
-${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT_2}/${SERVERNAME} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
-
-if [ $? -ne 0 ]
-then
-    echo "Output of jps differs from expected output. Failed."
-    cleanup
-    exit 1
-fi
-
-echo "running: ${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5"
-${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
-RC=$?
-
-if [ ${RC} -ne 0 ]
-then
-    echo "jstat output differs from expected output"
-fi
-
-echo "running: ${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5"
-${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
-RC=$?
-
-if [ ${RC} -ne 0 ]
-then
-    echo "jstat output differs from expected output"
-fi
-
-if [ -s ${JSTATD_1_OUT} ]
-then
-    echo "first jstatd generated the following, unexpected output:"
-    RC=1
-fi
-
-if [ -s ${JSTATD_2_OUT} ]
-then
-    echo "second jstatd generated the following, unexpected output:"
-    RC=1
-fi
-
-cleanup
-
-exit ${RC}
--- a/jdk/test/sun/tools/jstatd/jstatdUsage1.sh	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @bug 4990825
-# @run shell jstatdUsage1.sh
-# @summary Test that output of 'jstatd -help' matches the usage.out file
-
-. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh
-
-setup
-
-JSTATD="${TESTJAVA}/bin/jstatd"
-
-JSTATD_1_OUT="jstatd_$$_1.out"
-JSTATD_2_OUT="jstatd_$$_2.out"
-
-${JSTATD} -? > ${JSTATD_1_OUT} 2>&1
-
-diff -w ${JSTATD_1_OUT} ${TESTSRC}/usage.out
-if [ $? != 0 ]
-then
-  echo "Output of jstatd -? differs from expected output. Failed."
-  exit 1
-fi
-
-${JSTATD} -help > ${JSTATD_2_OUT} 2>&1
-
-diff -w ${JSTATD_2_OUT} ${TESTSRC}/usage.out
-if [ $? != 0 ]
-then
-  echo "Output of jstatd -help differs from expected output. Failed."
-  exit 1
-fi
-
-exit 0
--- a/jdk/test/sun/tools/jstatd/usage.out	Mon Nov 11 05:05:36 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-usage: jstatd [-nr] [-p port] [-n rminame]
--- a/jdk/test/sun/util/resources/TimeZone/Bug6317929.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/sun/util/resources/TimeZone/Bug6317929.java	Mon Nov 11 16:20:48 2013 +0100
@@ -130,12 +130,12 @@
                                        "(New South Wales)\"");
         tzLocale = locales2Test[1];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
-           ("\u00d6stliche Normalzeit (New South Wales)"))
+           ("Eastern Normalzeit (Neus\u00fcdwales)"))
             throw new RuntimeException("\n" + tzLocale + ": LONG, " +
                                        "non-daylight saving name for " +
                                        "Australia/Currie should be " +
-                                       "\"\u00d6stliche Normalzeit " +
-                                       "(New South Wales)\"");
+                                       "\"Eastern Normalzeit " +
+                                       "(Neus\u00fcdwales)\"");
         tzLocale = locales2Test[2];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
            ("Hora est\u00e1ndar Oriental (Nueva Gales del Sur)"))
@@ -154,53 +154,53 @@
                                        "(Nouvelle-Galles du Sud)\"");
         tzLocale = locales2Test[4];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
-           ("Ora solare dell'Australia orientale (Nuovo Galles del Sud)"))
+           ("Ora standard dell'Australia orientale (Nuovo Galles del Sud)"))
             throw new RuntimeException("\n" + tzLocale + ": LONG, " +
                                        "non-daylight saving name for " +
                                        "Australia/Currie should be " +
-                                       "\"Ora solare dell'Australia orientale " +
+                                       "\"Ora standard dell'Australia orientale " +
                                        "(Nuovo Galles del Sud)\"");
         tzLocale = locales2Test[5];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
-           ("\u6771\u90e8\u6a19\u6e96\u6642 " +
-            "(\u30cb\u30e5\u30fc\u30b5\u30a6\u30b9\u30a6\u30a7\u30fc\u30eb\u30ba)"))
+           ("\u6771\u90E8\u6A19\u6E96\u6642" +
+            "(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA)"))
             throw new RuntimeException("\n" + tzLocale + ": LONG, " +
                                        "non-daylight saving name for " +
                                        "Australia/Currie should be " +
-                                       "\"\u6771\u90e8\u6a19\u6e96\u6642 " +
-                                       "(\u30cb\u30e5\u30fc\u30b5\u30a6\u30b9" +
-                                       "\u30a6\u30a7\u30fc\u30eb\u30ba)\"");
+                                       "\"\u6771\u90E8\u6A19\u6E96\u6642" +
+                                       "(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9" +
+                                       "\u30A6\u30A7\u30FC\u30EB\u30BA)\"");
         tzLocale = locales2Test[6];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
-           ("\ub3d9\ubd80 \ud45c\uc900\uc2dc(\ub274 \uc0ac\uc6b0\uc2a4 \uc6e8\uc77c\uc988)"))
+           ("\uB3D9\uBD80 \uD45C\uC900\uC2DC(\uB274\uC0AC\uC6B0\uC2A4\uC6E8\uC77C\uC988)"))
             throw new RuntimeException("\n" + tzLocale + ": LONG, " +
                                        "non-daylight saving name for " +
                                        "Australia/Currie should be " +
-                                       "\"\ub3d9\ubd80 \ud45c\uc900\uc2dc" +
-                                       "(\ub274 \uc0ac\uc6b0\uc2a4 \uc6e8\uc77c\uc988)\"");
+                                       "\"\uB3D9\uBD80 \uD45C\uC900\uC2DC" +
+                                       "(\uB274\uC0AC\uC6B0\uC2A4\uC6E8\uC77C\uC988)\"");
         tzLocale = locales2Test[7];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
-           ("Eastern, normaltid (Nya Sydwales)"))
+           ("\u00D6stlig standardtid (New South Wales)"))
             throw new RuntimeException("\n" + tzLocale + ": LONG, " +
                                        "non-daylight saving name for " +
                                        "Australia/Currie should be " +
-                                       "\"Eastern, normaltid " +
-                                       "(Nya Sydwales)\"");
+                                       "\"\u00D6stlig standardtid " +
+                                       "(New South Wales)\"");
         tzLocale = locales2Test[8];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
-           ("\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u65b0\u5357\u5a01\u5c14\u65af\uff09"))
+           ("\u4E1C\u90E8\u6807\u51C6\u65F6\u95F4 (\u65B0\u5357\u5A01\u5C14\u65AF)"))
             throw new RuntimeException("\n" + tzLocale + ": LONG, " +
                                        "non-daylight saving name for " +
                                        "Australia/Currie should be " +
-                                       "\"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4 " +
-                                       "\uff08\u65b0\u5357\u5a01\u5c14\u65af\uff09\"");
+                                       "\"\u4E1C\u90E8\u6807\u51C6\u65F6\u95F4 " +
+                                       "(\u65B0\u5357\u5A01\u5C14\u65AF)\"");
         tzLocale = locales2Test[9];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
-           ("\u6771\u65b9\u6a19\u6e96\u6642\u9593 (\u65b0\u5357\u5a01\u723e\u65af)"))
+           ("\u6771\u90E8\u6A19\u6E96\u6642\u9593 (\u65B0\u5357\u5A01\u723E\u65AF)"))
             throw new RuntimeException("\n" + tzLocale + ": LONG, " +
                                        "non-daylight saving name for " +
                                        "Australia/Currie should be " +
-                                       "\"\u6771\u65b9\u6a19\u6e96\u6642\u9593 " +
-                                       "(\u65b0\u5357\u5a01\u723e\u65af)\"");
+                                       "\"\u6771\u90E8\u6A19\u6E96\u6642\u9593 " +
+                                       "(\u65B0\u5357\u5A01\u723E\u65AF)\"");
    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/tools/jar/normalize/TestNormal.java	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,147 @@
+/*
+ * 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
+ * @run main/timeout=600 TestNormal
+ * @bug 8020802
+ * @summary Need an ability to create jar files that are invariant to the pack200 packing/unpacking
+ * @author Alexander Zuev
+ */
+
+import java.io.*;
+import java.util.Collections;
+import java.util.Properties;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+public class TestNormal {
+    private static String FS = File.separator;
+
+    public static void main(String args[]) throws Exception {
+        Properties p = System.getProperties();
+        String java_home = p.getProperty("test.jdk");
+        String dtjar = java_home + File.separator + "lib"
+                + File.separator + "dt.jar";
+
+        File folder = new File("dt");
+        if (folder.exists()) {
+            delete(folder);
+        }
+        folder.mkdir();
+
+        try {
+            extractJar(new JarFile(dtjar), folder);
+            execJavaCommand(java_home, "jar cnf normalized.jar -C dt .");
+            execJavaCommand(java_home, "jar cf original.jar -C dt .");
+            execJavaCommand(java_home, "pack200 -r repacked.jar original.jar");
+            compareJars(new JarFile("normalized.jar"), new JarFile("repacked.jar"));
+        } finally {
+            String[] cleanupList = {"dt", "normalized.jar", "original.jar", "repacked.jar"};
+            for (String s : cleanupList) {
+                delete(new File(s));
+            }
+        }
+    }
+
+    public static void execJavaCommand(String java_home, String cmd) throws Exception {
+        Process proc = Runtime.getRuntime().exec(java_home + FS + "bin" + FS + cmd);
+        String s;
+        BufferedReader stdInput =
+                new BufferedReader(new InputStreamReader(proc.getInputStream()));
+        BufferedReader stdError =
+                new BufferedReader(new InputStreamReader(proc.getErrorStream()));
+        while ((s = stdInput.readLine()) != null) {
+            System.out.println(s);
+        }
+        while ((s = stdError.readLine()) != null) {
+            System.err.println(s);
+        }
+    }
+
+    public static void compareJars(JarFile jf1, JarFile jf2) throws Exception {
+        try {
+            if (jf1.size() != jf2.size()) {
+                throw new Exception("Jars " + jf1.getName() + " and " + jf2.getName()
+                        + " have different number of entries");
+            }
+            for (JarEntry elem1 : Collections.list(jf1.entries())) {
+                JarEntry elem2 = jf2.getJarEntry(elem1.getName());
+                if (elem2 == null) {
+                    throw new Exception("Element " + elem1.getName() + " is missing from " + jf2.getName());
+                }
+                if (!elem1.isDirectory() && elem1.getCrc() != elem2.getCrc()) {
+                    throw new Exception("The crc of " + elem1.getName() + " is different.");
+                }
+            }
+        } finally {
+            jf1.close();
+            jf2.close();
+        }
+    }
+
+    public static void extractJar(JarFile jf, File where) throws Exception {
+        for (JarEntry file : Collections.list(jf.entries())) {
+            File out = new File(where, file.getName());
+            if (file.isDirectory()) {
+                out.mkdirs();
+                continue;
+            }
+            File parent = out.getParentFile();
+            if (parent != null && !parent.exists()) {
+                parent.mkdirs();
+            }
+            InputStream is = null;
+            OutputStream os = null;
+            try {
+                is = jf.getInputStream(file);
+                os = new FileOutputStream(out);
+                while (is.available() > 0) {
+                    os.write(is.read());
+                }
+            } finally {
+                if (is != null) {
+                    is.close();
+                }
+                if (os != null) {
+                    os.close();
+                }
+            }
+        }
+    }
+
+    static void delete(File f) throws IOException {
+        if (!f.exists()) {
+            return;
+        }
+        if (f.isDirectory()) {
+            for (File c : f.listFiles()) {
+                delete(c);
+            }
+        }
+        if (!f.delete()) {
+            throw new FileNotFoundException("Failed to delete file: " + f);
+        }
+    }
+}
--- a/jdk/test/tools/launcher/VersionCheck.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/jdk/test/tools/launcher/VersionCheck.java	Mon Nov 11 16:20:48 2013 +0100
@@ -50,6 +50,7 @@
         "javaws",
         "jcontrol",
         "jmc",
+        "jmc.ini",
         "jvisualvm",
         "packager",
         "unpack200",
@@ -74,6 +75,7 @@
         "jinfo",
         "jmap",
         "jmc",
+        "jmc.ini",
         "jps",
         "jrunscript",
         "jjs",
--- a/langtools/.hgtags	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/.hgtags	Mon Nov 11 16:20:48 2013 +0100
@@ -235,3 +235,5 @@
 af6244ba81b6b8d1bf4ab06587a2067e021e4570 jdk8-b111
 954dd199d6ff3e4cfc42b894c1f611150526eecd jdk8-b112
 54150586ba785e1eb0c0de8d13906f643f640644 jdk8-b113
+850d2602ae9811687b0f404d05ec3e55df91d9cb jdk8-b114
+6b4d6205366c1170ebefea95b1b9ae1d69add036 jdk8-b115
--- a/langtools/src/share/classes/com/sun/javadoc/Tag.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/Tag.java	Mon Nov 11 16:20:48 2013 +0100
@@ -72,7 +72,7 @@
      * <code>kind()&nbsp;==&nbsp;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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Env.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/AnnoConstruct.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/JavacMessages.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Analyzer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Archive.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Profile.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/javax/annotation/processing/Processor.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/src/share/classes/jdk/Exported.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;</td>"},
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
--- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>" + NL +
             "</dl>"}
     };
--- a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&lt;E&gt; (implements java.lang." +
             "Comparable&lt;T&gt;, 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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&nbsp;int field</pre>" + NL +
-                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>"},
+                 "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>"},
 
         {TARGET_FILE2, "<pre>@Deprecated" + NL +
                  "public&nbsp;DeprecatedClassByAnnotation()</pre>" + NL +
-                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>"},
+                 "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>"},
 
         {TARGET_FILE2, "<pre>@Deprecated" + NL +
                  "public&nbsp;void&nbsp;method()</pre>" + NL +
-                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>"},
+                 "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>"},
     };
 
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;in class&nbsp;<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>&nbsp;in interface&nbsp;<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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testHref/TestHref.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&lt;E extends C4&lt;E&gt;&gt;</span>"
+            "public abstract class <span class=\"typeNameLabel\">C4&lt;E extends C4&lt;E&gt;&gt;</span>"
         },
     };
     private static final String[][] NEGATED_TEST =
--- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>" +
-                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+                 "&nbsp;<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 + "&nbsp;" + 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 + "&nbsp;" + 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>" +
-                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+                 "&nbsp;<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>" +
                  "&nbsp;</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>" +
-                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+                 "&nbsp;<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 + "&nbsp;" + 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 + "&nbsp;" + 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>" +
-                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+                 "&nbsp;<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>" +
                  "&nbsp;</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>&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+                 "undecorated</pre>" + NL + "<div class=\"block\"><span class=\"deprecatedLabel\">" +
+                 "Deprecated.</span>&nbsp;<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>&nbsp;<span class=\"italic\">As of JDK version" +
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" +
+                 "Deprecated.</span>&nbsp;<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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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\">&lt;Unnamed&gt;</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>&nbsp;</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>&nbsp;</dd>" + NL + "</dl>"},
     };
--- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;in interface&nbsp;<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>&nbsp;in class&nbsp;<code><a href=\"../pkg/Parent.html\" " +
             "title=\"class in pkg\">Parent</a>&lt;<a href=\"../pkg/Child.html\" " +
--- a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&nbsp;void&nbsp;setRate(double&nbsp;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&nbsp;double&nbsp;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>&nbsp;</td>" },
+                "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#setTestMethodProperty--\">setTestMethodProperty</a></span>()</code>&nbsp;</td>" },
             {"./" + BUG_ID + "/C.html",
                 "<h4>isPaused</h4>" + NL +
                 "<pre>public final&nbsp;double&nbsp;isPaused()</pre>" + NL +
--- a/langtools/test/com/sun/javadoc/testLegacyTaglet/Check.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testLegacyTaglet/Check.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;in interface&nbsp;<code>" +
                           "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" +
--- a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&nbsp;Class</li>"},
         {BUG_ID + FS + "pkg" + FS + "A.html",
-            "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">Next&nbsp;Class</span></a>"},
+            "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"strong\">Prev&nbsp;Class</span></a>"},
+            "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">Next&nbsp;Class</span></a>"},
+            "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "E.html",
-            "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">Prev&nbsp;Class</span></a>"},
+            "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "E.html",
-            "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"strong\">Next&nbsp;Class</span></a>"},
+            "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "I.html",
-            "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">Prev&nbsp;Class</span></a>"},
+            "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "I.html", "<li>Next&nbsp;Class</li>"},
         // Test for 4664607
         {BUG_ID + FS + "pkg" + FS + "I.html",
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&lt;<a href=\"../pkg/Coin.html\" " +
                      "title=\"enum in pkg\">Coin</a>&gt;</pre>"
             },
@@ -62,7 +62,7 @@
                      "</span><span class=\"tabEnd\">&nbsp;</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&lt;E&gt;</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>&nbsp;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&lt;T extends " +
+                "<pre>public class <span class=\"typeNameLabel\">TypeParameterSubClass&lt;T extends " +
                 "java.lang.String&gt;</span>" + NL + "extends " +
                 "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" +
                 "TypeParameterSuperClass</a>&lt;T&gt;</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\">&nbsp;</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>&lt;T extends " +
                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
@@ -333,8 +333,8 @@
                      "pkg2\">Foo</a></span><span class=\"tabEnd\">&nbsp;</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&nbsp;t)</code>&nbsp;</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>&lt;T extends " +
                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
                      "</a> &amp; <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&nbsp;t)</code>&nbsp;</td>"
             },
@@ -401,7 +401,7 @@
                      "&nbsp;</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>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
@@ -415,8 +415,8 @@
                      "&nbsp;</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&nbsp;t)</code>&nbsp;</td>"
             },
@@ -456,7 +456,7 @@
                      "Foo3</a></span><span class=\"tabEnd\">&nbsp;</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>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
                      "ParamTest</a>&lt;<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&nbsp;t)</code>&nbsp;</td>"
             },
@@ -500,7 +500,7 @@
                      "&nbsp;</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>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
                      "ParamTest2</a>&lt;java.util.List&lt;? extends " +
@@ -515,8 +515,8 @@
                      "&nbsp;</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&nbsp;t)</code>&nbsp;</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>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
                      "ParamTest2</a>&lt;java.util.List&lt;? extends " +
@@ -552,8 +552,8 @@
                      "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;</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&nbsp;t)</code>" +
                      "&nbsp;</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&lt;<a href=\"../../pkg2/Foo4.html\" title=\"" +
                      "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code>&nbsp;</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&lt;Object&gt;)</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&lt;Object&gt;)</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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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:&nbsp;<code>" +
+            "<span class=\"descfrmTypeLabel\">Description copied from class:&nbsp;<code>" +
             "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy--\">" +
             "BaseClass</a></code></span>"
         }
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;in class&nbsp;<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>&nbsp;in class&nbsp;<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>&nbsp;in class&nbsp;<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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;in class&nbsp;<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>&nbsp;in interface&nbsp;<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:&nbsp;<code>" +
+            "<span class=\"descfrmTypeLabel\">Description copied from interface:&nbsp;<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>" +
             "&nbsp;in interface&nbsp;<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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>" +
-                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+                 "&nbsp;<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 + "&nbsp;" + 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>" +
-                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
+                 "&nbsp;<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>" +
                  "&nbsp;</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>&nbsp;<span class=\"italic\">" +
+                 "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;<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>&nbsp;<span class=\"italic\">As of JDK version" +
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" +
+                 "Deprecated.</span>&nbsp;<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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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>&nbsp;</div>"},
+            "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>"},
         {BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html",
-            "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;" +
-            "<span class=\"italic\">Do not use this.</span></div>"}};
+            "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;" +
+            "<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>&nbsp;<span class=\"italic\"></span></div>"}};
+            "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated." +
+            "</span>&nbsp;<span class=\"deprecationComment\"></span></div>"}};
 
     private static final String[] ARGS =
         new String[] {
--- a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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&lt;K extends <a " +
+            "class <span class=\"typeNameLabel\">ExtendsBound&lt;K extends <a " +
             "href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
             "typeannos\">@ClassParamA</a> java.lang.String&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
-            "<pre>class <span class=\"strong\">ExtendsGeneric&lt;K extends " +
+            "<pre>class <span class=\"typeNameLabel\">ExtendsGeneric&lt;K extends " +
             "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
             "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " +
             "title=\"class in typeannos\">Unannotated</a>&lt;<a href=\"" +
@@ -87,24 +87,24 @@
             "@ClassParamB</a> java.lang.String&gt;&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
-            "<pre>class <span class=\"strong\">TwoBounds&lt;K extends <a href=\"" +
+            "<pre>class <span class=\"typeNameLabel\">TwoBounds&lt;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&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "Complex1.html",
-            "class <span class=\"strong\">Complex1&lt;K extends <a href=\"../" +
+            "class <span class=\"typeNameLabel\">Complex1&lt;K extends <a href=\"../" +
             "typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
             "@ClassParamA</a> java.lang.String &amp; java.lang.Runnable&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "Complex2.html",
-            "class <span class=\"strong\">Complex2&lt;K extends java.lang." +
+            "class <span class=\"typeNameLabel\">Complex2&lt;K extends java.lang." +
             "String &amp; <a href=\"../typeannos/ClassParamB.html\" title=\"" +
             "annotation in typeannos\">@ClassParamB</a> java.lang.Runnable&gt;</span>"
         },
         {BUG_ID + FS + "typeannos" + FS + "ComplexBoth.html",
-            "class <span class=\"strong\">ComplexBoth&lt;K extends <a href=\"" +
+            "class <span class=\"typeNameLabel\">ComplexBoth&lt;K extends <a href=\"" +
             "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\"" +
             ">@ClassParamA</a> java.lang.String &amp; <a href=\"../typeannos/" +
             "ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA" +
--- a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/doclint/DocLintTester.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/ExtDirs/ExtDirTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/MethodParameters/LambdaTest.out	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/MethodParameters/Tester.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ /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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.out	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AnonymousClass.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/MultiCatch.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/lambda/8016081/T8016081.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/lambda/LambdaExpr13.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/lambda/TargetType58.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/lambda/TestSelfRef.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/Compiler.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/SourceModel.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/TestHarness.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/jdeps/Basic.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/langtools/test/tools/jdeps/Test.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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/make/scripts/webrev.ksh	Mon Nov 11 05:05:36 2013 -0800
+++ b/make/scripts/webrev.ksh	Mon Nov 11 16:20:48 2013 +0100
@@ -27,7 +27,7 @@
 # Documentation is available via 'webrev -h'.
 #
 
-WEBREV_UPDATED=25.0-hg+openjdk.java.net
+WEBREV_UPDATED=25.1-hg+openjdk.java.net
 
 HTML='<?xml version="1.0"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -1686,19 +1686,20 @@
 	    # It's a rename (or a move), or a copy, so let's make sure we move
 	    # to the right directory first, then restore it once done
 	    current_dir=`pwd`
-	    cd $CWS/$PDIR
+	    hg_root=`hg root`
+	    cd $CWS
 	    if [ -n "$rflag" ]; then
 		parentrev=$PARENT_REV
 	    elif [ "$HG_LIST_FROM_COMMIT" -eq 1 ]; then
                 parentrev=$OUTREV
 	    fi
 	    if [ -z "$parentrev" ]; then
-		parentrev=`hg log -l1 $PF | $AWK -F: '/changeset/ {print $2}'`
+		parentrev=`hg log -l1 $PDIR/$PF | $AWK -F: '/changeset/ {print $2}'`
 	    fi
 	    if [ -n "$parentrev" ]; then
 		mkdir -p $olddir/$PDIR
 		if [ -z "$parent" ]; then
-		    hg cat --rev $parentrev --output $olddir/$PDIR/$PF $PF 2>/dev/null
+		    hg cat -R $hg_root --rev $parentrev --output $olddir/$PDIR/$PF $PDIR/$PF 2>/dev/null
 		else
 		    $parent cat --rev $parentrev --output $olddir/$PDIR/$PF $PDIR/$PF 2>/dev/null
 		fi
--- a/nashorn/.hgtags	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/.hgtags	Mon Nov 11 16:20:48 2013 +0100
@@ -223,3 +223,5 @@
 75fd3486e584f20475c064a2cd4d01ac6406a511 jdk8-b111
 6a4fdb3bb4e34af4c5bb8db467bb01e13b1a7e31 jdk8-b112
 676cd7bf5e092356f7ee2116c8cf88cdc12377c7 jdk8-b113
+79f7b79bf97b71c9b5c9b103dbdef5f269eeb86d jdk8-b114
+f0d3ac2474ee755b1180ec71bcdfa190845b17eb jdk8-b115
--- a/nashorn/make/build.xml	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/make/build.xml	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/make/project.properties	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/api/scripting/JSObject.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Lower.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/ir/Expression.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeString.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/parser/Lexer.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/CompiledFunctions.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/JSType.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ /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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/src/overview.html	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/test/examples/array-micro.js	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/test/script/basic/JDK-8024847.js	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/test/script/basic/JDK-8024847.js.EXPECTED	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -0,0 +1,1 @@
+ReferenceError: "x" is not defined
--- a/nashorn/test/script/basic/NASHORN-397.js	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/test/script/basic/NASHORN-397.js	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/PluggableJSObjectTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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	Mon Nov 11 05:05:36 2013 -0800
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java	Mon Nov 11 16:20:48 2013 +0100
@@ -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")) {