changeset 8715:f82b730c798b jdk8-b115

Merge
author lana
date Thu, 31 Oct 2013 16:44:18 -0700
parents 6f436140049d c4bbd5963f9c
children a389b4f5723f bdcba4854576 d152c5b01ea8
files src/share/classes/java/lang/invoke/MagicLambdaImpl.java src/share/classes/java/net/DatagramSocket.java src/share/classes/java/net/URLConnection.java src/share/classes/java/net/URLDecoder.java src/share/classes/java/net/URLEncoder.java src/share/classes/java/security/KeyStore.java src/share/classes/java/util/Locale.java src/share/classes/java/util/ResourceBundle.java src/share/classes/java/util/regex/Pattern.java src/share/classes/javax/naming/ldap/Rdn.java src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java src/share/classes/sun/tools/jar/Main.java src/share/demo/jfc/Notepad/resources/Notepad_fr.properties src/share/demo/jfc/Notepad/resources/Notepad_sv.properties src/share/javavm/export/jvm.h src/share/native/com/sun/java/util/jar/pack/zip.cpp src/solaris/classes/sun/nio/fs/UnixPath.java test/java/net/NetworkInterface/MemLeakTest.java test/jdk/lambda/vm/DefaultMethodsTest.java test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh test/sun/tools/jstatd/jpsOutput1.awk test/sun/tools/jstatd/jstatGcutilOutput1.awk test/sun/tools/jstatd/jstatdDefaults.sh test/sun/tools/jstatd/jstatdExternalRegistry.sh test/sun/tools/jstatd/jstatdPort.sh test/sun/tools/jstatd/jstatdServerName.sh test/sun/tools/jstatd/jstatdUsage1.sh test/sun/tools/jstatd/usage.out
diffstat 417 files changed, 14606 insertions(+), 5022 deletions(-) [+]
line wrap: on
line diff
--- a/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/makefiles/Setup.gmk	Thu Oct 31 16:22:30 2013 -0700
+++ b/makefiles/Setup.gmk	Thu Oct 31 16:44:18 2013 -0700
@@ -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/makefiles/mapfiles/libjava/mapfile-vers	Thu Oct 31 16:22:30 2013 -0700
+++ b/makefiles/mapfiles/libjava/mapfile-vers	Thu Oct 31 16:44:18 2013 -0700
@@ -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/makefiles/mapfiles/libjava/reorder-sparc	Thu Oct 31 16:22:30 2013 -0700
+++ b/makefiles/mapfiles/libjava/reorder-sparc	Thu Oct 31 16:44:18 2013 -0700
@@ -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/makefiles/mapfiles/libjava/reorder-sparcv9	Thu Oct 31 16:22:30 2013 -0700
+++ b/makefiles/mapfiles/libjava/reorder-sparcv9	Thu Oct 31 16:44:18 2013 -0700
@@ -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/makefiles/mapfiles/libjava/reorder-x86	Thu Oct 31 16:22:30 2013 -0700
+++ b/makefiles/mapfiles/libjava/reorder-x86	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/back/ThreadGroupReferenceImpl.c	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/back/ThreadGroupReferenceImpl.c	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/back/outStream.c	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/back/outStream.c	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/com/sun/jmx/snmp/SnmpString.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/com/sun/jmx/snmp/SnmpString.java	Thu Oct 31 16:44:18 2013 -0700
@@ -130,7 +130,7 @@
      * @return The value.
      */
     public byte[] byteValue() {
-        return value ;
+        return value.clone() ;
     }
 
     /**
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java	Thu Oct 31 16:44:18 2013 -0700
@@ -476,8 +476,7 @@
                 rootOid[i++]= val.longValue();
             }
         }
-        return rootOid;
-
+        return rootOid.clone();
     }
 
     // --------------------------------------------------------------------
--- a/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java	Thu Oct 31 16:44:18 2013 -0700
@@ -1248,7 +1248,7 @@
                      "of this CommunicatorServer instance has changed.");
         }
 
-        return notifInfos;
+        return notifInfos.clone();
     }
 
     /**
--- a/src/share/classes/java/io/ByteArrayInputStream.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/ByteArrayInputStream.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/ByteArrayOutputStream.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/ByteArrayOutputStream.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/Closeable.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/Closeable.java	Thu Oct 31 16:44:18 2013 -0700
@@ -34,7 +34,6 @@
  *
  * @since 1.5
  */
-@FunctionalInterface
 public interface Closeable extends AutoCloseable {
 
     /**
--- a/src/share/classes/java/io/DataInput.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/DataInput.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/DataOutput.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/DataOutput.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/FilePermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/FilePermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/Flushable.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/Flushable.java	Thu Oct 31 16:44:18 2013 -0700
@@ -34,7 +34,6 @@
  *
  * @since 1.5
  */
-@FunctionalInterface
 public interface Flushable {
 
     /**
--- a/src/share/classes/java/io/InputStream.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/InputStream.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/ObjectInputStream.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/ObjectInputStream.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/PipedInputStream.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/PipedInputStream.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/PipedReader.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/PipedReader.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/RandomAccessFile.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/RandomAccessFile.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/Serializable.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/Serializable.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/io/SerializablePermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/io/SerializablePermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/AbstractStringBuilder.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/AbstractStringBuilder.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/ArrayStoreException.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/ArrayStoreException.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/AutoCloseable.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/AutoCloseable.java	Thu Oct 31 16:44:18 2013 -0700
@@ -48,7 +48,6 @@
  * @author Josh Bloch
  * @since 1.7
  */
-@FunctionalInterface
 public interface AutoCloseable {
     /**
      * Closes this resource, relinquishing any underlying resources.
--- a/src/share/classes/java/lang/Byte.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Byte.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Character.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Character.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Class.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Class.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/ClassCastException.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/ClassCastException.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/ClassLoader.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/ClassLoader.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/ClassValue.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/ClassValue.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Comparable.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Comparable.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/ConditionalSpecialCasing.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/ConditionalSpecialCasing.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Double.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Double.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Float.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Float.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Integer.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Integer.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Iterable.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Iterable.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Long.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Long.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Readable.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Readable.java	Thu Oct 31 16:44:18 2013 -0700
@@ -34,7 +34,6 @@
  *
  * @since 1.5
  */
-@FunctionalInterface
 public interface Readable {
 
     /**
--- a/src/share/classes/java/lang/RuntimePermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/RuntimePermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/SecurityManager.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/SecurityManager.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Short.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Short.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/String.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/String.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/System.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/System.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/Thread.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/Thread.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/invoke/LambdaMetafactory.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/invoke/LambdaMetafactory.java	Thu Oct 31 16:44:18 2013 -0700
@@ -29,88 +29,128 @@
 import java.util.Arrays;
 
 /**
- * <p>Bootstrap methods for converting lambda expressions and method references to functional interface objects.</p>
+ * <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>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>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 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.
+ *     <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>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>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>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.
- *
- * <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.
      *
-     * @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>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}.
+     *
+     * <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>
      *
-     * @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>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}.
+     *
+     * <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/src/share/classes/java/lang/invoke/MagicLambdaImpl.java	Thu Oct 31 16:22:30 2013 -0700
+++ /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/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/invoke/MethodHandles.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandles.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/invoke/SerializedLambda.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/invoke/SerializedLambda.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/management/ManagementFactory.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/management/ManagementFactory.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/management/ManagementPermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/management/ManagementPermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/management/MemoryUsage.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/management/MemoryUsage.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/management/package.html	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/management/package.html	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/reflect/AnnotatedElement.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/reflect/AnnotatedElement.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/reflect/Constructor.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/reflect/Constructor.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/reflect/Executable.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/reflect/Executable.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/reflect/Field.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/reflect/Field.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/reflect/Parameter.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/reflect/Parameter.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/lang/reflect/ReflectPermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/lang/reflect/ReflectPermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/math/BigInteger.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/math/BigInteger.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/math/MutableBigInteger.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/math/MutableBigInteger.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/DatagramSocket.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/DatagramSocket.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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
@@ -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/src/share/classes/java/net/HttpCookie.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/HttpCookie.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/Inet6Address.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/Inet6Address.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/MulticastSocket.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/MulticastSocket.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/NetPermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/NetPermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/Proxy.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/Proxy.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/Socket.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/Socket.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/SocketOptions.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/SocketOptions.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/SocketPermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/SocketPermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/URI.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/URI.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/URLClassLoader.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/URLClassLoader.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/URLConnection.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/URLConnection.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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>
--- a/src/share/classes/java/net/URLDecoder.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/URLDecoder.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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
--- a/src/share/classes/java/net/URLEncoder.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/URLEncoder.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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
--- a/src/share/classes/java/net/URLPermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/URLPermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/net/package-info.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/net/package-info.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/nio/X-Buffer.java.template	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/nio/X-Buffer.java.template	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/nio/file/FileSystem.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/nio/file/FileSystem.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/rmi/RMISecurityManager.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/RMISecurityManager.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/rmi/activation/ActivationGroup.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/activation/ActivationGroup.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/rmi/dgc/VMID.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/dgc/VMID.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/rmi/server/RMISocketFactory.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/server/RMISocketFactory.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/rmi/server/RemoteStub.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/server/RemoteStub.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/rmi/server/ServerRef.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/server/ServerRef.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/rmi/server/SocketSecurityException.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/server/SocketSecurityException.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/rmi/server/UnicastRemoteObject.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/server/UnicastRemoteObject.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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>For the constructors and static <code>exportObject</code> methods
- * below, the stub for a remote object being exported is obtained as
- * follows:
+ * <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><ul>
+ * <p>There are six ways to export remote objects:
  *
- * <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.
+ * <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.
+ *
+ * <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>
+ *
+ * <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}.
+ *
+ * <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.
+ *
  * </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
- * {@link StubNotFoundException} is thrown.
- *
- * <p>
- * <li>For all other means of exporting:
- * <p><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/src/share/classes/java/rmi/server/package.html	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/rmi/server/package.html	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/AccessControlContext.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/AccessControlContext.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/AccessController.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/AccessController.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/AlgorithmParameterGenerator.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/AlgorithmParameterGenerator.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/BasicPermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/BasicPermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/CodeSource.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/CodeSource.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/Key.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/Key.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/KeyPairGenerator.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/KeyPairGenerator.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/KeyStore.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/KeyStore.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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>
--- a/src/share/classes/java/security/MessageDigest.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/MessageDigest.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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>
-* 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>
+ * <pre>{@code
+ * 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>
  *
  * <p>Note that if a given implementation is not cloneable, it is
  * still possible to compute intermediate digests by instantiating
--- a/src/share/classes/java/security/Permission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/Permission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/PermissionCollection.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/PermissionCollection.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/Provider.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/Provider.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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 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)) {
+            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;
+            }
+            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.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)) {
-            String keyString = (String)key;
-            if (keyString.startsWith("Provider.")) {
+            if (!checkLegacy(key)) {
                 return null;
             }
-            legacyChanged = true;
-            if (legacyStrings == null) {
-                legacyStrings = new LinkedHashMap<String,String>();
-            }
-            legacyStrings.put(keyString, (String)value);
+            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/src/share/classes/java/security/SecurityPermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/SecurityPermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/Signature.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/Signature.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/SignedObject.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/SignedObject.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/acl/Acl.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/acl/Acl.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/cert/CertificateFactory.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/cert/CertificateFactory.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/cert/PKIXRevocationChecker.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/cert/PKIXRevocationChecker.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/cert/PolicyQualifierInfo.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/cert/PolicyQualifierInfo.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/cert/TrustAnchor.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/cert/TrustAnchor.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/cert/X509CertSelector.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/cert/X509CertSelector.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/security/interfaces/DSAKeyPairGenerator.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/security/interfaces/DSAKeyPairGenerator.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/text/MessageFormat.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/text/MessageFormat.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/text/Normalizer.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/text/Normalizer.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/text/SimpleDateFormat.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/text/SimpleDateFormat.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/Duration.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/Duration.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/OffsetDateTime.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/OffsetDateTime.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/OffsetTime.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/OffsetTime.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/Period.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/Period.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/ZoneId.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/ZoneId.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/chrono/ChronoPeriodImpl.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/chrono/ChronoPeriodImpl.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/chrono/JapaneseDate.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/chrono/JapaneseDate.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/format/DateTimeFormatterBuilder.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/format/DateTimeFormatterBuilder.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/format/DateTimeParseContext.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/format/DateTimeParseContext.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/temporal/TemporalQueries.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/temporal/TemporalQueries.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/temporal/WeekFields.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/temporal/WeekFields.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/zone/Ser.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/zone/Ser.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/zone/TzdbZoneRulesProvider.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/zone/TzdbZoneRulesProvider.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/time/zone/ZoneOffsetTransition.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/time/zone/ZoneOffsetTransition.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/Base64.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Base64.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/BitSet.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/BitSet.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/Deque.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Deque.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/DoubleSummaryStatistics.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/DoubleSummaryStatistics.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/Formatter.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Formatter.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/HashMap.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/HashMap.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/Iterator.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Iterator.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/List.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/List.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/Locale.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Locale.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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>
      *
@@ -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/src/share/classes/java/util/Map.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Map.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/PrimitiveIterator.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/PrimitiveIterator.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/Properties.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Properties.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/PropertyPermission.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/PropertyPermission.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/Queue.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Queue.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/ResourceBundle.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/ResourceBundle.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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
--- a/src/share/classes/java/util/Scanner.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Scanner.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/Spliterator.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/Spliterator.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/TimeZone.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/TimeZone.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/UUID.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/UUID.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/BlockingDeque.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/BlockingDeque.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/BlockingQueue.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/BlockingQueue.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/ConcurrentMap.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/ConcurrentMap.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/Future.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/Future.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/atomic/DoubleAdder.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/DoubleAdder.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/atomic/LongAccumulator.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/LongAccumulator.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/atomic/LongAdder.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/LongAdder.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/function/package-info.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/function/package-info.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/jar/Pack200.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/jar/Pack200.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/logging/LogManager.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/logging/LogManager.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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/src/share/classes/java/util/logging/Logger.java	Thu Oct 31 16:22:30 2013 -0700
+++ b/src/share/classes/java/util/logging/Logger.java	Thu Oct 31 16:44:18 2013 -0700
@@ -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