Merge
authorlana
Tue, 13 Aug 2013 18:34:12 -0700
changeset 19467 2a47b1a28212
parent 19466 5466cd852eeb (current diff)
parent 19257 30a1d677a20c (diff)
child 19474 70c91fc38cb4
Merge
corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaInputStream.sjava
corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaOutputStream.sjava
corba/src/share/classes/com/sun/corba/se/impl/interceptors/ThreadCurrentStack.sjava
corba/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava
corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl_save.sjava
corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava
corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava
corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientResponseImpl.sjava
corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerRequestImpl.sjava
corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerResponseImpl.sjava
corba/src/share/classes/com/sun/corba/se/impl/transport/BufferConnectionImpl.sjava
hotspot/test/runtime/7196045/Test7196045.java
hotspot/test/runtime/8000968/Test8000968.sh
jdk/test/java/lang/System/MacJNUEncoding/ExpectedEncoding.java
jdk/test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh
--- a/.hgtags	Mon Aug 12 20:37:09 2013 +0530
+++ b/.hgtags	Tue Aug 13 18:34:12 2013 -0700
@@ -223,3 +223,4 @@
 2d3875b0d18b3ad1c2bebf385a697e309e4005a4 jdk8-b99
 3d34036aae4ea90b2ca59712d5a69db3221f0875 jdk8-b100
 edb01c460d4cab21ff0ff13512df7b746efaa0e7 jdk8-b101
+bbe43d712fe08e650808d774861b256ccb34e500 jdk8-b102
--- a/.hgtags-top-repo	Mon Aug 12 20:37:09 2013 +0530
+++ b/.hgtags-top-repo	Tue Aug 13 18:34:12 2013 -0700
@@ -223,3 +223,4 @@
 59dc9da813794c924a0383c2a6241af94defdfed jdk8-b99
 d2dcb110e9dbaf9903c05b211df800e78e4b394e jdk8-b100
 9f74a220677dc265a724515d8e2617548cef62f1 jdk8-b101
+5eb3c1dc348f72a7f84f7d9d07834e8bbe09a799 jdk8-b102
--- a/corba/.hgtags	Mon Aug 12 20:37:09 2013 +0530
+++ b/corba/.hgtags	Tue Aug 13 18:34:12 2013 -0700
@@ -223,3 +223,4 @@
 3f67804ab61303782df57e54989ef5e0e4629beb jdk8-b99
 8d492f1dfd1b131a4c7886ee6b59528609f7e4fe jdk8-b100
 a013024b07475782f1fa8e196e950b34b4077663 jdk8-b101
+528c7e76eaeee022817ee085668459bc97cf5665 jdk8-b102
--- a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaInputStream.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,528 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.corba.se.impl.encoding;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.Principal;
-import org.omg.CORBA.Any;
-
-import com.sun.org.omg.SendingContext.CodeBase;
-
-import com.sun.corba.se.pept.protocol.MessageMediator;
-
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.orb.ORB;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-import com.sun.corba.se.impl.encoding.CodeSetConversion;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-
-/**
- * This is delegates to the real implementation.
- *
- * NOTE:
- *
- * Before using the stream for valuetype unmarshaling, one must call
- * performORBVersionSpecificInit().
- */
-public abstract class CDRInputStream
-    extends org.omg.CORBA_2_3.portable.InputStream
-    implements com.sun.corba.se.impl.encoding.MarshalInputStream,
-               org.omg.CORBA.DataInputStream, org.omg.CORBA.portable.ValueInputStream
-{
-    protected CorbaMessageMediator messageMediator;
-    private CDRInputStreamBase impl;
-
-    // We can move this out somewhere later.  For now, it serves its purpose
-    // to create a concrete CDR delegate based on the GIOP version.
-    private static class InputStreamFactory {
-        
-        public static CDRInputStreamBase newInputStream(ORB orb, GIOPVersion version)
-        {
-            switch(version.intValue()) {
-                case GIOPVersion.VERSION_1_0:
-                    return new CDRInputStream_1_0();
-                case GIOPVersion.VERSION_1_1:
-                    return new CDRInputStream_1_1();
-                case GIOPVersion.VERSION_1_2:
-                    return new CDRInputStream_1_2();
-                default:
-		    ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
-			CORBALogDomains.RPC_ENCODING ) ;
-		    throw wrapper.unsupportedGiopVersion( version ) ;
-            }
-        }
-    }
-
-    // Required for the case when a ClientResponseImpl is
-    // created with a SystemException due to a dead server/closed
-    // connection with no warning.  Note that the stream will
-    // not be initialized in this case.
-    // 
-    // Probably also required by ServerRequestImpl.
-    // 
-    // REVISIT.
-    public CDRInputStream() {
-    }
-
-    public CDRInputStream(CDRInputStream is) {
-        impl = is.impl.dup();
-        impl.setParent(this);
-    }
-
-    public CDRInputStream(org.omg.CORBA.ORB orb,
-                          ByteBuffer byteBuffer,
-                          int size,
-                          boolean littleEndian,
-                          GIOPVersion version,
-                          BufferManagerRead bufMgr)
-    {
-        impl = InputStreamFactory.newInputStream( (ORB)orb, version);
-
-        impl.init(orb, byteBuffer, size, littleEndian, bufMgr);
-
-        impl.setParent(this);
-    }
-
-    // org.omg.CORBA.portable.InputStream
-    public final boolean read_boolean() {
-        return impl.read_boolean();
-    }
-
-    public final char read_char() {
-        return impl.read_char();
-    }
-
-    public final char read_wchar() {
-        return impl.read_wchar();
-    }
-
-    public final byte read_octet() {
-        return impl.read_octet();
-    }
-
-    public final short read_short() {
-        return impl.read_short();
-    }
-
-    public final short read_ushort() {
-        return impl.read_ushort();
-    }
-
-    public final int read_long() {
-        return impl.read_long();
-    }
-
-    public final int read_ulong() {
-        return impl.read_ulong();
-    }
-
-    public final long read_longlong() {
-        return impl.read_longlong();
-    }
-
-    public final long read_ulonglong() {
-        return impl.read_ulonglong();
-    }
-
-    public final float read_float() {
-        return impl.read_float();
-    }
-
-    public final double read_double() {
-        return impl.read_double();
-    }
-
-    public final String read_string() {
-        return impl.read_string();
-    }
-
-    public final String read_wstring() {
-        return impl.read_wstring();
-    }
-
-    public final void read_boolean_array(boolean[] value, int offset, int length) {
-        impl.read_boolean_array(value, offset, length);
-    }
-
-    public final void read_char_array(char[] value, int offset, int length) {
-        impl.read_char_array(value, offset, length);
-    }
-
-    public final void read_wchar_array(char[] value, int offset, int length) {
-        impl.read_wchar_array(value, offset, length);
-    }
-
-    public final void read_octet_array(byte[] value, int offset, int length) {
-        impl.read_octet_array(value, offset, length);
-    }
-
-    public final void read_short_array(short[] value, int offset, int length) {
-        impl.read_short_array(value, offset, length);
-    }
-
-    public final void read_ushort_array(short[] value, int offset, int length) {
-        impl.read_ushort_array(value, offset, length);
-    }
-
-    public final void read_long_array(int[] value, int offset, int length) {
-        impl.read_long_array(value, offset, length);
-    }
-
-    public final void read_ulong_array(int[] value, int offset, int length) {
-        impl.read_ulong_array(value, offset, length);
-    }
-
-    public final void read_longlong_array(long[] value, int offset, int length) {
-        impl.read_longlong_array(value, offset, length);
-    }
-
-    public final void read_ulonglong_array(long[] value, int offset, int length) {
-        impl.read_ulonglong_array(value, offset, length);
-    }
-
-    public final void read_float_array(float[] value, int offset, int length) {
-        impl.read_float_array(value, offset, length);
-    }
-
-    public final void read_double_array(double[] value, int offset, int length) {
-        impl.read_double_array(value, offset, length);
-    }
-
-    public final org.omg.CORBA.Object read_Object() {
-        return impl.read_Object();
-    }
-
-    public final TypeCode read_TypeCode() {
-        return impl.read_TypeCode();
-    }
-    public final Any read_any() {
-        return impl.read_any();
-    }
-
-    public final Principal read_Principal() {
-        return impl.read_Principal();
-    }
-
-    public final int read() throws java.io.IOException {
-        return impl.read();
-    }
-
-    public final java.math.BigDecimal read_fixed() {
-        return impl.read_fixed();
-    }
-
-    public final org.omg.CORBA.Context read_Context() {
-        return impl.read_Context();
-    }
-
-    public final org.omg.CORBA.Object read_Object(java.lang.Class clz) {
-        return impl.read_Object(clz);
-    }
-
-    public final org.omg.CORBA.ORB orb() {
-        return impl.orb();
-    }
-
-    // org.omg.CORBA_2_3.portable.InputStream
-    public final java.io.Serializable read_value() {
-        return impl.read_value();
-    }
-
-    public final java.io.Serializable read_value(java.lang.Class clz) {
-        return impl.read_value(clz);
-    }
-
-    public final java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory) {
-        return impl.read_value(factory);
-    }
-
-    public final java.io.Serializable read_value(java.lang.String rep_id) {
-        return impl.read_value(rep_id);
-    }
-
-    public final java.io.Serializable read_value(java.io.Serializable value) {
-        return impl.read_value(value);
-    }
-
-    public final java.lang.Object read_abstract_interface() {
-        return impl.read_abstract_interface();
-    }
-
-    public final java.lang.Object read_abstract_interface(java.lang.Class clz) {
-        return impl.read_abstract_interface(clz);
-    }
-    // com.sun.corba.se.impl.encoding.MarshalInputStream
-
-    public final void consumeEndian() {
-        impl.consumeEndian();
-    }
-
-    public final int getPosition() {
-        return impl.getPosition();
-    }
-
-    // org.omg.CORBA.DataInputStream
-
-    public final java.lang.Object read_Abstract () {
-        return impl.read_Abstract();
-    }
-
-    public final java.io.Serializable read_Value () {
-        return impl.read_Value();
-    }
-
-    public final void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length) {
-        impl.read_any_array(seq, offset, length);
-    }
-
-    public final void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length) {
-        impl.read_boolean_array(seq, offset, length);
-    }
-
-    public final void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length) {
-        impl.read_char_array(seq, offset, length);
-    }
-
-    public final void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length) {
-        impl.read_wchar_array(seq, offset, length);
-    }
-
-    public final void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length) {
-        impl.read_octet_array(seq, offset, length);
-    }
-
-    public final void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length) {
-        impl.read_short_array(seq, offset, length);
-    }
-
-    public final void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length) {
-        impl.read_ushort_array(seq, offset, length);
-    }
-
-    public final void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length) {
-        impl.read_long_array(seq, offset, length);
-    }
-
-    public final void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length) {
-        impl.read_ulong_array(seq, offset, length);
-    }
-
-    public final void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length) {
-        impl.read_ulonglong_array(seq, offset, length);
-    }
-
-    public final void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length) {
-        impl.read_longlong_array(seq, offset, length);
-    }
-
-    public final void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length) {
-        impl.read_float_array(seq, offset, length);
-    }
-
-    public final void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length) {
-        impl.read_double_array(seq, offset, length);
-    }
-
-    // org.omg.CORBA.portable.ValueBase
-    public final String[] _truncatable_ids() {
-        return impl._truncatable_ids();
-    }
-
-    // java.io.InputStream
-    public final int read(byte b[]) throws IOException {
-        return impl.read(b);
-    }
-
-    public final int read(byte b[], int off, int len) throws IOException {
-        return impl.read(b, off, len);
-    }
-
-    public final long skip(long n) throws IOException {
-        return impl.skip(n);
-    }
-
-    public final int available() throws IOException {
-        return impl.available();
-    }
-
-    public final void close() throws IOException {
-        impl.close();
-    }
-
-    public final void mark(int readlimit) {
-        impl.mark(readlimit);
-    }
-
-    public final void reset() {
-        impl.reset();
-    }
-
-    public final boolean markSupported() {
-        return impl.markSupported();
-    }
-
-    public abstract CDRInputStream dup();
-
-    // Needed by TCUtility
-    public final java.math.BigDecimal read_fixed(short digits, short scale) {
-        return impl.read_fixed(digits, scale);
-    }
-
-    public final boolean isLittleEndian() {
-        return impl.isLittleEndian();
-    }
-
-    protected final ByteBuffer getByteBuffer() {
-        return impl.getByteBuffer();
-    }
-
-    protected final void setByteBuffer(ByteBuffer byteBuffer) {
-        impl.setByteBuffer(byteBuffer);
-    }
-
-    protected final void setByteBufferWithInfo(ByteBufferWithInfo bbwi) {
-        impl.setByteBufferWithInfo(bbwi);
-    }
-
-    public final int getBufferLength() {
-        return impl.getBufferLength();
-    }
-
-    protected final void setBufferLength(int value) {
-        impl.setBufferLength(value);
-    }
-
-    protected final int getIndex() {
-        return impl.getIndex();
-    }
-
-    protected final void setIndex(int value) {
-        impl.setIndex(value);
-    }
-
-    public final void orb(org.omg.CORBA.ORB orb) {
-        impl.orb(orb);
-    }
-
-    public final GIOPVersion getGIOPVersion() {
-        return impl.getGIOPVersion();
-    }
-
-    public final BufferManagerRead getBufferManager() {
-        return impl.getBufferManager();
-    }
-
-    // This should be overridden by any stream (ex: IIOPInputStream)
-    // which wants to read values.  Thus, TypeCodeInputStream doesn't
-    // have to do this.
-    public CodeBase getCodeBase() {
-        return null;
-    }
-
-    // Use Latin-1 for GIOP 1.0 or when code set negotiation was not
-    // performed.
-    protected CodeSetConversion.BTCConverter createCharBTCConverter() {
-        return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.ISO_8859_1,
-                                                        impl.isLittleEndian());
-    }
-
-    // Subclasses must decide what to do here.  It's inconvenient to
-    // make the class and this method abstract because of dup().
-    protected abstract CodeSetConversion.BTCConverter createWCharBTCConverter();
-
-    // Prints the current buffer in a human readable form
-    void printBuffer() {
-        impl.printBuffer();
-    }
-
-    /**
-     * Aligns the current position on the given octet boundary
-     * if there are enough bytes available to do so.  Otherwise,
-     * it just returns.  This is used for some (but not all)
-     * GIOP 1.2 message headers.
-     */
-    public void alignOnBoundary(int octetBoundary) {
-        impl.alignOnBoundary(octetBoundary);
-    }
-
-    // Needed by request and reply messages for GIOP versions >= 1.2 only.
-    public void setHeaderPadding(boolean headerPadding) {
-        impl.setHeaderPadding(headerPadding);
-    }
-    
-    /**
-     * This must be called after determining the proper ORB version,
-     * and setting it on the stream's ORB instance.  It can be called
-     * after reading the service contexts, since that is the only place
-     * we can get the ORB version info.
-     *
-     * Trying to unmarshal things requiring repository IDs before calling
-     * this will result in NullPtrExceptions.
-     */
-    public void performORBVersionSpecificInit() {
-        // In the case of SystemExceptions, a stream is created
-        // with its default constructor (and thus no impl is set).
-        if (impl != null)
-            impl.performORBVersionSpecificInit();
-    }
-
-    /**
-     * Resets any internal references to code set converters.
-     * This is useful for forcing the CDR stream to reacquire
-     * converters (probably from its subclasses) when state
-     * has changed.
-     */
-    public void resetCodeSetConverters() {
-        impl.resetCodeSetConverters();
-    }
-
-    public void setMessageMediator(MessageMediator messageMediator)
-    {
-        this.messageMediator = (CorbaMessageMediator) messageMediator;
-    }
-
-    public MessageMediator getMessageMediator()
-    {
-        return messageMediator;
-    }
-
-    // ValueInputStream -----------------------------
-
-    public void start_value() {
-        impl.start_value();
-    }
-
-    public void end_value() {
-        impl.end_value();
-    }
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaOutputStream.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,435 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.corba.se.impl.encoding;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.Principal;
-import org.omg.CORBA.Any;
-
-import com.sun.corba.se.pept.protocol.MessageMediator;
-
-import com.sun.corba.se.spi.orb.ORB;
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-
-import com.sun.corba.se.impl.encoding.CodeSetConversion;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-
-/**
- * This is delegates to the real implementation.
- */
-public abstract class CDROutputStream
-    extends org.omg.CORBA_2_3.portable.OutputStream
-    implements com.sun.corba.se.impl.encoding.MarshalOutputStream,
-               org.omg.CORBA.DataOutputStream, org.omg.CORBA.portable.ValueOutputStream
-{
-/*
-    private CDROutputStreamBase impl;
-    protected ORB orb ;
-    protected ORBUtilSystemException wrapper ;
-    protected CorbaMessageMediator corbaMessageMediator;
-
-
-    // We can move this out somewhere later.  For now, it serves its purpose
-    // to create a concrete CDR delegate based on the GIOP version.
-    private static class OutputStreamFactory {
-        
-        public static CDROutputStreamBase newOutputStream(ORB orb, GIOPVersion version)
-        {
-            switch(version.intValue()) {
-                case GIOPVersion.VERSION_1_0:
-                    return new CDROutputStream_1_0();
-                case GIOPVersion.VERSION_1_1:
-                    return new CDROutputStream_1_1();
-                case GIOPVersion.VERSION_1_2:
-                    return new CDROutputStream_1_2();
-                default:
-		    ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
-			CORBALogDomains.RPC_ENCODING ) ;
-                    // REVISIT - what is appropriate?  INTERNAL exceptions
-                    // are really hard to track later.
-		    throw wrapper.unsupportedGiopVersion( version ) ;
-            }
-        }
-    }
-
-    // REVISIT - These two constructors should be re-factored to better hide
-    // the fact that someone extending this class 'can' construct a CDROutputStream
-    // that does not use pooled ByteBuffers. Right now, only EncapsOutputStream
-    // does _not_ use pooled ByteBuffers, see EncapsOutputStream.
-
-    // NOTE: When a stream is constructed for non-channel-backed sockets
-    // it notifies the constructor not to use pooled (i.e, direct)
-    // ByteBuffers.
-
-    public CDROutputStream(ORB orb,
-                           GIOPVersion version,
-			   boolean littleEndian,
-			   BufferManagerWrite bufferManager,
-                           byte streamFormatVersion,
-                           boolean usePooledByteBuffers)
-    {
-        impl = OutputStreamFactory.newOutputStream(orb, version);
-        impl.init(orb, littleEndian, bufferManager, streamFormatVersion, usePooledByteBuffers);
-
-        impl.setParent(this);
-	this.orb = orb ;
-	this.wrapper = ORBUtilSystemException.get( orb,
-	    CORBALogDomains.RPC_ENCODING ) ;
-    }
-
-    public CDROutputStream(ORB orb,
-                           GIOPVersion version,
-			   boolean littleEndian,
-			   BufferManagerWrite bufferManager,
-                           byte streamFormatVersion)
-    {
-        this(orb, version, littleEndian, bufferManager, streamFormatVersion, true);
-    }
-*/
-
-    private ByteArrayOutputStream bos ;
-    private ObjectOutputStream oos ;
-
-    public JavaOutputStream() 
-    {
-	bos = new ByteArrayOutputStream() ;
-	oos = new ObjectOutputStream( bos ) ;
-    }
-
-    // Provided by IIOPOutputStream and EncapsOutputStream
-    public org.omg.CORBA.portable.InputStream create_input_stream()
-    {
-	ObjectInputStream ois = new ByteArrayInputStream( bos.toByteArray() ) ;
-	    
-	return new JavaInputStream( ois ) ;
-    }
-
-    public final void write_boolean(boolean value) {
-        impl.write_boolean(value);
-    }
-    public final void write_char(char value) {
-        impl.write_char(value);
-    }
-    public final void write_wchar(char value) {
-        impl.write_wchar(value);
-    }
-    public final void write_octet(byte value) {
-        impl.write_octet(value);
-    }
-    public final void write_short(short value) {
-        impl.write_short(value);
-    }
-    public final void write_ushort(short value) {
-        impl.write_ushort(value);
-    }
-    public final void write_long(int value) {
-        impl.write_long(value);
-    }
-    public final void write_ulong(int value) {
-        impl.write_ulong(value);
-    }
-    public final void write_longlong(long value) {
-        impl.write_longlong(value);
-    }
-    public final void write_ulonglong(long value) {
-        impl.write_ulonglong(value);
-    }
-    public final void write_float(float value) {
-        impl.write_float(value);
-    }
-    public final void write_double(double value) {
-        impl.write_double(value);
-    }
-    public final void write_string(String value) {
-        impl.write_string(value);
-    }
-    public final void write_wstring(String value) {
-        impl.write_wstring(value);
-    }
-
-    public final void write_boolean_array(boolean[] value, int offset, int length) {
-        impl.write_boolean_array(value, offset, length);
-    }
-    public final void write_char_array(char[] value, int offset, int length) {
-        impl.write_char_array(value, offset, length);
-    }
-    public final void write_wchar_array(char[] value, int offset, int length) {
-        impl.write_wchar_array(value, offset, length);
-    }
-    public final void write_octet_array(byte[] value, int offset, int length) {
-        impl.write_octet_array(value, offset, length);
-    }
-    public final void write_short_array(short[] value, int offset, int length) {
-        impl.write_short_array(value, offset, length);
-    }
-    public final void write_ushort_array(short[] value, int offset, int length){
-        impl.write_ushort_array(value, offset, length);
-    }
-    public final void write_long_array(int[] value, int offset, int length) {
-        impl.write_long_array(value, offset, length);
-    }
-    public final void write_ulong_array(int[] value, int offset, int length) {
-        impl.write_ulong_array(value, offset, length);
-    }
-    public final void write_longlong_array(long[] value, int offset, int length) {
-        impl.write_longlong_array(value, offset, length);
-    }
-    public final void write_ulonglong_array(long[] value, int offset,int length) {
-        impl.write_ulonglong_array(value, offset, length);
-    }
-    public final void write_float_array(float[] value, int offset, int length) {
-        impl.write_float_array(value, offset, length);
-    }
-    public final void write_double_array(double[] value, int offset, int length) {
-        impl.write_double_array(value, offset, length);
-    }
-    public final void write_Object(org.omg.CORBA.Object value) {
-        impl.write_Object(value);
-    }
-    public final void write_TypeCode(TypeCode value) {
-        impl.write_TypeCode(value);
-    }
-    public final void write_any(Any value) {
-        impl.write_any(value);
-    }
-
-    public final void write_Principal(Principal value) {
-        impl.write_Principal(value);
-    }
-
-    public final void write(int b) throws java.io.IOException {
-        impl.write(b);
-    }
-    
-    public final void write_fixed(java.math.BigDecimal value) {
-        impl.write_fixed(value);
-    }
-
-    public final void write_Context(org.omg.CORBA.Context ctx,
-			      org.omg.CORBA.ContextList contexts) {
-        impl.write_Context(ctx, contexts);
-    }
-
-    public final org.omg.CORBA.ORB orb() {
-        return impl.orb();
-    }
-
-    // org.omg.CORBA_2_3.portable.OutputStream
-    public final void write_value(java.io.Serializable value) {
-        impl.write_value(value);
-    }
-
-    public final void write_value(java.io.Serializable value, java.lang.Class clz) {
-        impl.write_value(value, clz);
-    }
-
-    public final void write_value(java.io.Serializable value, String repository_id) {
-        impl.write_value(value, repository_id);
-    }
-
-    public final void write_value(java.io.Serializable value, 
-                            org.omg.CORBA.portable.BoxedValueHelper factory) {
-        impl.write_value(value, factory);
-    }
-
-    public final void write_abstract_interface(java.lang.Object obj) {
-        impl.write_abstract_interface(obj);
-    }
-
-    // java.io.OutputStream
-    public final void write(byte b[]) throws IOException {
-        impl.write(b);
-    }
-
-    public final void write(byte b[], int off, int len) throws IOException {
-        impl.write(b, off, len);
-    }
-
-    public final void flush() throws IOException {
-        impl.flush();
-    }
-
-    public final void close() throws IOException {
-        impl.close();
-    }
-
-    // com.sun.corba.se.impl.encoding.MarshalOutputStream
-    public final void start_block() {
-        impl.start_block();
-    }
-
-    public final void end_block() {
-        impl.end_block();
-    }
-
-    public final void putEndian() {
-        impl.putEndian();
-    }
-
-    public void writeTo(java.io.OutputStream s)
-	throws IOException 
-    {
-        impl.writeTo(s);
-    }
-
-    public final byte[] toByteArray() {
-        return impl.toByteArray();
-    }
-
-    // org.omg.CORBA.DataOutputStream
-    public final void write_Abstract (java.lang.Object value) {
-        impl.write_Abstract(value);
-    }
-
-    public final void write_Value (java.io.Serializable value) {
-        impl.write_Value(value);
-    }
-
-    public final void write_any_array(org.omg.CORBA.Any[] seq, int offset, int length) {
-        impl.write_any_array(seq, offset, length);
-    }
-
-    public void setMessageMediator(MessageMediator messageMediator)
-    {
-        this.corbaMessageMediator = (CorbaMessageMediator) messageMediator;
-    }
-
-    public MessageMediator getMessageMediator()
-    {
-        return corbaMessageMediator;
-    }
-
-    // org.omg.CORBA.portable.ValueBase
-    public final String[] _truncatable_ids() {
-        return impl._truncatable_ids();
-    }
-
-    // Other
-    protected final int getSize() {
-        return impl.getSize();
-    }
-
-    protected final int getIndex() {
-        return impl.getIndex();
-    }
-
-    protected int getRealIndex(int index) {
-        // Used in indirections. Overridden by TypeCodeOutputStream.
-        return index;
-    }
-
-    protected final void setIndex(int value) {
-        impl.setIndex(value);
-    }
-
-    protected final ByteBuffer getByteBuffer() {
-        return impl.getByteBuffer();
-    }
-
-    protected final void setByteBuffer(ByteBuffer byteBuffer) {
-        impl.setByteBuffer(byteBuffer);
-    }
-
-    public final boolean isLittleEndian() {
-        return impl.isLittleEndian();
-    }
-
-    // XREVISIT - return to final if possible
-    // REVISIT - was protected - need access from msgtypes test.
-    public ByteBufferWithInfo getByteBufferWithInfo() {
-        return impl.getByteBufferWithInfo();
-    }
-
-    protected void setByteBufferWithInfo(ByteBufferWithInfo bbwi) {
-        impl.setByteBufferWithInfo(bbwi);
-    }
-
-    // REVISIT: was protected - but need to access from xgiop.
-    public final BufferManagerWrite getBufferManager() {
-        return impl.getBufferManager();
-    }
-
-    public final void write_fixed(java.math.BigDecimal bigDecimal, short digits, short scale) {
-        impl.write_fixed(bigDecimal, digits, scale);
-    }
-
-    public final void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream s) {
-        impl.writeOctetSequenceTo(s);
-    }
-
-    public final GIOPVersion getGIOPVersion() {
-        return impl.getGIOPVersion();
-    }
-
-    public final void writeIndirection(int tag, int posIndirectedTo) {
-        impl.writeIndirection(tag, posIndirectedTo);
-    }
-
-    // Use Latin-1 for GIOP 1.0 or when code set negotiation was not
-    // performed.
-    protected CodeSetConversion.CTBConverter createCharCTBConverter() {
-        return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.ISO_8859_1);
-    }
-
-    // Subclasses must decide what to do here.  It's inconvenient to
-    // make the class and this method abstract because of dup().
-    protected abstract CodeSetConversion.CTBConverter createWCharCTBConverter();
-
-    protected final void freeInternalCaches() {
-        impl.freeInternalCaches();
-    }
-
-    void printBuffer() {
-        impl.printBuffer();
-    }
-
-    public void alignOnBoundary(int octetBoundary) {
-        impl.alignOnBoundary(octetBoundary);
-    }
-
-    // Needed by request and reply messages for GIOP versions >= 1.2 only.
-    public void setHeaderPadding(boolean headerPadding) {
-        impl.setHeaderPadding(headerPadding);
-    }
-
-    // ValueOutputStream -----------------------------
-
-    public void start_value(String rep_id) {
-        impl.start_value(rep_id);
-    }
-
-    public void end_value() {
-        impl.end_value();
-    }
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ThreadCurrentStack.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.interceptors;
-
-import com.sun.corba.se.impl.corba.AnyImpl;
-import org.omg.PortableInterceptor.Current;
-import org.omg.PortableInterceptor.InvalidSlot;
-
-import com.sun.corba.se.impl.util.MinorCodes;
-import com.sun.corba.se.impl.core.ORB;
-
-/**
- * ThreadCurrentStack is the container of PICurrent instances for each thread
- */
-public class ThreadCurrentStack
-{
-    // PICurrentPool is the container for reusable PICurrents
-    private class PICurrentPool {
-
-        // Contains a list of reusable PICurrents
-        private java.util.ArrayList pool;
-
-        // High water mark for the pool
-        // If the pool size reaches this limit then putPICurrent will
-        // not put PICurrent to the pool.
-        private static final int  HIGH_WATER_MARK = 5;
-
-        // currentIndex points to the last PICurrent in the list
-        private int currentIndex;
-
-        PICurrentPool( ) {
-            pool = new java.util.ArrayList( HIGH_WATER_MARK );
-            currentIndex = 0;
-        }
-
-        /**
-         * Puts PICurrent to the re-usable pool.
-         */
-        void putPICurrent( PICurrent current ) {
-            // If there are enough PICurrents in the pool, then don't add
-            // this current to the pool.
-            if( currentIndex >= HIGH_WATER_MARK ) {
-                return;
-            }
-            pool.add(currentIndex , current);
-            currentIndex++;
-        }
-
-        /**
-         * Gets PICurrent from the re-usable pool.
-         */
-        PICurrent getPICurrent( ) {
-            // If there are no entries in the pool then return null
-            if( currentIndex == 0 ) {
-                return null;
-            }
-            // Works like a stack, Gets the last one added first
-            currentIndex--;
-            return (PICurrent) pool.get(currentIndex);
-        }
-    }
-   
-    // Contains all the active PICurrents for each thread.
-    // The ArrayList is made to behave like a stack.
-    private java.util.ArrayList currentContainer;
-
-    // Keeps track of number of PICurrents in the stack.
-    private int currentIndex;
- 
-    // For Every Thread there will be a pool of re-usable ThreadCurrent's
-    // stored in PICurrentPool
-    private PICurrentPool currentPool;
-
-    // The orb associated with this ThreadCurrentStack
-    private ORB piOrb;
-
-    /**
-     * Constructs the stack and and PICurrentPool
-     */
-    ThreadCurrentStack( ORB piOrb, PICurrent current ) {
-       this.piOrb = piOrb;
-       currentIndex = 0;
-       currentContainer = new java.util.ArrayList( );
-       currentPool = new PICurrentPool( );
-       currentContainer.add( currentIndex, current );
-       currentIndex++;
-    }
-   
-
-    /**
-     * pushPICurrent goes through the following steps
-     * 1: Checks to see if there is any PICurrent in PICurrentPool
-     *    If present then use that instance to push into the ThreadCurrentStack
-     *
-     * 2:If there is no PICurrent in the pool, then creates a new one and pushes
-     *    that into the ThreadCurrentStack
-     */
-    void pushPICurrent( ) {
-        PICurrent current = currentPool.getPICurrent( );
-        if( current == null ) {
-            // get an existing PICurrent to get the slotSize
-            PICurrent currentTemp = peekPICurrent();
-            current = new PICurrent( piOrb, currentTemp.getSlotSize( ));
-        }
-        currentContainer.add( currentIndex, current );
-        currentIndex++;
-    }
-
-    /**
-     * popPICurrent does the following
-     * 1: pops the top PICurrent in the ThreadCurrentStack
-     *
-     * 2: resets the slots in the PICurrent which resets the slotvalues to
-     *    null if there are any previous sets. 
-     *
-     * 3: pushes the reset PICurrent into the PICurrentPool to reuse 
-     */
-    void  popPICurrent( ) {
-        // Do not pop the PICurrent, If there is only one.
-        // This should not happen, But an extra check for safety.
-        if( currentIndex <= 1 ) {
-            throw new org.omg.CORBA.INTERNAL( 
-                      "Cannot pop the only PICurrent in the stack",
-		      MinorCodes.CANT_POP_ONLY_CURRENT_2,
-		      CompletionStatus.COMPLETED_NO );
-        }
-        currentIndex--;
-        PICurrent current = (PICurrent)currentContainer.get( currentIndex );
-        current.resetSlots( );
-        currentPool.putPICurrent( current );
-    }
-
-    /**
-     * peekPICurrent gets the top PICurrent in the ThreadCurrentStack without
-     * popping.
-     */
-    PICurrent peekPICurrent( ) {
-       return (PICurrent) currentContainer.get( currentIndex - 1);
-    }
-
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2001, 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 com.sun.corba.se.impl.orbutil ;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-/** This class provides just a main method.  Its purpose is to allow -D arguments to
-* set up the system properties when starting programs with tools like OptimizeIt that
-* make this difficult or impossible.
-*
-* Invocation: {java launcher of some kind} DefineClass -Dxxx=yyy -Dxxx=yyy ... {class name} arg0, arg1, ...
-* Result: updates system properties with -D args, then uses reflection to invoke {class name}.main with the args
-*/
-
-class DefineWrapper {
-    public static void main( String[] args )
-    {
-	int numberDefines = args.length ;
-	String className = null ;
-
-	for (int ctr=0; ctr<args.length; ctr++ ) {
-	    String arg = args[ctr] ;
-
-	    if ((arg.charAt(0) == '-') && (arg.charAt(1) == 'D')) {
-		int eqIndex =  arg.indexOf( '=' ) ;
-		if (eqIndex < 0)
-		    throw new Exception( arg + " is not a valid property assignment" ) ;
-
-		final String key = arg.subString( 2, eqIndex ) ;
-		final String value = arg.subStrung( eqIndex + 1 ) ;
-
-		AccessController.doPrivileged( new PrivilegedAction() {
-			public Object run() {
-			    System.setProperty( key, value ) ;
-			    return null ;
-			}
-		    } ) ;
-	    } else {
-		numberDefines = ctr ;
-		className = arg ;
-		break ;
-	    }
-	}
-
-	if (numberDefines < args.length) {
-	    Class cls = getMainClass( className ) ;
-	    Method mainMethod = getMainMethod( cls ) ;
-
-	    String[] newArgs = new String[ args.length - numberDefines ] ;
-	    for (int ctr = numberDefines+1; ctr<args.length; ctr++ ) {
-		newArgs[ ctr-numberDefines-1 ] = args[ ctr ] ;
-	    }
-		
-	    // build args to the main and call it
-	    Object params [] = new Object [1];
-	    params[0] = newArgs;
-	    mainMethod.invoke(null, params);
-	} else {
-	    throw new Exception( "No class name given" ) ;
-	}
-    }
-
-    private static Class getMainClass( String name ) 
-    {
-	// determine the class loader to be used for loading the class
-	// since ServerMain is going to be in JDK and we need to have this
-	// class to load application classes, this is required here.
-	ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
-	if (cl == null)
-	    cl = ClassLoader.getSystemClassLoader();
-
-	try {
-	    // determine the main class, try loading with current class loader
-	    cls = Class.forName( className ) ;
-	} catch (ClassNotFoundException ex) {
-	    // eat the exception and try to load using SystemClassLoader
-	    cls = Class.forName( className, true, cl);
-	}
-    }
-
-    private static Method getMainMethod( Class serverClass ) 
-    {
-	Class argTypes[] = new Class[] { String[].class } ;
-	Method method = null ;
-
-	try {
-	    method = serverClass.getDeclaredMethod( "main", argTypes ) ;
-	} catch (Exception exc) {
-	    throw new Exception( "Could not get main() method: " + exc ) ;
-	} 
-
-	if (!isPublicStaticVoid( method ))
-	    throw new Exception( "Main method is not public static void" ) ;
-	
-	return method ;
-    }
-
-    private static boolean isPublicStaticVoid( Method method ) 
-    {
-	// check modifiers: public static
-	int modifiers =  method.getModifiers ();
-	if (!Modifier.isPublic (modifiers) || !Modifier.isStatic (modifiers)) {
-	    logError( method.getName() + " is not public static" ) ;
-	    return false ;
-	}
-
-	// check return type and exceptions
-	if (method.getExceptionTypes ().length != 0) {
-	    logError( method.getName() + " declares exceptions" ) ;
-	    return false ;
-	}
-
-	if (!method.getReturnType().equals (Void.TYPE)) {
-	    logError( method.getName() + " does not have a void return type" ) ;
-	    return false ;
-	}
-
-	return true ;
-    }
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl_save.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,909 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.presentation.rmi ;
-
-import java.lang.reflect.Method;
-
-import java.math.BigInteger;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.HashMap;
-import java.util.StringTokenizer;
-
-import com.sun.corba.se.spi.presentation.rmi.IDLNameTranslator ;
-
-import com.sun.corba.se.impl.presentation.rmi.IDLType ;
-import com.sun.corba.se.impl.presentation.rmi.IDLTypeException ;
-import com.sun.corba.se.impl.presentation.rmi.IDLTypesUtil ;
-import com.sun.corba.se.impl.orbutil.ObjectUtility ;
-
-/**
- * Bidirectional translator between RMI-IIOP interface methods and
- * and IDL Names.
- */
-public class IDLNameTranslatorImpl implements IDLNameTranslator {
-
-    // From CORBA Spec, Table 6 Keywords.
-    // Note that since all IDL identifiers are case 
-    // insensitive, java identifier comparisons to these
-    // will be case insensitive also.
-    private static String[] IDL_KEYWORDS = {
-
-        "abstract", "any", "attribute", "boolean", "case", "char",
-        "const", "context", "custom", "default", "double", "enum",
-        "exception", "factory", "FALSE", "fixed", "float", "in", "inout",
-        "interface", "long", "module", "native", "Object", "octet",
-        "oneway", "out", "private", "public", "raises", "readonly", "sequence",
-        "short", "string", "struct", "supports", "switch", "TRUE", "truncatable",
-        "typedef", "unsigned", "union", "ValueBase", "valuetype", "void",
-	"wchar", "wstring"
-
-    };
-
-    private static char[] HEX_DIGITS = {
-        '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
-        'A', 'B', 'C', 'D', 'E', 'F' 
-    };
-    
-    private static final String UNDERSCORE = "_";
-
-    // used to mangle java inner class names
-    private static final String INNER_CLASS_SEPARATOR =
-        UNDERSCORE + UNDERSCORE;
-
-    // used to form IDL array type names
-    private static final String[] BASE_IDL_ARRAY_MODULE_TYPE=
-	new String[] { "org", "omg", "boxedRMI" } ;
-
-    private static final String BASE_IDL_ARRAY_ELEMENT_TYPE = "seq";
-
-    // used to mangling java identifiers that have a leading underscore
-    private static final String LEADING_UNDERSCORE_CHAR = "J";
-    private static final String ID_CONTAINER_CLASH_CHAR = UNDERSCORE;
-
-    // separator used between types in a mangled overloaded method name
-    private static final String OVERLOADED_TYPE_SEPARATOR = 
-        UNDERSCORE + UNDERSCORE;
-
-    // string appended to attribute if it clashes with a method name
-    private static final String ATTRIBUTE_METHOD_CLASH_MANGLE_CHARS =
-        UNDERSCORE + UNDERSCORE;
-
-    private static Set idlKeywords_;
-
-    static {
-        
-        idlKeywords_ = new HashSet();
-        for(int i = 0; i < IDL_KEYWORDS.length; i++) {
-            String next = (String) IDL_KEYWORDS[i];
-            // Convert keyword to all caps to ease equality
-            // check.
-            String keywordAllCaps = next.toUpperCase();
-            idlKeywords_.add(keywordAllCaps);
-        }
-
-    }
-
-    //
-    // Instance state
-    //
-    
-    // Remote interface for name translation.  
-    private Class[] interf_;
-
-    // Maps used to hold name translations.  These do not need to be
-    // synchronized since the translation is never modified after
-    // initialization.
-    private Map methodToIDLNameMap_;
-    private Map IDLNameToMethodMap_;
-    private Method[] methods_;
-    
-    /**
-     * Return an IDLNameTranslator for the given interface.  
-     *
-     * @throws IllegalStateException if given class is not a valid 
-     *         RMI/IIOP Remote Interface
-     */
-    public static IDLNameTranslator get( Class interf )
-    {
-        
-        return new IDLNameTranslatorImpl(new Class[] { interf } );
-
-    }
-
-    /**
-     * Return an IDLNameTranslator for the given interfacex.  
-     *
-     * @throws IllegalStateException if given classes are not  valid 
-     *         RMI/IIOP Remote Interfaces
-     */
-    public static IDLNameTranslator get( Class[] interfaces )
-    {
-        
-        return new IDLNameTranslatorImpl(interfaces );
-
-    }
-
-    public static String getExceptionId( Class cls ) 
-    {
-	// Requirements for this method:
-	// 1. cls must be an exception but not a RemoteException.
-	// 2. If cls has an IDL keyword name, an underscore is prepended (1.3.2.2).
-	// 3. If cls jas a leading underscore, J is prepended (1.3.2.3).
-	// 4. If cls has an illegal IDL ident char, it is mapped to UXXXX where
-	//    XXXX is the unicode value in hex of the char (1.3.2.4).
-	// 5. double underscore for inner class (1.3.2.5).
-	// 6. The ID is "IDL:" + name with / separators + ":1.0".
-	IDLType itype = classToIDLType( cls ) ;
-	return itype.getExceptionName() ;
-    }
-
-    public Class[] getInterfaces()
-    {
-        return interf_;
-    }
-
-    public Method[] getMethods()
-    {
-	return methods_ ;
-    }
-
-    public Method getMethod( String idlName ) 
-    {
-        return (Method) IDLNameToMethodMap_.get(idlName);
-    }
-
-    public String getIDLName( Method method ) 
-    {
-        return (String) methodToIDLNameMap_.get(method);
-    }
-
-    /**
-     * Initialize an IDLNameTranslator for the given interface.  
-     *
-     * @throws IllegalStateException if given class is not a valid 
-     *         RMI/IIOP Remote Interface
-     */
-    private IDLNameTranslatorImpl(Class[] interfaces) 
-    {
-
-        try {
-            IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
-	    for (int ctr=0; ctr<interfaces.length; ctr++)
-		idlTypesUtil.validateRemoteInterface(interfaces[ctr]);
-            interf_ = interfaces;
-            buildNameTranslation();
-        } catch( IDLTypeException ite) {
-            String msg = ite.getMessage();
-            IllegalStateException ise = new IllegalStateException(msg);
-            ise.initCause(ite);
-            throw ise;
-        }
-    }
-
-    private void buildNameTranslation() 
-    {
-	// holds method info, keyed by method
-	Map allMethodInfo = new HashMap() ;
-
-	for (int ctr=0; ctr<interf_.length; ctr++) {
-	    Class interf = interf_[ctr] ;
-
-	    IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
-	    Method[] methods = interf.getMethods();
-
-	    // Take an initial pass through all the methods and create some
-	    // information that will be used to track the IDL name 
-	    // transformation.
-	    for(int i = 0; i < methods.length; i++) {
-		
-		Method nextMethod = methods[i];
-
-		IDLMethodInfo methodInfo = new IDLMethodInfo();
-
-		methodInfo.method = nextMethod;           
-
-		methodInfo.propertyType = 
-		    idlTypesUtil.propertyAccessorMethodType(
-			nextMethod, interf ) ;
-
-		if (methodInfo.propertyType != null) {
-		    String attributeName = idlTypesUtil.
-			getAttributeNameForProperty(nextMethod.getName());
-		    methodInfo.originalName = attributeName;
-		    methodInfo.mangledName  = attributeName;               
-		} else {
-		    methodInfo.originalName = nextMethod.getName();
-		    methodInfo.mangledName  = nextMethod.getName();
-		}
-		
-		allMethodInfo.put(nextMethod, methodInfo);
-	    }
-	}
-
-	// Check for having both is<NAME> and get<NAME> methods.
-
-	
-        //
-        // Perform case sensitivity test first.  This applies to all
-        // method names AND attributes.  Compare each method name and 
-        // attribute to all other method names and attributes.  If names 
-        // differ only in case, apply mangling as defined in section 1.3.2.7
-        // of Java2IDL spec.  Note that we compare using the original names.
-        //
-        for(Iterator outerIter=allMethodInfo.values().iterator();
-            outerIter.hasNext();) {
-            IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();           
-            for(Iterator innerIter = allMethodInfo.values().iterator(); 
-                innerIter.hasNext();) {
-                IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
-
-                if( (outer != inner) &&
-                    (!outer.originalName.equals(inner.originalName)) &&
-                    outer.originalName.equalsIgnoreCase(inner.originalName) ) {
-                    outer.mangledName = 
-                        mangleCaseSensitiveCollision(outer.originalName);
-                    break;
-                }
-
-            }
-        }
-                   
-        for(Iterator iter = allMethodInfo.values().iterator(); 
-            iter.hasNext();) {
-            IDLMethodInfo next = (IDLMethodcurrentInfo) iter.next();           
-            next.mangledName = 
-                mangleIdentifier(next.mangledName, 
-		    next.propertyType != null);
-        }         
-
-        //
-        // Now check for overloaded method names and apply 1.3.2.6.
-        //
-        for(Iterator outerIter=allMethodInfo.values().iterator();
-            outerIter.hasNext();) {
-            IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
-            if (outer.propertyType != null) {
-                continue;
-            }
-            for(Iterator innerIter = allMethodInfo.values().iterator(); 
-                innerIter.hasNext();) {
-                IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
-
-                if( (outer != inner) &&
-                    (inner.propertyType == null) &&
-                    outer.originalName.equals(inner.originalName) ) {
-                    outer.mangledName = mangleOverloadedMethod
-                        (outer.mangledName, outer.method);
-                    break;
-                }
-            }
-        }
-       
-        //
-        // Now mangle any properties that clash with method names.
-        //
-        for(Iterator outerIter=allMethodInfo.values().iterator();
-            outerIter.hasNext();) {
-            IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
-            if(outer.propertyType == null) {
-                continue;
-            }
-            for(Iterator innerIter = allMethodInfo.values().iterator(); 
-                innerIter.hasNext();) {
-                IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
-                if( (outer != inner) &&
-                    (inner.propertyType == null) &&
-                    outer.mangledName.equals(inner.mangledName) ) {
-                    outer.mangledName = outer.mangledName + 
-                        ATTRIBUTE_METHOD_CLASH_MANGLE_CHARS;
-                    break;
-                }
-            }
-        }
-
-        //
-        // Ensure that no mapped method names clash with mapped name
-        // of container(1.3.2.9).  This is a case insensitive comparison.
-        //
-	for (int ctr=0; ctr<interf_.length; ctr++ ) {
-	    Class interf = interf_[ctr] ;
-	    String mappedContainerName = getMappedContainerName(interf);
-	    for(Iterator iter = allMethodInfo.values().iterator(); 
-		iter.hasNext();) {
-		IDLMethodInfo next = (IDLMethodInfo) iter.next();           
-		if( (next.propertyType == null) &&
-		    identifierClashesWithContainer(mappedContainerName, 
-						   next.mangledName)) {
-		    next.mangledName = mangleContainerClash(next.mangledName);
-		}
-	    }         
-	}
-
-        //
-        // Populate name translation maps.
-        //
-        methodToIDLNameMap_ = new HashMap();
-        IDLNameToMethodMap_ = new HashMap();
-	methods_ = (Method[])allMethodInfo.keySet().toArray( 
-	    new Method[0] ) ;
-
-        for(Iterator iter = allMethodInfo.values().iterator(); 
-            iter.hasNext();) {
-            IDLMethodInfo next = (IDLMethodInfo) iter.next();           
-            String idlName = next.mangledName;
-            if (next.propertyType != null) {                
-		idlName = javaPropertyPrefixToIDL( next.propertyType ) +
-		    next.mangledName ;
-            }
-            
-            methodToIDLNameMap_.put(next.method, idlName);
-
-            // Final check to see if there are any clashes after all the
-            // manglings have been applied.  If so, this is treated as an
-            // invalid interface.  Currently, we do a CASE-SENSITIVE 
-            // comparison since that matches the rmic behavior.  
-            // @@@ Shouldn't this be a case-insensitive check?
-	    // If there is a collision between is<TYPE> and get<TYPE>,
-	    // map only is<TYPE> to an attribute, and leave the
-	    // get<TYPE> method alone.
-            if( IDLNameToMethodMap_.containsKey(idlName) ) {
-                // @@@ I18N
-                Method clash = (Method) IDLNameToMethodMap_.get(idlName);
-		MethodInfo clashMethodInfo = 
-		    (MethodInfo)allMethodInfo.get( clash ) ;
-		if (clashMethodInfo.isBooleanProperty() &&
-		    next.isReadProperty()) {
-		    // fix idlName
-		} else if (clashMethodInfo.isReadProperty() &&
-		    next.isBooleanProperty()) {
-		    // Remove entry under idlName
-		    // put entry into table under correct name
-		} else {
-		    throw new IllegalStateException("Error : methods " + 
-			clash + " and " + next.method + 
-			" both result in IDL name '" + idlName + "'");
-		}
-            } 
-
-	    IDLNameToMethodMap_.put(idlName, next.method);
-        }
-
-        return;
-
-    }
-
-    
-    /**
-     * Perform all necessary stand-alone identifier mangling operations
-     * on a java identifier that is being transformed into an IDL name.
-     * That is, mangling operations that don't require looking at anything
-     * else but the identifier itself.  This covers sections 1.3.2.2, 1.3.2.3, 
-     * and 1.3.2.4 of the Java2IDL spec.  Method overloading and 
-     * case-sensitivity checks are handled elsewhere.
-     */
-
-    private static String mangleIdentifier(String identifier) {
-        return mangleIdentifier(identifier, false);
-    }
-
-    private static String mangleIdentifier(String identifier, boolean attribute) {
-
-        String mangledName = identifier;
-
-        //
-        // Apply leading underscore test (1.3.2.3) 
-        // This should be done before IDL Keyword clash test, since clashing 
-        // IDL keywords are mangled by adding a leading underscore.
-        //
-        if( hasLeadingUnderscore(mangledName) ) {
-            mangledName = mangleLeadingUnderscore(mangledName);            
-        }         
-        
-        //
-        // Apply IDL keyword clash test (1.3.2.2).
-        // This is not needed for attributes since when the full property 
-        // name is composed it cannot clash with an IDL keyword.
-        // (Also, rmic doesn't do it.)
-        //
-        
-        if( !attribute && isIDLKeyword(mangledName) ) {
-            mangledName = mangleIDLKeywordClash(mangledName);           
-        } 
-
-        //
-        // Replace illegal IDL identifier characters (1.3.2.4) 
-        // for all method names and attributes.
-        //
-        if( !isIDLIdentifier(mangledName) ) {
-            mangledName = mangleUnicodeChars(mangledName);
-        }       
-        
-        return mangledName;
-    }
-
-    /**
-     * Checks whether a java identifier clashes with an
-     * IDL keyword.  Note that this is a case-insensitive
-     * comparison.
-     *
-     * Used to implement section 1.3.2.2 of Java2IDL spec.
-     */ 
-    private static boolean isIDLKeyword(String identifier) {
-        
-        String identifierAllCaps = identifier.toUpperCase();
-
-        return idlKeywords_.contains(identifierAllCaps);
-    }
-
-    private static String mangleIDLKeywordClash(String identifier) {
-        return UNDERSCORE + identifier;
-    }
-
-    private static String mangleLeadingUnderscore(String identifier) {
-        return LEADING_UNDERSCORE_CHAR + identifier;
-    }
-
-    /**
-     * Checks whether a java identifier starts with an underscore.
-     * Used to implement section 1.3.2.3 of Java2IDL spec.
-     */
-    private static boolean hasLeadingUnderscore(String identifier) {
-        return identifier.startsWith(UNDERSCORE);
-    }
-
-    /**
-     * Implements Section 1.3.2.4 of Java2IDL Mapping.
-     * All non-IDL identifier characters must be replaced
-     * with their Unicode representation.
-     */
-    static String mangleUnicodeChars(String identifier) {
-        StringBuffer mangledIdentifier = new StringBuffer();
-
-        for(int i = 0; i < identifier.length(); i++) {
-            char nextChar = identifier.charAt(i);
-            if( isIDLIdentifierChar(nextChar) ) {
-                mangledIdentifier.append(nextChar);
-            } else {
-                String unicode = charToUnicodeRepresentation(nextChar);
-                mangledIdentifier.append(unicode);
-            }
-        }
-        
-        return mangledIdentifier.toString();
-    }
-
-    /**
-     * Implements mangling portion of Section 1.3.2.7 of Java2IDL spec.
-     * This method only deals with the actual mangling.  Decision about 
-     * whether case-sensitive collision mangling is required is made 
-     * elsewhere.
-     * 
-     * 
-     * "...a mangled name is generated consisting of the original name 
-     * followed by an underscore separated list of decimal indices 
-     * into the string, where the indices identify all the upper case 
-     * characters in the original string. Indices are zero based."
-     *
-     */ 
-    String mangleCaseSensitiveCollision(String identifier) {
-
-        StringBuffer mangledIdentifier = new StringBuffer(identifier);
-
-        // There is always at least one trailing underscore, whether or 
-        // not the identifier has uppercase letters.
-        mangledIdentifier.append(UNDERSCORE);
-
-        boolean needUnderscore = false;
-        for(int i = 0; i < identifier.length(); i++) {
-            char next = identifier.charAt(i);
-            if( Character.isUpperCase(next) ) {
-                // This bit of logic is needed to ensure that we have
-                // an underscore separated list of indices but no 
-                // trailing underscores.  Basically, after we have at least
-                // one uppercase letter, we always put an undercore before
-                // printing the next one.
-                if( needUnderscore ) {
-                    mangledIdentifier.append(UNDERSCORE);
-                }
-                mangledIdentifier.append(i);
-                needUnderscore = true;
-            }
-        }
-
-        return mangledIdentifier.toString();
-    }
-
-    private static String mangleContainerClash(String identifier) {
-        return identifier + ID_CONTAINER_CLASH_CHAR;
-    }
-
-    /**
-     * Implements Section 1.3.2.9 of Java2IDL Mapping. Container in this
-     * context means the name of the java Class(excluding package) in which 
-     * the identifier is defined.  Comparison is case-insensitive.
-     */
-    private static boolean identifierClashesWithContainer
-        (String mappedContainerName, String identifier) {
-
-        return identifier.equalsIgnoreCase(mappedContainerName);
-    }
-
-    /**
-     * Returns Unicode mangling as defined in Section 1.3.2.4 of
-     * Java2IDL spec.
-     *
-     * "For Java identifiers that contain illegal OMG IDL identifier 
-     * characters such as '$' or Unicode characters outside of ISO Latin 1,
-     * any such illegal characters are replaced by "U" followed by the
-     * 4 hexadecimal characters(in upper case) representing the Unicode
-     * value.  So, the Java name a$b is mapped to aU0024b and 
-     * x\u03bCy is mapped to xU03BCy."
-     */
-    public static String charToUnicodeRepresentation(char c) {
-        
-        int orig = (int) c;
-        StringBuffer hexString = new StringBuffer();
-        
-        int value = orig;
-
-        while( value > 0 ) {
-            int div = value / 16;
-            int mod = value % 16;
-            hexString.insert(0, HEX_DIGITS[mod]);
-            value = div;
-        }
-
-        int numZerosToAdd = 4 - hexString.length();
-        for(int i = 0; i < numZerosToAdd; i++) {
-            hexString.insert(0, "0");
-        }
-
-        hexString.insert(0, "U");
-        return hexString.toString();
-    }
-
-    private static boolean isIDLIdentifier(String identifier) {
-
-        boolean isIdentifier = true;
-
-        for(int i = 0; i < identifier.length(); i++) {
-            char nextChar = identifier.charAt(i);
-            // 1st char must be alphbetic.
-            isIdentifier  = (i == 0) ?
-                isIDLAlphabeticChar(nextChar) : 
-                isIDLIdentifierChar(nextChar);
-            if( !isIdentifier ) {
-                break;
-            }
-        }
-
-        return isIdentifier;
-        
-    }
-
-    private static boolean isIDLIdentifierChar(char c) {
-        return (isIDLAlphabeticChar(c) || 
-                isIDLDecimalDigit(c)   ||
-                isUnderscore(c));
-    }
-
-    /**
-     * True if character is one of 114 Alphabetic characters as
-     * specified in Table 2 of Chapter 3 in CORBA spec.
-     */ 
-    private static boolean isIDLAlphabeticChar(char c) {
-
-        // NOTE that we can't use the java.lang.Character
-        // isUpperCase, isLowerCase, etc. methods since they
-        // include many characters other than the Alphabetic list in
-        // the CORBA spec.  Instead, we test for inclusion in the
-        // Unicode value ranges for the corresponding legal characters.
-
-        boolean alphaChar = 
-            (
-             // A - Z
-             ((c >= 0x0041) && (c <= 0x005A)) 
-
-             ||
-             
-             // a - z
-             ((c >= 0x0061) && (c <= 0x007A)) 
-             
-             ||
-             
-             // other letter uppercase, other letter lowercase, which is
-             // the entire upper half of C1 Controls except X and /
-             ((c >= 0x00C0) && (c <= 0x00FF)
-              && (c != 0x00D7) && (c != 0x00F7)));
-        
-        return alphaChar;
-    }
-
-    /**
-     * True if character is one of 10 Decimal Digits 
-     * specified in Table 3 of Chapter 3 in CORBA spec.
-     */ 
-    private static boolean isIDLDecimalDigit(char c) {
-        return ( (c >= 0x0030) && (c <= 0x0039) );
-    }
-
-    private static boolean isUnderscore(char c) {
-        return ( c == 0x005F );
-    }
-    
-    /**
-     * Mangle an overloaded method name as defined in Section 1.3.2.6 of
-     * Java2IDL spec.  Current value of method name is passed in as argument.
-     * We can't start from original method name since the name might have
-     * been partially mangled as a result of the other rules.  
-     */
-    private static String mangleOverloadedMethod(String mangledName, Method m) {
-
-        IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
-
-        // Start by appending the separator string
-        String newMangledName = mangledName + OVERLOADED_TYPE_SEPARATOR;
-        
-        Class[] parameterTypes = m.getParameterTypes();
-        
-        for(int i = 0; i < parameterTypes.length; i++) {
-            Class nextParamType = parameterTypes[i];
-            
-            if( i > 0 ) {
-                newMangledName = newMangledName + OVERLOADED_TYPE_SEPARATOR;
-            }            
-            IDLType idlType = classToIDLType(nextParamType);
-
-            String moduleName = idlType.getModuleName();
-            String memberName = idlType.getMemberName();
-
-            String typeName = (moduleName.length() > 0) ?
-                moduleName + UNDERSCORE + memberName : memberName;
-                                   
-            if( !idlTypesUtil.isPrimitive(nextParamType) && 
-                (idlTypesUtil.getSpecialCaseIDLTypeMapping(nextParamType) 
-                 == null) &&               
-                isIDLKeyword(typeName) ) {
-                typeName = mangleIDLKeywordClash(typeName);
-            }
-
-            typeName = mangleUnicodeChars(typeName);
-
-            newMangledName = newMangledName + typeName;
-        }        
-
-        return newMangledName;        
-    }
-
-
-    private static IDLType classToIDLType(Class c) {
-               
-        IDLType idlType = null;
-        IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
-
-        if( idlTypesUtil.isPrimitive(c) ) {
-
-            idlType = idlTypesUtil.getPrimitiveIDLTypeMapping(c);
-
-        } else if( c.isArray() ) {
-            
-            // Calculate array depth, as well as base element type.
-            Class componentType = c.getComponentType();
-            int numArrayDimensions = 1;
-            while(componentType.isArray()) {
-                componentType = componentType.getComponentType();
-                numArrayDimensions++;
-            }
-            IDLType componentIdlType = classToIDLType(componentType);
-            
-            String[] modules = BASE_IDL_ARRAY_MODULE_TYPE;
-            if( componentIdlType.hasModule() ) {
-                modules = (String[])ObjectUtility.concatenateArrays( modules, 
-                    componentIdlType.getModules() ) ;
-            }
-
-            String memberName = BASE_IDL_ARRAY_ELEMENT_TYPE + 
-                numArrayDimensions + UNDERSCORE + 
-                componentIdlType.getMemberName();                
-            
-            idlType = new IDLType(c, modules, memberName);
-               
-        } else {
-            idlType = idlTypesUtil.getSpecialCaseIDLTypeMapping(c);
-
-            if (idlType == null) {
-                // Section 1.3.2.5 of Java2IDL spec defines mangling rules for
-                // inner classes.
-                String memberName = getUnmappedContainerName(c);
-
-                // replace inner class separator with double underscore
-                memberName = memberName.replaceAll("\\$", 
-                                                   INNER_CLASS_SEPARATOR);
-                                
-                if( hasLeadingUnderscore(memberName) ) {
-                    memberName = mangleLeadingUnderscore(memberName);
-                }                    
-
-                // Get raw package name.  If there is a package, it
-                // will still have the "." separators and none of the
-                // mangling rules will have been applied.
-                String packageName = getPackageName(c);                 
-                
-                if (packageName == null) {
-		    idlType = new IDLType( c, memberName ) ;
-		} else {
-		    // If this is a generated IDL Entity Type we need to
-		    // prepend org_omg_boxedIDL per sections 1.3.5 and 1.3.9
-		    if (idlTypesUtil.isEntity(c)) {
-			packageName = "org.omg.boxedIDL." + packageName ;
-		    }
-		    
-		    // Section 1.3.2.1 and 1.3.2.6 of Java2IDL spec defines 
-		    // rules for mapping java packages to IDL modules and for 
-		    // mangling module name portion of type name.  NOTE that
-		    // of the individual identifier mangling rules, 
-		    // only the leading underscore test is done here.  
-		    // The other two(IDL Keyword, Illegal Unicode chars) are
-		    // done in mangleOverloadedMethodName.  
-                    StringTokenizer tokenizer = 
-                        new StringTokenizer(packageName, ".");
-		    
-		    String[] modules = new String[ tokenizer.countTokens() ] ;
-		    int index = 0 ;
-                    while (tokenizer.hasMoreElements()) {
-                        String next = tokenizer.nextToken();
-                        String nextMangled = hasLeadingUnderscore(next) ?
-                            mangleLeadingUnderscore(next) : next;
-
-			modules[index++] = nextMangled ;
-                    }                                                          
-
-		    idlType = new IDLType(c, modules, memberName);
-                }
-            }
-        }
-
-        return idlType;
-    }
-
-    /**
-     * Return Class' package name or null if there is no package.
-     */
-    private static String getPackageName(Class c) {
-        Package thePackage = c.getPackage();
-        String packageName = null;
-
-        // Try to get package name by introspection.  Some classloaders might
-        // not provide this information, so check for null.
-        if( thePackage != null ) {
-            packageName = thePackage.getName();
-        } else {
-            // brute force method
-            String fullyQualifiedClassName = c.getName();
-            int lastDot = fullyQualifiedClassName.indexOf('.');
-            packageName = (lastDot == -1) ? null :
-                fullyQualifiedClassName.substring(0, lastDot);
-        }
-        return packageName;
-    }
-    
-    private static String getMappedContainerName(Class c) {
-        String unmappedName = getUnmappedContainerName(c);
-
-        return mangleIdentifier(unmappedName);
-    }
-
-    /**
-     * Return portion of class name excluding package name.
-     */
-    private static String getUnmappedContainerName(Class c) {
-
-        String memberName  = null;
-        String packageName = getPackageName(c);
-
-        String fullyQualifiedClassName = c.getName();
-               
-        if( packageName != null ) {
-            int packageLength = packageName.length();
-            memberName = fullyQualifiedClassName.substring(packageLength + 1);
-        } else {
-            memberName = fullyQualifiedClassName;
-
-        }
-
-        return memberName;
-    }
-
-    /**
-     * Internal helper class for tracking information related to each
-     * interface method while we're building the name translation table.
-     */
-    private static class IDLMethodInfo 
-    {
-        public Method method;
-        public String propertyType;
-        
-        // If this is a property, originalName holds the original 
-        // attribute name. Otherwise, it holds the original method name.
-        public String originalName;
-
-        // If this is a property, mangledName holds the mangled attribute 
-        // name. Otherwise, it holds the mangled method name. 
-        public String mangledName;        
-
-    }
-
-    public String toString() {
-
-        StringBuffer contents = new StringBuffer();
-        contents.append("IDLNameTranslator[" );
-	for( int ctr=0; ctr<interf_.length; ctr++) {
-	    if (ctr != 0)
-		contents.append( " " ) ;
-	    contents.append( interf_[ctr].getName() ) ;
-	}
-        contents.append("]\n");
-        for(Iterator iter = methodToIDLNameMap_.keySet().iterator();
-            iter.hasNext();) {
-
-            Method method  = (Method) iter.next();
-            String idlName = (String) methodToIDLNameMap_.get(method);
-
-            contents.append(idlName + ":" + method + "\n");
-
-        }
-
-        return contents.toString();
-    }
-
-    public static void main(String[] args) {
-        
-        Class remoteInterface = java.rmi.Remote.class;
-        
-        if( args.length > 0 ) {
-            String className = args[0];
-            try {
-                remoteInterface = Class.forName(className);
-            } catch(Exception e) {
-                e.printStackTrace();
-                System.exit(-1);
-            }            
-        }
-        
-        System.out.println("Building name translation for " + remoteInterface);
-        try {
-            IDLNameTranslator nameTranslator = 
-                IDLNameTranslatorImpl.get(remoteInterface);
-            System.out.println(nameTranslator);
-        } catch(IllegalStateException ise) {
-            ise.printStackTrace();
-        }
-    }
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,544 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.presentation.rmi ;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Field;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-
-/**
- * Utility class for testing RMI/IDL Types as defined in
- * Section 1.2 of The Java Language to IDL Mapping.  Note that
- * these are static checks only.  Runtime checks, such as those
- * described in Section 1.2.3, #3, are not covered.
- */
-public class IDLTypesUtil {
-
-    public static final String JAVA_GET_PROPERTY_PREFIX = "get";
-    public static final String JAVA_SET_PROPERTY_PREFIX = "set";
-    public static final String JAVA_IS_PROPERTY_PREFIX  = "is";
-
-    public static final int VALID_TYPE   = 0;
-    public static final int INVALID_TYPE = 1;
-
-    /**
-     * Validate a class to ensure it conforms to the rules for a
-     * Java RMI/IIOP interface.
-     *
-     * @throws IDLTypeException if not a valid RMI/IIOP interface.
-     */
-    public void validateRemoteInterface(Class c) throws IDLTypeException
-    {
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        if( !c.isInterface() ) {
-            String msg = "Class " + c + " must be a java interface.";
-            throw new IDLTypeException(msg);
-        }
-
-        if( !java.rmi.Remote.class.isAssignableFrom(c) ) {
-            String msg = "Class " + c + " must extend java.rmi.Remote, " +
-                "either directly or indirectly.";
-            throw new IDLTypeException(msg);
-        }
-
-        // Get all methods, including super-interface methods.
-        Method[] methods = c.getMethods();
-        
-        for(int i = 0; i < methods.length; i++) {
-            Method next = methods[i];
-            validateExceptions(next);
-        }
-        
-	// Removed because of bug 4989053
-        // validateDirectInterfaces(c);
-        validateConstants(c);
-
-        return;
-    }
-
-    public boolean isRemoteInterface(Class c)     
-    {
-        boolean remoteInterface = true;
-        try {
-            validateRemoteInterface(c);
-        } catch(IDLTypeException ite) {
-            remoteInterface = false;
-        }
-
-        return remoteInterface;
-    }
-
-    /**
-     * Section 1.2.2 Primitive Types
-     */ 
-    public boolean isPrimitive(Class c) 
-    {
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        return c.isPrimitive();
-    }
-
-    /**
-     * Section 1.2.4
-     */
-    public boolean isValue(Class c) 
-    {
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        return 
-            (!c.isInterface() &&
-             java.io.Serializable.class.isAssignableFrom(c) &&
-             !java.rmi.Remote.class.isAssignableFrom(c));
-    }
-
-    /**
-     * Section 1.2.5
-     */
-    public boolean isArray(Class c) 
-    {
-        boolean arrayType = false;
-
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        if( c.isArray() ) {
-            Class componentType = c.getComponentType();
-            arrayType =
-                (isPrimitive(componentType) || isRemoteInterface(componentType) ||
-                 isEntity(componentType) || isException(componentType) || 
-		 isValue(componentType) || isObjectReference(componentType) );
-        }
-
-        return arrayType;
-    }
-
-    /**
-     * Section 1.2.6
-     */
-    public boolean isException(Class c) 
-    {
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        // Must be a checked exception, not including RemoteException or
-        // its subclasses.
-        return isCheckedException(c) && !isRemoteException(c) && isValue(c);
-    }
-
-    public boolean isRemoteException(Class c)
-    {
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-	return java.rmi.RemoteException.class.isAssignableFrom(c) ;
-    }
-
-    public boolean isCheckedException(Class c) 
-    {
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        return Throwable.class.isAssignableFrom(c) &&
-            !RuntimeException.class.isAssignableFrom(c) &&
-            !Error.class.isAssignableFrom(c) ;
-    }
-
-    /**
-     * Section 1.2.7
-     */ 
-    public boolean isObjectReference(Class c) 
-    {
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        return (c.isInterface() && 
-                org.omg.CORBA.Object.class.isAssignableFrom(c));
-    }
-
-    /**
-     * Section 1.2.8
-     */ 
-    public boolean isEntity(Class c)
-    {
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        Class superClass = c.getSuperclass();
-        return (!c.isInterface() &&
-                (superClass != null) && 
-                (org.omg.CORBA.portable.IDLEntity.class.isAssignableFrom(c)));
-    }
-
-    public String javaPropertyPrefixToIDL( String javaPrefix )
-    {
-	return "_" + javaPrefix + "_" ;
-    }
-
-    /**
-     * Return the property type if given method is legal property accessor as defined in 
-     * Section 1.3.4.3 of Java2IDL spec.  Result is one of: JAVA_GET_PROPERTY_PREFIX,
-     * JAVA_SET_PROPERTY_PREFIX, JAVA_IS_PROPERTY_PREFIX.
-     */
-    public String propertyAccessorMethodType(Method m, Class c) {
-        
-        String methodName = m.getName();
-        Class returnType  = m.getReturnType();
-        Class[] parameters = m.getParameterTypes();
-        Class[] exceptionTypes = m.getExceptionTypes();
-        String propertyType = null;
-
-        if( methodName.startsWith(JAVA_GET_PROPERTY_PREFIX) ) {
-
-            if((parameters.length == 0) && (returnType != Void.TYPE) &&
-		!hasCorrespondingReadProperty(m, c, JAVA_IS_PROPERTY_PREFIX) {
-                propertyType = JAVA_GET_PROPERTY_PREFIX;
-            }
-           
-        } else if( methodName.startsWith(JAVA_SET_PROPERTY_PREFIX) ) {
-            
-            if((returnType == Void.TYPE) && (parameters.length == 1)) {
-                if (hasCorrespondingReadProperty(m, c, JAVA_GET_PROPERTY_PREFIX) ||
-                    hasCorrespondingReadProperty(m, c, JAVA_IS_PROPERTY_PREFIX)) {
-                    propertyType = JAVA_SET_PROPERTY_PREFIX;
-                }
-            }
-
-        } else if( methodName.startsWith(JAVA_IS_PROPERTY_PREFIX) ) {
-            if((parameters.length == 0) && (returnType == Boolean.TYPE)) {
-                propertyType = JAVA_IS_PROPERTY_PREFIX;             
-            }
-        }
-
-        // Some final checks that apply to all properties.  
-        if( propertyType != null ) {
-            if(!validPropertyExceptions(m) || 
-               (methodName.length() <= propertyType.length())) {
-                propertyType = null;
-            }                                       
-        }
-
-        return propertyType ;
-    }
-
-    private boolean hasCorrespondingReadProperty
-        (Method writeProperty, Class c, String readPropertyPrefix) {
-
-        String writePropertyMethodName = writeProperty.getName();
-        Class[] writePropertyParameters = writeProperty.getParameterTypes();
-        boolean foundReadProperty = false;
-
-        try {            
-            // Look for a valid corresponding Read property
-            String readPropertyMethodName = 
-                writePropertyMethodName.replaceFirst
-                    (JAVA_SET_PROPERTY_PREFIX, readPropertyPrefix);
-            Method readPropertyMethod = c.getMethod(readPropertyMethodName, 
-                                                    new Class[] {});
-            foundReadProperty = 
-                ((propertyAccessorMethodType(readPropertyMethod, c) != null) &&
-                 (readPropertyMethod.getReturnType() == 
-                   writePropertyParameters[0]));
-        } catch(Exception e) {
-            // ignore. this means we didn't find a corresponding get property.
-        }
-
-        return foundReadProperty;
-    }
-
-    public String getAttributeNameForProperty(String propertyName) {
-        String attributeName = null;
-        String prefix = null;
-
-        if( propertyName.startsWith(JAVA_GET_PROPERTY_PREFIX) ) {
-            prefix = JAVA_GET_PROPERTY_PREFIX;           
-        } else if( propertyName.startsWith(JAVA_SET_PROPERTY_PREFIX) ) {
-            prefix = JAVA_SET_PROPERTY_PREFIX;
-        } else if( propertyName.startsWith(JAVA_IS_PROPERTY_PREFIX) ) {
-            prefix = JAVA_IS_PROPERTY_PREFIX;
-        }
-
-        if( (prefix != null) && (prefix.length() < propertyName.length()) ) {
-            String remainder = propertyName.substring(prefix.length());
-            if( (remainder.length() >= 2) && 
-                Character.isUpperCase(remainder.charAt(0)) &&
-                Character.isUpperCase(remainder.charAt(1)) ) {
-                // don't set the first letter to lower-case if the 
-                // first two are upper-case
-                attributeName = remainder;
-            } else {
-                attributeName = Character.toLowerCase(remainder.charAt(0)) +
-                    remainder.substring(1);
-            }
-        }
-
-        return attributeName;
-    }
-
-    /**
-     * Return IDL Type name for primitive types as defined in 
-     * Section 1.3.3 of Java2IDL spec or null if not a primitive type.
-     */ 
-    public IDLType getPrimitiveIDLTypeMapping(Class c) {
-               
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        if( c.isPrimitive() ) {            
-            if( c == Void.TYPE ) {
-		return new IDLType( c, "void" ) ;
-            } else if( c == Boolean.TYPE ) {
-		return new IDLType( c, "boolean" ) ;
-            } else if( c == Character.TYPE ) {
-		return new IDLType( c, "wchar" ) ;
-            } else if( c == Byte.TYPE ) {
-		return new IDLType( c, "octet" ) ;
-            } else if( c == Short.TYPE ) {
-		return new IDLType( c, "short" ) ;
-            } else if( c == Integer.TYPE ) {
-		return new IDLType( c, "long" ) ;
-            } else if( c == Long.TYPE ) {
-		return new IDLType( c, "long_long" ) ;
-            } else if( c == Float.TYPE ) {
-		return new IDLType( c, "float" ) ;
-            } else if( c == Double.TYPE ) {
-		return new IDLType( c, "double" ) ;
-            }
-        }
-        
-        return null;
-    }
-
-    /**
-     * Return IDL Type name for special case type mappings as defined in
-     * Table 1-1 of Java2IDL spec or null if given class is not a special
-     * type.
-     */
-    public IDLType getSpecialCaseIDLTypeMapping(Class c) {
-
-        if( c == null ) {
-            throw new IllegalArgumentException();
-        } 
-
-        if( c == java.lang.Object.class ) {
-	    return new IDLType( c, new String[] { "java", "lang" },
-		"Object" ) ;
-        } else if( c == java.lang.String.class ) {
-	    return new IDLType( c, new String[] { "CORBA" },
-		"WStringValue" ) ;
-        } else if( c == java.lang.Class.class ) {
-	    return new IDLType( c, new String[] { "javax", "rmi", "CORBA" },
-		"ClassDesc" ) ;
-        } else if( c == java.io.Serializable.class ) {
-	    return new IDLType( c, new String[] { "java", "io" },
-		"Serializable" ) ;
-        } else if( c == java.io.Externalizable.class ) {
-	    return new IDLType( c, new String[] { "java", "io" },
-		"Externalizable" ) ;
-        } else if( c == java.rmi.Remote.class ) {
-	    return new IDLType( c, new String[] { "java", "rmi" },
-		"Remote" ) ;
-        } else if( c == org.omg.CORBA.Object.class ) {
-	    return new IDLType( c, "Object" ) ;
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Implements 1.2.3 #2 and #4
-     */
-    private void validateExceptions(Method method) throws IDLTypeException {
-        
-        Class[] exceptions = method.getExceptionTypes();
-
-        boolean declaresRemoteExceptionOrSuperClass = false;
-
-        // Section 1.2.3, #2
-        for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
-            Class exception = exceptions[eIndex];
-            if( isRemoteExceptionOrSuperClass(exception) ) {
-                declaresRemoteExceptionOrSuperClass = true;
-                break;
-            }
-        }
-
-        if( !declaresRemoteExceptionOrSuperClass ) {
-            String msg = "Method '" + method + "' must throw at least one " +
-                "exception of type java.rmi.RemoteException or one of its " +
-                "super-classes";
-            throw new IDLTypeException(msg);
-        } 
-
-        // Section 1.2.3, #4
-	// See also bug 4972402
-	// For all exceptions E in exceptions, 
-	// (isCheckedException(E) => (isValue(E) || RemoteException.isAssignableFrom( E ) )
-        for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
-            Class exception = exceptions[eIndex];
-
-	    if (isCheckedException(exception) && !isValue(exception) && 
-		!isRemoteException(exception)) 
-	    {
-		String msg = "Exception '" + exception + "' on method '" +
-		    method + "' is not a allowed RMI/IIOP exception type";
-		throw new IDLTypeException(msg);
-            }
-        }
-
-        return;
-    }
-
-    /**
-     * Returns true if the method's throw clause conforms to the exception 
-     * restrictions for properties as defined in Section 1.3.4.3 of 
-     * Java2IDL spec.  This means that for all exceptions E declared on the
-     * method, E isChecked => RemoteException.isAssignableFrom( E ). 
-     */
-    private boolean validPropertyExceptions(Method method) 
-    {
-        Class[] exceptions = method.getExceptionTypes();
-         
-        for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
-            Class exception = exceptions[eIndex];
-
-	    if (isCheckedException(exception) && !isRemoteException(exception)) 
-		return false ;
-        }
-
-        return true;
-    }
-
-    /**
-     * Implements Section 1.2.3, #2.  
-     */
-    private boolean isRemoteExceptionOrSuperClass(Class c) {
-        return 
-            ((c == java.rmi.RemoteException.class) ||
-             (c == java.io.IOException.class) ||
-             (c == java.lang.Exception.class) ||
-             (c == java.lang.Throwable.class));
-    }
-
-    /**
-     * Implements Section 1.2.3, #5.
-     */ 
-    private void validateDirectInterfaces(Class c) throws IDLTypeException {
-
-        Class[] directInterfaces = c.getInterfaces();
-
-        if( directInterfaces.length < 2 ) {
-            return;
-        }
-
-        Set allMethodNames = new HashSet();
-        Set currentMethodNames = new HashSet();
-
-        for(int i = 0; i < directInterfaces.length; i++) {
-            Class next = directInterfaces[i];
-            Method[] methods = next.getMethods();
-
-            // Comparison is based on method names only.  First collect
-            // all methods from current interface, eliminating duplicate
-            // names.
-            currentMethodNames.clear();
-            for(int m = 0; m < methods.length; m++) {
-                currentMethodNames.add(methods[m].getName());
-            }
-
-            // Now check each method against list of all unique method
-            // names processed so far.
-            for(Iterator iter=currentMethodNames.iterator(); iter.hasNext();) {
-                String methodName = (String) iter.next();
-                if( allMethodNames.contains(methodName) ) {
-                    String msg = "Class " + c + " inherits method " + 
-                        methodName + " from multiple direct interfaces.";
-                    throw new IDLTypeException(msg);
-                } else {
-                    allMethodNames.add(methodName);
-                }
-            }
-        }
-
-        return;
-    }
-
-    /**
-     * Implements 1.2.3 #6
-     */
-    private void validateConstants(final Class c) 
-        throws IDLTypeException {
-
-        Field[] fields = null;
-
-        try {
-            fields = (Field[])
-                java.security.AccessController.doPrivileged
-                (new java.security.PrivilegedExceptionAction() {
-                        public java.lang.Object run() throws Exception {
-                            return c.getFields();
-                        }
-                    });
-        } catch(java.security.PrivilegedActionException pae) {
-            IDLTypeException ite = new IDLTypeException();
-            ite.initCause(pae);
-            throw ite;
-        }
-   
-        for(int i = 0; i < fields.length; i++) {
-            Field next = fields[i];
-            Class fieldType = next.getType();
-            if( (fieldType != java.lang.String.class) &&
-                !isPrimitive(fieldType) ) {
-                String msg = "Constant field '" + next.getName() + 
-                    "' in class '" + next.getDeclaringClass().getName() + 
-                    "' has invalid type' " + next.getType() + "'. Constants" +
-                    " in RMI/IIOP interfaces can only have primitive" + 
-                    " types and java.lang.String types.";
-                throw new IDLTypeException(msg);
-            }
-        }
-
-
-        return;
-    }
-
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.iiop;
-
-import com.sun.corba.se.impl.protocol.Request;
-import com.sun.corba.se.impl.core.ClientRequest;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.core.ServerRequest;
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.corba.GIOPVersion;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.core.ORBVersion;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.orbutil.ORBUtility;
-import com.sun.corba.se.impl.ior.ObjectKeyFactory ;
-import com.sun.corba.se.impl.ior.ObjectKey ;
-import com.sun.corba.se.impl.ior.ObjectKeyTemplate ;
-import com.sun.corba.se.impl.ior.IIOPProfile;
-
-public class LocalClientRequestImpl extends IIOPOutputStream 
-    implements ClientRequest 
-{
-    public LocalClientRequestImpl( GIOPVersion gv, 
-	ORB orb, IOR ior, short addrDisposition, 
-        String operationName, boolean oneway, ServiceContexts svc, 
-	int requestId, byte streamFormatVersion)
-    {
-	super(gv, 
-              orb, 
-              null, 
-              BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
-              streamFormatVersion);
-
-	this.isOneway = oneway;
-	boolean responseExpected = !isOneway;
-
-        IIOPProfile iop = ior.getProfile();
-	ObjectKey okey = iop.getObjectKey();
-	ObjectKeyTemplate oktemp = okey.getTemplate() ;
-	ORBVersion version = oktemp.getORBVersion() ;
-	orb.setORBVersion( version ) ;
-
-        this.request = MessageBase.createRequest(orb, gv, requestId,
-	    responseExpected, ior, addrDisposition, operationName, svc, null);
-	setMessage(request);
-	request.write(this);
-
-	// mark beginning of msg body for possible later use
-	bodyBegin = getSize();
-    }
-
-    public int getRequestId() {
-	return request.getRequestId();
-    }
-    
-    public boolean isOneWay() {
-	return isOneway;
-    }
-
-    public ServiceContexts getServiceContexts() {
-	return request.getServiceContexts();
-    }
-
-    public String getOperationName() {
-	return request.getOperation();
-    }
-
-    public ObjectKey getObjectKey() {
-	return request.getObjectKey();
-    }
-
-    public ServerRequest getServerRequest()
-    {
-	// Set the size of the marshalled data in the message header.
-	getMessage().setSize( getByteBuffer(), getSize() ) ;
-
-	// Construct a new ServerRequest out of the buffer in this ClientRequest
-	LocalServerRequestImpl serverRequest = new LocalServerRequestImpl(
-	    (ORB)orb(), toByteArray(), request ) ;
-
-	// Skip over all of the GIOP header information.  This positions
-	// the offset in the buffer so that the skeleton can correctly read
-	// the marshalled arguments.
-	serverRequest.setIndex( bodyBegin ) ;
-
-	return serverRequest ;
-    }
-    
-    public ClientResponse invoke() 
-    {	
-	ORB myORB = (ORB)orb() ;
-
-	ServerResponse serverResponse = myORB.process( getServerRequest() ) ;
-
-	LocalServerResponseImpl lsr = (LocalServerResponseImpl)serverResponse ;
-
-	return lsr.getClientResponse() ;
-    }
-
-    /**
-     * Check to see if the request is local.
-     */
-    public boolean isLocal(){
-        return true;
-    }
-
-    private RequestMessage request;
-    private int bodyBegin;
-    private boolean isOneway;
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientResponseImpl.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.iiop;
-
-import java.io.IOException;
-
-import org.omg.CORBA.SystemException;
-import org.omg.CORBA.CompletionStatus;
-
-import com.sun.corba.se.impl.core.Response;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-import com.sun.corba.se.impl.orbutil.MinorCodes;
-
-class LocalClientResponseImpl extends IIOPInputStream implements ClientResponse
-{
-    LocalClientResponseImpl(ORB orb, byte[] buf, ReplyMessage header)
-    {
-	super(orb, buf, header.getSize(), header.isLittleEndian(), header, null);
-
-        this.reply = header;
-
-        // NOTE (Ram J) (06/02/2000) if we set result.setIndex(bodyBegin)
-        // in LocalServerResponse.getClientResponse(), then we do not need
-        // to read the headers (done below) anymore.
-        // This will be an optimisation which is can be done to speed up the
-        // local invocation by avoiding reading the headers in the local cases.
-
-        // BUGFIX(Ram Jeyaraman) This has been moved from
-        // LocalServerResponse.getClientResponse()
-        // Skip over all of the GIOP header information.  This positions
-        // the offset in the buffer so that the skeleton can correctly read
-        // the marshalled arguments.
-        this.setIndex(Message.GIOPMessageHeaderLength);
-
-        // BUGFIX(Ram Jeyaraman) For local invocations, the reply mesg fields
-        // needs to be set, by reading the response buffer contents
-        // to correctly set the exception type and other info.
-        this.reply.read(this);
-    }
-
-    LocalClientResponseImpl(SystemException ex)
-    {
-	this.systemException = ex;
-    }
-
-    public boolean isSystemException() {
-	if ( reply != null )
-	    return reply.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION;
-	else
-	    return (systemException != null);	
-    }
-
-    public boolean isUserException() {
-	if ( reply != null )
-	    return reply.getReplyStatus() == ReplyMessage.USER_EXCEPTION;
-	else
-	    return false;
-    }
-
-    public boolean isLocationForward() {
-        if ( reply != null ) {
-            return ( (reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD) ||
-                     (reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD_PERM) );
-            //return reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD;
-        } else {
-            return false;
-        }
-    }
-    
-    public boolean isDifferentAddrDispositionRequested() {
-        if (reply != null) {
-            return reply.getReplyStatus() == ReplyMessage.NEEDS_ADDRESSING_MODE;
-        }
-    
-        return false;
-    }
-        
-    public short getAddrDisposition() {
-        if (reply != null) {
-            return reply.getAddrDisposition();
-        }
-        
-        throw new org.omg.CORBA.INTERNAL(
-            "Null reply in getAddrDisposition",
-            MinorCodes.NULL_REPLY_IN_GET_ADDR_DISPOSITION,        
-            CompletionStatus.COMPLETED_MAYBE);
-    }
-        
-    public IOR getForwardedIOR() {
-	if ( reply != null )
-	    return reply.getIOR();
-	else
-	    return null;
-    }
-
-    public int getRequestId() {
-	if ( reply != null )
-	    return reply.getRequestId();
-	else
-	    throw new org.omg.CORBA.INTERNAL("Error in getRequestId");
-    }
-
-    public ServiceContexts getServiceContexts() {
-	if ( reply != null )
-	    return reply.getServiceContexts();
-	else
-	    return null;
-    }
-
-    public SystemException getSystemException() {
-	if ( reply != null )
-	    return reply.getSystemException();
-	else
-	    return systemException;
-    }
-
-    public java.lang.String peekUserExceptionId() {
-        mark(Integer.MAX_VALUE);
-        String result = read_string();
-        reset();
-        return result;
-    }
-
-    /**
-     * Check to see if the response is local.
-     */
-    public boolean isLocal(){
-        return true;
-    }
-
-    private ReplyMessage reply;
-    private SystemException systemException;
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerRequestImpl.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.iiop;
-
-import org.omg.CORBA.SystemException;
-
-import com.sun.corba.se.impl.core.ServerRequest;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.DuplicateServiceContext;
-import com.sun.corba.se.impl.core.UEInfoServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.orbutil.ORBUtility;  //d11638
-import org.omg.CORBA.portable.UnknownException;
-import org.omg.CORBA.UNKNOWN;
-import org.omg.CORBA.CompletionStatus;
-import com.sun.corba.se.impl.ior.ObjectKey;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
-
-class LocalServerRequestImpl extends IIOPInputStream implements ServerRequest {
-    org.omg.CORBA.portable.OutputStream replyStream;
-    org.omg.CORBA.portable.OutputStream exceptionReplyStream;
-
-    LocalServerRequestImpl(ORB orb, byte[] buf, RequestMessage header)
-    {
-        super(orb, buf, header.getSize(), header.isLittleEndian(), header, null );
-
-        this.request = header;
-    }
-
-    public int getRequestId() {
-    	return request.getRequestId();
-    }
-
-    public boolean isOneWay() {
-    	return !request.isResponseExpected();
-    }
-
-    public ServiceContexts getServiceContexts() {
-    	return request.getServiceContexts();
-    }
-
-    public String getOperationName() {
-    	return request.getOperation();
-    }
-
-    public ObjectKey getObjectKey() {
-    	return request.getObjectKey();
-    }
-
-    public ServerResponse createResponse(ServiceContexts svc)
-    {
-    	return new LocalServerResponseImpl(this, svc);
-    }
-
-    public org.omg.CORBA.portable.OutputStream createReply() {
-        if (replyStream == null) {
-            replyStream = (org.omg.CORBA.portable.OutputStream)
-                                createResponse(null);
-        }
-        return replyStream;
-    }
-
-    public org.omg.CORBA.portable.OutputStream createExceptionReply() {
-        if (exceptionReplyStream == null) {
-            exceptionReplyStream = (org.omg.CORBA.portable.OutputStream)
-                                        createUserExceptionResponse(null);
-        }
-        return exceptionReplyStream;
-    }
-
-    public ServerResponse createUserExceptionResponse(
-	ServiceContexts svc)
-    {
-    	return new LocalServerResponseImpl(this, svc, true);
-    }
-
-    public ServerResponse createUnknownExceptionResponse(
-	        UnknownException ex) {
-        ServiceContexts contexts = null;
-        SystemException sys = new UNKNOWN( 0,
-            CompletionStatus.COMPLETED_MAYBE);
-
-            try {
-                contexts = new ServiceContexts( (ORB)orb() );
-                UEInfoServiceContext uei = new UEInfoServiceContext(sys);
-                contexts.put(uei) ;
-            } catch (DuplicateServiceContext d) {
-            // can't happen
-            }
-
-        return createSystemExceptionResponse(sys,contexts);
-    }
-
-    public ServerResponse createSystemExceptionResponse(
-    	SystemException ex, ServiceContexts svc) {
-
-	// Only do this if interceptors have been initialized on this request
-	// and have not completed their lifecycle (otherwise the info stack
-	// may be empty or have a different request's entry on top).
-	if (executePIInResponseConstructor()) {
-	    // Inform Portable Interceptors of the SystemException.  This is
-	    // required to be done here because the ending interception point
-	    // is called in the ServerResponseImpl constructor called below
-	    // but we do not currently write the SystemException into the
-	    // response until after the ending point is called.
-	    ORB orb = (ORB)orb();
-	    orb.getPIHandler().setServerPIInfo( ex );
-	}
-
-	if (orb() != null && ((ORB)orb()).subcontractDebugFlag && ex != null)
-            ORBUtility.dprint(this, "Sending SystemException:", ex);
-
-        LocalServerResponseImpl response =
-            new LocalServerResponseImpl(this, svc, false);
-        ORBUtility.writeSystemException(ex, response);
-        return response;
-    }
-
-    public ServerResponse createLocationForward(
-	        IOR ior, ServiceContexts svc) {
-        ReplyMessage reply = MessageBase.createReply( (ORB)orb(),
-	    request.getGIOPVersion(), request.getRequestId(),
-	    ReplyMessage.LOCATION_FORWARD, svc, ior);
-        LocalServerResponseImpl response =
-            new LocalServerResponseImpl(this, reply, ior);
-
-        return response;
-    }
-
-    private RequestMessage request;
-
-    /**
-     * Check to see if the request is local.
-     */
-    public boolean isLocal(){
-        return true;
-    }
-
-    private boolean _executeReturnServantInResponseConstructor = false;
-
-    public boolean executeReturnServantInResponseConstructor()
-    {
-	return _executeReturnServantInResponseConstructor;
-    }
-
-    public void setExecuteReturnServantInResponseConstructor(boolean b)
-    {
-	_executeReturnServantInResponseConstructor = b;
-    }
-
-    
-    private boolean _executeRemoveThreadInfoInResponseConstructor = false;
-
-    public boolean executeRemoveThreadInfoInResponseConstructor()
-    {
-	return _executeRemoveThreadInfoInResponseConstructor;
-    }
-
-    public void setExecuteRemoveThreadInfoInResponseConstructor(boolean b)
-    {
-	_executeRemoveThreadInfoInResponseConstructor = b;
-    }
-
-    
-    private boolean _executePIInResponseConstructor = false;
-                                                            
-    public boolean executePIInResponseConstructor() {
-        return _executePIInResponseConstructor;
-    }
-
-    public void setExecutePIInResponseConstructor( boolean b ) {
-        _executePIInResponseConstructor = b;
-    }
-
-    // We know that we're talking to the same ValueHandler, so
-    // use the maximum version it supports.
-    public byte getStreamFormatVersionForReply() {
-        return ORBUtility.getMaxStreamFormatVersion();
-    }
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerResponseImpl.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.iiop;
-
-import org.omg.CORBA.SystemException;
-
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-
-class LocalServerResponseImpl
-    extends     IIOPOutputStream
-    implements  ServerResponse
-{
-    LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc)
-    {
-        this(request,
-            MessageBase.createReply(
-                            (ORB)request.orb(),
-                            request.getGIOPVersion(),
-                            request.getRequestId(), ReplyMessage.NO_EXCEPTION,
-                            svc, null),
-            null);
-    }
-
-    LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc,
-            boolean user)
-    {
-        this(request,
-            MessageBase.createReply(
-                            (ORB)request.orb(),
-                            request.getGIOPVersion(), request.getRequestId(),
-                            user ? ReplyMessage.USER_EXCEPTION :
-                                   ReplyMessage.SYSTEM_EXCEPTION,
-                            svc, null),
-            null);
-    }
-
-    LocalServerResponseImpl( LocalServerRequestImpl request, ReplyMessage reply,
-			     IOR ior)
-    {
-        super(request.getGIOPVersion(),
-              (ORB)request.orb(), 
-              null, 
-              BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
-              request.getStreamFormatVersionForReply());
-
-        setMessage(reply);
-
-	ORB orb = (ORB)request.orb();
-
-	ServerResponseImpl.runServantPostInvoke(orb, request);
-
-	if( request.executePIInResponseConstructor() ) {
-	    // Invoke server request ending interception points (send_*):
-	    // Note: this may end up with a SystemException or an internal
-	    // Runtime ForwardRequest.
-	    orb.getPIHandler().invokeServerPIEndingPoint( reply );
-
-	    // Note this will be executed even if a ForwardRequest or
-	    // SystemException is thrown by a Portable Interceptors ending 
-	    // point since we end up in this constructor again anyway.
-	    orb.getPIHandler().cleanupServerPIRequest();
-
-	    // See (Local)ServerRequestImpl.createSystemExceptionResponse
-	    // for why this is necesary.
-	    request.setExecutePIInResponseConstructor(false);
-	}
-
-	// Once you get here then the final reply is available (i.e.,
-	// postinvoke and interceptors have completed.
-	if (request.executeRemoveThreadInfoInResponseConstructor()) {
-	    ServerResponseImpl.removeThreadInfo(orb, request);
-	}
-        
-	reply.write(this);
-	if (reply.getIOR() != null)
-	    reply.getIOR().write(this);
-
-        this.reply = reply;
-        this.ior = reply.getIOR();
-    }
-
-    public boolean isSystemException() {
-        if (reply != null)
-            return reply.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION;
-        return false;
-    }
-
-    public boolean isUserException() {
-        if (reply != null)
-            return reply.getReplyStatus() == ReplyMessage.USER_EXCEPTION;
-        return false;
-    }
-
-    public boolean isLocationForward() {
-        if (ior != null)
-            return true;
-        return false;
-    }
-
-    public IOR getForwardedIOR() {
-    	return ior;
-    }
-
-    public int getRequestId() {
-        if (reply != null)
-            return reply.getRequestId();
-        return -1;
-    }
-
-    public ServiceContexts getServiceContexts() {
-        if (reply != null)
-            return reply.getServiceContexts();
-        return null;
-    }
-
-    public SystemException getSystemException() {
-        if (reply != null)
-            return reply.getSystemException();
-        return null;
-    }
-
-    public ReplyMessage getReply()
-    {
-    	return reply ;
-    }
-
-    public ClientResponse getClientResponse()
-    {
-        // set the size of the marshalled data in the message header
-        getMessage().setSize(getByteBuffer(), getSize());
-
-        // Construct a new ClientResponse out of the buffer in this ClientRequest
-        LocalClientResponseImpl result =
-            new LocalClientResponseImpl( (ORB)orb(), toByteArray(), reply);
-
-        // NOTE (Ram J) (06/02/2000) if we set result.setIndex(bodyBegin) here
-        // then the LocalClientResponse does not need to read the headers anymore.
-        // This will be an optimisation which is can be done to speed up the
-        // local invocation by avoiding reading the headers in the local cases.
-
-        // BUGFIX(Ram Jeyaraman) result.setOffset is now done in
-        // LocalClientResponseImpl constructor.
-        /*
-          // Skip over all of the GIOP header information.  This positions
-          // the offset in the buffer so that the skeleton can correctly read
-          // the marshalled arguments.
-          result.setOffset( bodyBegin ) ;
-        */
-
-        return result ;
-    }
-
-    /**
-     * Check to see if the response is local.
-     */
-    public boolean isLocal(){
-        return true;
-    }
-
-    private ReplyMessage reply;
-    private IOR ior; // forwarded IOR
-}
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/BufferConnectionImpl.sjava	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.transport;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.SocketChannel;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.omg.CORBA.COMM_FAILURE;
-import org.omg.CORBA.CompletionStatus;
-import org.omg.CORBA.DATA_CONVERSION;
-import org.omg.CORBA.INTERNAL;
-import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.OBJECT_NOT_EXIST;
-import org.omg.CORBA.SystemException;
-
-import com.sun.org.omg.SendingContext.CodeBase;
-
-import com.sun.corba.se.pept.broker.Broker;
-import com.sun.corba.se.pept.encoding.InputObject;
-import com.sun.corba.se.pept.encoding.OutputObject;
-import com.sun.corba.se.pept.protocol.MessageMediator;
-import com.sun.corba.se.pept.transport.Acceptor;
-import com.sun.corba.se.pept.transport.Connection;
-import com.sun.corba.se.pept.transport.ConnectionCache;
-import com.sun.corba.se.pept.transport.ContactInfo;
-import com.sun.corba.se.pept.transport.EventHandler;
-import com.sun.corba.se.pept.transport.InboundConnectionCache;
-import com.sun.corba.se.pept.transport.OutboundConnectionCache;
-import com.sun.corba.se.pept.transport.ResponseWaitingRoom;
-import com.sun.corba.se.pept.transport.Selector;
-
-import com.sun.corba.se.spi.ior.IOR;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.orb.ORB ;
-import com.sun.corba.se.spi.orbutil.threadpool.Work;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-import com.sun.corba.se.spi.transport.CorbaContactInfo;
-import com.sun.corba.se.spi.transport.CorbaConnection;
-import com.sun.corba.se.spi.transport.CorbaResponseWaitingRoom;
-
-import com.sun.corba.se.impl.encoding.CachedCodeBase;
-import com.sun.corba.se.impl.encoding.CDRInputStream_1_0;
-import com.sun.corba.se.impl.encoding.CDROutputObject;
-import com.sun.corba.se.impl.encoding.CDROutputStream_1_0;
-import com.sun.corba.se.impl.encoding.CodeSetComponentInfo;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.orbutil.ORBUtility;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl;
-
-/**
- * @author Ken Cavanaugh
- */
-public class BufferConnectionImpl
-    extends
-	EventHandlerBase
-    implements
-        CorbaConnection,
-	Work
-{
-    //
-    // New transport.
-    //
-
-    protected long enqueueTime;
-
-    public SocketChannel getSocketChannel()
-    {
-	return null;
-    }
-
-    // REVISIT:
-    // protected for test: genericRPCMSGFramework.IIOPConnection constructor.
-
-    //
-    // From iiop.Connection.java
-    //
-
-    protected long timeStamp = 0;
-    protected boolean isServer = false;
-
-    // Start at some value other than zero since this is a magic
-    // value in some protocols.
-    protected int requestId = 5;
-    protected CorbaResponseWaitingRoom responseWaitingRoom;
-    protected int state;
-    protected java.lang.Object stateEvent = new java.lang.Object();
-    protected java.lang.Object writeEvent = new java.lang.Object();
-    protected boolean writeLocked;
-    protected int serverRequestCount = 0;
-    
-    // Server request map: used on the server side of Connection
-    // Maps request ID to IIOPInputStream.
-    Map serverRequestMap = new HashMap() ;
-
-    // This is a flag associated per connection telling us if the
-    // initial set of sending contexts were sent to the receiver
-    // already...
-    protected boolean postInitialContexts = false;
- 
-    // Remote reference to CodeBase server (supplies
-    // FullValueDescription, among other things)
-    protected IOR codeBaseServerIOR;
-
-    // CodeBase cache for this connection.  This will cache remote operations,
-    // handle connecting, and ensure we don't do any remote operations until
-    // necessary.
-    protected CachedCodeBase cachedCodeBase = new CachedCodeBase(this);
-
-    protected ORBUtilSystemException wrapper ;
-
-    List buffers ;
-
-    public BufferConnectionImpl(ORB orb, byte[][] data )
-    {
-	this.orb = orb;
-	wrapper = ORBUtilSystemException.get( orb,
-	    CORBALogDomains.RPC_TRANSPORT ) ;
-	buffers = new ArrayList() ;
-    }
-
-    ////////////////////////////////////////////////////
-    //
-    // framework.transport.Connection
-    //
-
-    public boolean shouldRegisterReadEvent()
-    {
-	return false;
-    }
-
-    public boolean shouldRegisterServerReadEvent()
-    {
-	return false;
-    }
-
-    public boolean read()
-    {
-	return true ;
-    }
-
-    protected CorbaMessageMediator readBits()
-    {
-	return null ;
-    }
-
-    protected boolean dispatch(CorbaMessageMediator messageMediator)
-    {
-    }
-
-    public boolean shouldUseDirectByteBuffers()
-    {
-	return false ;
-    }
-
-    // Only called from readGIOPMessage with (12, 0, 12) as arguments
-    // size is size of buffer to create
-    // offset is offset from start of message in buffer
-    // length is length to read
-    public ByteBuffer read(int size, int offset, int length)
-	throws IOException
-    {
-	byte[] buf = new byte[size];
-	readFully( buf, offset, length);
-	ByteBuffer byteBuffer = ByteBuffer.wrap(buf);
-	byteBuffer.limit(size);
-	return byteBuffer;
-    }
-
-    // Only called as read( buf, 12, msgsize-12 ) in readGIOPMessage
-    // We can ignore the byteBuffer parameter
-    // offset is the starting position to place data in the result
-    // length is the length of the data to read
-    public ByteBuffer read(ByteBuffer byteBuffer, int offset, int length)
-	throws IOException
-    {
-	int size = offset + length;
-	byte[] buf = new byte[size];
-	readFully(buf, offset, length);
-	return ByteBuffer.wrap(buf);
-    }
-
-    // Read size bytes from buffer list and place the data
-    // starting at offset in buf.
-    public void readFully(byte[] buf, int offset, int size) 
-	throws IOException
-    {
-	int remaining = size ;
-	int position = offset ;
-	while (remaining > 0) {
-	    ByteBuffer buff = (ByteBuffer)buffers.get(0) ; 
-	    int dataSize = buff.remaining() ;
-	    int xferSize = dataSize ;
-	    if (dataSize >= remaining) :
-		xferSize = remaining ;
-		buffers.remove(0) ;
-	    }
-	    
-	    buff.get( buf, offset, xferSize ) ;
-
-	    offset += xferSize ;
-	    remaining -= xferSize ;
-	}
-    }    
-
-    public void write(ByteBuffer byteBuffer)
-	throws IOException
-    {
-	buffers.add( byteBuffer ) ;
-    }
-
-    /**
-     * Note:it is possible for this to be called more than once
-     */
-    public synchronized void close() 
-    {
-    }
-
-    public Acceptor getAcceptor()
-    {
-	return null;
-    }
-
-    public ContactInfo getContactInfo()
-    {
-	return null;
-    }
-
-    public EventHandler getEventHandler()
-    {
-	return this;
-    }
-
-    public OutputObject createOutputObject(MessageMediator messageMediator)
-    {
-	// REVISIT - remove this method from Connection and all it subclasses.
-	throw new RuntimeException("*****SocketOrChannelConnectionImpl.createOutputObject - should not be called.");
-    }
-
-    // This is used by the GIOPOutputObject in order to
-    // throw the correct error when handling code sets.
-    // Can we determine if we are on the server side by
-    // other means?  XREVISIT
-    public boolean isServer()
-    {
-        return isServer;
-    }
-
-    public boolean isBusy()
-    {
-	return false ;
-    }
-
-    public long getTimeStamp()
-    {
-	return timeStamp;
-    }
-
-    public void setTimeStamp(long time)
-    {
-	timeStamp = time;
-    }
-
-    public void setState(String stateString)
-    {
-	synchronized (stateEvent) {
-	    if (stateString.equals("ESTABLISHED")) {
-		state =  ESTABLISHED;
-		stateEvent.notifyAll();
-	    } else {
-		// REVISIT: ASSERT
-	    }
-	}
-    }
-
-    public void writeLock()
-    {
-    }
-
-    public void writeUnlock()
-    {
-    }
-
-    public void sendWithoutLock(OutputObject outputObject)
-    {
-    }
-
-    public void registerWaiter(MessageMediator messageMediator)
-    {
-    }
-
-    public void unregisterWaiter(MessageMediator messageMediator)
-    {
-    }
-
-    public InputObject waitForResponse(MessageMediator messageMediator)
-    {
-	return null ;
-    }
-
-    public void setConnectionCache(ConnectionCache connectionCache)
-    {
-    }
-
-    public ConnectionCache getConnectionCache()
-    {
-	return null;	
-    }
-
-    ////////////////////////////////////////////////////
-    //
-    // EventHandler methods
-    //
-
-    public SelectableChannel getChannel()
-    {
-	return null;
-    }
-
-    public int getInterestOps()
-    {
-	return null;
-    }
-
-    //    public Acceptor getAcceptor() - already defined above.
-
-    public Connection getConnection()
-    {
-	return this;
-    }
-
-    ////////////////////////////////////////////////////
-    //
-    // Work methods.
-    //
-
-    public String getName()
-    {
-	return this.toString();
-    }
-
-    public void doWork()
-    {
-    }
-
-    public void setEnqueueTime(long timeInMillis)
-    {
-	enqueueTime = timeInMillis;
-    }
-
-    public long getEnqueueTime()
-    {
-	return enqueueTime;
-    }
-
-    ////////////////////////////////////////////////////
-    //
-    // spi.transport.CorbaConnection.
-    //
-
-    public ResponseWaitingRoom getResponseWaitingRoom()
-    {
-	return null ;
-    }
-
-    // REVISIT - inteface defines isServer but already defined in 
-    // higher interface.
-
-
-    public void serverRequestMapPut(int requestId, 
-				    CorbaMessageMediator messageMediator)
-    {
-	serverRequestMap.put(new Integer(requestId), messageMediator);
-    }
-
-    public CorbaMessageMediator serverRequestMapGet(int requestId)
-    {
-	return (CorbaMessageMediator)
-	    serverRequestMap.get(new Integer(requestId));
-    }
-
-    public void serverRequestMapRemove(int requestId)
-    {
-	serverRequestMap.remove(new Integer(requestId));
-    }
-
-
-    // REVISIT: this is also defined in:
-    // com.sun.corba.se.spi.legacy.connection.Connection
-    public java.net.Socket getSocket()
-    {
-	return null;
-    }
-
-    /** It is possible for a Close Connection to have been
-     ** sent here, but we will not check for this. A "lazy"
-     ** Exception will be thrown in the Worker thread after the
-     ** incoming request has been processed even though the connection
-     ** is closed before the request is processed. This is o.k because
-     ** it is a boundary condition. To prevent it we would have to add
-     ** more locks which would reduce performance in the normal case.
-     **/
-    public synchronized void serverRequestProcessingBegins()
-    {
-        serverRequestCount++;
-    }
-
-    public synchronized void serverRequestProcessingEnds()
-    {
-        serverRequestCount--;
-    }
-
-    //
-    //
-    //
-
-    public synchronized int getNextRequestId() 
-    {
-	return requestId++;
-    }
-
-    // Negotiated code sets for char and wchar data
-    protected CodeSetComponentInfo.CodeSetContext codeSetContext = null;
-
-    public ORB getBroker() 
-    {
-        return orb;
-    }
-
-    public CodeSetComponentInfo.CodeSetContext getCodeSetContext() 
-    {
-        // Needs to be synchronized for the following case when the client
-        // doesn't send the code set context twice, and we have two threads
-        // in ServerRequestDispatcher processCodeSetContext.
-        //
-        // Thread A checks to see if there is a context, there is none, so
-        //     it calls setCodeSetContext, getting the synch lock.
-        // Thread B checks to see if there is a context.  If we didn't synch,
-        //     it might decide to outlaw wchar/wstring.
-        if (codeSetContext == null) {
-            synchronized(this) {
-                return codeSetContext;
-            }
-        }
-
-        return codeSetContext;
-    }
-
-    public synchronized void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc) {
-        // Double check whether or not we need to do this
-        if (codeSetContext == null) {
-            
-            if (OSFCodeSetRegistry.lookupEntry(csc.getCharCodeSet()) == null ||
-                OSFCodeSetRegistry.lookupEntry(csc.getWCharCodeSet()) == null) {
-                // If the client says it's negotiated a code set that
-                // isn't a fallback and we never said we support, then
-                // it has a bug.
-		throw wrapper.badCodesetsFromClient() ;
-            }
-
-            codeSetContext = csc;
-        }
-    }
-
-    //
-    // from iiop.IIOPConnection.java
-    //
-
-    // Map request ID to an InputObject.
-    // This is so the client thread can start unmarshaling
-    // the reply and remove it from the out_calls map while the
-    // ReaderThread can still obtain the input stream to give
-    // new fragments.  Only the ReaderThread touches the clientReplyMap,
-    // so it doesn't incur synchronization overhead.
-
-    public MessageMediator clientRequestMapGet(int requestId)
-    {
-	return null ;
-    }
-
-    protected MessageMediator clientReply_1_1;
-
-    public void clientReply_1_1_Put(MessageMediator x)
-    {
-	clientReply_1_1 = x;
-    }
-
-    public MessageMediator clientReply_1_1_Get()
-    {
-	return 	clientReply_1_1;
-    }
-
-    public void clientReply_1_1_Remove()
-    {
-	clientReply_1_1 = null;
-    }
-
-    protected MessageMediator serverRequest_1_1;
-
-    public void serverRequest_1_1_Put(MessageMediator x)
-    {
-	serverRequest_1_1 = x;
-    }
-
-    public MessageMediator serverRequest_1_1_Get()
-    {
-	return 	serverRequest_1_1;
-    }
-
-    public void serverRequest_1_1_Remove()
-    {
-	serverRequest_1_1 = null;
-    }
-
-    protected String getStateString( int state ) 
-    {
-        synchronized ( stateEvent ){
-            switch (state) {
-            case OPENING : return "OPENING" ;
-            case ESTABLISHED : return "ESTABLISHED" ;
-            case CLOSE_SENT : return "CLOSE_SENT" ;
-            case CLOSE_RECVD : return "CLOSE_RECVD" ;
-            case ABORT : return "ABORT" ;
-            default : return "???" ;
-            }
-        }
-    }
-    
-    public synchronized boolean isPostInitialContexts() {
-        return postInitialContexts;
-    }
-
-    // Can never be unset...
-    public synchronized void setPostInitialContexts(){
-        postInitialContexts = true;
-    }
-    
-    /**
-     * Wake up the outstanding requests on the connection, and hand them
-     * COMM_FAILURE exception with a given minor code.
-     *
-     * Also, delete connection from connection table and
-     * stop the reader thread.
-
-     * Note that this should only ever be called by the Reader thread for
-     * this connection.
-     * 
-     * @param minor_code The minor code for the COMM_FAILURE major code.
-     * @param die Kill the reader thread (this thread) before exiting.
-     */
-    public void purgeCalls(SystemException systemException,
-			   boolean die, boolean lockHeld)
-    {
-    }
-
-    /*************************************************************************
-    * The following methods are for dealing with Connection cleaning for
-    * better scalability of servers in high network load conditions.
-    **************************************************************************/
-
-    public void sendCloseConnection(GIOPVersion giopVersion)
-	throws IOException 
-    {
-        Message msg = MessageBase.createCloseConnection(giopVersion);
-	sendHelper(giopVersion, msg);
-    }
-
-    public void sendMessageError(GIOPVersion giopVersion)
-	throws IOException 
-    {
-        Message msg = MessageBase.createMessageError(giopVersion);
-	sendHelper(giopVersion, msg);
-    }
-
-    /**
-     * Send a CancelRequest message. This does not lock the connection, so the
-     * caller needs to ensure this method is called appropriately.
-     * @exception IOException - could be due to abortive connection closure.
-     */
-    public void sendCancelRequest(GIOPVersion giopVersion, int requestId)
-	throws IOException 
-    {
-
-        Message msg = MessageBase.createCancelRequest(giopVersion, requestId);
-	sendHelper(giopVersion, msg);
-    }
-
-    protected void sendHelper(GIOPVersion giopVersion, Message msg)
-	throws IOException
-    {
-	// REVISIT: See comments in CDROutputObject constructor.
-        CDROutputObject outputObject = 
-	    new CDROutputObject((ORB)orb, null, giopVersion, this, msg,
-				ORBConstants.STREAM_FORMAT_VERSION_1);
-        msg.write(outputObject);
-
-	outputObject.writeTo(this);
-    }
-
-    public void sendCancelRequestWithLock(GIOPVersion giopVersion,
-					  int requestId)
-	throws IOException 
-    {
-	writeLock();
-	try {
-	    sendCancelRequest(giopVersion, requestId);
-	} finally {
-	    writeUnlock();
-	}
-    }
-
-    // Begin Code Base methods ---------------------------------------
-    //
-    // Set this connection's code base IOR.  The IOR comes from the
-    // SendingContext.  This is an optional service context, but all
-    // JavaSoft ORBs send it.
-    //
-    // The set and get methods don't need to be synchronized since the
-    // first possible get would occur during reading a valuetype, and
-    // that would be after the set.
-
-    // Sets this connection's code base IOR.  This is done after
-    // getting the IOR out of the SendingContext service context.
-    // Our ORBs always send this, but it's optional in CORBA.
-
-    public final void setCodeBaseIOR(IOR ior) {
-        codeBaseServerIOR = ior;
-    }
-
-    public final IOR getCodeBaseIOR() {
-        return codeBaseServerIOR;
-    }
-
-    // Get a CodeBase stub to use in unmarshaling.  The CachedCodeBase
-    // won't connect to the remote codebase unless it's necessary.
-    public final CodeBase getCodeBase() {
-        return cachedCodeBase;
-    }
-
-    // End Code Base methods -----------------------------------------
-
-    // Can be overridden in subclass for different options.
-    protected void setSocketOptions(Socket socket)
-    {
-    }
-
-    public String toString()
-    {
-        synchronized ( stateEvent ){
-            return 
-		"BufferConnectionImpl[" + " "
-		+ getStateString( state ) + " "
-		+ shouldUseSelectThreadToWait() + " "
-		+ shouldUseWorkerThreadForEvent()
-		+ "]" ;
-        }
-    }
-    
-    // Must be public - used in encoding.
-    public void dprint(String msg) 
-    {
-	ORBUtility.dprint("SocketOrChannelConnectionImpl", msg);
-    }
-
-    protected void dprint(String msg, Throwable t)
-    {
-	dprint(msg);
-	t.printStackTrace(System.out);
-    }
-}
-
-// End of file.
--- a/hotspot/.hgtags	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/.hgtags	Tue Aug 13 18:34:12 2013 -0700
@@ -365,3 +365,5 @@
 46487ba40ff225654d0c51787ed3839bafcbd9f3 hs25-b43
 f6921c876db192bba389cec062855a66372da01c jdk8-b101
 530fe88b3b2c710f42810b3580d86a0d83ad6c1c hs25-b44
+c4697c1c448416108743b59118b4a2498b339d0c jdk8-b102
+7f55137d6aa81efc6eb0035813709f2cb6a26b8b hs25-b45
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java	Tue Aug 13 18:34:12 2013 -0700
@@ -29,11 +29,10 @@
     public static final int JVMTI_THREAD_STATE_ALIVE = 0x0001;
     public static final int JVMTI_THREAD_STATE_TERMINATED = 0x0002;
     public static final int JVMTI_THREAD_STATE_RUNNABLE = 0x0004;
-    public static final int JVMTI_THREAD_STATE_WAITING = 0x0008;
+    public static final int JVMTI_THREAD_STATE_WAITING = 0x0080;
     public static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
     public static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
     public static final int JVMTI_THREAD_STATE_SLEEPING = 0x0040;
-    public static final int JVMTI_THREAD_STATE_WAITING_FOR_NOTIFICATION = 0x0080;
     public static final int JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 0x0100;
     public static final int JVMTI_THREAD_STATE_PARKED = 0x0200;
     public static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java	Tue Aug 13 18:34:12 2013 -0700
@@ -32,7 +32,7 @@
 // to the sys_thread_t structure of the classic JVM implementation.
 public class OSThread extends VMObject {
     private static JIntField interruptedField;
-    private static JIntField threadIdField;
+    private static Field threadIdField;
     static {
         VM.registerVMInitializedObserver(new Observer() {
             public void update(Observable o, Object data) {
@@ -44,7 +44,7 @@
     private static synchronized void initialize(TypeDataBase db) {
         Type type = db.lookupType("OSThread");
         interruptedField = type.getJIntField("_interrupted");
-        threadIdField = type.getJIntField("_thread_id");
+        threadIdField = type.getField("_thread_id");
     }
 
     public OSThread(Address addr) {
@@ -56,7 +56,7 @@
     }
 
     public int threadId() {
-        return (int)threadIdField.getValue(addr);
+        return threadIdField.getJInt(addr);
     }
 
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,23 +74,24 @@
     public void run() {
         // Ready to go with the database...
         try {
-            // The name of the filter always comes from a System property.
-            // If we have a pkgList, pass it, otherwise let the filter read
-            // its own System property for the list of classes.
-            String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter",
-                                                        "sun.jvm.hotspot.tools.jcore.PackageNameFilter");
-            try {
-                Class filterClass = Class.forName(filterClassName);
-                if (pkgList == null) {
-                    classFilter = (ClassFilter) filterClass.newInstance();
-                } else {
-                    Constructor con = filterClass.getConstructor(String.class);
-                    classFilter = (ClassFilter) con.newInstance(pkgList);
+            if (classFilter == null) {
+                // If not already set, the name of the filter comes from a System property.
+                // If we have a pkgList, pass it, otherwise let the filter read
+                // its own System property for the list of classes.
+                String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter",
+                                                            "sun.jvm.hotspot.tools.jcore.PackageNameFilter");
+                try {
+                    Class filterClass = Class.forName(filterClassName);
+                    if (pkgList == null) {
+                        classFilter = (ClassFilter) filterClass.newInstance();
+                    } else {
+                        Constructor con = filterClass.getConstructor(String.class);
+                        classFilter = (ClassFilter) con.newInstance(pkgList);
+                    }
+                } catch(Exception exp) {
+                    System.err.println("Warning: Can not create class filter!");
                 }
-            } catch(Exception exp) {
-                System.err.println("Warning: Can not create class filter!");
             }
-
             String outputDirectory = System.getProperty("sun.jvm.hotspot.tools.jcore.outputDir", ".");
             setOutputDirectory(outputDirectory);
 
--- a/hotspot/make/hotspot_version	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/make/hotspot_version	Tue Aug 13 18:34:12 2013 -0700
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=25
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=44
+HS_BUILD_NUMBER=45
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=8
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Tue Aug 13 18:34:12 2013 -0700
@@ -2295,7 +2295,7 @@
       if (gen_type_check) {
         // We have determined that offset == referent_offset && src != null.
         // if (src->_klass->_reference_type == REF_NONE) -> continue
-        __ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), UseCompressedKlassPointers ? T_OBJECT : T_ADDRESS), src_klass);
+        __ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), src_klass);
         LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE);
         LIR_Opr reference_type = new_register(T_INT);
         __ move(reference_type_addr, reference_type);
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Tue Aug 13 18:34:12 2013 -0700
@@ -878,7 +878,7 @@
 
 instanceKlassHandle ClassLoader::load_classfile(Symbol* h_name, TRAPS) {
   ResourceMark rm(THREAD);
-  EventMark m("loading class " INTPTR_FORMAT, (address)h_name);
+  EventMark m("loading class %s", h_name->as_C_string());
   ThreadProfilerMark tpm(ThreadProfilerMark::classLoaderRegion);
 
   stringStream st;
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Tue Aug 13 18:34:12 2013 -0700
@@ -60,6 +60,28 @@
 #define DEFAULT_VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/crash.jsp"
 #define DEFAULT_JAVA_LAUNCHER  "generic"
 
+// Disable options not supported in this release, with a warning if they
+// were explicitly requested on the command-line
+#define UNSUPPORTED_OPTION(opt, description)                    \
+do {                                                            \
+  if (opt) {                                                    \
+    if (FLAG_IS_CMDLINE(opt)) {                                 \
+      warning(description " is disabled in this release.");     \
+    }                                                           \
+    FLAG_SET_DEFAULT(opt, false);                               \
+  }                                                             \
+} while(0)
+
+#define UNSUPPORTED_GC_OPTION(gc)                                     \
+do {                                                                  \
+  if (gc) {                                                           \
+    if (FLAG_IS_CMDLINE(gc)) {                                        \
+      warning(#gc " is not supported in this VM.  Using Serial GC."); \
+    }                                                                 \
+    FLAG_SET_DEFAULT(gc, false);                                      \
+  }                                                                   \
+} while(0)
+
 char**  Arguments::_jvm_flags_array             = NULL;
 int     Arguments::_num_jvm_flags               = 0;
 char**  Arguments::_jvm_args_array              = NULL;
@@ -3128,14 +3150,17 @@
     FLAG_SET_DEFAULT(UseLargePages, false);
   }
 
-  // Tiered compilation is undefined with C1.
-  TieredCompilation = false;
 #else
   if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) {
     FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1);
   }
 #endif
 
+#ifndef TIERED
+  // Tiered compilation is undefined.
+  UNSUPPORTED_OPTION(TieredCompilation, "TieredCompilation");
+#endif
+
   // If we are running in a headless jre, force java.awt.headless property
   // to be true unless the property has already been set.
   // Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state.
@@ -3278,29 +3303,6 @@
   }
 }
 
-// Disable options not supported in this release, with a warning if they
-// were explicitly requested on the command-line
-#define UNSUPPORTED_OPTION(opt, description)                    \
-do {                                                            \
-  if (opt) {                                                    \
-    if (FLAG_IS_CMDLINE(opt)) {                                 \
-      warning(description " is disabled in this release.");     \
-    }                                                           \
-    FLAG_SET_DEFAULT(opt, false);                               \
-  }                                                             \
-} while(0)
-
-
-#define UNSUPPORTED_GC_OPTION(gc)                                     \
-do {                                                                  \
-  if (gc) {                                                           \
-    if (FLAG_IS_CMDLINE(gc)) {                                        \
-      warning(#gc " is not supported in this VM.  Using Serial GC."); \
-    }                                                                 \
-    FLAG_SET_DEFAULT(gc, false);                                      \
-  }                                                                   \
-} while(0)
-
 #if !INCLUDE_ALL_GCS
 static void force_serial_gc() {
   FLAG_SET_DEFAULT(UseSerialGC, true);
--- a/hotspot/src/share/vm/services/gcNotifier.cpp	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/src/share/vm/services/gcNotifier.cpp	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -211,9 +211,9 @@
     NotificationMark nm(request);
     Handle objGcInfo = createGcInfo(request->gcManager, request->gcStatInfo, THREAD);
 
-    Handle objName = java_lang_String::create_from_platform_dependent_str(request->gcManager->name(), CHECK);
-    Handle objAction = java_lang_String::create_from_platform_dependent_str(request->gcAction, CHECK);
-    Handle objCause = java_lang_String::create_from_platform_dependent_str(request->gcCause, CHECK);
+    Handle objName = java_lang_String::create_from_str(request->gcManager->name(), CHECK);
+    Handle objAction = java_lang_String::create_from_str(request->gcAction, CHECK);
+    Handle objCause = java_lang_String::create_from_str(request->gcCause, CHECK);
 
     Klass* k = Management::sun_management_GarbageCollectorImpl_klass(CHECK);
     instanceKlassHandle gc_mbean_klass(THREAD, k);
--- a/hotspot/src/share/vm/services/management.cpp	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/src/share/vm/services/management.cpp	Tue Aug 13 18:34:12 2013 -0700
@@ -1831,13 +1831,13 @@
  private:
   objArrayHandle _names_strings;
   char **_names_chars;
-  typeArrayOop _times;
+  typeArrayHandle _times;
   int _names_len;
   int _times_len;
   int _count;
 
  public:
-  ThreadTimesClosure(objArrayHandle names, typeArrayOop times);
+  ThreadTimesClosure(objArrayHandle names, typeArrayHandle times);
   ~ThreadTimesClosure();
   virtual void do_thread(Thread* thread);
   void do_unlocked();
@@ -1845,9 +1845,9 @@
 };
 
 ThreadTimesClosure::ThreadTimesClosure(objArrayHandle names,
-                                       typeArrayOop times) {
+                                       typeArrayHandle times) {
   assert(names() != NULL, "names was NULL");
-  assert(times != NULL, "times was NULL");
+  assert(times() != NULL, "times was NULL");
   _names_strings = names;
   _names_len = names->length();
   _names_chars = NEW_C_HEAP_ARRAY(char*, _names_len, mtInternal);
@@ -1925,7 +1925,7 @@
   typeArrayOop ta = typeArrayOop(JNIHandles::resolve_non_null(times));
   typeArrayHandle times_ah(THREAD, ta);
 
-  ThreadTimesClosure ttc(names_ah, times_ah());
+  ThreadTimesClosure ttc(names_ah, times_ah);
   {
     MutexLockerEx ml(Threads_lock);
     Threads::threads_do(&ttc);
--- a/hotspot/src/share/vm/utilities/exceptions.cpp	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/src/share/vm/utilities/exceptions.cpp	Tue Aug 13 18:34:12 2013 -0700
@@ -125,13 +125,13 @@
 }
 
 void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) {
+  ResourceMark rm;
   assert(h_exception() != NULL, "exception should not be NULL");
 
   // tracing (do this up front - so it works during boot strapping)
   if (TraceExceptions) {
     ttyLocker ttyl;
-    ResourceMark rm;
-    tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n"
+    tty->print_cr("Exception <%s%s%s> (" INTPTR_FORMAT ") \n"
                   "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
                   h_exception->print_value_string(),
                   message ? ": " : "", message ? message : "",
@@ -141,7 +141,9 @@
   NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message));
 
   // Check for special boot-strapping/vm-thread handling
-  if (special_exception(thread, file, line, h_exception)) return;
+  if (special_exception(thread, file, line, h_exception)) {
+    return;
+  }
 
   assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
 
@@ -149,7 +151,9 @@
   thread->set_pending_exception(h_exception(), file, line);
 
   // vm log
-  Events::log_exception(thread, "Threw " INTPTR_FORMAT " at %s:%d", (address)h_exception(), file, line);
+  Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]",
+                        h_exception->print_value_string(), message ? ": " : "", message ? message : "",
+                        (address)h_exception(), file, line);
 }
 
 
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp	Tue Aug 13 18:34:12 2013 -0700
@@ -395,7 +395,13 @@
 template<class E, MEMFLAGS F, unsigned int N>
 bool GenericTaskQueue<E, F, N>::pop_global(E& t) {
   Age oldAge = _age.get();
-  uint localBot = _bottom;
+  // Architectures with weak memory model require a barrier here
+  // to guarantee that bottom is not older than age,
+  // which is crucial for the correctness of the algorithm.
+#if !(defined SPARC || defined IA32 || defined AMD64)
+  OrderAccess::fence();
+#endif
+  uint localBot = OrderAccess::load_acquire((volatile juint*)&_bottom);
   uint n_elems = size(localBot, oldAge.top());
   if (n_elems == 0) {
     return false;
@@ -644,7 +650,7 @@
 template<class E, MEMFLAGS F, unsigned int N> inline bool
 GenericTaskQueue<E, F, N>::push(E t) {
   uint localBot = _bottom;
-  assert((localBot >= 0) && (localBot < N), "_bottom out of range.");
+  assert(localBot < N, "_bottom out of range.");
   idx_t top = _age.top();
   uint dirty_n_elems = dirty_size(localBot, top);
   assert(dirty_n_elems < N, "n_elems out of range.");
--- a/hotspot/test/compiler/codecache/CheckUpperLimit.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/test/compiler/codecache/CheckUpperLimit.java	Tue Aug 13 18:34:12 2013 -0700
@@ -35,10 +35,6 @@
     ProcessBuilder pb;
     OutputAnalyzer out;
 
-    pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2048m", "-version");
-    out = new OutputAnalyzer(pb.start());
-    out.shouldHaveExitValue(0);
-
     pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
     out = new OutputAnalyzer(pb.start());
     out.shouldContain("Invalid ReservedCodeCacheSize=");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8016474
+ * @summary The bug only happens with C1 and G1 using a different ObjectAlignmentInBytes than KlassAlignmentInBytes (which is 8)
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 GetUnsafeObjectG1PreBarrier
+ */
+
+import java.lang.reflect.Field;
+
+import sun.misc.Unsafe;
+
+public class GetUnsafeObjectG1PreBarrier {
+    private static final Unsafe unsafe;
+    private static final int N = 100_000;
+
+    static {
+        try {
+            Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
+            theUnsafe.setAccessible(true);
+            unsafe = (Unsafe) theUnsafe.get(null);
+        } catch (NoSuchFieldException | IllegalAccessException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    public Object a;
+
+    public static void main(String[] args) throws Throwable {
+        new GetUnsafeObjectG1PreBarrier();
+    }
+
+    public GetUnsafeObjectG1PreBarrier() throws Throwable {
+        doit();
+    }
+
+    private void doit() throws Throwable {
+        Field field = GetUnsafeObjectG1PreBarrier.class.getField("a");
+        long fieldOffset = unsafe.objectFieldOffset(field);
+
+        for (int i = 0; i < N; i++) {
+            readField(this, fieldOffset);
+        }
+    }
+
+    private void readField(Object o, long fieldOffset) {
+        unsafe.getObject(o, fieldOffset);
+    }
+}
--- a/hotspot/test/runtime/7196045/Test7196045.java	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/*
- * @test
- * @bug 7196045
- * @summary Possible JVM deadlock in ThreadTimesClosure when using HotspotInternal non-public API.
- * @run main/othervm -XX:+UsePerfData Test7196045
- */
-
-import java.lang.management.ManagementFactory;
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-public class Test7196045 {
-
-    public static long duration = 1000 * 60 * 2;
-    private static final String HOTSPOT_INTERNAL = "sun.management:type=HotspotInternal";
-
-    public static void main(String[] args) {
-
-        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
-        ObjectName objName= null;
-        try {
-            ObjectName hotspotInternal = new ObjectName(HOTSPOT_INTERNAL);
-            try {
-                server.registerMBean(new sun.management.HotspotInternal(), hotspotInternal);
-            } catch (JMException e) {
-                throw new RuntimeException("HotSpotWatcher: Failed to register the HotspotInternal MBean" + e);
-            }
-            objName= new ObjectName("sun.management:type=HotspotThreading");
-
-        } catch (MalformedObjectNameException e1) {
-            throw new RuntimeException("Bad object name" + e1);
-        }
-
-        long endTime = System.currentTimeMillis() + duration;
-        long i = 0;
-        while (true) {
-            try {
-                server.getAttribute(objName, "InternalThreadCpuTimes");
-            } catch (Exception ex) {
-                System.err.println("Exception while getting attribute: " + ex);
-            }
-            i++;
-            if (i % 10000 == 0) {
-                System.out.println("Successful iterations: " + i);
-            }
-            if (System.currentTimeMillis() > endTime) {
-                break;
-            }
-        }
-        System.out.println("PASSED.");
-    }
-}
--- a/hotspot/test/runtime/8000968/Test8000968.sh	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-#
-#  Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
-#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-#  This code is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU General Public License version 2 only, as
-#  published by the Free Software Foundation.
-#
-#  This code is distributed in the hope that it will be useful, but WITHOUT
-#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-#  version 2 for more details (a copy is included in the LICENSE file that
-#  accompanied this code).
-#
-#  You should have received a copy of the GNU General Public License version
-#  2 along with this work; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-#  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-#  or visit www.oracle.com if you need additional information or have any
-#  questions.
-#
-
-
-# @test Test8000968.sh
-# @bug 8000968
-# @summary NPG: UseCompressedKlassPointers asserts with ObjectAlignmentInBytes=32
-# @run shell Test8000968.sh
-#
-
-if [ "${TESTJAVA}" = "" ]
-then
-  PARENT=`dirname \`which java\``
-  TESTJAVA=`dirname ${PARENT}`
-  printf "TESTJAVA not set, selecting " ${TESTJAVA}
-  printf "  If this is incorrect, try setting the variable manually.\n"
-fi
-
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  Windows_* )
-    FS="\\"
-    NULL=NUL
-    ;;
-  * )
-    FS="/"
-    NULL=/dev/null
-    ;;
-esac
-
-JAVA=${TESTJAVA}${FS}bin${FS}java
-
-#
-# See if platform has 64 bit java.
-#
-${JAVA} ${TESTVMOPTS} -d64 -version 2>&1 | grep -i "does not support" > ${NULL}
-if [ "$?" != "1" ]
-then
-  printf "Platform is 32 bit, does not support -XX:ObjectAlignmentInBytes= option.\n"
-  printf "Passed.\n"
-  exit 0
-fi
-
-#
-# Test -XX:ObjectAlignmentInBytes with -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops.
-#
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=16 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
-  printf "FAILED: -XX:ObjectAlignmentInBytes=16 option did not work.\n"
-  exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=32 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
-  printf "FAILED: -XX:ObjectAlignmentInBytes=32 option did not work.\n"
-  exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=64 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
-  printf "FAILED: -XX:ObjectAlignmentInBytes=64 option did not work.\n"
-  exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=128 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
-  printf "FAILED: -XX:ObjectAlignmentInBytes=128 option did not work.\n"
-  exit 1
-fi
-
-
-printf "Passed.\n"
-exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8000968
+ * @key regression
+ * @summary NPG: UseCompressedKlassPointers asserts with ObjectAlignmentInBytes=32
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class CompressedKlassPointerAndOops {
+
+    public static void main(String[] args) throws Exception {
+
+        if (!Platform.is64bit()) {
+            // Can't test this on 32 bit, just pass
+            System.out.println("Skipping test on 32bit");
+            return;
+        }
+
+        runWithAlignment(16);
+        runWithAlignment(32);
+        runWithAlignment(64);
+        runWithAlignment(128);
+    }
+
+    private static void runWithAlignment(int alignment) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer output;
+
+        pb = ProcessTools.createJavaProcessBuilder(
+            "-XX:+UseCompressedKlassPointers",
+            "-XX:+UseCompressedOops",
+            "-XX:ObjectAlignmentInBytes=" + alignment,
+            "-version");
+
+        output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/*
+ * @test
+ * @bug 7196045
+ * @bug 8014294
+ * @summary Possible JVM deadlock in ThreadTimesClosure when using HotspotInternal non-public API.
+ * @run main/othervm -XX:+UsePerfData -Xmx32m ThreadCpuTimesDeadlock
+ */
+
+import java.lang.management.ManagementFactory;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+public class ThreadCpuTimesDeadlock {
+
+    public static byte[] dummy;
+    public static long duration = 10 * 1000;
+    private static final String HOTSPOT_INTERNAL = "sun.management:type=HotspotInternal";
+
+    public static void main(String[] args) {
+
+        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+        ObjectName objName= null;
+        try {
+            ObjectName hotspotInternal = new ObjectName(HOTSPOT_INTERNAL);
+            try {
+                server.registerMBean(new sun.management.HotspotInternal(), hotspotInternal);
+            } catch (JMException e) {
+                throw new RuntimeException("HotSpotWatcher: Failed to register the HotspotInternal MBean" + e);
+            }
+            objName= new ObjectName("sun.management:type=HotspotThreading");
+
+        } catch (MalformedObjectNameException e1) {
+            throw new RuntimeException("Bad object name" + e1);
+        }
+
+        // Thread that allocs memory to generate GC's
+        Thread allocThread = new Thread() {
+          public void run() {
+            while (true) {
+              dummy = new byte[4096];
+            }
+          }
+        };
+
+        allocThread.setDaemon(true);
+        allocThread.start();
+
+        long endTime = System.currentTimeMillis() + duration;
+        long i = 0;
+        while (true) {
+            try {
+                server.getAttribute(objName, "InternalThreadCpuTimes");
+            } catch (Exception ex) {
+                System.err.println("Exception while getting attribute: " + ex);
+            }
+            i++;
+            if (i % 10000 == 0) {
+                System.out.println("Successful iterations: " + i);
+            }
+            if (System.currentTimeMillis() > endTime) {
+                break;
+            }
+        }
+        System.out.println("PASSED.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/OutputAnalyzerReportingTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+/*
+ * @test
+ * @summary Test the OutputAnalyzer reporting functionality,
+ *     such as printing additional diagnostic info
+ *     (exit code, stdout, stderr, command line, etc.)
+ * @library /testlibrary
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+
+
+public class OutputAnalyzerReportingTest {
+
+    public static void main(String[] args) throws Exception {
+        // Create the output analyzer under test
+        String stdout = "aaaaaa";
+        String stderr = "bbbbbb";
+        OutputAnalyzer output = new OutputAnalyzer(stdout, stderr);
+
+        // Expected summary values should be the same for all cases,
+        // since the outputAnalyzer object is the same
+        String expectedExitValue = "-1";
+        String expectedSummary =
+                " stdout: [" + stdout + "];\n" +
+                " stderr: [" + stderr + "]\n" +
+                " exitValue = " + expectedExitValue + "\n";
+
+
+        DiagnosticSummaryTestRunner testRunner =
+                new DiagnosticSummaryTestRunner();
+
+        // should have exit value
+        testRunner.init(expectedSummary);
+        int unexpectedExitValue = 2;
+        try {
+            output.shouldHaveExitValue(unexpectedExitValue);
+        } catch (RuntimeException e) { }
+        testRunner.closeAndCheckResults();
+
+        // should not contain
+        testRunner.init(expectedSummary);
+        try {
+            output.shouldNotContain(stdout);
+        } catch (RuntimeException e) { }
+        testRunner.closeAndCheckResults();
+
+        // should contain
+        testRunner.init(expectedSummary);
+        try {
+            output.shouldContain("unexpected-stuff");
+        } catch (RuntimeException e) { }
+        testRunner.closeAndCheckResults();
+
+        // should not match
+        testRunner.init(expectedSummary);
+        try {
+            output.shouldNotMatch("[a]");
+        } catch (RuntimeException e) { }
+        testRunner.closeAndCheckResults();
+
+        // should match
+        testRunner.init(expectedSummary);
+        try {
+            output.shouldMatch("[qwerty]");
+        } catch (RuntimeException e) { }
+        testRunner.closeAndCheckResults();
+
+    }
+
+    private static class DiagnosticSummaryTestRunner {
+        private ByteArrayOutputStream byteStream =
+                new ByteArrayOutputStream(10000);
+
+        private String expectedSummary = "";
+        private PrintStream errStream;
+
+
+        public void init(String expectedSummary) {
+            this.expectedSummary = expectedSummary;
+            byteStream.reset();
+            errStream = new PrintStream(byteStream);
+            System.setErr(errStream);
+        }
+
+        public void closeAndCheckResults() {
+            // check results
+            errStream.close();
+            String stdErrStr = byteStream.toString();
+            if (!stdErrStr.contains(expectedSummary)) {
+                throw new RuntimeException("The output does not contain "
+                    + "the diagnostic message, or the message is incorrect");
+            }
+        }
+    }
+
+}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -76,7 +76,8 @@
    */
   public void shouldContain(String expectedString) {
     if (!stdout.contains(expectedString) && !stderr.contains(expectedString)) {
-      throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr: [" + stdout + stderr + "]\n");
+        reportDiagnosticSummary();
+        throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr \n");
     }
   }
 
@@ -88,7 +89,8 @@
    */
   public void stdoutShouldContain(String expectedString) {
     if (!stdout.contains(expectedString)) {
-      throw new RuntimeException("'" + expectedString + "' missing from stdout: [" + stdout + "]\n");
+        reportDiagnosticSummary();
+        throw new RuntimeException("'" + expectedString + "' missing from stdout \n");
     }
   }
 
@@ -100,7 +102,8 @@
    */
   public void stderrShouldContain(String expectedString) {
     if (!stderr.contains(expectedString)) {
-      throw new RuntimeException("'" + expectedString + "' missing from stderr: [" + stderr + "]\n");
+        reportDiagnosticSummary();
+        throw new RuntimeException("'" + expectedString + "' missing from stderr \n");
     }
   }
 
@@ -112,10 +115,12 @@
    */
   public void shouldNotContain(String notExpectedString) {
     if (stdout.contains(notExpectedString)) {
-      throw new RuntimeException("'" + notExpectedString + "' found in stdout: [" + stdout + "]\n");
+        reportDiagnosticSummary();
+        throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
     }
     if (stderr.contains(notExpectedString)) {
-      throw new RuntimeException("'" + notExpectedString + "' found in stderr: [" + stderr + "]\n");
+        reportDiagnosticSummary();
+        throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
     }
   }
 
@@ -127,7 +132,8 @@
    */
   public void stdoutShouldNotContain(String notExpectedString) {
     if (stdout.contains(notExpectedString)) {
-      throw new RuntimeException("'" + notExpectedString + "' found in stdout: [" + stdout + "]\n");
+        reportDiagnosticSummary();
+        throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
     }
   }
 
@@ -139,7 +145,8 @@
    */
   public void stderrShouldNotContain(String notExpectedString) {
     if (stderr.contains(notExpectedString)) {
-      throw new RuntimeException("'" + notExpectedString + "' found in stderr: [" + stderr + "]\n");
+        reportDiagnosticSummary();
+        throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
     }
   }
 
@@ -154,9 +161,9 @@
       Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
       Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
       if (!stdoutMatcher.find() && !stderrMatcher.find()) {
+          reportDiagnosticSummary();
           throw new RuntimeException("'" + pattern
-                  + "' missing from stdout/stderr: [" + stdout + stderr
-                  + "]\n");
+                + "' missing from stdout/stderr \n");
       }
   }
 
@@ -170,8 +177,9 @@
   public void stdoutShouldMatch(String pattern) {
       Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
       if (!matcher.find()) {
+          reportDiagnosticSummary();
           throw new RuntimeException("'" + pattern
-                  + "' missing from stdout: [" + stdout + "]\n");
+                + "' missing from stdout \n");
       }
   }
 
@@ -185,8 +193,9 @@
   public void stderrShouldMatch(String pattern) {
       Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
       if (!matcher.find()) {
+          reportDiagnosticSummary();
           throw new RuntimeException("'" + pattern
-                  + "' missing from stderr: [" + stderr + "]\n");
+                + "' missing from stderr \n");
       }
   }
 
@@ -200,13 +209,15 @@
   public void shouldNotMatch(String pattern) {
       Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
       if (matcher.find()) {
+          reportDiagnosticSummary();
           throw new RuntimeException("'" + pattern
-                  + "' found in stdout: [" + stdout + "]\n");
+                  + "' found in stdout \n");
       }
       matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
       if (matcher.find()) {
+          reportDiagnosticSummary();
           throw new RuntimeException("'" + pattern
-                  + "' found in stderr: [" + stderr + "]\n");
+                  + "' found in stderr \n");
       }
   }
 
@@ -220,8 +231,9 @@
   public void stdoutShouldNotMatch(String pattern) {
       Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
       if (matcher.find()) {
+          reportDiagnosticSummary();
           throw new RuntimeException("'" + pattern
-                  + "' found in stdout: [" + stdout + "]\n");
+                  + "' found in stdout \n");
       }
   }
 
@@ -235,23 +247,45 @@
   public void stderrShouldNotMatch(String pattern) {
       Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
       if (matcher.find()) {
+          reportDiagnosticSummary();
           throw new RuntimeException("'" + pattern
-                  + "' found in stderr: [" + stderr + "]\n");
+                  + "' found in stderr \n");
       }
   }
 
   /**
-   * Verifiy the exit value of the process
+   * Verify the exit value of the process
    *
    * @param expectedExitValue Expected exit value from process
    * @throws RuntimeException If the exit value from the process did not match the expected value
    */
   public void shouldHaveExitValue(int expectedExitValue) {
       if (getExitValue() != expectedExitValue) {
-          throw new RuntimeException("Exit value " + getExitValue() + " , expected to get " + expectedExitValue);
+          reportDiagnosticSummary();
+          throw new RuntimeException("Expected to get exit value of ["
+                  + expectedExitValue + "]\n");
       }
   }
 
+
+  /**
+   * Report summary that will help to diagnose the problem
+   * Currently includes:
+   *  - standard input produced by the process under test
+   *  - standard output
+   *  - exit code
+   *  Note: the command line is printed by the ProcessTools
+   */
+    private void reportDiagnosticSummary() {
+        String msg =
+            " stdout: [" + stdout + "];\n" +
+            " stderr: [" + stderr + "]\n" +
+            " exitValue = " + getExitValue() + "\n";
+
+        System.err.println(msg);
+    }
+
+
   /**
    * Get the contents of the output buffer (stdout and stderr)
    *
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java	Tue Aug 13 18:34:12 2013 -0700
@@ -27,6 +27,7 @@
   private static final String osName = System.getProperty("os.name");
   private static final String dataModel = System.getProperty("sun.arch.data.model");
   private static final String vmVersion = System.getProperty("java.vm.version");
+  private static final String osArch = System.getProperty("os.arch");
 
   public static boolean is64bit() {
     return dataModel.equals("64");
@@ -59,4 +60,14 @@
   public static String getVMVersion() {
     return vmVersion;
   }
+
+  // Returns true for sparc and sparcv9.
+  public static boolean isSparc() {
+    return osArch.toLowerCase().startsWith("sparc");
+  }
+
+  public static String getOsArch() {
+    return osArch;
+  }
+
 }
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java	Tue Aug 13 18:34:12 2013 -0700
@@ -31,6 +31,7 @@
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.List;
 
 import sun.management.VMManagement;
 
@@ -107,6 +108,22 @@
   }
 
   /**
+   * Get the string containing input arguments passed to the VM
+   *
+   * @return arguments
+   */
+  public static String getVmInputArguments() {
+    RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+
+    List<String> args = runtime.getInputArguments();
+    StringBuilder result = new StringBuilder();
+    for (String arg : args)
+        result.append(arg).append(' ');
+
+    return result.toString();
+  }
+
+  /**
    * Get platform specific VM arguments (e.g. -d64 on 64bit Solaris)
    *
    * @return String[] with platform specific arguments, empty if there are none
@@ -132,8 +149,13 @@
     Collections.addAll(args, getPlatformSpecificVMArgs());
     Collections.addAll(args, command);
 
+    // Reporting
+    StringBuilder cmdLine = new StringBuilder();
+    for (String cmd : args)
+        cmdLine.append(cmd).append(' ');
+    System.out.println("Command line: [" + cmdLine.toString() + "]");
+
     return new ProcessBuilder(args.toArray(new String[args.size()]));
-
   }
 
 }
--- a/jaxp/.hgtags	Mon Aug 12 20:37:09 2013 +0530
+++ b/jaxp/.hgtags	Tue Aug 13 18:34:12 2013 -0700
@@ -223,3 +223,4 @@
 adf49c3ef83c160d53ece623049b2cdccaf78fc7 jdk8-b99
 5d1974c1d7b9a86431bc253dc5a6a52d4586622e jdk8-b100
 0a7432f898e579ea35e8c51e3edab37f949168e4 jdk8-b101
+7cffafa606e9fb865e7b5e6a56e0a681ce5cf617 jdk8-b102
--- a/jaxws/.hgtags	Mon Aug 12 20:37:09 2013 +0530
+++ b/jaxws/.hgtags	Tue Aug 13 18:34:12 2013 -0700
@@ -223,3 +223,4 @@
 8ef83d4b23c933935e28f59b282cea920b1b1f5f jdk8-b99
 4fd722afae5c02f00bbd44c3a34425ee474afb1c jdk8-b100
 60b623a361642a0f5aef5f06dad9e5f279b9d9a9 jdk8-b101
+988a5f2ac559dcab05698b8a8633aa453e012260 jdk8-b102
--- a/jdk/.hgtags	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/.hgtags	Tue Aug 13 18:34:12 2013 -0700
@@ -223,3 +223,4 @@
 6a099a36589bd933957272ba63e5263bede29971 jdk8-b99
 5be9c5bfcfe9b2a40412b4fb364377d49de014eb jdk8-b100
 6901612328239fbd471d20823113c1cf3fdaebee jdk8-b101
+8ed8e2b4b90e0ac9aa5b3efef51cd576a9db96a9 jdk8-b102
--- a/jdk/makefiles/CompileNativeLibraries.gmk	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/makefiles/CompileNativeLibraries.gmk	Tue Aug 13 18:34:12 2013 -0700
@@ -798,6 +798,16 @@
 	LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 endif
 
+ifeq ($(OPENJDK_TARGET_OS),linux)
+ifndef OPENJDK
+include $(JDK_TOPDIR)/make/closed/xawt.gmk
+endif
+
+ifeq ($(DISABLE_XRENDER),true)
+	LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
+endif
+endif
+
 ifeq ($(MILESTONE),internal)
 	LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
 endif
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1856,7 +1856,10 @@
         // If we're not valid that means we will shortly be validated and
         // painted, which means we don't have to do anything here.
         if (!isRunsDirty && index >= 0 && index < tabPane.getTabCount()) {
-            tabPane.repaint(getTabBounds(tabPane, index));
+            Rectangle rect = getTabBounds(tabPane, index);
+            if (rect != null) {
+                tabPane.repaint(rect);
+            }
         }
     }
 
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java	Tue Aug 13 18:34:12 2013 -0700
@@ -702,6 +702,20 @@
     }
 
     /**
+     * Returns the bounds of the specified tab index.  The bounds are
+     * with respect to the JTabbedPane's coordinate space.  If the tab at this
+     * index is not currently visible in the UI, then returns null.
+     */
+    @Override
+    public Rectangle getTabBounds(final JTabbedPane pane, final int i) {
+        if (visibleTabState.needsScrollTabs()
+                && (visibleTabState.isBefore(i) || visibleTabState.isAfter(i))) {
+            return null;
+        }
+        return super.getTabBounds(pane, i);
+    }
+
+    /**
      * Returns the tab index which intersects the specified point
      * in the JTabbedPane's coordinate space.
      */
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Tue Aug 13 18:34:12 2013 -0700
@@ -830,18 +830,19 @@
     //                          UTILITY METHODS
     // ----------------------------------------------------------------------
 
-    /*
-     * Find image to install into Title or into Application icon.
-     * First try icons installed for toplevel. If there is no icon
-     * use default Duke image.
-     * This method shouldn't return null.
+    /**
+     * Find image to install into Title or into Application icon. First try
+     * icons installed for toplevel. Null is returned, if there is no icon and
+     * default Duke image should be used.
      */
     private CImage getImageForTarget() {
-        List<Image> icons = target.getIconImages();
-        if (icons == null || icons.size() == 0) {
-            return null;
+        CImage icon = null;
+        try {
+            icon = CImage.getCreator().createFromImages(target.getIconImages());
+        } catch (Exception ignored) {
+            // Perhaps the icon passed into Java is broken. Skipping this icon.
         }
-        return CImage.getCreator().createFromImages(icons);
+        return icon;
     }
 
     /*
--- a/jdk/src/macosx/native/java/util/SCDynamicStoreConfig.m	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/macosx/native/java/util/SCDynamicStoreConfig.m	Tue Aug 13 18:34:12 2013 -0700
@@ -103,7 +103,6 @@
         CFTypeRef realmInfo = SCDynamicStoreCopyValue(store, (CFStringRef) [NSString stringWithFormat:@"Kerberos:%@", realm]);
 
         if (CFGetTypeID(realmInfo) != CFDictionaryGetTypeID()) {
-            NSLog(@"Unexpected CFType for realm Info: %lu", CFGetTypeID(realmInfo));
             return nil;
         }
 
@@ -140,7 +139,6 @@
 
     SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("java"), _SCDynamicStoreCallBack, NULL);
     if (store == NULL) {
-        NSLog(@"Unable to load SCDynamicStore to install NotificationCallback");
         return;
     }
 
@@ -171,19 +169,11 @@
 
     SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("java-kerberos"), NULL, NULL);
     if (store == NULL) {
-        NSLog(@"Unable to load SCDynamicStore");
-        return NULL;
-    }
-
-    // Create the store if it is NULL and set it.
-    if (store == NULL) {
-        NSLog(@"Invalid value for SCDynamicStore");
         return NULL;
     }
 
     CFTypeRef realms = SCDynamicStoreCopyValue(store, (CFStringRef) KERBEROS_DEFAULT_REALMS);
     if (realms == NULL || CFGetTypeID(realms) != CFArrayGetTypeID()) {
-        NSLog(@"Unable to load realm info from SCDynamicStore");
         if (realms) CFRelease(realms);
         CFRelease(store);
         return NULL;
@@ -192,7 +182,6 @@
     CFTypeRef realmMappings = SCDynamicStoreCopyValue(store, (CFStringRef) KERBEROS_DEFAULT_REALM_MAPPINGS);
 
     if (realmMappings == NULL || CFGetTypeID(realmMappings) != CFArrayGetTypeID()) {
-        NSLog(@"Unable to load realm mapping info from SCDynamicStore");
         if (realmMappings) CFRelease(realmMappings);
         CFRelease(realms);
         CFRelease(store);
--- a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,10 @@
 
 import sun.security.util.PropertyExpander;
 
+import sun.security.provider.PolicyParser.PrincipalEntry;
+import sun.security.provider.PolicyParser.GrantEntry;
+import sun.security.provider.PolicyParser.PermissionEntry;
+
 /**
  * This class represents a default implementation for
  * <code>javax.security.auth.Policy</code>.
@@ -469,7 +473,8 @@
      * @param policyFile the policy Reader object.
      */
     private void init(URL policy) {
-        PolicyParser pp = new PolicyParser(expandProperties);
+        sun.security.provider.PolicyParser pp =
+                new sun.security.provider.PolicyParser(expandProperties);
         try {
             InputStreamReader isr
                 = new InputStreamReader(getInputStream(policy));
@@ -477,12 +482,12 @@
             isr.close();
             KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(),
                                              pp.getKeyStoreType());
-            Enumeration<PolicyParser.GrantEntry> enum_ = pp.grantElements();
+            Enumeration<GrantEntry> enum_ = pp.grantElements();
             while (enum_.hasMoreElements()) {
-                PolicyParser.GrantEntry ge = enum_.nextElement();
+                GrantEntry ge = enum_.nextElement();
                 addGrantEntry(ge, keyStore);
             }
-        } catch (PolicyParser.ParsingException pe) {
+        } catch (sun.security.provider.PolicyParser.ParsingException pe) {
             System.err.println(AUTH_POLICY +
                                 rb.getString(".error.parsing.") + policy);
             System.err.println(AUTH_POLICY +
@@ -521,8 +526,8 @@
      *
      * @return null if signedBy alias is not recognized
      */
-    CodeSource getCodeSource(PolicyParser.GrantEntry ge, KeyStore keyStore)
-        throws java.net.MalformedURLException
+    CodeSource getCodeSource(GrantEntry ge, KeyStore keyStore)
+            throws java.net.MalformedURLException
     {
         Certificate[] certs = null;
         if (ge.signedBy != null) {
@@ -559,20 +564,18 @@
     /**
      * Add one policy entry to the vector.
      */
-    private void addGrantEntry(PolicyParser.GrantEntry ge,
-                               KeyStore keyStore) {
+    private void addGrantEntry(GrantEntry ge, KeyStore keyStore) {
 
         if (debug != null) {
             debug.println("Adding policy entry: ");
             debug.println("  signedBy " + ge.signedBy);
             debug.println("  codeBase " + ge.codeBase);
             if (ge.principals != null && ge.principals.size() > 0) {
-                ListIterator<PolicyParser.PrincipalEntry> li =
-                                                ge.principals.listIterator();
+                ListIterator<PrincipalEntry> li = ge.principals.listIterator();
                 while (li.hasNext()) {
-                    PolicyParser.PrincipalEntry pppe = li.next();
-                    debug.println("  " + pppe.principalClass +
-                                        " " + pppe.principalName);
+                    PrincipalEntry pppe = li.next();
+                    debug.println("  " + pppe.getPrincipalClass() +
+                                        " " + pppe.getPrincipalName());
                 }
             }
             debug.println();
@@ -584,10 +587,9 @@
             if (codesource == null) return;
 
             PolicyEntry entry = new PolicyEntry(codesource);
-            Enumeration<PolicyParser.PermissionEntry> enum_ =
-                                                ge.permissionElements();
+            Enumeration<PermissionEntry> enum_ = ge.permissionElements();
             while (enum_.hasMoreElements()) {
-                PolicyParser.PermissionEntry pe = enum_.nextElement();
+                PermissionEntry pe = enum_.nextElement();
                 try {
                     // XXX special case PrivateCredentialPermission-SELF
                     Permission perm;
@@ -998,11 +1000,11 @@
                 return true;
             }
 
-            ListIterator<PolicyParser.PrincipalEntry> pli =
-                                        scs.getPrincipals().listIterator();
+            ListIterator<PrincipalEntry> pli =
+                    scs.getPrincipals().listIterator();
             while (pli.hasNext()) {
 
-                PolicyParser.PrincipalEntry principal = pli.next();
+                PrincipalEntry principal = pli.next();
 
                 // XXX
                 //      if the Policy entry's Principal does not contain a
@@ -1050,30 +1052,29 @@
      *                  if (y == 1), it's the principal name.
      */
     private String[][] getPrincipalInfo
-                (PolicyParser.PrincipalEntry principal,
-                final CodeSource accCs) {
+                (PrincipalEntry principal, final CodeSource accCs) {
 
         // there are 3 possibilities:
         // 1) the entry's Principal class and name are not wildcarded
         // 2) the entry's Principal name is wildcarded only
         // 3) the entry's Principal class and name are wildcarded
 
-        if (!principal.principalClass.equals
-                (PolicyParser.PrincipalEntry.WILDCARD_CLASS) &&
-            !principal.principalName.equals
-                (PolicyParser.PrincipalEntry.WILDCARD_NAME)) {
+        if (!principal.getPrincipalClass().equals
+                (PrincipalEntry.WILDCARD_CLASS) &&
+            !principal.getPrincipalName().equals
+                (PrincipalEntry.WILDCARD_NAME)) {
 
             // build a PrivateCredentialPermission for the principal
             // from the Policy entry
             String[][] info = new String[1][2];
-            info[0][0] = principal.principalClass;
-            info[0][1] = principal.principalName;
+            info[0][0] = principal.getPrincipalClass();
+            info[0][1] = principal.getPrincipalName();
             return info;
 
-        } else if (!principal.principalClass.equals
-                (PolicyParser.PrincipalEntry.WILDCARD_CLASS) &&
-            principal.principalName.equals
-                (PolicyParser.PrincipalEntry.WILDCARD_NAME)) {
+        } else if (!principal.getPrincipalClass().equals
+                (PrincipalEntry.WILDCARD_CLASS) &&
+            principal.getPrincipalName().equals
+                (PrincipalEntry.WILDCARD_NAME)) {
 
             // build a PrivateCredentialPermission for all
             // the Subject's principals that are instances of principalClass
@@ -1088,7 +1089,7 @@
                 // If it doesn't, we should stop here with a ClassCastException.
                 @SuppressWarnings("unchecked")
                 Class<? extends Principal> pClass = (Class<? extends Principal>)
-                        Class.forName(principal.principalClass, false,
+                        Class.forName(principal.getPrincipalClass(), false,
                                       ClassLoader.getSystemClassLoader());
                 principalSet = scs.getSubject().getPrincipals(pClass);
             } catch (Exception e) {
@@ -1387,6 +1388,7 @@
     }
 }
 
+@SuppressWarnings("deprecation")
 class PolicyPermissions extends PermissionCollection {
 
     private static final long serialVersionUID = -1954188373270545523L;
--- a/jdk/src/share/classes/com/sun/security/auth/SubjectCodeSource.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/com/sun/security/auth/SubjectCodeSource.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 import java.lang.reflect.Constructor;
 
 import javax.security.auth.Subject;
+import sun.security.provider.PolicyParser.PrincipalEntry;
 
 /**
  * <p> This <code>SubjectCodeSource</code> class contains
@@ -57,7 +58,7 @@
         });
 
     private Subject subject;
-    private LinkedList<PolicyParser.PrincipalEntry> principals;
+    private LinkedList<PrincipalEntry> principals;
     private static final Class[] PARAMS = { String.class };
     private static final sun.security.util.Debug debug =
         sun.security.util.Debug.getInstance("auth", "\t[Auth Access]");
@@ -87,14 +88,14 @@
      *                  <code>SubjectCodeSource</code> <p>
      */
     SubjectCodeSource(Subject subject,
-        LinkedList<PolicyParser.PrincipalEntry> principals,
+        LinkedList<PrincipalEntry> principals,
         URL url, Certificate[] certs) {
 
         super(url, certs);
         this.subject = subject;
         this.principals = (principals == null ?
-                new LinkedList<PolicyParser.PrincipalEntry>() :
-                new LinkedList<PolicyParser.PrincipalEntry>(principals));
+                new LinkedList<PrincipalEntry>() :
+                new LinkedList<PrincipalEntry>(principals));
         sysClassLoader = java.security.AccessController.doPrivileged
         (new java.security.PrivilegedAction<ClassLoader>() {
             public ClassLoader run() {
@@ -114,7 +115,7 @@
      *          <code>SubjectCodeSource</code> as a <code>LinkedList</code>
      *          of <code>PolicyParser.PrincipalEntry</code> objects.
      */
-    LinkedList<PolicyParser.PrincipalEntry> getPrincipals() {
+    LinkedList<PrincipalEntry> getPrincipals() {
         return principals;
     }
 
@@ -167,7 +168,7 @@
      */
     public boolean implies(CodeSource codesource) {
 
-        LinkedList<PolicyParser.PrincipalEntry> subjectList = null;
+        LinkedList<PrincipalEntry> subjectList = null;
 
         if (codesource == null ||
             !(codesource instanceof SubjectCodeSource) ||
@@ -197,20 +198,19 @@
             return false;
         }
 
-        ListIterator<PolicyParser.PrincipalEntry> li =
-                this.principals.listIterator(0);
+        ListIterator<PrincipalEntry> li = this.principals.listIterator(0);
         while (li.hasNext()) {
-            PolicyParser.PrincipalEntry pppe = li.next();
+            PrincipalEntry pppe = li.next();
             try {
 
                 // handle PrincipalComparators
 
                 Class<?> principalComparator = Class.forName(
-                        pppe.principalClass, true, sysClassLoader);
+                        pppe.getPrincipalClass(), true, sysClassLoader);
                 Constructor<?> c = principalComparator.getConstructor(PARAMS);
                 PrincipalComparator pc =
                         (PrincipalComparator)c.newInstance
-                        (new Object[] { pppe.principalName });
+                        (new Object[] { pppe.getPrincipalName() });
 
                 if (!pc.implies(that.getSubject())) {
                     if (debug != null)
@@ -236,11 +236,10 @@
                     Iterator<Principal> i =
                                 that.getSubject().getPrincipals().iterator();
 
-                    subjectList = new LinkedList<PolicyParser.PrincipalEntry>();
+                    subjectList = new LinkedList<PrincipalEntry>();
                     while (i.hasNext()) {
                         Principal p = i.next();
-                        PolicyParser.PrincipalEntry spppe =
-                                new PolicyParser.PrincipalEntry
+                        PrincipalEntry spppe = new PrincipalEntry
                                 (p.getClass().getName(), p.getName());
                         subjectList.add(spppe);
                     }
@@ -281,23 +280,19 @@
      *          <i>pppe</i> argument.
      */
     private boolean subjectListImpliesPrincipalEntry(
-                LinkedList<PolicyParser.PrincipalEntry> subjectList,
-                PolicyParser.PrincipalEntry pppe) {
+                LinkedList<PrincipalEntry> subjectList, PrincipalEntry pppe) {
 
-        ListIterator<PolicyParser.PrincipalEntry> li =
-                                        subjectList.listIterator(0);
+        ListIterator<PrincipalEntry> li = subjectList.listIterator(0);
         while (li.hasNext()) {
-            PolicyParser.PrincipalEntry listPppe = li.next();
+            PrincipalEntry listPppe = li.next();
 
-            if (pppe.principalClass.equals
-                        (PolicyParser.PrincipalEntry.WILDCARD_CLASS) ||
-                pppe.principalClass.equals
-                        (listPppe.principalClass)) {
-
-                if (pppe.principalName.equals
-                        (PolicyParser.PrincipalEntry.WILDCARD_NAME) ||
-                    pppe.principalName.equals
-                        (listPppe.principalName))
+            if (pppe.getPrincipalClass().equals
+                        (PrincipalEntry.WILDCARD_CLASS) ||
+                pppe.getPrincipalClass().equals(listPppe.getPrincipalClass()))
+            {
+                if (pppe.getPrincipalName().equals
+                        (PrincipalEntry.WILDCARD_NAME) ||
+                    pppe.getPrincipalName().equals(listPppe.getPrincipalName()))
                     return true;
             }
         }
@@ -390,13 +385,12 @@
             }
         }
         if (principals != null) {
-            ListIterator<PolicyParser.PrincipalEntry> li =
-                                        principals.listIterator();
+            ListIterator<PrincipalEntry> li = principals.listIterator();
             while (li.hasNext()) {
-                PolicyParser.PrincipalEntry pppe = li.next();
+                PrincipalEntry pppe = li.next();
                 returnMe = returnMe + rb.getString("NEWLINE") +
-                        pppe.principalClass + " " +
-                        pppe.principalName;
+                        pppe.getPrincipalClass() + " " +
+                        pppe.getPrincipalName();
             }
         }
         return returnMe;
--- a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js	Tue Aug 13 18:34:12 2013 -0700
@@ -151,7 +151,7 @@
         while (tmp != null) {
             res[res.length] = tmp;
             tmp = tmp.superclass;
-        } 
+        }
         return res;
     }
 
@@ -263,16 +263,19 @@
     
                     if (name == 'class') {
                         return wrapJavaValue(instance.clazz);
-                    } else if (name == 'toString') {
-                        return function() { 
-                            return instance.toString();
-                        }
                     } else if (name == 'wrapped-object') {
                         return instance;
                     } 
     
                     return undefined;
-            }
+            },
+            __call__: function(name) {
+                if (name == 'toString') {
+                    return instance.toString();
+                } else {
+                    return undefined;
+                }
+            } 
         }				
     }
 
@@ -297,7 +300,7 @@
                         return true;
                     }					
                 }
-                return theJavaClassProto[name] != undefined;
+                return false;
             },
             __get__ : function(name) {
                 for (var i in fields) {
@@ -305,7 +308,7 @@
                         return wrapJavaValue(fields[i].value);	
                     }					
                 }
-                return theJavaClassProto[name];
+                return undefined;
             }
         }
     		
@@ -322,7 +325,12 @@
         this.name = jclass.name; 
         this.fields = jclass.fields;
         this['wrapped-object'] = jclass;
-        this.__proto__ = this.statics;
+    }
+
+    for (var i in theJavaClassProto) {
+        if (typeof theJavaClassProto[i] == 'function') {
+           JavaClassWrapper.prototype[i] = theJavaClassProto[i];
+        }
     }
     
     // returns wrapper for Java object arrays
@@ -334,32 +342,35 @@
             __getIds__ : function() {
                 var res = new Array(elements.length);
                 for (var i = 0; i < elements.length; i++) {
-                    res[i] = i;
+                    res[i] = String(i);
                 }
                 return res;
             },
             __has__: function(name) {
-                return (typeof(name) == 'number' &&
-                        name >= 0 && name < elements.length)  ||
+                return (name >= 0 && name < elements.length)  ||
                         name == 'length' || name == 'class' ||
                         name == 'toString' || name == 'wrapped-object';
             },
             __get__ : function(name) {
-                if (typeof(name) == 'number' &&
-                    name >= 0 && name < elements.length) {
+                if (name >= 0 && name < elements.length) {
                     return wrapJavaValue(elements[name]);
                 } else if (name == 'length') {
                     return elements.length;
                 } else if (name == 'class') {
                     return wrapJavaValue(array.clazz);
-                } else if (name == 'toString') {
-                    return function() { return array.toString(); }          
                 } else if (name == 'wrapped-object') {
                     return array;
                 } else {
                     return undefined;
                 }				
-            }
+            },
+            __call__: function(name) {
+                if (name == 'toString') {
+                    return array.toString();
+                } else {
+                    return undefined;
+                }
+            } 
         }			
     }
     
@@ -373,26 +384,22 @@
             __getIds__ : function() {
                 var r = new Array(array.length);
                 for (var i = 0; i < array.length; i++) {
-                    r[i] = i;
+                    r[i] = String(i);
                 }
                 return r;
             },
             __has__: function(name) {
-                return (typeof(name) == 'number' &&
-                        name >= 0 && name < array.length) ||
+                return (name >= 0 && name < array.length) ||
                         name == 'length' || name == 'class' ||
                         name == 'toString' || name == 'wrapped-object';
             },
             __get__: function(name) {
-                if (typeof(name) == 'number' &&
-                    name >= 0 && name < array.length) {
+                if (name >= 0 && name < array.length) {
                     return elements[name];
                 }
     
                 if (name == 'length') {
                     return array.length;
-                } else if (name == 'toString') {
-                    return function() { return array.valueString(true); } 
                 } else if (name == 'wrapped-object') {
                     return array;
                 } else if (name == 'class') {
@@ -400,7 +407,14 @@
                 } else {
                     return undefined;
                 }
-            }
+            },
+            __call__: function(name) {
+                if (name == 'toString') {
+                    return array.valueString(true);
+                } else {
+                    return undefined;
+                }
+            } 
         }
     }
     return javaObject(thing);
@@ -673,34 +687,33 @@
                     __getIds__ : function() {
                         var res = new Array(path.length);
                         for (var i = 0; i < path.length; i++) {
-                            res[i] = i;
+                            res[i] = String(i);
                         }
                         return res;
                     },
                     __has__ : function (name) {
-                        return (typeof(name) == 'number' &&
-                            name >= 0 && name < path.length) ||
+                        return (name >= 0 && name < path.length) ||
                             name == 'length' || name == 'toHtml' ||
                             name == 'toString';
                     },
                     __get__ : function(name) {
-                        if (typeof(name) == 'number' &&
-                            name >= 0 && name < path.length) {
+                        if (name >= 0 && name < path.length) {
                             return path[name];
                         } else if (name == 'length') {
                             return path.length;
-                        } else if (name == 'toHtml') {
-                            return function() { 
-                               return computeDescription(true);
-                            }
-                        } else if (name == 'toString') {
-                            return function() {
-                               return computeDescription(false);
-                            }
                         } else {
                             return undefined;
                         }
                     },
+                    __call__: function(name) {
+                        if (name == 'toHtml') {
+                            return computeDescription(true);
+                        } else if (name == 'toString') {
+                            return computeDescription(false);
+                        } else {
+                            return undefined;
+                        }
+                    }
                 };
             }
 
@@ -1005,22 +1018,8 @@
             return "<a href='/object/" + id + "'>" +
                    name + "@" + id + "</a>";
         }
-    } else if ((typeof(obj) == 'object') || (obj instanceof JSAdapter)) {
-        if (obj instanceof java.lang.Object) {
-            // script wrapped Java object
-            obj = wrapIterator(obj);
-            // special case for enumeration
-            if (obj instanceof java.util.Enumeration) {
-                var res = "[ ";
-                while (obj.hasMoreElements()) {
-                    res += toHtml(obj.nextElement()) + ", ";
-                }
-                res += "]";
-                return res; 
-            } else {
-                return obj;
-            }
-        } else if (obj instanceof Array) {
+    } else if (obj instanceof Object) {
+        if (Array.isArray(obj)) {
             // script array
             var res = "[ ";
             for (var i in obj) {
@@ -1047,8 +1046,19 @@
             }
         }
     } else {
-        // JavaScript primitive value
-        return obj;
+        // a Java object
+        obj = wrapIterator(obj);
+        // special case for enumeration
+        if (obj instanceof java.util.Enumeration) {
+            var res = "[ ";
+            while (obj.hasMoreElements()) {
+                res += toHtml(obj.nextElement()) + ", ";
+            }
+            res += "]";
+            return res; 
+        } else {
+            return obj;
+        }
     }
 }
 
--- a/jdk/src/share/classes/com/sun/tools/hat/resources/oqlhelp.html	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/com/sun/tools/hat/resources/oqlhelp.html	Tue Aug 13 18:34:12 2013 -0700
@@ -79,7 +79,7 @@
 <li>select all Strings of length 100 or more
 <pre>
 <code>
-    select s from java.lang.String s where s.count >= 100
+    select s from java.lang.String s where s.value.length >= 100
 </code>
 </pre>
 <li>select all int arrays of length 256 or more
@@ -92,7 +92,7 @@
 <pre>
 <code>
     select s.value.toString() from java.lang.String s 
-    where /java/(s.value.toString())
+    where /java/.test(s.value.toString())
 </code>
 </pre>
 <li>show path value of all File objects
@@ -219,7 +219,6 @@
 <pre>
 <code>
     select heap.findClass("java.lang.System").statics.props
-    select heap.findClass("java.lang.System").props
 </code>
 </pre>
 <li>get number of fields of java.lang.String class 
@@ -237,7 +236,7 @@
 <li>select all classes that have name pattern java.net.*
 <pre>
 <code>
-    select <a href="#filter">filter</a>(heap.classes(), "/java.net./(it.name)")
+    select <a href="#filter">filter</a>(heap.classes(), "/java.net./.test(it.name)")
 </code>
 </pre>
 </ul>
@@ -536,7 +535,7 @@
 Example: print number of classes that have specific name pattern
 <pre>
 <code>
-    select count(<a href="#classes">heap.classes()</a>, "/java.io./(it.name)")
+    select count(<a href="#classes">heap.classes()</a>, "/java.io./.test(it.name)")
 </code>
 </pre>
 
@@ -559,14 +558,14 @@
 <li>show all classes that have java.io.* name pattern
 <pre>
 <code>
-    select filter(<a href="#classes">heap.classes</a>(), "/java.io./(it.name)")
+    select filter(<a href="#classes">heap.classes</a>(), "/java.io./.test(it.name)")
 </code>
 </pre>
 <li> show all referrers of URL object where the referrer is not from
 java.net package
 <pre>
 <code>
-    select filter(<a href="#referrers">referrers</a>(u), "! /java.net./(<a href="#classof">classof</a>(it).name)")
+    select filter(<a href="#referrers">referrers</a>(u), "! /java.net./.test(<a href="#classof">classof</a>(it).name)")
     from java.net.URL u
 </code>
 </pre>
@@ -619,13 +618,13 @@
 <li>find the maximum length of any String instance
 <pre>
 <code>
-    select max(map(heap.objects('java.lang.String', false), 'it.count'))
+    select max(map(heap.objects('java.lang.String', false), 'it.value.length'))
 </code>
 </pre>
 <li>find string instance that has the maximum length
 <pre>
 <code>
-    select max(heap.objects('java.lang.String'), 'lhs.count > rhs.count')
+    select max(heap.objects('java.lang.String'), 'lhs.value.length > rhs.value.length')
 </code>
 </pre>
 </ul>
@@ -775,7 +774,7 @@
 
 <pre>
 <code>
-   select <a href="#map">map</a>(<a href="#filter">filter(<a href="#findClass">heap.findClass</a>('java.lang.System').props.table, 'it != null'), 
+   select <a href="#map">map</a>(<a href="#filter">filter(<a href="#findClass">heap.findClass</a>('java.lang.System').statics.props.table, 'it != null'), 
             function (it) {
                 var res = "";
                 while (it != null) {
--- a/jdk/src/share/classes/java/applet/AppletContext.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/applet/AppletContext.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
 
     /**
      * Returns an <code>Image</code> object that can then be painted on
-     * the screen. The <code>url</code> argument<code> </code>that is
+     * the screen. The <code>url</code> argument that is
      * passed as an argument must specify an absolute URL.
      * <p>
      * This method always returns immediately, whether or not the image
@@ -157,7 +157,7 @@
      * @param stream stream to be associated with the specified key. If this
      *               parameter is <code>null</code>, the specified key is removed
      *               in this applet context.
-     * @throws <code>IOException</code> if the stream size exceeds a certain
+     * @throws IOException if the stream size exceeds a certain
      *         size limit. Size limit is decided by the implementor of this
      *         interface.
      * @since 1.4
--- a/jdk/src/share/classes/java/awt/event/ContainerListener.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/event/ContainerListener.java	Tue Aug 13 18:34:12 2013 -0700
@@ -42,7 +42,7 @@
  * Container events are provided for notification purposes ONLY;
  * The AWT will automatically handle add and remove operations
  * internally so the program works properly regardless of
- * whether the program registers a <code>ComponentListener</code> or not.
+ * whether the program registers a {@code ContainerListener} or not.
  *
  * @see ContainerAdapter
  * @see ContainerEvent
--- a/jdk/src/share/classes/java/awt/image/BufferStrategy.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/BufferStrategy.java	Tue Aug 13 18:34:12 2013 -0700
@@ -55,7 +55,7 @@
  * Alternatively, the contents of the back buffer can be copied, or
  * <i>blitted</i> forward in a chain instead of moving the video pointer.
  * <p>
- * <pre>
+ * <pre>{@code
  * Double buffering:
  *
  *                    ***********         ***********
@@ -72,7 +72,7 @@
  *          *         * <------ *         * <----- *         *
  *          ***********         ***********        ***********
  *
- * </pre>
+ * }</pre>
  * <p>
  * Here is an example of how buffer strategies can be created and used:
  * <pre><code>
--- a/jdk/src/share/classes/java/awt/image/BufferedImage.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java	Tue Aug 13 18:34:12 2013 -0700
@@ -602,12 +602,12 @@
      *                  the raster has been premultiplied with alpha.
      * @param properties <code>Hashtable</code> of
      *                  <code>String</code>/<code>Object</code> pairs.
-     * @exception <code>RasterFormatException</code> if the number and
+     * @exception RasterFormatException if the number and
      * types of bands in the <code>SampleModel</code> of the
      * <code>Raster</code> do not match the number and types required by
      * the <code>ColorModel</code> to represent its color and alpha
      * components.
-     * @exception <code>IllegalArgumentException</code> if
+     * @exception IllegalArgumentException if
      *          <code>raster</code> is incompatible with <code>cm</code>
      * @see ColorModel
      * @see Raster
@@ -927,7 +927,7 @@
      * each color component in the returned data when
      * using this method.  With a specified coordinate (x,&nbsp;y) in the
      * image, the ARGB pixel can be accessed in this way:
-     * </p>
+     * <p>
      *
      * <pre>
      *    pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)]; </pre>
@@ -1131,7 +1131,7 @@
      * @return an {@link Object} that is the property referred to by the
      *          specified <code>name</code> or <code>null</code> if the
      *          properties of this image are not yet known.
-     * @throws <code>NullPointerException</code> if the property name is null.
+     * @throws NullPointerException if the property name is null.
      * @see ImageObserver
      * @see java.awt.Image#UndefinedProperty
      */
@@ -1144,7 +1144,7 @@
      * @param name the property name
      * @return an <code>Object</code> that is the property referred to by
      *          the specified <code>name</code>.
-     * @throws <code>NullPointerException</code> if the property name is null.
+     * @throws NullPointerException if the property name is null.
      */
     public Object getProperty(String name) {
         if (name == null) {
@@ -1196,7 +1196,7 @@
      * @param h the height of the specified rectangular region
      * @return a <code>BufferedImage</code> that is the subimage of this
      *          <code>BufferedImage</code>.
-     * @exception <code>RasterFormatException</code> if the specified
+     * @exception RasterFormatException if the specified
      * area is not contained within this <code>BufferedImage</code>.
      */
     public BufferedImage getSubimage (int x, int y, int w, int h) {
@@ -1388,7 +1388,7 @@
      * @param tileY the y index of the requested tile in the tile array
      * @return a <code>Raster</code> that is the tile defined by the
      *          arguments <code>tileX</code> and <code>tileY</code>.
-     * @exception <code>ArrayIndexOutOfBoundsException</code> if both
+     * @exception ArrayIndexOutOfBoundsException if both
      *          <code>tileX</code> and <code>tileY</code> are not
      *          equal to 0
      */
@@ -1558,7 +1558,7 @@
      * @return <code>true</code> if the tile specified by the specified
      *          indices is checked out for writing; <code>false</code>
      *          otherwise.
-     * @exception <code>ArrayIndexOutOfBoundsException</code> if both
+     * @exception ArrayIndexOutOfBoundsException if both
      *          <code>tileX</code> and <code>tileY</code> are not equal
      *          to 0
      */
--- a/jdk/src/share/classes/java/awt/image/ByteLookupTable.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/ByteLookupTable.java	Tue Aug 13 18:34:12 2013 -0700
@@ -171,7 +171,7 @@
      * @exception ArrayIndexOutOfBoundsException if <code>src</code> is
      *            longer than <code>dst</code> or if for any element
      *            <code>i</code> of <code>src</code>,
-     *            <code>(src[i]&0xff)-offset</code> is either less than
+     *            {@code (src[i]&0xff)-offset} is either less than
      *            zero or greater than or equal to the length of the
      *            lookup table for any band.
      */
--- a/jdk/src/share/classes/java/awt/image/ColorModel.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/ColorModel.java	Tue Aug 13 18:34:12 2013 -0700
@@ -692,12 +692,12 @@
      * <code>DataBuffer.TYPE_INT</code>.
      * @param inData an array of pixel values
      * @return the value of the green component of the specified pixel.
-     * @throws <code>ClassCastException</code> if <code>inData</code>
+     * @throws ClassCastException if <code>inData</code>
      *  is not a primitive array of type <code>transferType</code>
-     * @throws <code>ArrayIndexOutOfBoundsException</code> if
+     * @throws ArrayIndexOutOfBoundsException if
      *  <code>inData</code> is not large enough to hold a pixel value
      *  for this <code>ColorModel</code>
-     * @throws <code>UnsupportedOperationException</code> if this
+     * @throws UnsupportedOperationException if this
      *  <code>tranferType</code> is not supported by this
      *  <code>ColorModel</code>
      */
--- a/jdk/src/share/classes/java/awt/image/DirectColorModel.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/DirectColorModel.java	Tue Aug 13 18:34:12 2013 -0700
@@ -642,12 +642,12 @@
      * @param inData the specified pixel
      * @return the alpha component of the specified pixel, scaled from
      *         0 to 255.
-     * @exception <code>ClassCastException</code> if <code>inData</code>
+     * @exception ClassCastException if <code>inData</code>
      *  is not a primitive array of type <code>transferType</code>
-     * @exception <code>ArrayIndexOutOfBoundsException</code> if
+     * @exception ArrayIndexOutOfBoundsException if
      *  <code>inData</code> is not large enough to hold a pixel value
      *  for this <code>ColorModel</code>
-     * @exception <code>UnsupportedOperationException</code> if this
+     * @exception UnsupportedOperationException if this
      *  <code>tranferType</code> is not supported by this
      *  <code>ColorModel</code>
      */
@@ -1055,7 +1055,7 @@
      * begin retrieving the color and alpha components
      * @return an <code>int</code> pixel value in this
      * <code>ColorModel</code> corresponding to the specified components.
-     * @exception <code>ArrayIndexOutOfBoundsException</code> if
+     * @exception ArrayIndexOutOfBoundsException if
      *  the <code>components</code> array is not large enough to
      *  hold all of the color and alpha components starting at
      *  <code>offset</code>
@@ -1097,9 +1097,9 @@
      * and alpha components
      * @return an <code>Object</code> representing an array of color and
      * alpha components.
-     * @exception <code>ClassCastException</code> if <code>obj</code>
+     * @exception ClassCastException if <code>obj</code>
      *  is not a primitive array of type <code>transferType</code>
-     * @exception <code>ArrayIndexOutOfBoundsException</code> if
+     * @exception ArrayIndexOutOfBoundsException if
      *  <code>obj</code> is not large enough to hold a pixel value
      *  for this <code>ColorModel</code> or the <code>components</code>
      *  array is not large enough to hold all of the color and alpha
--- a/jdk/src/share/classes/java/awt/image/ImageProducer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/ImageProducer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -100,11 +100,11 @@
      * <code>ImageProducer</code> should respond by executing
      * the following minimum set of <code>ImageConsumer</code>
      * method calls:
-     * <pre>
+     * <pre>{@code
      *  ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >);
      *  ic.setPixels(...);      // As many times as needed
      *  ic.imageComplete();
-     * </pre>
+     * }</pre>
      * @param ic the specified <code>ImageConsumer</code>
      * @see ImageConsumer#setHints
      */
--- a/jdk/src/share/classes/java/awt/image/IndexColorModel.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/IndexColorModel.java	Tue Aug 13 18:34:12 2013 -0700
@@ -98,6 +98,7 @@
  * Index values greater than or equal to the map size, but less than
  * 2<sup><em>n</em></sup>, are undefined and return 0 for all color and
  * alpha components.
+ * </a>
  * <p>
  * For those methods that use a primitive array pixel representation of
  * type <code>transferType</code>, the array length is always one.
--- a/jdk/src/share/classes/java/awt/image/MemoryImageSource.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/MemoryImageSource.java	Tue Aug 13 18:34:12 2013 -0700
@@ -37,7 +37,7 @@
  * uses an array to produce pixel values for an Image.  Here is an example
  * which calculates a 100x100 image representing a fade from black to blue
  * along the X axis and a fade from black to red along the Y axis:
- * <pre>
+ * <pre>{@code
  *
  *      int w = 100;
  *      int h = 100;
@@ -52,12 +52,12 @@
  *      }
  *      Image img = createImage(new MemoryImageSource(w, h, pix, 0, w));
  *
- * </pre>
+ * }</pre>
  * The MemoryImageSource is also capable of managing a memory image which
  * varies over time to allow animation or custom rendering.  Here is an
  * example showing how to set up the animation source and signal changes
  * in the data (adapted from the MemoryAnimationSourceDemo by Garth Dickie):
- * <pre>
+ * <pre>{@code
  *
  *      int pixels[];
  *      MemoryImageSource source;
@@ -96,7 +96,7 @@
  *          }
  *      }
  *
- * </pre>
+ * }</pre>
  *
  * @see ImageProducer
  *
--- a/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java	Tue Aug 13 18:34:12 2013 -0700
@@ -52,14 +52,14 @@
  * <code>x,&nbsp;y</code> from <code>DataBuffer</code> <code>data</code>
  * and storing the pixel data in data elements of type
  * <code>dataType</code>:
- * <pre>
+ * <pre>{@code
  *      int dataElementSize = DataBuffer.getDataTypeSize(dataType);
  *      int bitnum = dataBitOffset + x*pixelBitStride;
  *      int element = data.getElem(y*scanlineStride + bitnum/dataElementSize);
  *      int shift = dataElementSize - (bitnum & (dataElementSize-1))
  *                  - pixelBitStride;
  *      int pixel = (element >> shift) & ((1 << pixelBitStride) - 1);
- * </pre>
+ * }</pre>
  */
 
 public class MultiPixelPackedSampleModel extends SampleModel
--- a/jdk/src/share/classes/java/awt/image/PixelGrabber.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/PixelGrabber.java	Tue Aug 13 18:34:12 2013 -0700
@@ -35,7 +35,7 @@
  * The PixelGrabber class implements an ImageConsumer which can be attached
  * to an Image or ImageProducer object to retrieve a subset of the pixels
  * in that image.  Here is an example:
- * <pre>
+ * <pre>{@code
  *
  * public void handlesinglepixel(int x, int y, int pixel) {
  *      int alpha = (pixel >> 24) & 0xff;
@@ -65,7 +65,7 @@
  *      }
  * }
  *
- * </pre>
+ * }</pre>
  *
  * @see ColorModel#getRGBdefault
  *
@@ -165,8 +165,8 @@
      * accumulated in the default RGB ColorModel.  If the forceRGB
      * parameter is true, then the pixels will be accumulated in the
      * default RGB ColorModel anyway.  A buffer is allocated by the
-     * PixelGrabber to hold the pixels in either case.  If (w < 0) or
-     * (h < 0), then they will default to the remaining width and
+     * PixelGrabber to hold the pixels in either case.  If {@code (w < 0)} or
+     * {@code (h < 0)}, then they will default to the remaining width and
      * height of the source data when that information is delivered.
      * @param img the image to retrieve the image data from
      * @param x the x coordinate of the upper left corner of the rectangle
@@ -233,10 +233,10 @@
      * behaves in the following ways, depending on the value of
      * <code>ms</code>:
      * <ul>
-     * <li> If <code>ms</code> == 0, waits until all pixels are delivered
-     * <li> If <code>ms</code> > 0, waits until all pixels are delivered
+     * <li> If {@code ms == 0}, waits until all pixels are delivered
+     * <li> If {@code ms > 0}, waits until all pixels are delivered
      * as timeout expires.
-     * <li> If <code>ms</code> < 0, returns <code>true</code> if all pixels
+     * <li> If {@code ms < 0}, returns <code>true</code> if all pixels
      * are grabbed, <code>false</code> otherwise and does not wait.
      * </ul>
      * @param ms the number of milliseconds to wait for the image pixels
--- a/jdk/src/share/classes/java/awt/image/RGBImageFilter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/RGBImageFilter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -39,7 +39,7 @@
  * The only method which needs to be defined to create a useable image
  * filter is the filterRGB method.  Here is an example of a definition
  * of a filter which swaps the red and blue components of an image:
- * <pre>
+ * <pre>{@code
  *
  *      class RedBlueSwapFilter extends RGBImageFilter {
  *          public RedBlueSwapFilter() {
@@ -56,7 +56,7 @@
  *          }
  *      }
  *
- * </pre>
+ * }</pre>
  *
  * @see FilteredImageSource
  * @see ImageFilter
--- a/jdk/src/share/classes/java/awt/image/ShortLookupTable.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/ShortLookupTable.java	Tue Aug 13 18:34:12 2013 -0700
@@ -114,7 +114,7 @@
      * @exception ArrayIndexOutOfBoundsException if <code>src</code> is
      *            longer than <code>dst</code> or if for any element
      *            <code>i</code> of <code>src</code>,
-     *            <code>(src[i]&0xffff)-offset</code> is either less than
+     *            {@code (src[i]&0xffff)-offset} is either less than
      *            zero or greater than or equal to the length of the
      *            lookup table for any band.
      */
@@ -165,7 +165,7 @@
      * @exception ArrayIndexOutOfBoundsException if <code>src</code> is
      *            longer than <code>dst</code> or if for any element
      *            <code>i</code> of <code>src</code>,
-     *            <code>(src[i]&0xffff)-offset</code> is either less than
+     *            {@code (src[i]&0xffff)-offset} is either less than
      *            zero or greater than or equal to the length of the
      *            lookup table for any band.
      */
--- a/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java	Tue Aug 13 18:34:12 2013 -0700
@@ -57,10 +57,10 @@
  * The following code illustrates extracting the bits of the sample
  * representing band <code>b</code> for pixel <code>x,y</code>
  * from DataBuffer <code>data</code>:
- * <pre>
+ * <pre>{@code
  *      int sample = data.getElem(y * scanlineStride + x);
  *      sample = (sample & bitMasks[b]) >>> bitOffsets[b];
- * </pre>
+ * }</pre>
  */
 
 public class SinglePixelPackedSampleModel extends SampleModel
--- a/jdk/src/share/classes/java/awt/image/WritableRaster.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java	Tue Aug 13 18:34:12 2013 -0700
@@ -372,13 +372,13 @@
      * integral type and less than or equal to 32 bits in size, then calling
      * this method is equivalent to executing the following code for all
      * <code>x,y</code> addresses valid in both Rasters.
-     * <pre>
+     * <pre>{@code
      *       Raster srcRaster;
      *       WritableRaster dstRaster;
      *       for (int b = 0; b < srcRaster.getNumBands(); b++) {
      *           dstRaster.setSample(x, y, b, srcRaster.getSample(x, y, b));
      *       }
-     * </pre>
+     * }</pre>
      * Thus, when copying an integral type source to an integral type
      * destination, if the source sample size is greater than the destination
      * sample size for a particular band, the high order bits of the source
--- a/jdk/src/share/classes/java/beans/AppletInitializer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/AppletInitializer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,6 @@
      * the Applet with its Container during the subsequent invocation of its
      * addChildren() method.
      * </ol>
-     * </p>
      *
      * @param newAppletBean  The newly instantiated JavaBean
      * @param bCtxt          The BeanContext intended for this Applet, or
--- a/jdk/src/share/classes/java/beans/Beans.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/Beans.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2009, 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
@@ -62,7 +62,7 @@
      * <p>
      * Instantiate a JavaBean.
      * </p>
-     *
+     * @return a JavaBean
      * @param     cls         the class-loader from which we should create
      *                        the bean.  If this is null, then the system
      *                        class-loader is used.
@@ -82,6 +82,7 @@
      * <p>
      * Instantiate a JavaBean.
      * </p>
+     * @return a JavaBean
      *
      * @param     cls         the class-loader from which we should create
      *                        the bean.  If this is null, then the system
@@ -137,6 +138,7 @@
      * the JDK appletviewer (for a reference browser environment) and the
      * BDK BeanBox (for a reference bean container).
      *
+     * @return a JavaBean
      * @param     cls         the class-loader from which we should create
      *                        the bean.  If this is null, then the system
      *                        class-loader is used.
@@ -361,6 +363,8 @@
      * This method is provided in Beans 1.0 as a hook to allow the
      * addition of more flexible bean behaviour in the future.
      *
+     * @return an object representing a specified type view of the
+     * source object
      * @param bean        Object from which we want to obtain a view.
      * @param targetType  The type of view we'd like to get.
      *
@@ -384,7 +388,6 @@
         return Introspector.isSubclass(bean.getClass(), targetType);
     }
 
-
     /**
      * Test if we are in design-mode.
      *
--- a/jdk/src/share/classes/java/beans/ConstructorProperties.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/ConstructorProperties.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
    the {@code getY()} method.  Since parameter names are not in
    general available at runtime, without the annotation there would be
    no way to know whether the parameters correspond to {@code getX()}
-   and {@code getY()} or the other way around.</p>
+   and {@code getY()} or the other way around.
 
    @since 1.6
 */
--- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -382,6 +382,7 @@
      * a class such that no property value depends on the value of
      * a subsequent property.
      *
+     * @param type the type of the instances
      * @param oldInstance The instance to be copied.
      * @param newInstance The instance that is to be modified.
      * @param out The stream to which any initialization statements should be written.
--- a/jdk/src/share/classes/java/beans/EventHandler.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/EventHandler.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -515,6 +515,7 @@
      *</pre>
      *</blockquote>
      *
+     * @param <T> the type to create
      * @param listenerInterface the listener interface to create a proxy for
      * @param target the object that will perform the action
      * @param action the name of a (possibly qualified) property or method on
@@ -570,6 +571,7 @@
      *</pre>
      *</blockquote>
      *
+     * @param <T> the type to create
      * @param listenerInterface the listener interface to create a proxy for
      * @param target the object that will perform the action
      * @param action the name of a (possibly qualified) property or method on
@@ -659,6 +661,7 @@
      * </pre>
      *</blockquote>
      *
+     * @param <T> the type to create
      * @param listenerInterface the listener interface to create a proxy for
      * @param target the object that will perform the action
      * @param action the name of a (possibly qualified) property or method on
--- a/jdk/src/share/classes/java/beans/Expression.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/Expression.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@
      * replaces this default value in the same way that any other value
      * would, ensuring that expressions are never evaluated more than once.
      * <p>
-     * See the <code>excecute</code> method for details on how
+     * See the <code>execute</code> method for details on how
      * methods are chosen using the dynamic types of the target
      * and arguments.
      *
@@ -147,6 +147,8 @@
      * @see #setValue
      *
      * @return The result of applying this method to these arguments.
+     * @throws Exception if the method with the specified methodName
+     * throws an exception
      */
     public Object getValue() throws Exception {
         if (value == unbound) {
--- a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Tue Aug 13 18:34:12 2013 -0700
@@ -207,6 +207,8 @@
      * Sets the method that should be used to read an indexed property value.
      *
      * @param readMethod The new indexed read method.
+     * @throws IntrospectionException if an exception occurs during
+     * introspection.
      */
     public synchronized void setIndexedReadMethod(Method readMethod)
         throws IntrospectionException {
@@ -285,6 +287,8 @@
      * Sets the method that should be used to write an indexed property value.
      *
      * @param writeMethod The new indexed write method.
+     * @throws IntrospectionException if an exception occurs during
+     * introspection.
      */
     public synchronized void setIndexedWriteMethod(Method writeMethod)
         throws IntrospectionException {
--- a/jdk/src/share/classes/java/beans/Introspector.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/Introspector.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,8 +93,17 @@
 public class Introspector {
 
     // Flags that can be used to control getBeanInfo:
+    /**
+     * Flag to indicate to use of all beaninfo.
+     */
     public final static int USE_ALL_BEANINFO           = 1;
+    /**
+     * Flag to indicate to ignore immediate beaninfo.
+     */
     public final static int IGNORE_IMMEDIATE_BEANINFO  = 2;
+    /**
+     * Flag to indicate to ignore all beaninfo.
+     */
     public final static int IGNORE_ALL_BEANINFO        = 3;
 
     // Static Caches to speed up introspection.
@@ -202,7 +211,7 @@
      * If the BeanInfo class for a Java Bean has been previously Introspected
      * based on the same arguments, then the BeanInfo class is retrieved
      * from the BeanInfo cache.
-     *
+     * @return the BeanInfo for the bean
      * @param beanClass The bean class to be analyzed.
      * @param stopClass The baseclass at which to stop the analysis.  Any
      *    methods/properties/events in the stopClass or in its baseclasses
--- a/jdk/src/share/classes/java/beans/PersistenceDelegate.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/PersistenceDelegate.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -197,6 +197,7 @@
      * The default implementation, calls the <code>initialize</code>
      * method of the type's superclass.
      *
+     * @param type the type of the instances
      * @param oldInstance The instance to be copied.
      * @param newInstance The instance that is to be modified.
      * @param out The stream to which any initialization statements should be written.
--- a/jdk/src/share/classes/java/beans/PropertyChangeSupport.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/PropertyChangeSupport.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -156,7 +156,7 @@
      * <code>PropertyChangeListenerProxy</code>, perform the cast, and examine
      * the parameter.
      *
-     * <pre>
+     * <pre>{@code
      * PropertyChangeListener[] listeners = bean.getPropertyChangeListeners();
      * for (int i = 0; i < listeners.length; i++) {
      *   if (listeners[i] instanceof PropertyChangeListenerProxy) {
@@ -168,7 +168,7 @@
      *     }
      *   }
      * }
-     *</pre>
+     * }</pre>
      *
      * @see PropertyChangeListenerProxy
      * @return all of the <code>PropertyChangeListeners</code> added or an
--- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Tue Aug 13 18:34:12 2013 -0700
@@ -243,6 +243,7 @@
      * Sets the method that should be used to read the property value.
      *
      * @param readMethod The new read method.
+     * @throws IntrospectionException if the read method is invalid
      */
     public synchronized void setReadMethod(Method readMethod)
                                 throws IntrospectionException {
@@ -313,6 +314,7 @@
      * Sets the method that should be used to write the property value.
      *
      * @param writeMethod The new write method.
+     * @throws IntrospectionException if the write method is invalid
      */
     public synchronized void setWriteMethod(Method writeMethod)
                                 throws IntrospectionException {
--- a/jdk/src/share/classes/java/beans/Transient.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/Transient.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
  * A {@code true} value for the "transient" attribute
  * indicates to encoders derived from {@link Encoder}
  * that this feature should be ignored.
- * <p/>
+ * <p>
  * The {@code Transient} annotation may be be used
  * in any of the methods that are involved
  * in a {@link FeatureDescriptor} subclass
@@ -49,7 +49,7 @@
  * to put the annotation and it is this declaration
  * that takes precedence in the case of multiple annotations
  * being defined for the same feature.
- * <p/>
+ * <p>
  * To declare a feature non-transient in a class
  * whose superclass declares it transient,
  * use {@code @Transient(false)}.
@@ -64,5 +64,11 @@
 @Target({METHOD})
 @Retention(RUNTIME)
 public @interface Transient {
+    /**
+     * Returns whether or not the {@code Introspector} should
+     * construct artifacts for the annotated method.
+     * @return whether or not the {@code Introspector} should
+     * construct artifacts for the annotated method
+     */
     boolean value() default true;
 }
--- a/jdk/src/share/classes/java/beans/VetoableChangeSupport.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/VetoableChangeSupport.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -42,7 +42,7 @@
  * <p>
  * Here is an example of {@code VetoableChangeSupport} usage that follows
  * the rules and recommendations laid out in the JavaBeans&trade; specification:
- * <pre>
+ * <pre>{@code
  * public class MyBean {
  *     private final VetoableChangeSupport vcs = new VetoableChangeSupport(this);
  *
@@ -68,7 +68,7 @@
  *
  *     [...]
  * }
- * </pre>
+ * }</pre>
  * <p>
  * A {@code VetoableChangeSupport} instance is thread-safe.
  * <p>
@@ -156,7 +156,7 @@
      * <code>VetoableChangeListenerProxy</code>, perform the cast, and examine
      * the parameter.
      *
-     * <pre>
+     * <pre>{@code
      * VetoableChangeListener[] listeners = bean.getVetoableChangeListeners();
      * for (int i = 0; i < listeners.length; i++) {
      *        if (listeners[i] instanceof VetoableChangeListenerProxy) {
@@ -168,7 +168,7 @@
      *     }
      *   }
      * }
-     *</pre>
+     * }</pre>
      *
      * @see VetoableChangeListenerProxy
      * @return all of the <code>VetoableChangeListeners</code> added or an
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContext.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContext.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,10 +64,12 @@
      * and is defined by the
      * <code>java.beans.Beans.instantiate()</code> method.
      *
+     * @return a javaBean named as a child of this
+     * <code>BeanContext</code>
      * @param beanName The name of the JavaBean to instantiate
      * as a child of this <code>BeanContext</code>
-     * @throws <code>IOException</code>
-     * @throws <code>ClassNotFoundException</code> if the class identified
+     * @throws IOException if an IO problem occurs
+     * @throws ClassNotFoundException if the class identified
      * by the beanName parameter is not found
      */
     Object instantiateChild(String beanName) throws IOException, ClassNotFoundException;
@@ -83,7 +85,7 @@
      * @return an <code>InputStream</code> for reading the resource,
      * or <code>null</code> if the resource could not
      * be found.
-     * @throws <code>IllegalArgumentException</code> if
+     * @throws IllegalArgumentException if
      * the resource is not valid
      */
     InputStream getResourceAsStream(String name, BeanContextChild bcc) throws IllegalArgumentException;
@@ -98,7 +100,7 @@
      * @param bcc the specified child
      * @return a <code>URL</code> for the named
      * resource for the specified child
-     * @throws <code>IllegalArgumentException</code>
+     * @throws IllegalArgumentException
      * if the resource is not valid
      */
     URL getResource(String name, BeanContextChild bcc) throws IllegalArgumentException;
@@ -109,7 +111,7 @@
       * this <code>BeanContext</code> whenever it adds
       * or removes a child <code>Component</code>(s).
       *
-      * @param bcml the <code>BeanContextMembershipListener</code> to be added
+      * @param bcml the BeanContextMembershipListener to be added
       */
     void addBeanContextMembershipListener(BeanContextMembershipListener bcml);
 
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextChild.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextChild.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -82,7 +82,7 @@
      * </p>
      * @param bc The <code>BeanContext</code> with which
      * to associate this <code>BeanContextChild</code>.
-     * @throws <code>PropertyVetoException</code> if the
+     * @throws PropertyVetoException if the
      * addition of the specified <code>BeanContext</code> is refused.
      */
     void setBeanContext(BeanContext bc) throws PropertyVetoException;
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java	Tue Aug 13 18:34:12 2013 -0700
@@ -78,6 +78,7 @@
      * construct a BeanContextChildSupport where the JavaBean component
      * itself implements BeanContextChild, and encapsulates this, delegating
      * that interface to this implementation
+     * @param bcc the underlying bean context child
      */
 
     public BeanContextChildSupport(BeanContextChild bcc) {
@@ -94,7 +95,7 @@
      * this <code>BeanContextChildSupport</code>.
      * @param bc the new value to be assigned to the <code>BeanContext</code>
      * property
-     * @throws <code>PropertyVetoException</code> if the change is rejected
+     * @throws PropertyVetoException if the change is rejected
      */
     public synchronized void setBeanContext(BeanContext bc) throws PropertyVetoException {
         if (bc == beanContext) return;
@@ -361,6 +362,9 @@
     */
     protected VetoableChangeSupport vcSupport;
 
+    /**
+     * The bean context.
+     */
     protected transient BeanContext           beanContext;
 
    /**
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,6 +103,7 @@
      * Is the child specified affected by the event?
      * @return <code>true</code> if affected, <code>false</code>
      * if not
+     * @param child the object to check for being affected
      */
     public boolean contains(Object child) {
         return children.contains(child);
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextServices.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServices.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, 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
@@ -60,6 +60,7 @@
      * @param serviceClass     the service to add
      * @param serviceProvider  the <code>BeanContextServiceProvider</code>
      * associated with the service
+     * @return true if the service was successful added, false otherwise
      */
     boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider);
 
@@ -108,7 +109,7 @@
      * @param bcsrl the
      * <code>BeanContextServiceRevokedListener</code> to notify
      * if the service should later become revoked
-     * @throws TooManyListenersException
+     * @throws TooManyListenersException if there are too many listeners
      * @return a reference to this context's named
      * Service as requested or <code>null</code>
      */
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, 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
@@ -603,12 +603,16 @@
                 serviceProvider = bcsp;
             }
 
+            /**
+             * Returns the service provider.
+             * @return the service provider
+             */
             protected BeanContextServiceProvider getServiceProvider() {
                 return serviceProvider;
             }
 
-            /*
-             * fields
+            /**
+             * The service provider.
              */
 
             protected BeanContextServiceProvider serviceProvider;
@@ -618,6 +622,9 @@
          * subclasses can override this method to create new subclasses of
          * BCSSServiceProvider without having to overrride addService() in
          * order to instantiate.
+         * @param sc the class
+         * @param bcsp the service provider
+         * @return a service provider without overriding addService()
          */
 
         protected BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp) {
@@ -629,7 +636,7 @@
     /**
      * add a BeanContextServicesListener
      *
-     * @throws NullPointerException
+     * @throws NullPointerException if the argument is null
      */
 
     public void addBeanContextServicesListener(BeanContextServicesListener bcsl) {
@@ -660,6 +667,8 @@
 
     /**
      * add a service
+     * @param serviceClass the service class
+     * @param bcsp the service provider
      */
 
     public boolean addService(Class serviceClass, BeanContextServiceProvider bcsp) {
@@ -668,6 +677,10 @@
 
     /**
      * add a service
+     * @param serviceClass the service class
+     * @param bcsp the service provider
+     * @param fireEvent whether or not an event should be fired
+     * @return true if the service was successfully added
      */
 
     protected boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) {
@@ -709,6 +722,9 @@
 
     /**
      * remove a service
+     * @param serviceClass the service class
+     * @param bcsp the service provider
+     * @param revokeCurrentServicesNow whether or not to revoke the service
      */
 
     public void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
@@ -1067,6 +1083,7 @@
 
     /**
      * Fires a <tt>BeanContextServiceEvent</tt> notifying of a new service.
+     * @param serviceClass the service class
      */
     protected final void fireServiceAdded(Class serviceClass) {
         BeanContextServiceAvailableEvent bcssae = new BeanContextServiceAvailableEvent(getBeanContextServicesPeer(), serviceClass);
@@ -1109,6 +1126,8 @@
      * Fires a <tt>BeanContextServiceRevokedEvent</tt>
      * indicating that a particular service is
      * no longer available.
+     * @param serviceClass the service class
+     * @param revokeNow whether or not the event should be revoked now
      */
     protected final void fireServiceRevoked(Class serviceClass, boolean revokeNow) {
         Object[]                       copy;
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,6 @@
 /**
  * This helper class provides a utility implementation of the
  * java.beans.beancontext.BeanContext interface.
- * </p>
  * <p>
  * Since this class directly implements the BeanContext interface, the class
  * can, and is intended to be used either by subclassing this implementation,
@@ -351,9 +350,8 @@
      * of Child without having to override add() or the other Collection
      * methods that add children to the set.
      * </p>
-     *
      * @param targetChild the child to create the Child on behalf of
-     * @param peer        the peer if the tragetChild and the peer are related by an implementation of BeanContextProxy
+     * @param peer        the peer if the tragetChild and the peer are related by an implementation of BeanContextProxy     * @return Subtype-specific subclass of Child without overriding collection methods
      */
 
     protected BCSChild createBCSChild(Object targetChild, Object peer) {
@@ -492,6 +490,7 @@
      * @param callChildSetBC used to indicate that
      * the child should be notified that it is no
      * longer nested in this <tt>BeanContext</tt>.
+     * @return whether or not was present before being removed
      */
     protected boolean remove(Object targetChild, boolean callChildSetBC) {
 
@@ -580,7 +579,8 @@
     /**
      * add Collection to set of Children (Unsupported)
      * implementations must synchronized on the hierarchy lock and "children" protected field
-     * @throws UnsupportedOperationException
+     * @throws UnsupportedOperationException thrown unconditionally by this implementation
+     * @return this implementation unconditionally throws {@code UnsupportedOperationException}
      */
     public boolean addAll(Collection c) {
         throw new UnsupportedOperationException();
@@ -589,7 +589,9 @@
     /**
      * remove all specified children (Unsupported)
      * implementations must synchronized on the hierarchy lock and "children" protected field
-     * @throws UnsupportedOperationException
+     * @throws UnsupportedOperationException thrown unconditionally by this implementation
+     * @return this implementation unconditionally throws {@code UnsupportedOperationException}
+
      */
     public boolean removeAll(Collection c) {
         throw new UnsupportedOperationException();
@@ -599,7 +601,8 @@
     /**
      * retain only specified children (Unsupported)
      * implementations must synchronized on the hierarchy lock and "children" protected field
-     * @throws UnsupportedOperationException
+     * @throws UnsupportedOperationException thrown unconditionally by this implementation
+     * @return this implementation unconditionally throws {@code UnsupportedOperationException}
      */
     public boolean retainAll(Collection c) {
         throw new UnsupportedOperationException();
@@ -608,7 +611,7 @@
     /**
      * clear the children (Unsupported)
      * implementations must synchronized on the hierarchy lock and "children" protected field
-     * @throws UnsupportedOperationException
+     * @throws UnsupportedOperationException thrown unconditionally by this implementation
      */
     public void clear() {
         throw new UnsupportedOperationException();
@@ -618,7 +621,7 @@
      * Adds a BeanContextMembershipListener
      *
      * @param  bcml the BeanContextMembershipListener to add
-     * @throws NullPointerException
+     * @throws NullPointerException if the argument is null
      */
 
     public void addBeanContextMembershipListener(BeanContextMembershipListener bcml) {
@@ -636,7 +639,7 @@
      * Removes a BeanContextMembershipListener
      *
      * @param  bcml the BeanContextMembershipListener to remove
-     * @throws NullPointerException
+     * @throws NullPointerException if the argument is null
      */
 
     public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml) {
@@ -655,7 +658,7 @@
      * @param bcc  the child object making the request.
      *
      * @return  the requested resource as an InputStream
-     * @throws  NullPointerException
+     * @throws  NullPointerException if the argument is null
      */
 
     public InputStream getResourceAsStream(String name, BeanContextChild bcc) {
@@ -849,6 +852,8 @@
      *
      * This method should not however be used by subclasses to replace their
      * own implementation (if any) of writeObject().
+     * @param oos the {@code ObjectOutputStream} to use during serialization
+     * @throws IOException if serialization failed
      */
 
     protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException {
@@ -864,6 +869,9 @@
      *
      * This method should not however be used by subclasses to replace their
      * own implementation (if any) of readObject().
+     * @param ois the {@code ObjectInputStream} to use during deserialization
+     * @throws IOException if deserialization failed
+     * @throws ClassNotFoundException if needed classes are not found
      */
 
     protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException {
@@ -914,6 +922,8 @@
      * used by readObject to deserialize a collection.
      * @param ois the ObjectInputStream to use
      * @param coll the Collection
+     * @throws IOException if deserialization failed
+     * @throws ClassNotFoundException if needed classes are not found
      */
     protected final void deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException {
         int count = 0;
@@ -1005,6 +1015,9 @@
      * When an instance of this class is used as a delegate for the
      * implementation of the BeanContext protocols (and its subprotocols)
      * there exists a 'chicken and egg' problem during deserialization
+     * @param ois the ObjectInputStream to use
+     * @throws IOException if deserialization failed
+     * @throws ClassNotFoundException if needed classes are not found
      */
 
     public final void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException {
@@ -1122,6 +1135,7 @@
      * immediately prior to their being added to the BeanContext.
      * </p>
      *
+     * @param targetChild the child to create the Child on behalf of
      * @return true iff the child may be added to this BeanContext, otherwise false.
      */
 
@@ -1136,6 +1150,7 @@
      * immediately prior to their being removed from the BeanContext.
      * </p>
      *
+     * @param targetChild the child to create the Child on behalf of
      * @return true iff the child may be removed from this BeanContext, otherwise false.
      */
 
@@ -1147,6 +1162,8 @@
      * subclasses may override this method to simply extend add() semantics
      * after the child has been added and before the event notification has
      * occurred. The method is called with the child synchronized.
+     * @param child the child
+     * @param bcsc the BCSChild
      */
 
     protected void childJustAddedHook(Object child, BCSChild bcsc) {
@@ -1156,6 +1173,8 @@
      * subclasses may override this method to simply extend remove() semantics
      * after the child has been removed and before the event notification has
      * occurred. The method is called with the child synchronized.
+     * @param child the child
+     * @param bcsc the BCSChild
      */
 
     protected void childJustRemovedHook(Object child, BCSChild bcsc) {
@@ -1254,6 +1273,7 @@
 
     /**
      * Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
+     * @param bcme the event to fire
      */
 
     protected final void fireChildrenAdded(BeanContextMembershipEvent bcme) {
@@ -1267,6 +1287,7 @@
 
     /**
      * Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
+     * @param bcme the event to fire
      */
 
     protected final void fireChildrenRemoved(BeanContextMembershipEvent bcme) {
--- a/jdk/src/share/classes/java/net/SocketAddress.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/net/SocketAddress.java	Tue Aug 13 18:34:12 2013 -0700
@@ -39,4 +39,7 @@
  * @since 1.4
  */
 public abstract class SocketAddress implements java.io.Serializable {
+
+    static final long serialVersionUID = 5215720748342549866L;
+
 }
--- a/jdk/src/share/classes/java/nio/file/Files.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/nio/file/Files.java	Tue Aug 13 18:34:12 2013 -0700
@@ -25,10 +25,10 @@
 
 package java.nio.file;
 
-import java.nio.ByteBuffer;
 import java.nio.file.attribute.*;
 import java.nio.file.spi.FileSystemProvider;
 import java.nio.file.spi.FileTypeDetector;
+import java.nio.channels.Channels;
 import java.nio.channels.FileChannel;
 import java.nio.channels.SeekableByteChannel;
 import java.io.Closeable;
@@ -2965,7 +2965,63 @@
     }
 
     /**
-     * Read all the bytes from a file. The method ensures that the file is
+     * The maximum size of array to allocate.
+     * Some VMs reserve some header words in an array.
+     * Attempts to allocate larger arrays may result in
+     * OutOfMemoryError: Requested array size exceeds VM limit
+     */
+    private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
+
+    /**
+     * Reads all the bytes from an input stream. Uses {@code initialSize} as a hint
+     * about how many bytes the stream will have.
+     *
+     * @param   source
+     *          the input stream to read from
+     * @param   initialSize
+     *          the initial size of the byte array to allocate
+     *
+     * @return  a byte array containing the bytes read from the file
+     *
+     * @throws  IOException
+     *          if an I/O error occurs reading from the stream
+     * @throws  OutOfMemoryError
+     *          if an array of the required size cannot be allocated
+     */
+    private static byte[] read(InputStream source, int initialSize)
+            throws IOException
+    {
+        int capacity = initialSize;
+        byte[] buf = new byte[capacity];
+        int nread = 0;
+        int n;
+        for (;;) {
+            // read to EOF which may read more or less than initialSize (eg: file
+            // is truncated while we are reading)
+            while ((n = source.read(buf, nread, capacity - nread)) > 0)
+                nread += n;
+
+            // if last call to source.read() returned -1, we are done
+            // otherwise, try to read one more byte; if that failed we're done too
+            if (n < 0 || (n = source.read()) < 0)
+                break;
+
+            // one more byte was read; need to allocate a larger buffer
+            if (capacity <= MAX_BUFFER_SIZE - capacity) {
+                capacity = Math.max(capacity << 1, BUFFER_SIZE);
+            } else {
+                if (capacity == MAX_BUFFER_SIZE)
+                    throw new OutOfMemoryError("Required array size too large");
+                capacity = MAX_BUFFER_SIZE;
+            }
+            buf = Arrays.copyOf(buf, capacity);
+            buf[nread++] = (byte)n;
+        }
+        return (capacity == nread) ? buf : Arrays.copyOf(buf, nread);
+    }
+
+    /**
+     * Reads all the bytes from a file. The method ensures that the file is
      * closed when all bytes have been read or an I/O error, or other runtime
      * exception, is thrown.
      *
@@ -2989,22 +3045,13 @@
      *          method is invoked to check read access to the file.
      */
     public static byte[] readAllBytes(Path path) throws IOException {
-        try (FileChannel fc = FileChannel.open(path)) {
+        try (FileChannel fc = FileChannel.open(path);
+             InputStream is = Channels.newInputStream(fc)) {
             long size = fc.size();
-            if (size > (long)Integer.MAX_VALUE)
+            if (size > (long)MAX_BUFFER_SIZE)
                 throw new OutOfMemoryError("Required array size too large");
 
-            byte[] arr = new byte[(int)size];
-            ByteBuffer bb = ByteBuffer.wrap(arr);
-            while (bb.hasRemaining()) {
-                if (fc.read(bb) < 0) {
-                    // truncated
-                    break;
-                }
-            }
-
-            int nread = bb.position();
-            return (nread == size) ? arr : Arrays.copyOf(arr, nread);
+            return read(is, (int)size);
         }
     }
 
--- a/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2002, 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,15 +33,47 @@
  * in order to obtain client and server sockets for RMI calls.  An
  * application may use the <code>setSocketFactory</code> method to
  * request that the RMI runtime use its socket factory instance
- * instead of the default implementation.<p>
+ * instead of the default implementation.
  *
- * The default socket factory implementation used goes through a
+ * <p>The default socket factory implementation performs a
  * three-tiered approach to creating client sockets. First, a direct
  * socket connection to the remote VM is attempted.  If that fails
  * (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.<p>
+ * to POST the RMI call.
+ *
+ * <p>The default socket factory implementation creates server sockets that
+ * are bound to the wildcard address, which accepts requests from all network
+ * interfaces.
+ *
+ * @implNote
+ * <p>You can use the {@code RMISocketFactory} class to create a server socket that
+ * is bound to a specific address, restricting the origin of requests. For example,
+ * the following code implements a socket factory that binds server sockets to the
+ * loopback address. This restricts RMI to processing requests only from the local host.
+ *
+ * <pre>{@code
+ *     class LoopbackSocketFactory extends RMISocketFactory {
+ *         public ServerSocket createServerSocket(int port) throws IOException {
+ *             return new ServerSocket(port, 5, InetAddress.getLoopbackAddress());
+ *         }
+ *
+ *         public Socket createSocket(String host, int port) throws IOException {
+ *             // just call the default client socket factory
+ *             return RMISocketFactory.getDefaultSocketFactory()
+ *                                    .createSocket(host, port);
+ *         }
+ *     }
+ *
+ *     // ...
+ *
+ *     RMISocketFactory.setSocketFactory(new LoopbackSocketFactory());
+ * }</pre>
+ *
+ * Set the {@code java.rmi.server.hostname} system property
+ * to a host name (typically {@code localhost}) that resolves to the loopback
+ * interface to ensure that the generated stubs use the right network interface.
  *
  * @author  Ann Wollrath
  * @author  Peter Jones
--- a/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java	Tue Aug 13 18:34:12 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
@@ -100,6 +100,26 @@
  * </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
+ * 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>
+ * in the
+ * <a href="{@docRoot}/../platform/rmi/spec/rmiTOC.html">Java RMI Specification</a>.
+ *
  * @author  Ann Wollrath
  * @author  Peter Jones
  * @since   JDK1.1
--- a/jdk/src/share/classes/java/security/Security.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/security/Security.java	Tue Aug 13 18:34:12 2013 -0700
@@ -326,17 +326,13 @@
      *
      * <p>A provider cannot be added if it is already installed.
      *
-     * <p>First, if there is a security manager, its
-     * {@code checkSecurityAccess}
-     * method is called with the string
-     * {@code "insertProvider."+provider.getName()}
-     * to see if it's ok to add a new provider.
-     * If the default implementation of {@code checkSecurityAccess}
-     * is used (i.e., that method is not overriden), then this will result in
-     * a call to the security manager's {@code checkPermission} method
-     * with a
-     * {@code SecurityPermission("insertProvider."+provider.getName())}
-     * permission.
+     * <p>If there is a security manager, the
+     * {@link java.lang.SecurityManager#checkSecurityAccess} method is called
+     * with the {@code "insertProvider"} permission target name to see if
+     * it's ok to add a new provider. If this permission check is denied,
+     * {@code checkSecurityAccess} is called again with the
+     * {@code "insertProvider."+provider.getName()} permission target name. If
+     * both checks are denied, a {@code SecurityException} is thrown.
      *
      * @param provider the provider to be added.
      *
@@ -360,7 +356,7 @@
     public static synchronized int insertProviderAt(Provider provider,
             int position) {
         String providerName = provider.getName();
-        check("insertProvider." + providerName);
+        checkInsertProvider(providerName);
         ProviderList list = Providers.getFullProviderList();
         ProviderList newList = ProviderList.insertAt(list, provider, position - 1);
         if (list == newList) {
@@ -373,17 +369,13 @@
     /**
      * Adds a provider to the next position available.
      *
-     * <p>First, if there is a security manager, its
-     * {@code checkSecurityAccess}
-     * method is called with the string
-     * {@code "insertProvider."+provider.getName()}
-     * to see if it's ok to add a new provider.
-     * If the default implementation of {@code checkSecurityAccess}
-     * is used (i.e., that method is not overriden), then this will result in
-     * a call to the security manager's {@code checkPermission} method
-     * with a
-     * {@code SecurityPermission("insertProvider."+provider.getName())}
-     * permission.
+     * <p>If there is a security manager, the
+     * {@link java.lang.SecurityManager#checkSecurityAccess} method is called
+     * with the {@code "insertProvider"} permission target name to see if
+     * it's ok to add a new provider. If this permission check is denied,
+     * {@code checkSecurityAccess} is called again with the
+     * {@code "insertProvider."+provider.getName()} permission target name. If
+     * both checks are denied, a {@code SecurityException} is thrown.
      *
      * @param provider the provider to be added.
      *
@@ -863,6 +855,23 @@
         }
     }
 
+    private static void checkInsertProvider(String name) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            try {
+                security.checkSecurityAccess("insertProvider");
+            } catch (SecurityException se1) {
+                try {
+                    security.checkSecurityAccess("insertProvider." + name);
+                } catch (SecurityException se2) {
+                    // throw first exception, but add second to suppressed
+                    se1.addSuppressed(se2);
+                    throw se1;
+                }
+            }
+        }
+    }
+
     /*
     * Returns all providers who satisfy the specified
     * criterion.
--- a/jdk/src/share/classes/java/security/SecurityPermission.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/security/SecurityPermission.java	Tue Aug 13 18:34:12 2013 -0700
@@ -130,14 +130,17 @@
  * </tr>
  *
  * <tr>
- *   <td>insertProvider.{provider name}</td>
- *   <td>Addition of a new provider, with the specified name</td>
+ *   <td>insertProvider</td>
+ *   <td>Addition of a new provider</td>
  *   <td>This would allow somebody to introduce a possibly
  * malicious provider (e.g., one that discloses the private keys passed
  * to it) as the highest-priority provider. This would be possible
  * because the Security object (which manages the installed providers)
  * currently does not check the integrity or authenticity of a provider
- * before attaching it.</td>
+ * before attaching it. The "insertProvider" permission subsumes the
+ * "insertProvider.{provider name}" permission (see the section below for
+ * more information).
+ * </td>
  * </tr>
  *
  * <tr>
@@ -186,9 +189,10 @@
  * </table>
  *
  * <P>
- * The following permissions are 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.
+ * The following permissions have been superseded by newer permissions or are
+ * 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">
@@ -199,6 +203,23 @@
  * </tr>
  *
  * <tr>
+ *   <td>insertProvider.{provider name}</td>
+ *   <td>Addition of a new provider, with the specified name</td>
+ *   <td>Use of this permission is discouraged from further use because it is
+ * possible to circumvent the name restrictions by overriding the
+ * {@link java.security.Provider#getName} method. Also, there is an equivalent
+ * level of risk associated with granting code permission to insert a provider
+ * with a specific name, or any name it chooses. Users should use the
+ * "insertProvider" permission instead.
+ * <p>This would allow somebody to introduce a possibly
+ * malicious provider (e.g., one that discloses the private keys passed
+ * to it) as the highest-priority provider. This would be possible
+ * because the Security object (which manages the installed providers)
+ * currently does not check the integrity or authenticity of a provider
+ * before attaching it.</td>
+ * </tr>
+ *
+ * <tr>
  *   <td>setSystemScope</td>
  *   <td>Setting of the system identity scope</td>
  *   <td>This would allow an attacker to configure the system identity scope with
@@ -306,7 +327,6 @@
      * @throws NullPointerException if {@code name} is {@code null}.
      * @throws IllegalArgumentException if {@code name} is empty.
      */
-
     public SecurityPermission(String name)
     {
         super(name);
@@ -323,7 +343,6 @@
      * @throws NullPointerException if {@code name} is {@code null}.
      * @throws IllegalArgumentException if {@code name} is empty.
      */
-
     public SecurityPermission(String name, String actions)
     {
         super(name, actions);
--- a/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java	Tue Aug 13 18:34:12 2013 -0700
@@ -128,6 +128,7 @@
             this.lo = lo; this.hi = hi;
         }
 
+        @SuppressWarnings("unchecked")
         public final void compute() {
             final BinaryOperator<T> fn;
             final T[] a;
@@ -692,6 +693,4 @@
             }
         }
     }
-
-
-}
\ No newline at end of file
+}
--- a/jdk/src/share/classes/java/util/Collections.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Collections.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1143,6 +1143,7 @@
         public boolean removeIf(Predicate<? super E> filter) {
             throw new UnsupportedOperationException();
         }
+        @SuppressWarnings("unchecked")
         @Override
         public Spliterator<E> spliterator() {
             return (Spliterator<E>)c.spliterator();
@@ -1900,7 +1901,7 @@
 
             private static final long serialVersionUID = -2239321462712562324L;
 
-            EmptyNavigableMap()                       { super(new TreeMap()); }
+            EmptyNavigableMap()                       { super(new TreeMap<K,V>()); }
 
             @Override
             public NavigableSet<K> navigableKeySet()
@@ -1928,46 +1929,52 @@
         public K ceilingKey(K key)               { return nm.ceilingKey(key); }
         public K higherKey(K key)                 { return nm.higherKey(key); }
 
+        @SuppressWarnings("unchecked")
         public Entry<K, V> lowerEntry(K key) {
             Entry<K,V> lower = (Entry<K, V>) nm.lowerEntry(key);
             return (null != lower)
-                ? new UnmodifiableEntrySet.UnmodifiableEntry(lower)
+                ? new UnmodifiableEntrySet.UnmodifiableEntry<>(lower)
                 : null;
         }
 
+        @SuppressWarnings("unchecked")
         public Entry<K, V> floorEntry(K key) {
             Entry<K,V> floor = (Entry<K, V>) nm.floorEntry(key);
             return (null != floor)
-                ? new UnmodifiableEntrySet.UnmodifiableEntry(floor)
+                ? new UnmodifiableEntrySet.UnmodifiableEntry<>(floor)
                 : null;
         }
 
+        @SuppressWarnings("unchecked")
         public Entry<K, V> ceilingEntry(K key) {
             Entry<K,V> ceiling = (Entry<K, V>) nm.ceilingEntry(key);
             return (null != ceiling)
-                ? new UnmodifiableEntrySet.UnmodifiableEntry(ceiling)
+                ? new UnmodifiableEntrySet.UnmodifiableEntry<>(ceiling)
                 : null;
         }
 
 
+        @SuppressWarnings("unchecked")
         public Entry<K, V> higherEntry(K key) {
             Entry<K,V> higher = (Entry<K, V>) nm.higherEntry(key);
             return (null != higher)
-                ? new UnmodifiableEntrySet.UnmodifiableEntry(higher)
+                ? new UnmodifiableEntrySet.UnmodifiableEntry<>(higher)
                 : null;
         }
 
+        @SuppressWarnings("unchecked")
         public Entry<K, V> firstEntry() {
             Entry<K,V> first = (Entry<K, V>) nm.firstEntry();
             return (null != first)
-                ? new UnmodifiableEntrySet.UnmodifiableEntry(first)
+                ? new UnmodifiableEntrySet.UnmodifiableEntry<>(first)
                 : null;
         }
 
+        @SuppressWarnings("unchecked")
         public Entry<K, V> lastEntry() {
             Entry<K,V> last = (Entry<K, V>) nm.lastEntry();
             return (null != last)
-                ? new UnmodifiableEntrySet.UnmodifiableEntry(last)
+                ? new UnmodifiableEntrySet.UnmodifiableEntry<>(last)
                 : null;
         }
 
@@ -2360,7 +2367,7 @@
         }
         public NavigableSet<E> tailSet(E fromElement) {
             synchronized (mutex) {
-                return new SynchronizedNavigableSet(ns.tailSet(fromElement, true), mutex);
+                return new SynchronizedNavigableSet<>(ns.tailSet(fromElement, true), mutex);
             }
         }
 
@@ -2925,7 +2932,7 @@
         public NavigableMap<K, V> descendingMap() {
             synchronized (mutex) {
                 return
-                    new SynchronizedNavigableMap(nm.descendingMap(), mutex);
+                    new SynchronizedNavigableMap<>(nm.descendingMap(), mutex);
             }
         }
 
@@ -2935,13 +2942,13 @@
 
         public NavigableSet<K> navigableKeySet() {
             synchronized (mutex) {
-                return new SynchronizedNavigableSet(nm.navigableKeySet(), mutex);
+                return new SynchronizedNavigableSet<>(nm.navigableKeySet(), mutex);
             }
         }
 
         public NavigableSet<K> descendingKeySet() {
             synchronized (mutex) {
-                return new SynchronizedNavigableSet(nm.descendingKeySet(), mutex);
+                return new SynchronizedNavigableSet<>(nm.descendingKeySet(), mutex);
             }
         }
 
@@ -2959,27 +2966,27 @@
         }
         public SortedMap<K,V> tailMap(K fromKey) {
             synchronized (mutex) {
-               return new SynchronizedNavigableMap<>(nm.tailMap(fromKey, true),mutex);
+        return new SynchronizedNavigableMap<>(nm.tailMap(fromKey, true),mutex);
             }
         }
 
         public NavigableMap<K, V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) {
             synchronized (mutex) {
-                return new SynchronizedNavigableMap(
+                return new SynchronizedNavigableMap<>(
                     nm.subMap(fromKey, fromInclusive, toKey, toInclusive), mutex);
             }
         }
 
         public NavigableMap<K, V> headMap(K toKey, boolean inclusive) {
             synchronized (mutex) {
-                return new SynchronizedNavigableMap(
+                return new SynchronizedNavigableMap<>(
                         nm.headMap(toKey, inclusive), mutex);
             }
         }
 
         public NavigableMap<K, V> tailMap(K fromKey, boolean inclusive) {
             synchronized (mutex) {
-                return new SynchronizedNavigableMap(
+                return new SynchronizedNavigableMap<>(
                     nm.tailMap(fromKey, inclusive), mutex);
             }
         }
@@ -4081,7 +4088,7 @@
         public Entry<K, V> lowerEntry(K key) {
             Entry<K,V> lower = nm.lowerEntry(key);
             return (null != lower)
-                ? new CheckedMap.CheckedEntrySet.CheckedEntry(lower, valueType)
+                ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(lower, valueType)
                 : null;
         }
 
@@ -4090,7 +4097,7 @@
         public Entry<K, V> floorEntry(K key) {
             Entry<K,V> floor = nm.floorEntry(key);
             return (null != floor)
-                ? new CheckedMap.CheckedEntrySet.CheckedEntry(floor, valueType)
+                ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(floor, valueType)
                 : null;
         }
 
@@ -4099,7 +4106,7 @@
         public Entry<K, V> ceilingEntry(K key) {
             Entry<K,V> ceiling = nm.ceilingEntry(key);
             return (null != ceiling)
-                ? new CheckedMap.CheckedEntrySet.CheckedEntry(ceiling, valueType)
+                ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(ceiling, valueType)
                 : null;
         }
 
@@ -4108,7 +4115,7 @@
         public Entry<K, V> higherEntry(K key) {
             Entry<K,V> higher = nm.higherEntry(key);
             return (null != higher)
-                ? new CheckedMap.CheckedEntrySet.CheckedEntry(higher, valueType)
+                ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(higher, valueType)
                 : null;
         }
 
@@ -4117,14 +4124,14 @@
         public Entry<K, V> firstEntry() {
             Entry<K,V> first = nm.firstEntry();
             return (null != first)
-                ? new CheckedMap.CheckedEntrySet.CheckedEntry(first, valueType)
+                ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(first, valueType)
                 : null;
         }
 
         public Entry<K, V> lastEntry() {
             Entry<K,V> last = nm.lastEntry();
             return (null != last)
-                ? new CheckedMap.CheckedEntrySet.CheckedEntry(last, valueType)
+                ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(last, valueType)
                 : null;
         }
 
@@ -4132,14 +4139,14 @@
             Entry<K,V> entry = nm.pollFirstEntry();
             return (null == entry)
                 ? null
-                : new CheckedMap.CheckedEntrySet.CheckedEntry(entry, valueType);
+                : new CheckedMap.CheckedEntrySet.CheckedEntry<>(entry, valueType);
         }
 
         public Entry<K, V> pollLastEntry() {
             Entry<K,V> entry = nm.pollLastEntry();
             return (null == entry)
                 ? null
-                : new CheckedMap.CheckedEntrySet.CheckedEntry(entry, valueType);
+                : new CheckedMap.CheckedEntrySet.CheckedEntry<>(entry, valueType);
         }
 
         public NavigableMap<K, V> descendingMap() {
--- a/jdk/src/share/classes/java/util/Comparator.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Comparator.java	Tue Aug 13 18:34:12 2013 -0700
@@ -352,6 +352,7 @@
      * @see Comparable
      * @since 1.8
      */
+    @SuppressWarnings("unchecked")
     public static <T extends Comparable<? super T>> Comparator<T> naturalOrder() {
         return (Comparator<T>) Comparators.NaturalOrderComparator.INSTANCE;
     }
@@ -374,7 +375,7 @@
      * @since 1.8
      */
     public static <T> Comparator<T> nullsFirst(Comparator<? super T> comparator) {
-        return new Comparators.NullComparator(true, comparator);
+        return new Comparators.NullComparator<>(true, comparator);
     }
 
     /**
@@ -395,7 +396,7 @@
      * @since 1.8
      */
     public static <T> Comparator<T> nullsLast(Comparator<? super T> comparator) {
-        return new Comparators.NullComparator(false, comparator);
+        return new Comparators.NullComparator<>(false, comparator);
     }
 
     /**
--- a/jdk/src/share/classes/java/util/Comparators.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Comparators.java	Tue Aug 13 18:34:12 2013 -0700
@@ -87,12 +87,12 @@
         @Override
         public Comparator<T> thenComparing(Comparator<? super T> other) {
             Objects.requireNonNull(other);
-            return new NullComparator(nullFirst, real == null ? other : real.thenComparing(other));
+            return new NullComparator<>(nullFirst, real == null ? other : real.thenComparing(other));
         }
 
         @Override
         public Comparator<T> reversed() {
-            return new NullComparator(!nullFirst, real == null ? null : real.reversed());
+            return new NullComparator<>(!nullFirst, real == null ? null : real.reversed());
         }
     }
 }
--- a/jdk/src/share/classes/java/util/Deque.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Deque.java	Tue Aug 13 18:34:12 2013 -0700
@@ -38,7 +38,7 @@
 /**
  * A linear collection that supports element insertion and removal at
  * both ends.  The name <i>deque</i> is short for "double ended queue"
- * and is usually pronounced "deck".  Most <tt>Deque</tt>
+ * and is usually pronounced "deck".  Most {@code Deque}
  * implementations place no fixed limits on the number of elements
  * they may contain, but this interface supports capacity-restricted
  * deques as well as those with no fixed size limit.
@@ -47,10 +47,10 @@
  * ends of the deque.  Methods are provided to insert, remove, and
  * examine the element.  Each of these methods exists in two forms:
  * one throws an exception if the operation fails, the other returns a
- * special value (either <tt>null</tt> or <tt>false</tt>, depending on
+ * special value (either {@code null} or {@code false}, depending on
  * the operation).  The latter form of the insert operation is
  * designed specifically for use with capacity-restricted
- * <tt>Deque</tt> implementations; in most implementations, insert
+ * {@code Deque} implementations; in most implementations, insert
  * operations cannot fail.
  *
  * <p>The twelve methods described above are summarized in the
@@ -58,6 +58,7 @@
  *
  * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <caption>Summary of Deque methods</caption>
  *  <tr>
  *    <td></td>
  *    <td ALIGN=CENTER COLSPAN = 2> <b>First Element (Head)</b></td>
@@ -72,38 +73,39 @@
  *  </tr>
  *  <tr>
  *    <td><b>Insert</b></td>
- *    <td>{@link #addFirst addFirst(e)}</td>
- *    <td>{@link #offerFirst offerFirst(e)}</td>
- *    <td>{@link #addLast addLast(e)}</td>
- *    <td>{@link #offerLast offerLast(e)}</td>
+ *    <td>{@link Deque#addFirst addFirst(e)}</td>
+ *    <td>{@link Deque#offerFirst offerFirst(e)}</td>
+ *    <td>{@link Deque#addLast addLast(e)}</td>
+ *    <td>{@link Deque#offerLast offerLast(e)}</td>
  *  </tr>
  *  <tr>
  *    <td><b>Remove</b></td>
- *    <td>{@link #removeFirst removeFirst()}</td>
- *    <td>{@link #pollFirst pollFirst()}</td>
- *    <td>{@link #removeLast removeLast()}</td>
- *    <td>{@link #pollLast pollLast()}</td>
+ *    <td>{@link Deque#removeFirst removeFirst()}</td>
+ *    <td>{@link Deque#pollFirst pollFirst()}</td>
+ *    <td>{@link Deque#removeLast removeLast()}</td>
+ *    <td>{@link Deque#pollLast pollLast()}</td>
  *  </tr>
  *  <tr>
  *    <td><b>Examine</b></td>
- *    <td>{@link #getFirst getFirst()}</td>
- *    <td>{@link #peekFirst peekFirst()}</td>
- *    <td>{@link #getLast getLast()}</td>
- *    <td>{@link #peekLast peekLast()}</td>
+ *    <td>{@link Deque#getFirst getFirst()}</td>
+ *    <td>{@link Deque#peekFirst peekFirst()}</td>
+ *    <td>{@link Deque#getLast getLast()}</td>
+ *    <td>{@link Deque#peekLast peekLast()}</td>
  *  </tr>
  * </table>
  *
  * <p>This interface extends the {@link Queue} interface.  When a deque is
  * used as a queue, FIFO (First-In-First-Out) behavior results.  Elements are
  * added at the end of the deque and removed from the beginning.  The methods
- * inherited from the <tt>Queue</tt> interface are precisely equivalent to
- * <tt>Deque</tt> methods as indicated in the following table:
+ * 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>
- *    <td ALIGN=CENTER> <b><tt>Queue</tt> Method</b></td>
- *    <td ALIGN=CENTER> <b>Equivalent <tt>Deque</tt> Method</b></td>
+ *    <td ALIGN=CENTER> <b>{@code Queue} Method</b></td>
+ *    <td ALIGN=CENTER> <b>Equivalent {@code Deque} Method</b></td>
  *  </tr>
  *  <tr>
  *    <td>{@link java.util.Queue#add add(e)}</td>
@@ -135,13 +137,14 @@
  * interface should be used in preference to the legacy {@link Stack} class.
  * When a deque is used as a stack, elements are pushed and popped from the
  * beginning of the deque.  Stack methods are precisely equivalent to
- * <tt>Deque</tt> methods as indicated in the table below:
+ * {@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>
  *    <td ALIGN=CENTER> <b>Stack Method</b></td>
- *    <td ALIGN=CENTER> <b>Equivalent <tt>Deque</tt> Method</b></td>
+ *    <td ALIGN=CENTER> <b>Equivalent {@code Deque} Method</b></td>
  *  </tr>
  *  <tr>
  *    <td>{@link #push push(e)}</td>
@@ -168,18 +171,18 @@
  * <p>Unlike the {@link List} interface, this interface does not
  * provide support for indexed access to elements.
  *
- * <p>While <tt>Deque</tt> implementations are not strictly required
+ * <p>While {@code Deque} implementations are not strictly required
  * to prohibit the insertion of null elements, they are strongly
- * encouraged to do so.  Users of any <tt>Deque</tt> implementations
+ * encouraged to do so.  Users of any {@code Deque} implementations
  * that do allow null elements are strongly encouraged <i>not</i> to
  * take advantage of the ability to insert nulls.  This is so because
- * <tt>null</tt> is used as a special return value by various methods
+ * {@code null} is used as a special return value by various methods
  * to indicated that the deque is empty.
  *
- * <p><tt>Deque</tt> implementations generally do not define
- * element-based versions of the <tt>equals</tt> and <tt>hashCode</tt>
+ * <p>{@code Deque} implementations generally do not define
+ * element-based versions of the {@code equals} and {@code hashCode}
  * methods, but instead inherit the identity-based versions from class
- * <tt>Object</tt>.
+ * {@code Object}.
  *
  * <p>This interface is a member of the <a
  * href="{@docRoot}/../technotes/guides/collections/index.html"> Java Collections
@@ -190,13 +193,13 @@
  * @since  1.6
  * @param <E> the type of elements held in this collection
  */
-
 public interface Deque<E> extends Queue<E> {
     /**
      * Inserts the specified element at the front of this deque if it is
-     * possible to do so immediately without violating capacity restrictions.
-     * When using a capacity-restricted deque, it is generally preferable to
-     * use method {@link #offerFirst}.
+     * possible to do so immediately without violating capacity restrictions,
+     * throwing an {@code IllegalStateException} if no space is currently
+     * available.  When using a capacity-restricted deque, it is generally
+     * preferable to use method {@link #offerFirst}.
      *
      * @param e the element to add
      * @throws IllegalStateException if the element cannot be added at this
@@ -212,9 +215,10 @@
 
     /**
      * Inserts the specified element at the end of this deque if it is
-     * possible to do so immediately without violating capacity restrictions.
-     * When using a capacity-restricted deque, it is generally preferable to
-     * use method {@link #offerLast}.
+     * possible to do so immediately without violating capacity restrictions,
+     * throwing an {@code IllegalStateException} if no space is currently
+     * available.  When using a capacity-restricted deque, it is generally
+     * preferable to use method {@link #offerLast}.
      *
      * <p>This method is equivalent to {@link #add}.
      *
@@ -237,8 +241,8 @@
      * which can fail to insert an element only by throwing an exception.
      *
      * @param e the element to add
-     * @return <tt>true</tt> if the element was added to this deque, else
-     *         <tt>false</tt>
+     * @return {@code true} if the element was added to this deque, else
+     *         {@code false}
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this deque
      * @throws NullPointerException if the specified element is null and this
@@ -255,8 +259,8 @@
      * which can fail to insert an element only by throwing an exception.
      *
      * @param e the element to add
-     * @return <tt>true</tt> if the element was added to this deque, else
-     *         <tt>false</tt>
+     * @return {@code true} if the element was added to this deque, else
+     *         {@code false}
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this deque
      * @throws NullPointerException if the specified element is null and this
@@ -288,17 +292,17 @@
 
     /**
      * Retrieves and removes the first element of this deque,
-     * or returns <tt>null</tt> if this deque is empty.
+     * or returns {@code null} if this deque is empty.
      *
-     * @return the head of this deque, or <tt>null</tt> if this deque is empty
+     * @return the head of this deque, or {@code null} if this deque is empty
      */
     E pollFirst();
 
     /**
      * Retrieves and removes the last element of this deque,
-     * or returns <tt>null</tt> if this deque is empty.
+     * or returns {@code null} if this deque is empty.
      *
-     * @return the tail of this deque, or <tt>null</tt> if this deque is empty
+     * @return the tail of this deque, or {@code null} if this deque is empty
      */
     E pollLast();
 
@@ -325,31 +329,31 @@
 
     /**
      * Retrieves, but does not remove, the first element of this deque,
-     * or returns <tt>null</tt> if this deque is empty.
+     * or returns {@code null} if this deque is empty.
      *
-     * @return the head of this deque, or <tt>null</tt> if this deque is empty
+     * @return the head of this deque, or {@code null} if this deque is empty
      */
     E peekFirst();
 
     /**
      * Retrieves, but does not remove, the last element of this deque,
-     * or returns <tt>null</tt> if this deque is empty.
+     * or returns {@code null} if this deque is empty.
      *
-     * @return the tail of this deque, or <tt>null</tt> if this deque is empty
+     * @return the tail of this deque, or {@code null} if this deque is empty
      */
     E peekLast();
 
     /**
      * Removes the first occurrence of the specified element from this deque.
      * If the deque does not contain the element, it is unchanged.
-     * More formally, removes the first element <tt>e</tt> such that
+     * More formally, removes the first element {@code e} such that
      * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
      * (if such an element exists).
-     * Returns <tt>true</tt> if this deque contained the specified element
+     * Returns {@code true} if this deque contained the specified element
      * (or equivalently, if this deque changed as a result of the call).
      *
      * @param o element to be removed from this deque, if present
-     * @return <tt>true</tt> if an element was removed as a result of this call
+     * @return {@code true} if an element was removed as a result of this call
      * @throws ClassCastException if the class of the specified element
      *         is incompatible with this deque
      * (<a href="Collection.html#optional-restrictions">optional</a>)
@@ -362,14 +366,14 @@
     /**
      * Removes the last occurrence of the specified element from this deque.
      * If the deque does not contain the element, it is unchanged.
-     * More formally, removes the last element <tt>e</tt> such that
+     * More formally, removes the last element {@code e} such that
      * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
      * (if such an element exists).
-     * Returns <tt>true</tt> if this deque contained the specified element
+     * Returns {@code true} if this deque contained the specified element
      * (or equivalently, if this deque changed as a result of the call).
      *
      * @param o element to be removed from this deque, if present
-     * @return <tt>true</tt> if an element was removed as a result of this call
+     * @return {@code true} if an element was removed as a result of this call
      * @throws ClassCastException if the class of the specified element
      *         is incompatible with this deque
      * (<a href="Collection.html#optional-restrictions">optional</a>)
@@ -385,15 +389,15 @@
      * Inserts the specified element into the queue represented by this deque
      * (in other words, at the tail of this deque) if it is possible to do so
      * immediately without violating capacity restrictions, returning
-     * <tt>true</tt> upon success and throwing an
-     * <tt>IllegalStateException</tt> if no space is currently available.
+     * {@code true} upon success and throwing an
+     * {@code IllegalStateException} if no space is currently available.
      * When using a capacity-restricted deque, it is generally preferable to
      * use {@link #offer(Object) offer}.
      *
      * <p>This method is equivalent to {@link #addLast}.
      *
      * @param e the element to add
-     * @return <tt>true</tt> (as specified by {@link Collection#add})
+     * @return {@code true} (as specified by {@link Collection#add})
      * @throws IllegalStateException if the element cannot be added at this
      *         time due to capacity restrictions
      * @throws ClassCastException if the class of the specified element
@@ -409,7 +413,7 @@
      * Inserts the specified element into the queue represented by this deque
      * (in other words, at the tail of this deque) if it is possible to do so
      * immediately without violating capacity restrictions, returning
-     * <tt>true</tt> upon success and <tt>false</tt> if no space is currently
+     * {@code true} upon success and {@code false} if no space is currently
      * available.  When using a capacity-restricted deque, this method is
      * generally preferable to the {@link #add} method, which can fail to
      * insert an element only by throwing an exception.
@@ -417,8 +421,8 @@
      * <p>This method is equivalent to {@link #offerLast}.
      *
      * @param e the element to add
-     * @return <tt>true</tt> if the element was added to this deque, else
-     *         <tt>false</tt>
+     * @return {@code true} if the element was added to this deque, else
+     *         {@code false}
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this deque
      * @throws NullPointerException if the specified element is null and this
@@ -444,11 +448,11 @@
     /**
      * Retrieves and removes the head of the queue represented by this deque
      * (in other words, the first element of this deque), or returns
-     * <tt>null</tt> if this deque is empty.
+     * {@code null} if this deque is empty.
      *
      * <p>This method is equivalent to {@link #pollFirst()}.
      *
-     * @return the first element of this deque, or <tt>null</tt> if
+     * @return the first element of this deque, or {@code null} if
      *         this deque is empty
      */
     E poll();
@@ -469,12 +473,12 @@
     /**
      * Retrieves, but does not remove, the head of the queue represented by
      * this deque (in other words, the first element of this deque), or
-     * returns <tt>null</tt> if this deque is empty.
+     * returns {@code null} if this deque is empty.
      *
      * <p>This method is equivalent to {@link #peekFirst()}.
      *
      * @return the head of the queue represented by this deque, or
-     *         <tt>null</tt> if this deque is empty
+     *         {@code null} if this deque is empty
      */
     E peek();
 
@@ -484,9 +488,8 @@
     /**
      * Pushes an element onto the stack represented by this deque (in other
      * words, at the head of this deque) if it is possible to do so
-     * immediately without violating capacity restrictions, returning
-     * <tt>true</tt> upon success and throwing an
-     * <tt>IllegalStateException</tt> if no space is currently available.
+     * immediately without violating capacity restrictions, throwing an
+     * {@code IllegalStateException} if no space is currently available.
      *
      * <p>This method is equivalent to {@link #addFirst}.
      *
@@ -520,16 +523,16 @@
     /**
      * Removes the first occurrence of the specified element from this deque.
      * If the deque does not contain the element, it is unchanged.
-     * More formally, removes the first element <tt>e</tt> such that
+     * More formally, removes the first element {@code e} such that
      * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
      * (if such an element exists).
-     * Returns <tt>true</tt> if this deque contained the specified element
+     * Returns {@code true} if this deque contained the specified element
      * (or equivalently, if this deque changed as a result of the call).
      *
-     * <p>This method is equivalent to {@link #removeFirstOccurrence}.
+     * <p>This method is equivalent to {@link #removeFirstOccurrence(Object)}.
      *
      * @param o element to be removed from this deque, if present
-     * @return <tt>true</tt> if an element was removed as a result of this call
+     * @return {@code true} if an element was removed as a result of this call
      * @throws ClassCastException if the class of the specified element
      *         is incompatible with this deque
      * (<a href="Collection.html#optional-restrictions">optional</a>)
@@ -540,13 +543,13 @@
     boolean remove(Object o);
 
     /**
-     * Returns <tt>true</tt> if this deque contains the specified element.
-     * More formally, returns <tt>true</tt> if and only if this deque contains
-     * at least one element <tt>e</tt> such that
+     * Returns {@code true} if this deque contains the specified element.
+     * More formally, returns {@code true} if and only if this deque contains
+     * at least one element {@code e} such that
      * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
      *
      * @param o element whose presence in this deque is to be tested
-     * @return <tt>true</tt> if this deque contains the specified element
+     * @return {@code true} if this deque contains the specified element
      * @throws ClassCastException if the type of the specified element
      *         is incompatible with this deque
      * (<a href="Collection.html#optional-restrictions">optional</a>)
--- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java	Tue Aug 13 18:34:12 2013 -0700
@@ -25,6 +25,7 @@
 package java.util;
 
 import java.util.function.DoubleConsumer;
+import java.util.stream.Collector;
 
 /**
  * A state object for collecting statistics such as count, min, max, sum, and
@@ -35,24 +36,24 @@
  * summary statistics on a stream of doubles with:
  * <pre> {@code
  * DoubleSummaryStatistics stats = doubleStream.collect(DoubleSummaryStatistics::new,
- *     DoubleSummaryStatistics::accept,
- *     DoubleSummaryStatistics::combine);
+ *                                                      DoubleSummaryStatistics::accept,
+ *                                                      DoubleSummaryStatistics::combine);
  * }</pre>
  *
  * <p>{@code DoubleSummaryStatistics} can be used as a
- * {@linkplain java.util.stream.Stream#reduce(java.util.function.BinaryOperator) reduction}
+ * {@linkplain java.util.stream.Stream#collect(Collector) reduction}
  * target for a {@linkplain java.util.stream.Stream stream}. For example:
  *
  * <pre> {@code
  * DoubleSummaryStatistics stats = people.stream()
- *     .collect(Collectors.toDoubleSummaryStatistics(Person::getWeight));
+ *     .collect(Collectors.summarizingDouble(Person::getWeight));
  *}</pre>
  *
  * This computes, in a single pass, the count of people, as well as the minimum,
  * maximum, sum, and average of their weights.
  *
  * @implNote This implementation is not thread safe. However, it is safe to use
- * {@link java.util.stream.Collectors#toDoubleSummaryStatistics(java.util.function.ToDoubleFunction)
+ * {@link java.util.stream.Collectors#summarizingDouble(java.util.function.ToDoubleFunction)
  * Collectors.toDoubleStatistics()} on a parallel stream, because the parallel
  * implementation of {@link java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -152,7 +153,7 @@
     }
 
     /**
-     * Returns the average of values recorded, or zero if no values have been
+     * Returns the arithmetic mean of values recorded, or zero if no values have been
      * recorded. The average returned can vary depending upon the order in
      * which values are recorded. This is due to accumulated rounding error in
      * addition of values of differing magnitudes. Values sorted by increasing
@@ -160,7 +161,7 @@
      * value is a {@code NaN} or the sum is at any point a {@code NaN} then the
      * average will be {@code NaN}.
      *
-     * @return the average of values, or zero if none
+     * @return the arithmetic mean of values, or zero if none
      */
     public final double getAverage() {
         return getCount() > 0 ? getSum() / getCount() : 0.0d;
--- a/jdk/src/share/classes/java/util/Formatter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Formatter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -626,12 +626,11 @@
  * <p> For general argument types, the precision is the maximum number of
  * characters to be written to the output.
  *
- * <p> For the floating-point conversions {@code 'e'}, {@code 'E'}, and
- * {@code 'f'} the precision is the number of digits after the decimal
- * separator.  If the conversion is {@code 'g'} or {@code 'G'}, then the
+ * <p> For the floating-point conversions {@code 'a'}, {@code 'A'}, {@code 'e'},
+ * {@code 'E'}, and {@code 'f'} the precision is the number of digits after the
+ * radix point.  If the conversion is {@code 'g'} or {@code 'G'}, then the
  * precision is the total number of digits in the resulting magnitude after
- * rounding.  If the conversion is {@code 'a'} or {@code 'A'}, then the
- * precision must not be specified.
+ * rounding.
  *
  * <p> For character, integral, and date/time argument types and the percent
  * and line separator conversions, the precision is not applicable; if a
@@ -1297,14 +1296,21 @@
  *     of the significand as a fraction.  The exponent is represented by
  *     {@code 'p'} (<tt>'&#92;u0070'</tt>) followed by a decimal string of the
  *     unbiased exponent as if produced by invoking {@link
- *     Integer#toString(int) Integer.toString} on the exponent value.
+ *     Integer#toString(int) Integer.toString} on the exponent value.  If the
+ *     precision is specified, the value is rounded to the given number of
+ *     hexadecimal digits.
  *
  *     <li> If <i>m</i> is a {@code double} value with a subnormal
- *     representation then the significand is represented by the characters
- *     {@code '0x0.'} followed by the hexadecimal representation of the rest
- *     of the significand as a fraction.  The exponent is represented by
- *     {@code 'p-1022'}.  Note that there must be at least one nonzero digit
- *     in a subnormal significand.
+ *     representation then, unless the precision is specified to be in the range
+ *     1 through 12, inclusive, the significand is represented by the characters
+ *     {@code '0x0.'} followed by the hexadecimal representation of the rest of
+ *     the significand as a fraction, and the exponent represented by
+ *     {@code 'p-1022'}.  If the precision is in the interval
+ *     [1,&nbsp;12], the subnormal value is normalized such that it
+ *     begins with the characters {@code '0x1.'}, rounded to the number of
+ *     hexadecimal digits of precision, and the exponent adjusted
+ *     accordingly.  Note that there must be at least one nonzero digit in a
+ *     subnormal significand.
  *
  *     </ul>
  *
@@ -1367,7 +1373,7 @@
  * {@code 1}.
  *
  * <p> If the conversion is {@code 'a'} or {@code 'A'}, then the precision
- * is the number of hexadecimal digits after the decimal separator.  If the
+ * is the number of hexadecimal digits after the radix point.  If the
  * precision is not provided, then all of the digits as returned by {@link
  * Double#toHexString(double)} will be output.
  *
--- a/jdk/src/share/classes/java/util/HashMap.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/HashMap.java	Tue Aug 13 18:34:12 2013 -0700
@@ -876,13 +876,9 @@
 
     private static int roundUpToPowerOf2(int number) {
         // assert number >= 0 : "number must be non-negative";
-        int rounded = number >= MAXIMUM_CAPACITY
+        return number >= MAXIMUM_CAPACITY
                 ? MAXIMUM_CAPACITY
-                : (rounded = Integer.highestOneBit(number)) != 0
-                    ? (Integer.bitCount(number) > 1) ? rounded << 1 : rounded
-                    : 1;
-
-        return rounded;
+                : (number > 1) ? Integer.highestOneBit((number - 1) << 1) : 1;
     }
 
     /**
--- a/jdk/src/share/classes/java/util/Hashtable.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Hashtable.java	Tue Aug 13 18:34:12 2013 -0700
@@ -928,6 +928,7 @@
         return (null == result) ? defaultValue : result;
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public synchronized void forEach(BiConsumer<? super K, ? super V> action) {
         Objects.requireNonNull(action);     // explicit check required in case
@@ -947,6 +948,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public synchronized void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
         Objects.requireNonNull(function);     // explicit check required in case
--- a/jdk/src/share/classes/java/util/IdentityHashMap.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/IdentityHashMap.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1339,6 +1339,7 @@
         tab[i + 1] = value;
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public void forEach(BiConsumer<? super K, ? super V> action) {
         Objects.requireNonNull(action);
@@ -1357,6 +1358,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
         Objects.requireNonNull(function);
--- a/jdk/src/share/classes/java/util/IntSummaryStatistics.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/IntSummaryStatistics.java	Tue Aug 13 18:34:12 2013 -0700
@@ -25,6 +25,7 @@
 package java.util;
 
 import java.util.function.IntConsumer;
+import java.util.stream.Collector;
 
 /**
  * A state object for collecting statistics such as count, min, max, sum, and
@@ -35,24 +36,24 @@
  * summary statistics on a stream of ints with:
  * <pre> {@code
  * IntSummaryStatistics stats = intStream.collect(IntSummaryStatistics::new,
- *     IntSummaryStatistics::accept,
- *     IntSummaryStatistics::combine);
+ *                                                IntSummaryStatistics::accept,
+ *                                                IntSummaryStatistics::combine);
  * }</pre>
  *
  * <p>{@code IntSummaryStatistics} can be used as a
- * {@linkplain java.util.stream.Stream#reduce(java.util.function.BinaryOperator) reduction}
+ * {@linkplain java.util.stream.Stream#collect(Collector) reduction}
  * target for a {@linkplain java.util.stream.Stream stream}. For example:
  *
  * <pre> {@code
  * IntSummaryStatistics stats = people.stream()
- *     .collect(Collectors.toIntSummaryStatistics(Person::getDependents));
+ *                                    .collect(Collectors.summarizingInt(Person::getDependents));
  *}</pre>
  *
  * This computes, in a single pass, the count of people, as well as the minimum,
  * maximum, sum, and average of their number of dependents.
  *
  * @implNote This implementation is not thread safe. However, it is safe to use
- * {@link java.util.stream.Collectors#toIntSummaryStatistics(java.util.function.ToIntFunction)
+ * {@link java.util.stream.Collectors#summarizingInt(java.util.function.ToIntFunction)
  * Collectors.toIntStatistics()} on a parallel stream, because the parallel
  * implementation of {@link java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -140,10 +141,10 @@
     }
 
     /**
-     * Returns the average of values recorded, or zero if no values have been
+     * Returns the arithmetic mean of values recorded, or zero if no values have been
      * recorded.
      *
-     * @return the average of values, or zero if none
+     * @return the arithmetic mean of values, or zero if none
      */
     public final double getAverage() {
         return getCount() > 0 ? (double) getSum() / getCount() : 0.0d;
--- a/jdk/src/share/classes/java/util/LongSummaryStatistics.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/LongSummaryStatistics.java	Tue Aug 13 18:34:12 2013 -0700
@@ -26,6 +26,7 @@
 
 import java.util.function.IntConsumer;
 import java.util.function.LongConsumer;
+import java.util.stream.Collector;
 
 /**
  * A state object for collecting statistics such as count, min, max, sum, and
@@ -36,24 +37,24 @@
  * summary statistics on a stream of longs with:
  * <pre> {@code
  * LongSummaryStatistics stats = longStream.collect(LongSummaryStatistics::new,
- *     LongSummaryStatistics::accept,
- *     LongSummaryStatistics::combine);
+ *                                                  LongSummaryStatistics::accept,
+ *                                                  LongSummaryStatistics::combine);
  * }</pre>
  *
  * <p>{@code LongSummaryStatistics} can be used as a
- * {@linkplain java.util.stream.Stream#reduce(java.util.function.BinaryOperator) reduction}
+ * {@linkplain java.util.stream.Stream#collect(Collector)} reduction}
  * target for a {@linkplain java.util.stream.Stream stream}. For example:
  *
  * <pre> {@code
  * LongSummaryStatistics stats = people.stream()
- *     .collect(Collectors.toLongSummaryStatistics(Person::getAge));
+ *                                     .collect(Collectors.summarizingLong(Person::getAge));
  *}</pre>
  *
  * This computes, in a single pass, the count of people, as well as the minimum,
- * maximum, sum, and average of their ages in milliseconds.
+ * maximum, sum, and average of their ages.
  *
  * @implNote This implementation is not thread safe. However, it is safe to use
- * {@link java.util.stream.Collectors#toLongSummaryStatistics(java.util.function.ToLongFunction)
+ * {@link java.util.stream.Collectors#summarizingLong(java.util.function.ToLongFunction)
  * Collectors.toLongStatistics()} on a parallel stream, because the parallel
  * implementation of {@link java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -152,10 +153,10 @@
     }
 
     /**
-     * Returns the average of values recorded, or zero if no values have been
+     * Returns the arithmetic mean of values recorded, or zero if no values have been
      * recorded.
      *
-     * @return The average of values, or zero if none
+     * @return The arithmetic mean of values, or zero if none
      */
     public final double getAverage() {
         return getCount() > 0 ? (double) getSum() / getCount() : 0.0d;
--- a/jdk/src/share/classes/java/util/Optional.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Optional.java	Tue Aug 13 18:34:12 2013 -0700
@@ -307,7 +307,7 @@
             return false;
         }
 
-        Optional other = (Optional) obj;
+        Optional<?> other = (Optional<?>) obj;
         return Objects.equals(value, other.value);
     }
 
--- a/jdk/src/share/classes/java/util/Queue.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Queue.java	Tue Aug 13 18:34:12 2013 -0700
@@ -41,14 +41,15 @@
  * queues provide additional insertion, extraction, and inspection
  * operations.  Each of these methods exists in two forms: one throws
  * an exception if the operation fails, the other returns a special
- * value (either <tt>null</tt> or <tt>false</tt>, depending on the
+ * value (either {@code null} or {@code false}, depending on the
  * operation).  The latter form of the insert operation is designed
- * specifically for use with capacity-restricted <tt>Queue</tt>
+ * specifically for use with capacity-restricted {@code Queue}
  * implementations; in most implementations, insert operations cannot
  * fail.
  *
  * <p>
  * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <caption>Summary of Queue methods</caption>
  *  <tr>
  *    <td></td>
  *    <td ALIGN=CENTER><em>Throws exception</em></td>
@@ -56,18 +57,18 @@
  *  </tr>
  *  <tr>
  *    <td><b>Insert</b></td>
- *    <td>{@link #add add(e)}</td>
- *    <td>{@link #offer offer(e)}</td>
+ *    <td>{@link Queue#add add(e)}</td>
+ *    <td>{@link Queue#offer offer(e)}</td>
  *  </tr>
  *  <tr>
  *    <td><b>Remove</b></td>
- *    <td>{@link #remove remove()}</td>
- *    <td>{@link #poll poll()}</td>
+ *    <td>{@link Queue#remove remove()}</td>
+ *    <td>{@link Queue#poll poll()}</td>
  *  </tr>
  *  <tr>
  *    <td><b>Examine</b></td>
- *    <td>{@link #element element()}</td>
- *    <td>{@link #peek peek()}</td>
+ *    <td>{@link Queue#element element()}</td>
+ *    <td>{@link Queue#peek peek()}</td>
  *  </tr>
  * </table>
  *
@@ -79,15 +80,15 @@
  * Whatever the ordering used, the <em>head</em> of the queue is that
  * element which would be removed by a call to {@link #remove() } or
  * {@link #poll()}.  In a FIFO queue, all new elements are inserted at
- * the <em> tail</em> of the queue. Other kinds of queues may use
- * different placement rules.  Every <tt>Queue</tt> implementation
+ * the <em>tail</em> of the queue. Other kinds of queues may use
+ * different placement rules.  Every {@code Queue} implementation
  * must specify its ordering properties.
  *
  * <p>The {@link #offer offer} method inserts an element if possible,
- * otherwise returning <tt>false</tt>.  This differs from the {@link
+ * otherwise returning {@code false}.  This differs from the {@link
  * java.util.Collection#add Collection.add} method, which can fail to
  * add an element only by throwing an unchecked exception.  The
- * <tt>offer</tt> method is designed for use when failure is a normal,
+ * {@code offer} method is designed for use when failure is a normal,
  * rather than exceptional occurrence, for example, in fixed-capacity
  * (or &quot;bounded&quot;) queues.
  *
@@ -95,32 +96,32 @@
  * return the head of the queue.
  * Exactly which element is removed from the queue is a
  * function of the queue's ordering policy, which differs from
- * implementation to implementation. The <tt>remove()</tt> and
- * <tt>poll()</tt> methods differ only in their behavior when the
- * queue is empty: the <tt>remove()</tt> method throws an exception,
- * while the <tt>poll()</tt> method returns <tt>null</tt>.
+ * implementation to implementation. The {@code remove()} and
+ * {@code poll()} methods differ only in their behavior when the
+ * queue is empty: the {@code remove()} method throws an exception,
+ * while the {@code poll()} method returns {@code null}.
  *
  * <p>The {@link #element()} and {@link #peek()} methods return, but do
  * not remove, the head of the queue.
  *
- * <p>The <tt>Queue</tt> interface does not define the <i>blocking queue
+ * <p>The {@code Queue} interface does not define the <i>blocking queue
  * methods</i>, which are common in concurrent programming.  These methods,
  * which wait for elements to appear or for space to become available, are
  * defined in the {@link java.util.concurrent.BlockingQueue} interface, which
  * extends this interface.
  *
- * <p><tt>Queue</tt> implementations generally do not allow insertion
- * of <tt>null</tt> elements, although some implementations, such as
- * {@link LinkedList}, do not prohibit insertion of <tt>null</tt>.
- * Even in the implementations that permit it, <tt>null</tt> should
- * not be inserted into a <tt>Queue</tt>, as <tt>null</tt> is also
- * used as a special return value by the <tt>poll</tt> method to
+ * <p>{@code Queue} implementations generally do not allow insertion
+ * of {@code null} elements, although some implementations, such as
+ * {@link LinkedList}, do not prohibit insertion of {@code null}.
+ * Even in the implementations that permit it, {@code null} should
+ * not be inserted into a {@code Queue}, as {@code null} is also
+ * used as a special return value by the {@code poll} method to
  * indicate that the queue contains no elements.
  *
- * <p><tt>Queue</tt> implementations generally do not define
- * element-based versions of methods <tt>equals</tt> and
- * <tt>hashCode</tt> but instead inherit the identity based versions
- * from class <tt>Object</tt>, because element-based equality is not
+ * <p>{@code Queue} implementations generally do not define
+ * element-based versions of methods {@code equals} and
+ * {@code hashCode} but instead inherit the identity based versions
+ * from class {@code Object}, because element-based equality is not
  * always well-defined for queues with the same elements but different
  * ordering properties.
  *
@@ -145,11 +146,11 @@
     /**
      * Inserts the specified element into this queue if it is possible to do so
      * immediately without violating capacity restrictions, returning
-     * <tt>true</tt> upon success and throwing an <tt>IllegalStateException</tt>
+     * {@code true} upon success and throwing an {@code IllegalStateException}
      * if no space is currently available.
      *
      * @param e the element to add
-     * @return <tt>true</tt> (as specified by {@link Collection#add})
+     * @return {@code true} (as specified by {@link Collection#add})
      * @throws IllegalStateException if the element cannot be added at this
      *         time due to capacity restrictions
      * @throws ClassCastException if the class of the specified element
@@ -169,8 +170,8 @@
      * by throwing an exception.
      *
      * @param e the element to add
-     * @return <tt>true</tt> if the element was added to this queue, else
-     *         <tt>false</tt>
+     * @return {@code true} if the element was added to this queue, else
+     *         {@code false}
      * @throws ClassCastException if the class of the specified element
      *         prevents it from being added to this queue
      * @throws NullPointerException if the specified element is null and
@@ -192,9 +193,9 @@
 
     /**
      * Retrieves and removes the head of this queue,
-     * or returns <tt>null</tt> if this queue is empty.
+     * or returns {@code null} if this queue is empty.
      *
-     * @return the head of this queue, or <tt>null</tt> if this queue is empty
+     * @return the head of this queue, or {@code null} if this queue is empty
      */
     E poll();
 
@@ -210,9 +211,9 @@
 
     /**
      * Retrieves, but does not remove, the head of this queue,
-     * or returns <tt>null</tt> if this queue is empty.
+     * or returns {@code null} if this queue is empty.
      *
-     * @return the head of this queue, or <tt>null</tt> if this queue is empty
+     * @return the head of this queue, or {@code null} if this queue is empty
      */
     E peek();
 }
--- a/jdk/src/share/classes/java/util/StringJoiner.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/StringJoiner.java	Tue Aug 13 18:34:12 2013 -0700
@@ -49,16 +49,17 @@
  * <p>
  * A {@code StringJoiner} may be employed to create formatted output from a
  * {@link java.util.stream.Stream} using
- * {@link java.util.stream.Collectors#toStringJoiner}. For example:
+ * {@link java.util.stream.Collectors#joining(CharSequence)}. For example:
  *
  * <pre> {@code
  * List<Integer> numbers = Arrays.asList(1, 2, 3, 4);
  * String commaSeparatedNumbers = numbers.stream()
  *     .map(i -> i.toString())
- *     .collect(Collectors.toStringJoiner(", ")).toString();
+ *     .collect(Collectors.joining(", "));
  * }</pre>
  *
- * @see java.util.stream.Collectors#toStringJoiner
+ * @see java.util.stream.Collectors#joining(CharSequence)
+ * @see java.util.stream.Collectors#joining(CharSequence, CharSequence, CharSequence)
  * @since  1.8
 */
 public final class StringJoiner {
--- a/jdk/src/share/classes/java/util/Vector.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/Vector.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1164,12 +1164,13 @@
                 if (i >= size) {
                     return;
                 }
-                final Object[] elementData = Vector.this.elementData;
+        @SuppressWarnings("unchecked")
+                final E[] elementData = (E[]) Vector.this.elementData;
                 if (i >= elementData.length) {
                     throw new ConcurrentModificationException();
                 }
                 while (i != size && modCount == expectedModCount) {
-                    action.accept((E) elementData[i++]);
+                    action.accept(elementData[i++]);
                 }
                 // update once at end of iteration to reduce heap write traffic
                 cursor = i;
@@ -1311,8 +1312,8 @@
         modCount++;
     }
 
+    @SuppressWarnings("unchecked")
     @Override
-    @SuppressWarnings("unchecked")
     public synchronized void sort(Comparator<? super E> c) {
         final int expectedModCount = modCount;
         Arrays.sort((E[]) elementData, 0, elementCount, c);
--- a/jdk/src/share/classes/java/util/WeakHashMap.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/WeakHashMap.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1038,6 +1038,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public void forEach(BiConsumer<? super K, ? super V> action) {
         Objects.requireNonNull(action);
@@ -1059,6 +1060,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
         Objects.requireNonNull(function);
--- a/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java	Tue Aug 13 18:34:12 2013 -0700
@@ -48,13 +48,16 @@
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.CancellationException;
+import java.util.concurrent.CompletionException;
+import java.util.concurrent.CompletionStage;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.LockSupport;
 
 /**
  * A {@link Future} that may be explicitly completed (setting its
- * value and status), and may include dependent functions and actions
- * that trigger upon its completion.
+ * value and status), and may be used as a {@link CompletionStage},
+ * supporting dependent functions and actions that trigger upon its
+ * completion.
  *
  * <p>When two or more threads attempt to
  * {@link #complete complete},
@@ -62,64 +65,50 @@
  * {@link #cancel cancel}
  * a CompletableFuture, only one of them succeeds.
  *
- * <p>Methods are available for adding dependents based on
- * user-provided Functions, Consumers, or Runnables. The appropriate
- * form to use depends on whether actions require arguments and/or
- * produce results.  Completion of a dependent action will trigger the
- * completion of another CompletableFuture.  Actions may also be
- * triggered after either or both the current and another
- * CompletableFuture complete.  Multiple CompletableFutures may also
- * be grouped as one using {@link #anyOf(CompletableFuture...)} and
- * {@link #allOf(CompletableFuture...)}.
+ * <p>In addition to these and related methods for directly
+ * manipulating status and results, CompletableFuture implements
+ * interface {@link CompletionStage} with the following policies: <ul>
  *
- * <p>CompletableFutures themselves do not execute asynchronously.
- * However, actions supplied for dependent completions of another
- * CompletableFuture may do so, depending on whether they are provided
- * via one of the <em>async</em> methods (that is, methods with names
- * of the form <tt><var>xxx</var>Async</tt>).  The <em>async</em>
- * methods provide a way to commence asynchronous processing of an
- * action using either a given {@link Executor} or by default the
- * {@link ForkJoinPool#commonPool()}. To simplify monitoring,
+ * <li>Actions supplied for dependent completions of
+ * <em>non-async</em> methods may be performed by the thread that
+ * completes the current CompletableFuture, or by any other caller of
+ * a completion method.</li>
+ *
+ * <li>All <em>async</em> methods without an explicit Executor
+ * argument are performed using the {@link ForkJoinPool#commonPool()}
+ * (unless it does not support a parallelism level of at least two, in
+ * which case, a new Thread is used). To simplify monitoring,
  * debugging, and tracking, all generated asynchronous tasks are
- * instances of the marker interface {@link AsynchronousCompletionTask}.
+ * instances of the marker interface {@link
+ * AsynchronousCompletionTask}. </li>
  *
- * <p>Actions supplied for dependent completions of <em>non-async</em>
- * methods may be performed by the thread that completes the current
- * CompletableFuture, or by any other caller of these methods.  There
- * are no guarantees about the order of processing completions unless
- * constrained by these methods.
+ * <li>All CompletionStage methods are implemented independently of
+ * other public methods, so the behavior of one method is not impacted
+ * by overrides of others in subclasses.  </li> </ul>
  *
- * <p>Since (unlike {@link FutureTask}) this class has no direct
- * control over the computation that causes it to be completed,
- * cancellation is treated as just another form of exceptional completion.
- * Method {@link #cancel cancel} has the same effect as
- * {@code completeExceptionally(new CancellationException())}.
+ * <p>CompletableFuture also implements {@link Future} with the following
+ * policies: <ul>
  *
- * <p>Upon exceptional completion (including cancellation), or when a
- * completion entails an additional computation which terminates
- * abruptly with an (unchecked) exception or error, then all of their
- * dependent completions (and their dependents in turn) generally act
- * as {@code completeExceptionally} with a {@link CompletionException}
- * holding that exception as its cause.  However, the {@link
- * #exceptionally exceptionally} and {@link #handle handle}
- * completions <em>are</em> able to handle exceptional completions of
- * the CompletableFutures they depend on.
+ * <li>Since (unlike {@link FutureTask}) this class has no direct
+ * control over the computation that causes it to be completed,
+ * cancellation is treated as just another form of exceptional
+ * completion.  Method {@link #cancel cancel} has the same effect as
+ * {@code completeExceptionally(new CancellationException())}. Method
+ * {@link #isCompletedExceptionally} can be used to determine if a
+ * CompletableFuture completed in any exceptional fashion.</li>
  *
- * <p>In case of exceptional completion with a CompletionException,
+ * <li>In case of exceptional completion with a CompletionException,
  * methods {@link #get()} and {@link #get(long, TimeUnit)} throw an
  * {@link ExecutionException} with the same cause as held in the
- * corresponding CompletionException.  However, in these cases,
- * methods {@link #join()} and {@link #getNow} throw the
- * CompletionException, which simplifies usage.
- *
- * <p>Arguments used to pass a completion result (that is, for parameters
- * of type {@code T}) may be null, but passing a null value for any other
- * parameter will result in a {@link NullPointerException} being thrown.
+ * corresponding CompletionException.  To simplify usage in most
+ * contexts, this class also defines methods {@link #join()} and
+ * {@link #getNow} that instead throw the CompletionException directly
+ * in these cases.</li> </ul>
  *
  * @author Doug Lea
  * @since 1.8
  */
-public class CompletableFuture<T> implements Future<T> {
+public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
 
     /*
      * Overview:
@@ -438,6 +427,19 @@
         public final void run() { exec(); }
     }
 
+    /**
+     * Starts the given async task using the given executor, unless
+     * the executor is ForkJoinPool.commonPool and it has been
+     * disabled, in which case starts a new thread.
+     */
+    static void execAsync(Executor e, Async r) {
+        if (e == ForkJoinPool.commonPool() &&
+            ForkJoinPool.getCommonPoolParallelism() <= 1)
+            new Thread(r).start();
+        else
+            e.execute(r);
+    }
+
     static final class AsyncRun extends Async {
         final Runnable fn;
         final CompletableFuture<Void> dst;
@@ -538,13 +540,13 @@
     static final class AsyncAccept<T> extends Async {
         final T arg;
         final Consumer<? super T> fn;
-        final CompletableFuture<Void> dst;
+        final CompletableFuture<?> dst;
         AsyncAccept(T arg, Consumer<? super T> fn,
-                    CompletableFuture<Void> dst) {
+                    CompletableFuture<?> dst) {
             this.arg = arg; this.fn = fn; this.dst = dst;
         }
         public final boolean exec() {
-            CompletableFuture<Void> d; Throwable ex;
+            CompletableFuture<?> d; Throwable ex;
             if ((d = this.dst) != null && d.result == null) {
                 try {
                     fn.accept(arg);
@@ -563,14 +565,14 @@
         final T arg1;
         final U arg2;
         final BiConsumer<? super T,? super U> fn;
-        final CompletableFuture<Void> dst;
+        final CompletableFuture<?> dst;
         AsyncAcceptBoth(T arg1, U arg2,
                         BiConsumer<? super T,? super U> fn,
-                        CompletableFuture<Void> dst) {
+                        CompletableFuture<?> dst) {
             this.arg1 = arg1; this.arg2 = arg2; this.fn = fn; this.dst = dst;
         }
         public final boolean exec() {
-            CompletableFuture<Void> d; Throwable ex;
+            CompletableFuture<?> d; Throwable ex;
             if ((d = this.dst) != null && d.result == null) {
                 try {
                     fn.accept(arg1, arg2);
@@ -587,10 +589,10 @@
 
     static final class AsyncCompose<T,U> extends Async {
         final T arg;
-        final Function<? super T, CompletableFuture<U>> fn;
+        final Function<? super T, ? extends CompletionStage<U>> fn;
         final CompletableFuture<U> dst;
         AsyncCompose(T arg,
-                     Function<? super T, CompletableFuture<U>> fn,
+                     Function<? super T, ? extends CompletionStage<U>> fn,
                      CompletableFuture<U> dst) {
             this.arg = arg; this.fn = fn; this.dst = dst;
         }
@@ -598,7 +600,8 @@
             CompletableFuture<U> d, fr; U u; Throwable ex;
             if ((d = this.dst) != null && d.result == null) {
                 try {
-                    fr = fn.apply(arg);
+                    CompletionStage<U> cs = fn.apply(arg);
+                    fr = (cs == null) ? null : cs.toCompletableFuture();
                     ex = (fr == null) ? new NullPointerException() : null;
                 } catch (Throwable rex) {
                     ex = rex;
@@ -626,6 +629,33 @@
         private static final long serialVersionUID = 5232453952276885070L;
     }
 
+    static final class AsyncWhenComplete<T> extends Async {
+        final T arg1;
+        final Throwable arg2;
+        final BiConsumer<? super T,? super Throwable> fn;
+        final CompletableFuture<T> dst;
+        AsyncWhenComplete(T arg1, Throwable arg2,
+                          BiConsumer<? super T,? super Throwable> fn,
+                          CompletableFuture<T> dst) {
+            this.arg1 = arg1; this.arg2 = arg2; this.fn = fn; this.dst = dst;
+        }
+        public final boolean exec() {
+            CompletableFuture<T> d;
+            if ((d = this.dst) != null && d.result == null) {
+                Throwable ex = arg2;
+                try {
+                    fn.accept(arg1, ex);
+                } catch (Throwable rex) {
+                    if (ex == null)
+                        ex = rex;
+                }
+                d.internalComplete(arg1, ex);
+            }
+            return true;
+        }
+        private static final long serialVersionUID = 5232453952276885070L;
+    }
+
     /* ------------- Completions -------------- */
 
     /**
@@ -680,7 +710,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncApply<T,U>(t, fn, dst));
+                            execAsync(e, new AsyncApply<T,U>(t, fn, dst));
                         else
                             u = fn.apply(t);
                     } catch (Throwable rex) {
@@ -697,11 +727,11 @@
     static final class ThenAccept<T> extends Completion {
         final CompletableFuture<? extends T> src;
         final Consumer<? super T> fn;
-        final CompletableFuture<Void> dst;
+        final CompletableFuture<?> dst;
         final Executor executor;
         ThenAccept(CompletableFuture<? extends T> src,
                    Consumer<? super T> fn,
-                   CompletableFuture<Void> dst,
+                   CompletableFuture<?> dst,
                    Executor executor) {
             this.src = src; this.fn = fn; this.dst = dst;
             this.executor = executor;
@@ -709,7 +739,7 @@
         public final void run() {
             final CompletableFuture<? extends T> a;
             final Consumer<? super T> fn;
-            final CompletableFuture<Void> dst;
+            final CompletableFuture<?> dst;
             Object r; T t; Throwable ex;
             if ((dst = this.dst) != null &&
                 (fn = this.fn) != null &&
@@ -729,7 +759,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncAccept<T>(t, fn, dst));
+                            execAsync(e, new AsyncAccept<T>(t, fn, dst));
                         else
                             fn.accept(t);
                     } catch (Throwable rex) {
@@ -773,7 +803,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncRun(fn, dst));
+                            execAsync(e, new AsyncRun(fn, dst));
                         else
                             fn.run();
                     } catch (Throwable rex) {
@@ -839,7 +869,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncCombine<T,U,V>(t, u, fn, dst));
+                            execAsync(e, new AsyncCombine<T,U,V>(t, u, fn, dst));
                         else
                             v = fn.apply(t, u);
                     } catch (Throwable rex) {
@@ -904,7 +934,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncAcceptBoth<T,U>(t, u, fn, dst));
+                            execAsync(e, new AsyncAcceptBoth<T,U>(t, u, fn, dst));
                         else
                             fn.accept(t, u);
                     } catch (Throwable rex) {
@@ -956,7 +986,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncRun(fn, dst));
+                            execAsync(e, new AsyncRun(fn, dst));
                         else
                             fn.run();
                     } catch (Throwable rex) {
@@ -1042,7 +1072,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncApply<T,U>(t, fn, dst));
+                            execAsync(e, new AsyncApply<T,U>(t, fn, dst));
                         else
                             u = fn.apply(t);
                     } catch (Throwable rex) {
@@ -1095,7 +1125,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncAccept<T>(t, fn, dst));
+                            execAsync(e, new AsyncAccept<T>(t, fn, dst));
                         else
                             fn.accept(t);
                     } catch (Throwable rex) {
@@ -1143,7 +1173,7 @@
                 if (ex == null) {
                     try {
                         if (e != null)
-                            e.execute(new AsyncRun(fn, dst));
+                            execAsync(e, new AsyncRun(fn, dst));
                         else
                             fn.run();
                     } catch (Throwable rex) {
@@ -1226,6 +1256,54 @@
         private static final long serialVersionUID = 5232453952276885070L;
     }
 
+    static final class WhenCompleteCompletion<T> extends Completion {
+        final CompletableFuture<? extends T> src;
+        final BiConsumer<? super T, ? super Throwable> fn;
+        final CompletableFuture<T> dst;
+        final Executor executor;
+        WhenCompleteCompletion(CompletableFuture<? extends T> src,
+                                  BiConsumer<? super T, ? super Throwable> fn,
+                                  CompletableFuture<T> dst,
+                                  Executor executor) {
+            this.src = src; this.fn = fn; this.dst = dst;
+            this.executor = executor;
+        }
+        public final void run() {
+            final CompletableFuture<? extends T> a;
+            final BiConsumer<? super T, ? super Throwable> fn;
+            final CompletableFuture<T> dst;
+            Object r; T t; Throwable ex;
+            if ((dst = this.dst) != null &&
+                (fn = this.fn) != null &&
+                (a = this.src) != null &&
+                (r = a.result) != null &&
+                compareAndSet(0, 1)) {
+                if (r instanceof AltResult) {
+                    ex = ((AltResult)r).ex;
+                    t = null;
+                }
+                else {
+                    ex = null;
+                    @SuppressWarnings("unchecked") T tr = (T) r;
+                    t = tr;
+                }
+                Executor e = executor;
+                Throwable dx = null;
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncWhenComplete<T>(t, ex, fn, dst));
+                    else
+                        fn.accept(t, ex);
+                } catch (Throwable rex) {
+                    dx = rex;
+                }
+                if (e == null || dx != null)
+                    dst.internalComplete(t, ex != null ? ex : dx);
+            }
+        }
+        private static final long serialVersionUID = 5232453952276885070L;
+    }
+
     static final class ThenCopy<T> extends Completion {
         final CompletableFuture<?> src;
         final CompletableFuture<T> dst;
@@ -1286,10 +1364,13 @@
         final CompletableFuture<? extends T> src;
         final BiFunction<? super T, Throwable, ? extends U> fn;
         final CompletableFuture<U> dst;
+        final Executor executor;
         HandleCompletion(CompletableFuture<? extends T> src,
                          BiFunction<? super T, Throwable, ? extends U> fn,
-                         CompletableFuture<U> dst) {
+                         CompletableFuture<U> dst,
+                          Executor executor) {
             this.src = src; this.fn = fn; this.dst = dst;
+            this.executor = executor;
         }
         public final void run() {
             final CompletableFuture<? extends T> a;
@@ -1310,13 +1391,19 @@
                     @SuppressWarnings("unchecked") T tr = (T) r;
                     t = tr;
                 }
-                U u = null; Throwable dx = null;
+                Executor e = executor;
+                U u = null;
+                Throwable dx = null;
                 try {
-                    u = fn.apply(t, ex);
+                    if (e != null)
+                        execAsync(e, new AsyncCombine<T,Throwable,U>(t, ex, fn, dst));
+                    else
+                        u = fn.apply(t, ex);
                 } catch (Throwable rex) {
                     dx = rex;
                 }
-                dst.internalComplete(u, dx);
+                if (e == null || dx != null)
+                    dst.internalComplete(u, dx);
             }
         }
         private static final long serialVersionUID = 5232453952276885070L;
@@ -1324,11 +1411,11 @@
 
     static final class ThenCompose<T,U> extends Completion {
         final CompletableFuture<? extends T> src;
-        final Function<? super T, CompletableFuture<U>> fn;
+        final Function<? super T, ? extends CompletionStage<U>> fn;
         final CompletableFuture<U> dst;
         final Executor executor;
         ThenCompose(CompletableFuture<? extends T> src,
-                    Function<? super T, CompletableFuture<U>> fn,
+                    Function<? super T, ? extends CompletionStage<U>> fn,
                     CompletableFuture<U> dst,
                     Executor executor) {
             this.src = src; this.fn = fn; this.dst = dst;
@@ -1336,7 +1423,7 @@
         }
         public final void run() {
             final CompletableFuture<? extends T> a;
-            final Function<? super T, CompletableFuture<U>> fn;
+            final Function<? super T, ? extends CompletionStage<U>> fn;
             final CompletableFuture<U> dst;
             Object r; T t; Throwable ex; Executor e;
             if ((dst = this.dst) != null &&
@@ -1358,10 +1445,12 @@
                 boolean complete = false;
                 if (ex == null) {
                     if ((e = executor) != null)
-                        e.execute(new AsyncCompose<T,U>(t, fn, dst));
+                        execAsync(e, new AsyncCompose<T,U>(t, fn, dst));
                     else {
                         try {
-                            if ((c = fn.apply(t)) == null)
+                            CompletionStage<U> cs = fn.apply(t);
+                            c = (cs == null) ? null : cs.toCompletableFuture();
+                            if (c == null)
                                 ex = new NullPointerException();
                         } catch (Throwable rex) {
                             ex = rex;
@@ -1401,6 +1490,619 @@
         private static final long serialVersionUID = 5232453952276885070L;
     }
 
+    // Implementations of stage methods with (plain, async, Executor) forms
+
+    private <U> CompletableFuture<U> doThenApply
+        (Function<? super T,? extends U> fn,
+         Executor e) {
+        if (fn == null) throw new NullPointerException();
+        CompletableFuture<U> dst = new CompletableFuture<U>();
+        ThenApply<T,U> d = null;
+        Object r;
+        if ((r = result) == null) {
+            CompletionNode p = new CompletionNode
+                (d = new ThenApply<T,U>(this, fn, dst, e));
+            while ((r = result) == null) {
+                if (UNSAFE.compareAndSwapObject
+                    (this, COMPLETIONS, p.next = completions, p))
+                    break;
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            U u = null;
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncApply<T,U>(t, fn, dst));
+                    else
+                        u = fn.apply(t);
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(u, ex);
+        }
+        helpPostComplete();
+        return dst;
+    }
+
+    private CompletableFuture<Void> doThenAccept(Consumer<? super T> fn,
+                                                 Executor e) {
+        if (fn == null) throw new NullPointerException();
+        CompletableFuture<Void> dst = new CompletableFuture<Void>();
+        ThenAccept<T> d = null;
+        Object r;
+        if ((r = result) == null) {
+            CompletionNode p = new CompletionNode
+                (d = new ThenAccept<T>(this, fn, dst, e));
+            while ((r = result) == null) {
+                if (UNSAFE.compareAndSwapObject
+                    (this, COMPLETIONS, p.next = completions, p))
+                    break;
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncAccept<T>(t, fn, dst));
+                    else
+                        fn.accept(t);
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(null, ex);
+        }
+        helpPostComplete();
+        return dst;
+    }
+
+    private CompletableFuture<Void> doThenRun(Runnable action,
+                                              Executor e) {
+        if (action == null) throw new NullPointerException();
+        CompletableFuture<Void> dst = new CompletableFuture<Void>();
+        ThenRun d = null;
+        Object r;
+        if ((r = result) == null) {
+            CompletionNode p = new CompletionNode
+                (d = new ThenRun(this, action, dst, e));
+            while ((r = result) == null) {
+                if (UNSAFE.compareAndSwapObject
+                    (this, COMPLETIONS, p.next = completions, p))
+                    break;
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            Throwable ex;
+            if (r instanceof AltResult)
+                ex = ((AltResult)r).ex;
+            else
+                ex = null;
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncRun(action, dst));
+                    else
+                        action.run();
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(null, ex);
+        }
+        helpPostComplete();
+        return dst;
+    }
+
+    private <U,V> CompletableFuture<V> doThenCombine
+        (CompletableFuture<? extends U> other,
+         BiFunction<? super T,? super U,? extends V> fn,
+         Executor e) {
+        if (other == null || fn == null) throw new NullPointerException();
+        CompletableFuture<V> dst = new CompletableFuture<V>();
+        ThenCombine<T,U,V> d = null;
+        Object r, s = null;
+        if ((r = result) == null || (s = other.result) == null) {
+            d = new ThenCombine<T,U,V>(this, other, fn, dst, e);
+            CompletionNode q = null, p = new CompletionNode(d);
+            while ((r == null && (r = result) == null) ||
+                   (s == null && (s = other.result) == null)) {
+                if (q != null) {
+                    if (s != null ||
+                        UNSAFE.compareAndSwapObject
+                        (other, COMPLETIONS, q.next = other.completions, q))
+                        break;
+                }
+                else if (r != null ||
+                         UNSAFE.compareAndSwapObject
+                         (this, COMPLETIONS, p.next = completions, p)) {
+                    if (s != null)
+                        break;
+                    q = new CompletionNode(d);
+                }
+            }
+        }
+        if (r != null && s != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; U u; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            if (ex != null)
+                u = null;
+            else if (s instanceof AltResult) {
+                ex = ((AltResult)s).ex;
+                u = null;
+            }
+            else {
+                @SuppressWarnings("unchecked") U us = (U) s;
+                u = us;
+            }
+            V v = null;
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncCombine<T,U,V>(t, u, fn, dst));
+                    else
+                        v = fn.apply(t, u);
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(v, ex);
+        }
+        helpPostComplete();
+        other.helpPostComplete();
+        return dst;
+    }
+
+    private <U> CompletableFuture<Void> doThenAcceptBoth
+        (CompletableFuture<? extends U> other,
+         BiConsumer<? super T,? super U> fn,
+         Executor e) {
+        if (other == null || fn == null) throw new NullPointerException();
+        CompletableFuture<Void> dst = new CompletableFuture<Void>();
+        ThenAcceptBoth<T,U> d = null;
+        Object r, s = null;
+        if ((r = result) == null || (s = other.result) == null) {
+            d = new ThenAcceptBoth<T,U>(this, other, fn, dst, e);
+            CompletionNode q = null, p = new CompletionNode(d);
+            while ((r == null && (r = result) == null) ||
+                   (s == null && (s = other.result) == null)) {
+                if (q != null) {
+                    if (s != null ||
+                        UNSAFE.compareAndSwapObject
+                        (other, COMPLETIONS, q.next = other.completions, q))
+                        break;
+                }
+                else if (r != null ||
+                         UNSAFE.compareAndSwapObject
+                         (this, COMPLETIONS, p.next = completions, p)) {
+                    if (s != null)
+                        break;
+                    q = new CompletionNode(d);
+                }
+            }
+        }
+        if (r != null && s != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; U u; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            if (ex != null)
+                u = null;
+            else if (s instanceof AltResult) {
+                ex = ((AltResult)s).ex;
+                u = null;
+            }
+            else {
+                @SuppressWarnings("unchecked") U us = (U) s;
+                u = us;
+            }
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncAcceptBoth<T,U>(t, u, fn, dst));
+                    else
+                        fn.accept(t, u);
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(null, ex);
+        }
+        helpPostComplete();
+        other.helpPostComplete();
+        return dst;
+    }
+
+    private CompletableFuture<Void> doRunAfterBoth(CompletableFuture<?> other,
+                                                   Runnable action,
+                                                   Executor e) {
+        if (other == null || action == null) throw new NullPointerException();
+        CompletableFuture<Void> dst = new CompletableFuture<Void>();
+        RunAfterBoth d = null;
+        Object r, s = null;
+        if ((r = result) == null || (s = other.result) == null) {
+            d = new RunAfterBoth(this, other, action, dst, e);
+            CompletionNode q = null, p = new CompletionNode(d);
+            while ((r == null && (r = result) == null) ||
+                   (s == null && (s = other.result) == null)) {
+                if (q != null) {
+                    if (s != null ||
+                        UNSAFE.compareAndSwapObject
+                        (other, COMPLETIONS, q.next = other.completions, q))
+                        break;
+                }
+                else if (r != null ||
+                         UNSAFE.compareAndSwapObject
+                         (this, COMPLETIONS, p.next = completions, p)) {
+                    if (s != null)
+                        break;
+                    q = new CompletionNode(d);
+                }
+            }
+        }
+        if (r != null && s != null && (d == null || d.compareAndSet(0, 1))) {
+            Throwable ex;
+            if (r instanceof AltResult)
+                ex = ((AltResult)r).ex;
+            else
+                ex = null;
+            if (ex == null && (s instanceof AltResult))
+                ex = ((AltResult)s).ex;
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncRun(action, dst));
+                    else
+                        action.run();
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(null, ex);
+        }
+        helpPostComplete();
+        other.helpPostComplete();
+        return dst;
+    }
+
+    private <U> CompletableFuture<U> doApplyToEither
+        (CompletableFuture<? extends T> other,
+         Function<? super T, U> fn,
+         Executor e) {
+        if (other == null || fn == null) throw new NullPointerException();
+        CompletableFuture<U> dst = new CompletableFuture<U>();
+        ApplyToEither<T,U> d = null;
+        Object r;
+        if ((r = result) == null && (r = other.result) == null) {
+            d = new ApplyToEither<T,U>(this, other, fn, dst, e);
+            CompletionNode q = null, p = new CompletionNode(d);
+            while ((r = result) == null && (r = other.result) == null) {
+                if (q != null) {
+                    if (UNSAFE.compareAndSwapObject
+                        (other, COMPLETIONS, q.next = other.completions, q))
+                        break;
+                }
+                else if (UNSAFE.compareAndSwapObject
+                         (this, COMPLETIONS, p.next = completions, p))
+                    q = new CompletionNode(d);
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            U u = null;
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncApply<T,U>(t, fn, dst));
+                    else
+                        u = fn.apply(t);
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(u, ex);
+        }
+        helpPostComplete();
+        other.helpPostComplete();
+        return dst;
+    }
+
+    private CompletableFuture<Void> doAcceptEither
+        (CompletableFuture<? extends T> other,
+         Consumer<? super T> fn,
+         Executor e) {
+        if (other == null || fn == null) throw new NullPointerException();
+        CompletableFuture<Void> dst = new CompletableFuture<Void>();
+        AcceptEither<T> d = null;
+        Object r;
+        if ((r = result) == null && (r = other.result) == null) {
+            d = new AcceptEither<T>(this, other, fn, dst, e);
+            CompletionNode q = null, p = new CompletionNode(d);
+            while ((r = result) == null && (r = other.result) == null) {
+                if (q != null) {
+                    if (UNSAFE.compareAndSwapObject
+                        (other, COMPLETIONS, q.next = other.completions, q))
+                        break;
+                }
+                else if (UNSAFE.compareAndSwapObject
+                         (this, COMPLETIONS, p.next = completions, p))
+                    q = new CompletionNode(d);
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncAccept<T>(t, fn, dst));
+                    else
+                        fn.accept(t);
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(null, ex);
+        }
+        helpPostComplete();
+        other.helpPostComplete();
+        return dst;
+    }
+
+    private CompletableFuture<Void> doRunAfterEither
+        (CompletableFuture<?> other,
+         Runnable action,
+         Executor e) {
+        if (other == null || action == null) throw new NullPointerException();
+        CompletableFuture<Void> dst = new CompletableFuture<Void>();
+        RunAfterEither d = null;
+        Object r;
+        if ((r = result) == null && (r = other.result) == null) {
+            d = new RunAfterEither(this, other, action, dst, e);
+            CompletionNode q = null, p = new CompletionNode(d);
+            while ((r = result) == null && (r = other.result) == null) {
+                if (q != null) {
+                    if (UNSAFE.compareAndSwapObject
+                        (other, COMPLETIONS, q.next = other.completions, q))
+                        break;
+                }
+                else if (UNSAFE.compareAndSwapObject
+                         (this, COMPLETIONS, p.next = completions, p))
+                    q = new CompletionNode(d);
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            Throwable ex;
+            if (r instanceof AltResult)
+                ex = ((AltResult)r).ex;
+            else
+                ex = null;
+            if (ex == null) {
+                try {
+                    if (e != null)
+                        execAsync(e, new AsyncRun(action, dst));
+                    else
+                        action.run();
+                } catch (Throwable rex) {
+                    ex = rex;
+                }
+            }
+            if (e == null || ex != null)
+                dst.internalComplete(null, ex);
+        }
+        helpPostComplete();
+        other.helpPostComplete();
+        return dst;
+    }
+
+    private <U> CompletableFuture<U> doThenCompose
+        (Function<? super T, ? extends CompletionStage<U>> fn,
+         Executor e) {
+        if (fn == null) throw new NullPointerException();
+        CompletableFuture<U> dst = null;
+        ThenCompose<T,U> d = null;
+        Object r;
+        if ((r = result) == null) {
+            dst = new CompletableFuture<U>();
+            CompletionNode p = new CompletionNode
+                (d = new ThenCompose<T,U>(this, fn, dst, e));
+            while ((r = result) == null) {
+                if (UNSAFE.compareAndSwapObject
+                    (this, COMPLETIONS, p.next = completions, p))
+                    break;
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            if (ex == null) {
+                if (e != null) {
+                    if (dst == null)
+                        dst = new CompletableFuture<U>();
+                    execAsync(e, new AsyncCompose<T,U>(t, fn, dst));
+                }
+                else {
+                    try {
+                        CompletionStage<U> cs = fn.apply(t);
+                        if (cs == null ||
+                            (dst = cs.toCompletableFuture()) == null)
+                            ex = new NullPointerException();
+                    } catch (Throwable rex) {
+                        ex = rex;
+                    }
+                }
+            }
+            if (dst == null)
+                dst = new CompletableFuture<U>();
+            if (e == null || ex != null)
+                dst.internalComplete(null, ex);
+        }
+        helpPostComplete();
+        dst.helpPostComplete();
+        return dst;
+    }
+
+    private CompletableFuture<T> doWhenComplete
+        (BiConsumer<? super T, ? super Throwable> fn,
+         Executor e) {
+        if (fn == null) throw new NullPointerException();
+        CompletableFuture<T> dst = new CompletableFuture<T>();
+        WhenCompleteCompletion<T> d = null;
+        Object r;
+        if ((r = result) == null) {
+            CompletionNode p =
+                new CompletionNode(d = new WhenCompleteCompletion<T>
+                                   (this, fn, dst, e));
+            while ((r = result) == null) {
+                if (UNSAFE.compareAndSwapObject(this, COMPLETIONS,
+                                                p.next = completions, p))
+                    break;
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            Throwable dx = null;
+            try {
+                if (e != null)
+                    execAsync(e, new AsyncWhenComplete<T>(t, ex, fn, dst));
+                else
+                    fn.accept(t, ex);
+            } catch (Throwable rex) {
+                dx = rex;
+            }
+            if (e == null || dx != null)
+                dst.internalComplete(t, ex != null ? ex : dx);
+        }
+        helpPostComplete();
+        return dst;
+    }
+
+    private <U> CompletableFuture<U> doHandle
+        (BiFunction<? super T, Throwable, ? extends U> fn,
+         Executor e) {
+        if (fn == null) throw new NullPointerException();
+        CompletableFuture<U> dst = new CompletableFuture<U>();
+        HandleCompletion<T,U> d = null;
+        Object r;
+        if ((r = result) == null) {
+            CompletionNode p =
+                new CompletionNode(d = new HandleCompletion<T,U>
+                                   (this, fn, dst, e));
+            while ((r = result) == null) {
+                if (UNSAFE.compareAndSwapObject(this, COMPLETIONS,
+                                                p.next = completions, p))
+                    break;
+            }
+        }
+        if (r != null && (d == null || d.compareAndSet(0, 1))) {
+            T t; Throwable ex;
+            if (r instanceof AltResult) {
+                ex = ((AltResult)r).ex;
+                t = null;
+            }
+            else {
+                ex = null;
+                @SuppressWarnings("unchecked") T tr = (T) r;
+                t = tr;
+            }
+            U u = null;
+            Throwable dx = null;
+            try {
+                if (e != null)
+                    execAsync(e, new AsyncCombine<T,Throwable,U>(t, ex, fn, dst));
+                else {
+                    u = fn.apply(t, ex);
+                    dx = null;
+                }
+            } catch (Throwable rex) {
+                dx = rex;
+                u = null;
+            }
+            if (e == null || dx != null)
+                dst.internalComplete(u, dx);
+        }
+        helpPostComplete();
+        return dst;
+    }
+
+
     // public methods
 
     /**
@@ -1416,13 +2118,13 @@
      *
      * @param supplier a function returning the value to be used
      * to complete the returned CompletableFuture
+     * @param <U> the function's return type
      * @return the new CompletableFuture
      */
     public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier) {
         if (supplier == null) throw new NullPointerException();
         CompletableFuture<U> f = new CompletableFuture<U>();
-        ForkJoinPool.commonPool().
-            execute((ForkJoinTask<?>)new AsyncSupply<U>(supplier, f));
+        execAsync(ForkJoinPool.commonPool(), new AsyncSupply<U>(supplier, f));
         return f;
     }
 
@@ -1434,6 +2136,7 @@
      * @param supplier a function returning the value to be used
      * to complete the returned CompletableFuture
      * @param executor the executor to use for asynchronous execution
+     * @param <U> the function's return type
      * @return the new CompletableFuture
      */
     public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier,
@@ -1441,7 +2144,7 @@
         if (executor == null || supplier == null)
             throw new NullPointerException();
         CompletableFuture<U> f = new CompletableFuture<U>();
-        executor.execute(new AsyncSupply<U>(supplier, f));
+        execAsync(executor, new AsyncSupply<U>(supplier, f));
         return f;
     }
 
@@ -1457,8 +2160,7 @@
     public static CompletableFuture<Void> runAsync(Runnable runnable) {
         if (runnable == null) throw new NullPointerException();
         CompletableFuture<Void> f = new CompletableFuture<Void>();
-        ForkJoinPool.commonPool().
-            execute((ForkJoinTask<?>)new AsyncRun(runnable, f));
+        execAsync(ForkJoinPool.commonPool(), new AsyncRun(runnable, f));
         return f;
     }
 
@@ -1477,7 +2179,7 @@
         if (executor == null || runnable == null)
             throw new NullPointerException();
         CompletableFuture<Void> f = new CompletableFuture<Void>();
-        executor.execute(new AsyncRun(runnable, f));
+        execAsync(executor, new AsyncRun(runnable, f));
         return f;
     }
 
@@ -1486,6 +2188,7 @@
      * the given value.
      *
      * @param value the value
+     * @param <U> the type of the value
      * @return the completed CompletableFuture
      */
     public static <U> CompletableFuture<U> completedFuture(U value) {
@@ -1657,60 +2360,18 @@
         return triggered;
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when this CompletableFuture completes, with the result of the
-     * given function of this CompletableFuture's result.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied function throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public <U> CompletableFuture<U> thenApply(Function<? super T,? extends U> fn) {
+    // CompletionStage methods
+
+    public <U> CompletableFuture<U> thenApply
+        (Function<? super T,? extends U> fn) {
         return doThenApply(fn, null);
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when this CompletableFuture completes, with the result of the
-     * given function of this CompletableFuture's result from a
-     * task running in the {@link ForkJoinPool#commonPool()}.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied function throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @return the new CompletableFuture
-     */
     public <U> CompletableFuture<U> thenApplyAsync
         (Function<? super T,? extends U> fn) {
         return doThenApply(fn, ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when this CompletableFuture completes, with the result of the
-     * given function of this CompletableFuture's result from a
-     * task running in the given executor.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied function throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
     public <U> CompletableFuture<U> thenApplyAsync
         (Function<? super T,? extends U> fn,
          Executor executor) {
@@ -1718,1149 +2379,228 @@
         return doThenApply(fn, executor);
     }
 
-    private <U> CompletableFuture<U> doThenApply
-        (Function<? super T,? extends U> fn,
-         Executor e) {
-        if (fn == null) throw new NullPointerException();
-        CompletableFuture<U> dst = new CompletableFuture<U>();
-        ThenApply<T,U> d = null;
-        Object r;
-        if ((r = result) == null) {
-            CompletionNode p = new CompletionNode
-                (d = new ThenApply<T,U>(this, fn, dst, e));
-            while ((r = result) == null) {
-                if (UNSAFE.compareAndSwapObject
-                    (this, COMPLETIONS, p.next = completions, p))
-                    break;
-            }
-        }
-        if (r != null && (d == null || d.compareAndSet(0, 1))) {
-            T t; Throwable ex;
-            if (r instanceof AltResult) {
-                ex = ((AltResult)r).ex;
-                t = null;
-            }
-            else {
-                ex = null;
-                @SuppressWarnings("unchecked") T tr = (T) r;
-                t = tr;
-            }
-            U u = null;
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncApply<T,U>(t, fn, dst));
-                    else
-                        u = fn.apply(t);
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(u, ex);
-        }
-        helpPostComplete();
-        return dst;
+    public CompletableFuture<Void> thenAccept
+        (Consumer<? super T> action) {
+        return doThenAccept(action, null);
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when this CompletableFuture completes, after performing the given
-     * action with this CompletableFuture's result.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied action throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> thenAccept(Consumer<? super T> block) {
-        return doThenAccept(block, null);
+    public CompletableFuture<Void> thenAcceptAsync
+        (Consumer<? super T> action) {
+        return doThenAccept(action, ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when this CompletableFuture completes, after performing the given
-     * action with this CompletableFuture's result from a task running
-     * in the {@link ForkJoinPool#commonPool()}.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied action throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> thenAcceptAsync(Consumer<? super T> block) {
-        return doThenAccept(block, ForkJoinPool.commonPool());
-    }
-
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when this CompletableFuture completes, after performing the given
-     * action with this CompletableFuture's result from a task running
-     * in the given executor.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied action throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> thenAcceptAsync(Consumer<? super T> block,
-                                                   Executor executor) {
+    public CompletableFuture<Void> thenAcceptAsync
+        (Consumer<? super T> action,
+         Executor executor) {
         if (executor == null) throw new NullPointerException();
-        return doThenAccept(block, executor);
+        return doThenAccept(action, executor);
     }
 
-    private CompletableFuture<Void> doThenAccept(Consumer<? super T> fn,
-                                                 Executor e) {
-        if (fn == null) throw new NullPointerException();
-        CompletableFuture<Void> dst = new CompletableFuture<Void>();
-        ThenAccept<T> d = null;
-        Object r;
-        if ((r = result) == null) {
-            CompletionNode p = new CompletionNode
-                (d = new ThenAccept<T>(this, fn, dst, e));
-            while ((r = result) == null) {
-                if (UNSAFE.compareAndSwapObject
-                    (this, COMPLETIONS, p.next = completions, p))
-                    break;
-            }
-        }
-        if (r != null && (d == null || d.compareAndSet(0, 1))) {
-            T t; Throwable ex;
-            if (r instanceof AltResult) {
-                ex = ((AltResult)r).ex;
-                t = null;
-            }
-            else {
-                ex = null;
-                @SuppressWarnings("unchecked") T tr = (T) r;
-                t = tr;
-            }
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncAccept<T>(t, fn, dst));
-                    else
-                        fn.accept(t);
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(null, ex);
-        }
-        helpPostComplete();
-        return dst;
-    }
-
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when this CompletableFuture completes, after performing the given
-     * action.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied action throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> thenRun(Runnable action) {
+    public CompletableFuture<Void> thenRun
+        (Runnable action) {
         return doThenRun(action, null);
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when this CompletableFuture completes, after performing the given
-     * action from a task running in the {@link ForkJoinPool#commonPool()}.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied action throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> thenRunAsync(Runnable action) {
+    public CompletableFuture<Void> thenRunAsync
+        (Runnable action) {
         return doThenRun(action, ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when this CompletableFuture completes, after performing the given
-     * action from a task running in the given executor.
-     *
-     * <p>If this CompletableFuture completes exceptionally, or the
-     * supplied action throws an exception, then the returned
-     * CompletableFuture completes exceptionally with a
-     * CompletionException holding the exception as its cause.
-     *
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> thenRunAsync(Runnable action,
-                                                Executor executor) {
+    public CompletableFuture<Void> thenRunAsync
+        (Runnable action,
+         Executor executor) {
         if (executor == null) throw new NullPointerException();
         return doThenRun(action, executor);
     }
 
-    private CompletableFuture<Void> doThenRun(Runnable action,
-                                              Executor e) {
-        if (action == null) throw new NullPointerException();
-        CompletableFuture<Void> dst = new CompletableFuture<Void>();
-        ThenRun d = null;
-        Object r;
-        if ((r = result) == null) {
-            CompletionNode p = new CompletionNode
-                (d = new ThenRun(this, action, dst, e));
-            while ((r = result) == null) {
-                if (UNSAFE.compareAndSwapObject
-                    (this, COMPLETIONS, p.next = completions, p))
-                    break;
-            }
-        }
-        if (r != null && (d == null || d.compareAndSet(0, 1))) {
-            Throwable ex;
-            if (r instanceof AltResult)
-                ex = ((AltResult)r).ex;
-            else
-                ex = null;
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncRun(action, dst));
-                    else
-                        action.run();
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(null, ex);
-        }
-        helpPostComplete();
-        return dst;
+    public <U,V> CompletableFuture<V> thenCombine
+        (CompletionStage<? extends U> other,
+         BiFunction<? super T,? super U,? extends V> fn) {
+        return doThenCombine(other.toCompletableFuture(), fn, null);
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when both this and the other given CompletableFuture complete,
-     * with the result of the given function of the results of the two
-     * CompletableFutures.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied function throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public <U,V> CompletableFuture<V> thenCombine
-        (CompletableFuture<? extends U> other,
+    public <U,V> CompletableFuture<V> thenCombineAsync
+        (CompletionStage<? extends U> other,
          BiFunction<? super T,? super U,? extends V> fn) {
-        return doThenCombine(other, fn, null);
+        return doThenCombine(other.toCompletableFuture(), fn,
+                             ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when both this and the other given CompletableFuture complete,
-     * with the result of the given function of the results of the two
-     * CompletableFutures from a task running in the
-     * {@link ForkJoinPool#commonPool()}.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied function throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @return the new CompletableFuture
-     */
     public <U,V> CompletableFuture<V> thenCombineAsync
-        (CompletableFuture<? extends U> other,
-         BiFunction<? super T,? super U,? extends V> fn) {
-        return doThenCombine(other, fn, ForkJoinPool.commonPool());
-    }
-
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when both this and the other given CompletableFuture complete,
-     * with the result of the given function of the results of the two
-     * CompletableFutures from a task running in the given executor.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied function throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
-    public <U,V> CompletableFuture<V> thenCombineAsync
-        (CompletableFuture<? extends U> other,
+        (CompletionStage<? extends U> other,
          BiFunction<? super T,? super U,? extends V> fn,
          Executor executor) {
         if (executor == null) throw new NullPointerException();
-        return doThenCombine(other, fn, executor);
+        return doThenCombine(other.toCompletableFuture(), fn, executor);
+    }
+
+    public <U> CompletableFuture<Void> thenAcceptBoth
+        (CompletionStage<? extends U> other,
+         BiConsumer<? super T, ? super U> action) {
+        return doThenAcceptBoth(other.toCompletableFuture(), action, null);
     }
 
-    private <U,V> CompletableFuture<V> doThenCombine
-        (CompletableFuture<? extends U> other,
-         BiFunction<? super T,? super U,? extends V> fn,
-         Executor e) {
-        if (other == null || fn == null) throw new NullPointerException();
-        CompletableFuture<V> dst = new CompletableFuture<V>();
-        ThenCombine<T,U,V> d = null;
-        Object r, s = null;
-        if ((r = result) == null || (s = other.result) == null) {
-            d = new ThenCombine<T,U,V>(this, other, fn, dst, e);
-            CompletionNode q = null, p = new CompletionNode(d);
-            while ((r == null && (r = result) == null) ||
-                   (s == null && (s = other.result) == null)) {
-                if (q != null) {
-                    if (s != null ||
-                        UNSAFE.compareAndSwapObject
-                        (other, COMPLETIONS, q.next = other.completions, q))
-                        break;
-                }
-                else if (r != null ||
-                         UNSAFE.compareAndSwapObject
-                         (this, COMPLETIONS, p.next = completions, p)) {
-                    if (s != null)
-                        break;
-                    q = new CompletionNode(d);
-                }
-            }
-        }
-        if (r != null && s != null && (d == null || d.compareAndSet(0, 1))) {
-            T t; U u; Throwable ex;
-            if (r instanceof AltResult) {
-                ex = ((AltResult)r).ex;
-                t = null;
-            }
-            else {
-                ex = null;
-                @SuppressWarnings("unchecked") T tr = (T) r;
-                t = tr;
-            }
-            if (ex != null)
-                u = null;
-            else if (s instanceof AltResult) {
-                ex = ((AltResult)s).ex;
-                u = null;
-            }
-            else {
-                @SuppressWarnings("unchecked") U us = (U) s;
-                u = us;
-            }
-            V v = null;
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncCombine<T,U,V>(t, u, fn, dst));
-                    else
-                        v = fn.apply(t, u);
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(v, ex);
-        }
-        helpPostComplete();
-        other.helpPostComplete();
-        return dst;
+    public <U> CompletableFuture<Void> thenAcceptBothAsync
+        (CompletionStage<? extends U> other,
+         BiConsumer<? super T, ? super U> action) {
+        return doThenAcceptBoth(other.toCompletableFuture(), action,
+                                ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when both this and the other given CompletableFuture complete,
-     * after performing the given action with the results of the two
-     * CompletableFutures.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied action throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public <U> CompletableFuture<Void> thenAcceptBoth
-        (CompletableFuture<? extends U> other,
-         BiConsumer<? super T, ? super U> block) {
-        return doThenAcceptBoth(other, block, null);
+    public <U> CompletableFuture<Void> thenAcceptBothAsync
+        (CompletionStage<? extends U> other,
+         BiConsumer<? super T, ? super U> action,
+         Executor executor) {
+        if (executor == null) throw new NullPointerException();
+        return doThenAcceptBoth(other.toCompletableFuture(), action, executor);
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when both this and the other given CompletableFuture complete,
-     * after performing the given action with the results of the two
-     * CompletableFutures from a task running in the {@link
-     * ForkJoinPool#commonPool()}.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied action throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public <U> CompletableFuture<Void> thenAcceptBothAsync
-        (CompletableFuture<? extends U> other,
-         BiConsumer<? super T, ? super U> block) {
-        return doThenAcceptBoth(other, block, ForkJoinPool.commonPool());
-    }
-
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when both this and the other given CompletableFuture complete,
-     * after performing the given action with the results of the two
-     * CompletableFutures from a task running in the given executor.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied action throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
-    public <U> CompletableFuture<Void> thenAcceptBothAsync
-        (CompletableFuture<? extends U> other,
-         BiConsumer<? super T, ? super U> block,
-         Executor executor) {
-        if (executor == null) throw new NullPointerException();
-        return doThenAcceptBoth(other, block, executor);
+    public CompletableFuture<Void> runAfterBoth
+        (CompletionStage<?> other,
+         Runnable action) {
+        return doRunAfterBoth(other.toCompletableFuture(), action, null);
     }
 
-    private <U> CompletableFuture<Void> doThenAcceptBoth
-        (CompletableFuture<? extends U> other,
-         BiConsumer<? super T,? super U> fn,
-         Executor e) {
-        if (other == null || fn == null) throw new NullPointerException();
-        CompletableFuture<Void> dst = new CompletableFuture<Void>();
-        ThenAcceptBoth<T,U> d = null;
-        Object r, s = null;
-        if ((r = result) == null || (s = other.result) == null) {
-            d = new ThenAcceptBoth<T,U>(this, other, fn, dst, e);
-            CompletionNode q = null, p = new CompletionNode(d);
-            while ((r == null && (r = result) == null) ||
-                   (s == null && (s = other.result) == null)) {
-                if (q != null) {
-                    if (s != null ||
-                        UNSAFE.compareAndSwapObject
-                        (other, COMPLETIONS, q.next = other.completions, q))
-                        break;
-                }
-                else if (r != null ||
-                         UNSAFE.compareAndSwapObject
-                         (this, COMPLETIONS, p.next = completions, p)) {
-                    if (s != null)
-                        break;
-                    q = new CompletionNode(d);
-                }
-            }
-        }
-        if (r != null && s != null && (d == null || d.compareAndSet(0, 1))) {
-            T t; U u; Throwable ex;
-            if (r instanceof AltResult) {
-                ex = ((AltResult)r).ex;
-                t = null;
-            }
-            else {
-                ex = null;
-                @SuppressWarnings("unchecked") T tr = (T) r;
-                t = tr;
-            }
-            if (ex != null)
-                u = null;
-            else if (s instanceof AltResult) {
-                ex = ((AltResult)s).ex;
-                u = null;
-            }
-            else {
-                @SuppressWarnings("unchecked") U us = (U) s;
-                u = us;
-            }
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncAcceptBoth<T,U>(t, u, fn, dst));
-                    else
-                        fn.accept(t, u);
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(null, ex);
-        }
-        helpPostComplete();
-        other.helpPostComplete();
-        return dst;
+    public CompletableFuture<Void> runAfterBothAsync
+        (CompletionStage<?> other,
+         Runnable action) {
+        return doRunAfterBoth(other.toCompletableFuture(), action,
+                              ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when both this and the other given CompletableFuture complete,
-     * after performing the given action.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied action throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> runAfterBoth(CompletableFuture<?> other,
-                                                Runnable action) {
-        return doRunAfterBoth(other, action, null);
-    }
-
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when both this and the other given CompletableFuture complete,
-     * after performing the given action from a task running in the
-     * {@link ForkJoinPool#commonPool()}.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied action throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> runAfterBothAsync(CompletableFuture<?> other,
-                                                     Runnable action) {
-        return doRunAfterBoth(other, action, ForkJoinPool.commonPool());
+    public CompletableFuture<Void> runAfterBothAsync
+        (CompletionStage<?> other,
+         Runnable action,
+         Executor executor) {
+        if (executor == null) throw new NullPointerException();
+        return doRunAfterBoth(other.toCompletableFuture(), action, executor);
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when both this and the other given CompletableFuture complete,
-     * after performing the given action from a task running in the
-     * given executor.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, or the supplied action throws an exception,
-     * then the returned CompletableFuture completes exceptionally
-     * with a CompletionException holding the exception as its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> runAfterBothAsync(CompletableFuture<?> other,
-                                                     Runnable action,
-                                                     Executor executor) {
-        if (executor == null) throw new NullPointerException();
-        return doRunAfterBoth(other, action, executor);
-    }
 
-    private CompletableFuture<Void> doRunAfterBoth(CompletableFuture<?> other,
-                                                   Runnable action,
-                                                   Executor e) {
-        if (other == null || action == null) throw new NullPointerException();
-        CompletableFuture<Void> dst = new CompletableFuture<Void>();
-        RunAfterBoth d = null;
-        Object r, s = null;
-        if ((r = result) == null || (s = other.result) == null) {
-            d = new RunAfterBoth(this, other, action, dst, e);
-            CompletionNode q = null, p = new CompletionNode(d);
-            while ((r == null && (r = result) == null) ||
-                   (s == null && (s = other.result) == null)) {
-                if (q != null) {
-                    if (s != null ||
-                        UNSAFE.compareAndSwapObject
-                        (other, COMPLETIONS, q.next = other.completions, q))
-                        break;
-                }
-                else if (r != null ||
-                         UNSAFE.compareAndSwapObject
-                         (this, COMPLETIONS, p.next = completions, p)) {
-                    if (s != null)
-                        break;
-                    q = new CompletionNode(d);
-                }
-            }
-        }
-        if (r != null && s != null && (d == null || d.compareAndSet(0, 1))) {
-            Throwable ex;
-            if (r instanceof AltResult)
-                ex = ((AltResult)r).ex;
-            else
-                ex = null;
-            if (ex == null && (s instanceof AltResult))
-                ex = ((AltResult)s).ex;
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncRun(action, dst));
-                    else
-                        action.run();
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(null, ex);
-        }
-        helpPostComplete();
-        other.helpPostComplete();
-        return dst;
+    public <U> CompletableFuture<U> applyToEither
+        (CompletionStage<? extends T> other,
+         Function<? super T, U> fn) {
+        return doApplyToEither(other.toCompletableFuture(), fn, null);
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when either this or the other given CompletableFuture completes,
-     * with the result of the given function of either this or the other
-     * CompletableFuture's result.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied function
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public <U> CompletableFuture<U> applyToEither
-        (CompletableFuture<? extends T> other,
+    public <U> CompletableFuture<U> applyToEitherAsync
+        (CompletionStage<? extends T> other,
          Function<? super T, U> fn) {
-        return doApplyToEither(other, fn, null);
+        return doApplyToEither(other.toCompletableFuture(), fn,
+                               ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when either this or the other given CompletableFuture completes,
-     * with the result of the given function of either this or the other
-     * CompletableFuture's result from a task running in the
-     * {@link ForkJoinPool#commonPool()}.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied function
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @return the new CompletableFuture
-     */
     public <U> CompletableFuture<U> applyToEitherAsync
-        (CompletableFuture<? extends T> other,
-         Function<? super T, U> fn) {
-        return doApplyToEither(other, fn, ForkJoinPool.commonPool());
-    }
-
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when either this or the other given CompletableFuture completes,
-     * with the result of the given function of either this or the other
-     * CompletableFuture's result from a task running in the
-     * given executor.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied function
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param fn the function to use to compute the value of
-     * the returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
-    public <U> CompletableFuture<U> applyToEitherAsync
-        (CompletableFuture<? extends T> other,
+        (CompletionStage<? extends T> other,
          Function<? super T, U> fn,
          Executor executor) {
         if (executor == null) throw new NullPointerException();
-        return doApplyToEither(other, fn, executor);
+        return doApplyToEither(other.toCompletableFuture(), fn, executor);
     }
 
-    private <U> CompletableFuture<U> doApplyToEither
-        (CompletableFuture<? extends T> other,
-         Function<? super T, U> fn,
-         Executor e) {
-        if (other == null || fn == null) throw new NullPointerException();
-        CompletableFuture<U> dst = new CompletableFuture<U>();
-        ApplyToEither<T,U> d = null;
-        Object r;
-        if ((r = result) == null && (r = other.result) == null) {
-            d = new ApplyToEither<T,U>(this, other, fn, dst, e);
-            CompletionNode q = null, p = new CompletionNode(d);
-            while ((r = result) == null && (r = other.result) == null) {
-                if (q != null) {
-                    if (UNSAFE.compareAndSwapObject
-                        (other, COMPLETIONS, q.next = other.completions, q))
-                        break;
-                }
-                else if (UNSAFE.compareAndSwapObject
-                         (this, COMPLETIONS, p.next = completions, p))
-                    q = new CompletionNode(d);
-            }
-        }
-        if (r != null && (d == null || d.compareAndSet(0, 1))) {
-            T t; Throwable ex;
-            if (r instanceof AltResult) {
-                ex = ((AltResult)r).ex;
-                t = null;
-            }
-            else {
-                ex = null;
-                @SuppressWarnings("unchecked") T tr = (T) r;
-                t = tr;
-            }
-            U u = null;
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncApply<T,U>(t, fn, dst));
-                    else
-                        u = fn.apply(t);
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(u, ex);
-        }
-        helpPostComplete();
-        other.helpPostComplete();
-        return dst;
+    public CompletableFuture<Void> acceptEither
+        (CompletionStage<? extends T> other,
+         Consumer<? super T> action) {
+        return doAcceptEither(other.toCompletableFuture(), action, null);
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when either this or the other given CompletableFuture completes,
-     * after performing the given action with the result of either this
-     * or the other CompletableFuture's result.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied action
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> acceptEither
-        (CompletableFuture<? extends T> other,
-         Consumer<? super T> block) {
-        return doAcceptEither(other, block, null);
-    }
-
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when either this or the other given CompletableFuture completes,
-     * after performing the given action with the result of either this
-     * or the other CompletableFuture's result from a task running in
-     * the {@link ForkJoinPool#commonPool()}.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied action
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
     public CompletableFuture<Void> acceptEitherAsync
-        (CompletableFuture<? extends T> other,
-         Consumer<? super T> block) {
-        return doAcceptEither(other, block, ForkJoinPool.commonPool());
+        (CompletionStage<? extends T> other,
+         Consumer<? super T> action) {
+        return doAcceptEither(other.toCompletableFuture(), action,
+                              ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when either this or the other given CompletableFuture completes,
-     * after performing the given action with the result of either this
-     * or the other CompletableFuture's result from a task running in
-     * the given executor.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied action
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param block the action to perform before completing the
-     * returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
     public CompletableFuture<Void> acceptEitherAsync
-        (CompletableFuture<? extends T> other,
-         Consumer<? super T> block,
+        (CompletionStage<? extends T> other,
+         Consumer<? super T> action,
          Executor executor) {
         if (executor == null) throw new NullPointerException();
-        return doAcceptEither(other, block, executor);
+        return doAcceptEither(other.toCompletableFuture(), action, executor);
     }
 
-    private CompletableFuture<Void> doAcceptEither
-        (CompletableFuture<? extends T> other,
-         Consumer<? super T> fn,
-         Executor e) {
-        if (other == null || fn == null) throw new NullPointerException();
-        CompletableFuture<Void> dst = new CompletableFuture<Void>();
-        AcceptEither<T> d = null;
-        Object r;
-        if ((r = result) == null && (r = other.result) == null) {
-            d = new AcceptEither<T>(this, other, fn, dst, e);
-            CompletionNode q = null, p = new CompletionNode(d);
-            while ((r = result) == null && (r = other.result) == null) {
-                if (q != null) {
-                    if (UNSAFE.compareAndSwapObject
-                        (other, COMPLETIONS, q.next = other.completions, q))
-                        break;
-                }
-                else if (UNSAFE.compareAndSwapObject
-                         (this, COMPLETIONS, p.next = completions, p))
-                    q = new CompletionNode(d);
-            }
-        }
-        if (r != null && (d == null || d.compareAndSet(0, 1))) {
-            T t; Throwable ex;
-            if (r instanceof AltResult) {
-                ex = ((AltResult)r).ex;
-                t = null;
-            }
-            else {
-                ex = null;
-                @SuppressWarnings("unchecked") T tr = (T) r;
-                t = tr;
-            }
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncAccept<T>(t, fn, dst));
-                    else
-                        fn.accept(t);
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(null, ex);
-        }
-        helpPostComplete();
-        other.helpPostComplete();
-        return dst;
+    public CompletableFuture<Void> runAfterEither(CompletionStage<?> other,
+                                                  Runnable action) {
+        return doRunAfterEither(other.toCompletableFuture(), action, null);
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed
-     * when either this or the other given CompletableFuture completes,
-     * after performing the given action.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied action
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> runAfterEither(CompletableFuture<?> other,
-                                                  Runnable action) {
-        return doRunAfterEither(other, action, null);
+    public CompletableFuture<Void> runAfterEitherAsync
+        (CompletionStage<?> other,
+         Runnable action) {
+        return doRunAfterEither(other.toCompletableFuture(), action,
+                                ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when either this or the other given CompletableFuture completes,
-     * after performing the given action from a task running in the
-     * {@link ForkJoinPool#commonPool()}.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied action
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
     public CompletableFuture<Void> runAfterEitherAsync
-        (CompletableFuture<?> other,
-         Runnable action) {
-        return doRunAfterEither(other, action, ForkJoinPool.commonPool());
-    }
-
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * when either this or the other given CompletableFuture completes,
-     * after performing the given action from a task running in the
-     * given executor.
-     *
-     * <p>If this and/or the other CompletableFuture complete
-     * exceptionally, then the returned CompletableFuture may also do so,
-     * with a CompletionException holding one of these exceptions as its
-     * cause.  No guarantees are made about which result or exception is
-     * used in the returned CompletableFuture.  If the supplied action
-     * throws an exception, then the returned CompletableFuture completes
-     * exceptionally with a CompletionException holding the exception as
-     * its cause.
-     *
-     * @param other the other CompletableFuture
-     * @param action the action to perform before completing the
-     * returned CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the new CompletableFuture
-     */
-    public CompletableFuture<Void> runAfterEitherAsync
-        (CompletableFuture<?> other,
+        (CompletionStage<?> other,
          Runnable action,
          Executor executor) {
         if (executor == null) throw new NullPointerException();
-        return doRunAfterEither(other, action, executor);
+        return doRunAfterEither(other.toCompletableFuture(), action, executor);
     }
 
-    private CompletableFuture<Void> doRunAfterEither
-        (CompletableFuture<?> other,
-         Runnable action,
-         Executor e) {
-        if (other == null || action == null) throw new NullPointerException();
-        CompletableFuture<Void> dst = new CompletableFuture<Void>();
-        RunAfterEither d = null;
-        Object r;
-        if ((r = result) == null && (r = other.result) == null) {
-            d = new RunAfterEither(this, other, action, dst, e);
-            CompletionNode q = null, p = new CompletionNode(d);
-            while ((r = result) == null && (r = other.result) == null) {
-                if (q != null) {
-                    if (UNSAFE.compareAndSwapObject
-                        (other, COMPLETIONS, q.next = other.completions, q))
-                        break;
-                }
-                else if (UNSAFE.compareAndSwapObject
-                         (this, COMPLETIONS, p.next = completions, p))
-                    q = new CompletionNode(d);
-            }
-        }
-        if (r != null && (d == null || d.compareAndSet(0, 1))) {
-            Throwable ex;
-            if (r instanceof AltResult)
-                ex = ((AltResult)r).ex;
-            else
-                ex = null;
-            if (ex == null) {
-                try {
-                    if (e != null)
-                        e.execute(new AsyncRun(action, dst));
-                    else
-                        action.run();
-                } catch (Throwable rex) {
-                    ex = rex;
-                }
-            }
-            if (e == null || ex != null)
-                dst.internalComplete(null, ex);
-        }
-        helpPostComplete();
-        other.helpPostComplete();
-        return dst;
-    }
-
-    /**
-     * Returns a CompletableFuture that upon completion, has the same
-     * value as produced by the given function of the result of this
-     * CompletableFuture.
-     *
-     * <p>If this CompletableFuture completes exceptionally, then the
-     * returned CompletableFuture also does so, with a
-     * CompletionException holding this exception as its cause.
-     * Similarly, if the computed CompletableFuture completes
-     * exceptionally, then so does the returned CompletableFuture.
-     *
-     * @param fn the function returning a new CompletableFuture
-     * @return the CompletableFuture
-     */
     public <U> CompletableFuture<U> thenCompose
-        (Function<? super T, CompletableFuture<U>> fn) {
+        (Function<? super T, ? extends CompletionStage<U>> fn) {
         return doThenCompose(fn, null);
     }
 
-    /**
-     * Returns a CompletableFuture that upon completion, has the same
-     * value as that produced asynchronously using the {@link
-     * ForkJoinPool#commonPool()} by the given function of the result
-     * of this CompletableFuture.
-     *
-     * <p>If this CompletableFuture completes exceptionally, then the
-     * returned CompletableFuture also does so, with a
-     * CompletionException holding this exception as its cause.
-     * Similarly, if the computed CompletableFuture completes
-     * exceptionally, then so does the returned CompletableFuture.
-     *
-     * @param fn the function returning a new CompletableFuture
-     * @return the CompletableFuture
-     */
     public <U> CompletableFuture<U> thenComposeAsync
-        (Function<? super T, CompletableFuture<U>> fn) {
+        (Function<? super T, ? extends CompletionStage<U>> fn) {
         return doThenCompose(fn, ForkJoinPool.commonPool());
     }
 
-    /**
-     * Returns a CompletableFuture that upon completion, has the same
-     * value as that produced asynchronously using the given executor
-     * by the given function of this CompletableFuture.
-     *
-     * <p>If this CompletableFuture completes exceptionally, then the
-     * returned CompletableFuture also does so, with a
-     * CompletionException holding this exception as its cause.
-     * Similarly, if the computed CompletableFuture completes
-     * exceptionally, then so does the returned CompletableFuture.
-     *
-     * @param fn the function returning a new CompletableFuture
-     * @param executor the executor to use for asynchronous execution
-     * @return the CompletableFuture
-     */
     public <U> CompletableFuture<U> thenComposeAsync
-        (Function<? super T, CompletableFuture<U>> fn,
+        (Function<? super T, ? extends CompletionStage<U>> fn,
          Executor executor) {
         if (executor == null) throw new NullPointerException();
         return doThenCompose(fn, executor);
     }
 
-    private <U> CompletableFuture<U> doThenCompose
-        (Function<? super T, CompletableFuture<U>> fn,
-         Executor e) {
-        if (fn == null) throw new NullPointerException();
-        CompletableFuture<U> dst = null;
-        ThenCompose<T,U> d = null;
-        Object r;
-        if ((r = result) == null) {
-            dst = new CompletableFuture<U>();
-            CompletionNode p = new CompletionNode
-                (d = new ThenCompose<T,U>(this, fn, dst, e));
-            while ((r = result) == null) {
-                if (UNSAFE.compareAndSwapObject
-                    (this, COMPLETIONS, p.next = completions, p))
-                    break;
-            }
-        }
-        if (r != null && (d == null || d.compareAndSet(0, 1))) {
-            T t; Throwable ex;
-            if (r instanceof AltResult) {
-                ex = ((AltResult)r).ex;
-                t = null;
-            }
-            else {
-                ex = null;
-                @SuppressWarnings("unchecked") T tr = (T) r;
-                t = tr;
-            }
-            if (ex == null) {
-                if (e != null) {
-                    if (dst == null)
-                        dst = new CompletableFuture<U>();
-                    e.execute(new AsyncCompose<T,U>(t, fn, dst));
-                }
-                else {
-                    try {
-                        if ((dst = fn.apply(t)) == null)
-                            ex = new NullPointerException();
-                    } catch (Throwable rex) {
-                        ex = rex;
-                    }
-                }
-            }
-            if (dst == null)
-                dst = new CompletableFuture<U>();
-            if (e == null || ex != null)
-                dst.internalComplete(null, ex);
-        }
-        helpPostComplete();
-        dst.helpPostComplete();
-        return dst;
+    public CompletableFuture<T> whenComplete
+        (BiConsumer<? super T, ? super Throwable> action) {
+        return doWhenComplete(action, null);
+    }
+
+    public CompletableFuture<T> whenCompleteAsync
+        (BiConsumer<? super T, ? super Throwable> action) {
+        return doWhenComplete(action, ForkJoinPool.commonPool());
+    }
+
+    public CompletableFuture<T> whenCompleteAsync
+        (BiConsumer<? super T, ? super Throwable> action,
+         Executor executor) {
+        if (executor == null) throw new NullPointerException();
+        return doWhenComplete(action, executor);
+    }
+
+    public <U> CompletableFuture<U> handle
+        (BiFunction<? super T, Throwable, ? extends U> fn) {
+        return doHandle(fn, null);
     }
 
+    public <U> CompletableFuture<U> handleAsync
+        (BiFunction<? super T, Throwable, ? extends U> fn) {
+        return doHandle(fn, ForkJoinPool.commonPool());
+    }
+
+    public <U> CompletableFuture<U> handleAsync
+        (BiFunction<? super T, Throwable, ? extends U> fn,
+         Executor executor) {
+        if (executor == null) throw new NullPointerException();
+        return doHandle(fn, executor);
+    }
+
+    /**
+     * Returns this CompletableFuture
+     *
+     * @return this CompletableFuture
+     */
+    public CompletableFuture<T> toCompletableFuture() {
+        return this;
+    }
+
+    // not in interface CompletionStage
+
     /**
      * Returns a new CompletableFuture that is completed when this
      * CompletableFuture completes, with the result of the given
@@ -2868,6 +2608,8 @@
      * completion when it completes exceptionally; otherwise, if this
      * CompletableFuture completes normally, then the returned
      * CompletableFuture also completes normally with the same value.
+     * Note: More flexible versions of this functionality are
+     * available using methods {@code whenComplete} and {@code handle}.
      *
      * @param fn the function to use to compute the value of the
      * returned CompletableFuture if this CompletableFuture completed
@@ -2882,7 +2624,8 @@
         Object r;
         if ((r = result) == null) {
             CompletionNode p =
-                new CompletionNode(d = new ExceptionCompletion<T>(this, fn, dst));
+                new CompletionNode(d = new ExceptionCompletion<T>
+                                   (this, fn, dst));
             while ((r = result) == null) {
                 if (UNSAFE.compareAndSwapObject(this, COMPLETIONS,
                                                 p.next = completions, p))
@@ -2910,59 +2653,6 @@
         return dst;
     }
 
-    /**
-     * Returns a new CompletableFuture that is completed when this
-     * CompletableFuture completes, with the result of the given
-     * function of the result and exception of this CompletableFuture's
-     * completion.  The given function is invoked with the result (or
-     * {@code null} if none) and the exception (or {@code null} if none)
-     * of this CompletableFuture when complete.
-     *
-     * @param fn the function to use to compute the value of the
-     * returned CompletableFuture
-     * @return the new CompletableFuture
-     */
-    public <U> CompletableFuture<U> handle
-        (BiFunction<? super T, Throwable, ? extends U> fn) {
-        if (fn == null) throw new NullPointerException();
-        CompletableFuture<U> dst = new CompletableFuture<U>();
-        HandleCompletion<T,U> d = null;
-        Object r;
-        if ((r = result) == null) {
-            CompletionNode p =
-                new CompletionNode(d = new HandleCompletion<T,U>(this, fn, dst));
-            while ((r = result) == null) {
-                if (UNSAFE.compareAndSwapObject(this, COMPLETIONS,
-                                                p.next = completions, p))
-                    break;
-            }
-        }
-        if (r != null && (d == null || d.compareAndSet(0, 1))) {
-            T t; Throwable ex;
-            if (r instanceof AltResult) {
-                ex = ((AltResult)r).ex;
-                t = null;
-            }
-            else {
-                ex = null;
-                @SuppressWarnings("unchecked") T tr = (T) r;
-                t = tr;
-            }
-            U u; Throwable dx;
-            try {
-                u = fn.apply(t, ex);
-                dx = null;
-            } catch (Throwable rex) {
-                dx = rex;
-                u = null;
-            }
-            dst.internalComplete(u, dx);
-        }
-        helpPostComplete();
-        return dst;
-    }
-
-
     /* ------------- Arbitrary-arity constructions -------------- */
 
     /*
@@ -3215,6 +2905,21 @@
     }
 
     /**
+     * Returns {@code true} if this CompletableFuture completed
+     * exceptionally, in any way. Possible causes include
+     * cancellation, explicit invocation of {@code
+     * completeExceptionally}, and abrupt termination of a
+     * CompletionStage action.
+     *
+     * @return {@code true} if this CompletableFuture completed
+     * exceptionally
+     */
+    public boolean isCompletedExceptionally() {
+        Object r;
+        return ((r = result) instanceof AltResult) && r != NIL;
+    }
+
+    /**
      * Forcibly sets or resets the value subsequently returned by
      * method {@link #get()} and related methods, whether or not
      * already completed. This method is designed for use only in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/util/concurrent/CompletionStage.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,760 @@
+/*
+ * 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.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+package java.util.concurrent;
+import java.util.function.Supplier;
+import java.util.function.Consumer;
+import java.util.function.BiConsumer;
+import java.util.function.Function;
+import java.util.function.BiFunction;
+import java.util.concurrent.Executor;
+
+/**
+ * A stage of a possibly asynchronous computation, that performs an
+ * action or computes a value when another CompletionStage completes.
+ * A stage completes upon termination of its computation, but this may
+ * in turn trigger other dependent stages.  The functionality defined
+ * in this interface takes only a few basic forms, which expand out to
+ * a larger set of methods to capture a range of usage styles: <ul>
+ *
+ * <li>The computation performed by a stage may be expressed as a
+ * Function, Consumer, or Runnable (using methods with names including
+ * <em>apply</em>, <em>accept</em>, or <em>run</em>, respectively)
+ * depending on whether it requires arguments and/or produces results.
+ * For example, {@code stage.thenApply(x -> square(x)).thenAccept(x ->
+ * System.out.print(x)).thenRun(() -> System.out.println())}. An
+ * additional form (<em>compose</em>) applies functions of stages
+ * themselves, rather than their results. </li>
+ *
+ * <li> One stage's execution may be triggered by completion of a
+ * single stage, or both of two stages, or either of two stages.
+ * Dependencies on a single stage are arranged using methods with
+ * prefix <em>then</em>. Those triggered by completion of
+ * <em>both</em> of two stages may <em>combine</em> their results or
+ * effects, using correspondingly named methods. Those triggered by
+ * <em>either</em> of two stages make no guarantees about which of the
+ * results or effects are used for the dependent stage's
+ * computation.</li>
+ *
+ * <li> Dependencies among stages control the triggering of
+ * computations, but do not otherwise guarantee any particular
+ * ordering. Additionally, execution of a new stage's computations may
+ * be arranged in any of three ways: default execution, default
+ * asynchronous execution (using methods with suffix <em>async</em>
+ * that employ the stage's default asynchronous execution facility),
+ * or custom (via a supplied {@link Executor}).  The execution
+ * properties of default and async modes are specified by
+ * CompletionStage implementations, not this interface. Methods with
+ * explicit Executor arguments may have arbitrary execution
+ * properties, and might not even support concurrent execution, but
+ * are arranged for processing in a way that accommodates asynchrony.
+ *
+ * <li> Two method forms support processing whether the triggering
+ * stage completed normally or exceptionally: Method {@link
+ * #whenComplete whenComplete} allows injection of an action
+ * regardless of outcome, otherwise preserving the outcome in its
+ * completion. Method {@link #handle handle} additionally allows the
+ * stage to compute a replacement result that may enable further
+ * processing by other dependent stages.  In all other cases, if a
+ * stage's computation terminates abruptly with an (unchecked)
+ * exception or error, then all dependent stages requiring its
+ * completion complete exceptionally as well, with a {@link
+ * CompletionException} holding the exception as its cause.  If a
+ * stage is dependent on <em>both</em> of two stages, and both
+ * complete exceptionally, then the CompletionException may correspond
+ * to either one of these exceptions.  If a stage is dependent on
+ * <em>either</em> of two others, and only one of them completes
+ * exceptionally, no guarantees are made about whether the dependent
+ * stage completes normally or exceptionally. In the case of method
+ * {@code whenComplete}, when the supplied action itself encounters an
+ * exception, then the stage exceptionally completes with this
+ * exception if not already completed exceptionally.</li>
+ *
+ * </ul>
+ *
+ * <p>All methods adhere to the above triggering, execution, and
+ * exceptional completion specifications (which are not repeated in
+ * individual method specifications). Additionally, while arguments
+ * used to pass a completion result (that is, for parameters of type
+ * {@code T}) for methods accepting them may be null, passing a null
+ * value for any other parameter will result in a {@link
+ * NullPointerException} being thrown.
+ *
+ * <p>This interface does not define methods for initially creating,
+ * forcibly completing normally or exceptionally, probing completion
+ * status or results, or awaiting completion of a stage.
+ * Implementations of CompletionStage may provide means of achieving
+ * such effects, as appropriate.  Method {@link #toCompletableFuture}
+ * enables interoperability among different implementations of this
+ * interface by providing a common conversion type.
+ *
+ * @author Doug Lea
+ * @since 1.8
+ */
+public interface CompletionStage<T> {
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed with this stage's result as the argument
+     * to the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> thenApply(Function<? super T,? extends U> fn);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed using this stage's default asynchronous
+     * execution facility, with this stage's result as the argument to
+     * the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> thenApplyAsync
+        (Function<? super T,? extends U> fn);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed using the supplied Executor, with this
+     * stage's result as the argument to the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> thenApplyAsync
+        (Function<? super T,? extends U> fn,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed with this stage's result as the argument
+     * to the supplied action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> thenAccept(Consumer<? super T> action);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed using this stage's default asynchronous
+     * execution facility, with this stage's result as the argument to
+     * the supplied action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed using the supplied Executor, with this
+     * stage's result as the argument to the supplied action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> thenAcceptAsync(Consumer<? super T> action,
+                                                 Executor executor);
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, executes the given action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> thenRun(Runnable action);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, executes the given action using this stage's default
+     * asynchronous execution facility.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> thenRunAsync(Runnable action);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, executes the given action using the supplied Executor.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> thenRunAsync(Runnable action,
+                                              Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage both complete normally, is executed with the two
+     * results as arguments to the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param <U> the type of the other CompletionStage's result
+     * @param <V> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U,V> CompletionStage<V> thenCombine
+        (CompletionStage<? extends U> other,
+         BiFunction<? super T,? super U,? extends V> fn);
+
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage complete normally, is executed using this stage's
+     * default asynchronous execution facility, with the two results
+     * as arguments to the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param <U> the type of the other CompletionStage's result
+     * @param <V> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U,V> CompletionStage<V> thenCombineAsync
+        (CompletionStage<? extends U> other,
+         BiFunction<? super T,? super U,? extends V> fn);
+
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage complete normally, is executed using the supplied
+     * executor, with the two results as arguments to the supplied
+     * function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @param <U> the type of the other CompletionStage's result
+     * @param <V> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U,V> CompletionStage<V> thenCombineAsync
+        (CompletionStage<? extends U> other,
+         BiFunction<? super T,? super U,? extends V> fn,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage both complete normally, is executed with the two
+     * results as arguments to the supplied action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @param <U> the type of the other CompletionStage's result
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<Void> thenAcceptBoth
+        (CompletionStage<? extends U> other,
+         BiConsumer<? super T, ? super U> action);
+
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage complete normally, is executed using this stage's
+     * default asynchronous execution facility, with the two results
+     * as arguments to the supplied action.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @param <U> the type of the other CompletionStage's result
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<Void> thenAcceptBothAsync
+        (CompletionStage<? extends U> other,
+         BiConsumer<? super T, ? super U> action);
+
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage complete normally, is executed using the supplied
+     * executor, with the two results as arguments to the supplied
+     * function.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @param <U> the type of the other CompletionStage's result
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<Void> thenAcceptBothAsync
+        (CompletionStage<? extends U> other,
+         BiConsumer<? super T, ? super U> action,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage both complete normally, executes the given action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> runAfterBoth(CompletionStage<?> other,
+                                              Runnable action);
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage complete normally, executes the given action using
+     * this stage's default asynchronous execution facility.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other,
+                                                   Runnable action);
+
+    /**
+     * Returns a new CompletionStage that, when this and the other
+     * given stage complete normally, executes the given action using
+     * the supplied executor
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> runAfterBothAsync(CompletionStage<?> other,
+                                                   Runnable action,
+                                                   Executor executor);
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, is executed with the
+     * corresponding result as argument to the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> applyToEither
+        (CompletionStage<? extends T> other,
+         Function<? super T, U> fn);
+
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, is executed using this
+     * stage's default asynchronous execution facility, with the
+     * corresponding result as argument to the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> applyToEitherAsync
+        (CompletionStage<? extends T> other,
+         Function<? super T, U> fn);
+
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, is executed using the
+     * supplied executor, with the corresponding result as argument to
+     * the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param fn the function to use to compute the value of
+     * the returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> applyToEitherAsync
+        (CompletionStage<? extends T> other,
+         Function<? super T, U> fn,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, is executed with the
+     * corresponding result as argument to the supplied action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> acceptEither
+        (CompletionStage<? extends T> other,
+         Consumer<? super T> action);
+
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, is executed using this
+     * stage's default asynchronous execution facility, with the
+     * corresponding result as argument to the supplied action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> acceptEitherAsync
+        (CompletionStage<? extends T> other,
+         Consumer<? super T> action);
+
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, is executed using the
+     * supplied executor, with the corresponding result as argument to
+     * the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> acceptEitherAsync
+        (CompletionStage<? extends T> other,
+         Consumer<? super T> action,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, executes the given action.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> runAfterEither(CompletionStage<?> other,
+                                                Runnable action);
+
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, executes the given action
+     * using this stage's default asynchronous execution facility.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> runAfterEitherAsync
+        (CompletionStage<?> other,
+         Runnable action);
+
+    /**
+     * Returns a new CompletionStage that, when either this or the
+     * other given stage complete normally, executes the given action
+     * using supplied executor.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param other the other CompletionStage
+     * @param action the action to perform before completing the
+     * returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @return the new CompletionStage
+     */
+    public CompletionStage<Void> runAfterEitherAsync
+        (CompletionStage<?> other,
+         Runnable action,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed with this stage as the argument
+     * to the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param fn the function returning a new CompletionStage
+     * @param <U> the type of the returned CompletionStage's result
+     * @return the CompletionStage
+     */
+    public <U> CompletionStage<U> thenCompose
+        (Function<? super T, ? extends CompletionStage<U>> fn);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed using this stage's default asynchronous
+     * execution facility, with this stage as the argument to the
+     * supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param fn the function returning a new CompletionStage
+     * @param <U> the type of the returned CompletionStage's result
+     * @return the CompletionStage
+     */
+    public <U> CompletionStage<U> thenComposeAsync
+        (Function<? super T, ? extends CompletionStage<U>> fn);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * normally, is executed using the supplied Executor, with this
+     * stage's result as the argument to the supplied function.
+     *
+     * See the {@link CompletionStage} documentation for rules
+     * covering exceptional completion.
+     *
+     * @param fn the function returning a new CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @param <U> the type of the returned CompletionStage's result
+     * @return the CompletionStage
+     */
+    public <U> CompletionStage<U> thenComposeAsync
+        (Function<? super T, ? extends CompletionStage<U>> fn,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * exceptionally, is executed with this stage's exception as the
+     * argument to the supplied function.  Otherwise, if this stage
+     * completes normally, then the returned stage also completes
+     * normally with the same value.
+     *
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage if this CompletionStage completed
+     * exceptionally
+     * @return the new CompletionStage
+     */
+    public CompletionStage<T> exceptionally
+        (Function<Throwable, ? extends T> fn);
+
+    /**
+     * Returns a new CompletionStage with the same result or exception
+     * as this stage, and when this stage completes, executes the
+     * given action with the result (or {@code null} if none) and the
+     * exception (or {@code null} if none) of this stage.
+     *
+     * @param action the action to perform
+     * @return the new CompletionStage
+     */
+    public CompletionStage<T> whenComplete
+        (BiConsumer<? super T, ? super Throwable> action);
+
+    /**
+     * Returns a new CompletionStage with the same result or exception
+     * as this stage, and when this stage completes, executes the
+     * given action executes the given action using this stage's
+     * default asynchronous execution facility, with the result (or
+     * {@code null} if none) and the exception (or {@code null} if
+     * none) of this stage as arguments.
+     *
+     * @param action the action to perform
+     * @return the new CompletionStage
+     */
+    public CompletionStage<T> whenCompleteAsync
+        (BiConsumer<? super T, ? super Throwable> action);
+
+    /**
+     * Returns a new CompletionStage with the same result or exception
+     * as this stage, and when this stage completes, executes using
+     * the supplied Executor, the given action with the result (or
+     * {@code null} if none) and the exception (or {@code null} if
+     * none) of this stage as arguments.
+     *
+     * @param action the action to perform
+     * @param executor the executor to use for asynchronous execution
+     * @return the new CompletionStage
+     */
+    public CompletionStage<T> whenCompleteAsync
+        (BiConsumer<? super T, ? super Throwable> action,
+         Executor executor);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * either normally or exceptionally, is executed with this stage's
+     * result and exception as arguments to the supplied function.
+     * The given function is invoked with the result (or {@code null}
+     * if none) and the exception (or {@code null} if none) of this
+     * stage when complete as arguments.
+     *
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> handle
+        (BiFunction<? super T, Throwable, ? extends U> fn);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * either normally or exceptionally, is executed using this stage's
+     * default asynchronous execution facility, with this stage's
+     * result and exception as arguments to the supplied function.
+     * The given function is invoked with the result (or {@code null}
+     * if none) and the exception (or {@code null} if none) of this
+     * stage when complete as arguments.
+     *
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> handleAsync
+        (BiFunction<? super T, Throwable, ? extends U> fn);
+
+    /**
+     * Returns a new CompletionStage that, when this stage completes
+     * either normally or exceptionally, is executed using the
+     * supplied executor, with this stage's result and exception as
+     * arguments to the supplied function.  The given function is
+     * invoked with the result (or {@code null} if none) and the
+     * exception (or {@code null} if none) of this stage when complete
+     * as arguments.
+     *
+     * @param fn the function to use to compute the value of the
+     * returned CompletionStage
+     * @param executor the executor to use for asynchronous execution
+     * @param <U> the function's return type
+     * @return the new CompletionStage
+     */
+    public <U> CompletionStage<U> handleAsync
+        (BiFunction<? super T, Throwable, ? extends U> fn,
+         Executor executor);
+
+    /**
+     * Returns a {@link CompletableFuture} maintaining the same
+     * completion properties as this stage. If this stage is already a
+     * CompletableFuture, this method may return this stage itself.
+     * Otherwise, invocation of this method may be equivalent in
+     * effect to {@code thenApply(x -> x)}, but returning an instance
+     * of type {@code CompletableFuture}. A CompletionStage
+     * implementation that does not choose to interoperate with others
+     * may throw {@code UnsupportedOperationException}.
+     *
+     * @return the CompletableFuture
+     * @throws UnsupportedOperationException if this implementation
+     * does not interoperate with CompletableFuture
+     */
+    public CompletableFuture<T> toCompletableFuture();
+
+}
--- a/jdk/src/share/classes/java/util/logging/XMLFormatter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/logging/XMLFormatter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -47,7 +47,7 @@
     private LogManager manager = LogManager.getLogManager();
 
     // Append a two digit number.
-    private void a2(StringBuffer sb, int x) {
+    private void a2(StringBuilder sb, int x) {
         if (x < 10) {
             sb.append('0');
         }
@@ -55,25 +55,26 @@
     }
 
     // Append the time and date in ISO 8601 format
-    private void appendISO8601(StringBuffer sb, long millis) {
-        Date date = new Date(millis);
-        sb.append(date.getYear() + 1900);
+    private void appendISO8601(StringBuilder sb, long millis) {
+        GregorianCalendar cal = new GregorianCalendar();
+        cal.setTimeInMillis(millis);
+        sb.append(cal.get(Calendar.YEAR) + 1900);
         sb.append('-');
-        a2(sb, date.getMonth() + 1);
+        a2(sb, cal.get(Calendar.MONTH) + 1);
         sb.append('-');
-        a2(sb, date.getDate());
+        a2(sb, cal.get(Calendar.DAY_OF_MONTH));
         sb.append('T');
-        a2(sb, date.getHours());
+        a2(sb, cal.get(Calendar.HOUR_OF_DAY));
         sb.append(':');
-        a2(sb, date.getMinutes());
+        a2(sb, cal.get(Calendar.MINUTE));
         sb.append(':');
-        a2(sb, date.getSeconds());
+        a2(sb, cal.get(Calendar.SECOND));
     }
 
-    // Append to the given StringBuffer an escaped version of the
+    // Append to the given StringBuilder an escaped version of the
     // given text string where XML special characters have been escaped.
     // For a null string we append "<null>"
-    private void escape(StringBuffer sb, String text) {
+    private void escape(StringBuilder sb, String text) {
         if (text == null) {
             text = "<null>";
         }
@@ -102,7 +103,7 @@
      * @return a formatted log record
      */
     public String format(LogRecord record) {
-        StringBuffer sb = new StringBuffer(500);
+        StringBuilder sb = new StringBuilder(500);
         sb.append("<record>\n");
 
         sb.append("  <date>");
@@ -224,7 +225,7 @@
      * @return  a valid XML string
      */
     public String getHead(Handler h) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         String encoding;
         sb.append("<?xml version=\"1.0\"");
 
--- a/jdk/src/share/classes/java/util/stream/AbstractPipeline.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/AbstractPipeline.java	Tue Aug 13 18:34:12 2013 -0700
@@ -75,11 +75,13 @@
      * Backlink to the head of the pipeline chain (self if this is the source
      * stage).
      */
+    @SuppressWarnings("rawtypes")
     private final AbstractPipeline sourceStage;
 
     /**
      * The "upstream" pipeline, or null if this is the source stage.
      */
+    @SuppressWarnings("rawtypes")
     private final AbstractPipeline previousStage;
 
     /**
@@ -92,6 +94,7 @@
      * The next stage in the pipeline, or null if this is the last stage.
      * Effectively final at the point of linking to the next pipeline.
      */
+    @SuppressWarnings("rawtypes")
     private AbstractPipeline nextStage;
 
     /**
@@ -222,8 +225,8 @@
         linkedOrConsumed = true;
 
         return isParallel()
-               ? (R) terminalOp.evaluateParallel(this, sourceSpliterator(terminalOp.getOpFlags()))
-               : (R) terminalOp.evaluateSequential(this, sourceSpliterator(terminalOp.getOpFlags()));
+               ? terminalOp.evaluateParallel(this, sourceSpliterator(terminalOp.getOpFlags()))
+               : terminalOp.evaluateSequential(this, sourceSpliterator(terminalOp.getOpFlags()));
     }
 
     /**
@@ -232,6 +235,7 @@
      * @param generator the array generator to be used to create array instances
      * @return a flat array-backed Node that holds the collected output elements
      */
+    @SuppressWarnings("unchecked")
     final Node<E_OUT> evaluateToArrayNode(IntFunction<E_OUT[]> generator) {
         if (linkedOrConsumed)
             throw new IllegalStateException("stream has already been operated upon");
@@ -256,6 +260,7 @@
      * @throws IllegalStateException if this pipeline stage is not the source
      *         stage.
      */
+    @SuppressWarnings("unchecked")
     final Spliterator<E_OUT> sourceStageSpliterator() {
         if (this != sourceStage)
             throw new IllegalStateException();
@@ -265,11 +270,13 @@
         linkedOrConsumed = true;
 
         if (sourceStage.sourceSpliterator != null) {
+            @SuppressWarnings("unchecked")
             Spliterator<E_OUT> s = sourceStage.sourceSpliterator;
             sourceStage.sourceSpliterator = null;
             return s;
         }
         else if (sourceStage.sourceSupplier != null) {
+            @SuppressWarnings("unchecked")
             Spliterator<E_OUT> s = (Spliterator<E_OUT>) sourceStage.sourceSupplier.get();
             sourceStage.sourceSupplier = null;
             return s;
@@ -282,12 +289,14 @@
     // BaseStream
 
     @Override
+    @SuppressWarnings("unchecked")
     public final S sequential() {
         sourceStage.parallel = false;
         return (S) this;
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public final S parallel() {
         sourceStage.parallel = true;
         return (S) this;
@@ -295,6 +304,7 @@
 
     // Primitive specialization use co-variant overrides, hence is not final
     @Override
+    @SuppressWarnings("unchecked")
     public Spliterator<E_OUT> spliterator() {
         if (linkedOrConsumed)
             throw new IllegalStateException("stream has already been operated upon");
@@ -302,12 +312,14 @@
 
         if (this == sourceStage) {
             if (sourceStage.sourceSpliterator != null) {
-                Spliterator<E_OUT> s = sourceStage.sourceSpliterator;
+                @SuppressWarnings("unchecked")
+                Spliterator<E_OUT> s = (Spliterator<E_OUT>) sourceStage.sourceSpliterator;
                 sourceStage.sourceSpliterator = null;
                 return s;
             }
             else if (sourceStage.sourceSupplier != null) {
-                Supplier<Spliterator<E_OUT>> s = sourceStage.sourceSupplier;
+                @SuppressWarnings("unchecked")
+                Supplier<Spliterator<E_OUT>> s = (Supplier<Spliterator<E_OUT>>) sourceStage.sourceSupplier;
                 sourceStage.sourceSupplier = null;
                 return lazySpliterator(s);
             }
@@ -349,10 +361,11 @@
      * @param terminalFlags Operation flags for the terminal operation
      */
     private void parallelPrepare(int terminalFlags) {
+        @SuppressWarnings("rawtypes")
         AbstractPipeline backPropagationHead = sourceStage;
         if (sourceStage.sourceAnyStateful) {
             int depth = 1;
-            for (AbstractPipeline u = sourceStage, p = sourceStage.nextStage;
+            for (  @SuppressWarnings("rawtypes") AbstractPipeline u = sourceStage, p = sourceStage.nextStage;
                  p != null;
                  u = p, p = p.nextStage) {
                 int thisOpFlags = p.sourceOrOpFlags;
@@ -383,7 +396,7 @@
         // Apply the upstream terminal flags
         if (terminalFlags != 0) {
             int upstreamTerminalFlags = terminalFlags & StreamOpFlag.UPSTREAM_TERMINAL_OP_MASK;
-            for (AbstractPipeline p = backPropagationHead; p.nextStage != null; p = p.nextStage) {
+            for ( @SuppressWarnings("rawtypes") AbstractPipeline p = backPropagationHead; p.nextStage != null; p = p.nextStage) {
                 p.combinedFlags = StreamOpFlag.combineOpFlags(upstreamTerminalFlags, p.combinedFlags);
             }
 
@@ -398,6 +411,7 @@
      * of all computations up to and including the most recent stateful
      * operation.
      */
+    @SuppressWarnings("unchecked")
     private Spliterator<?> sourceSpliterator(int terminalFlags) {
         // Get the source spliterator of the pipeline
         Spliterator<?> spliterator = null;
@@ -421,7 +435,7 @@
 
             // Adapt the source spliterator, evaluating each stateful op
             // in the pipeline up to and including this pipeline stage
-            for (AbstractPipeline u = sourceStage, p = sourceStage.nextStage, e = this;
+            for ( @SuppressWarnings("rawtypes") AbstractPipeline u = sourceStage, p = sourceStage.nextStage, e = this;
                  u != e;
                  u = p, p = p.nextStage) {
 
@@ -442,6 +456,7 @@
 
     @Override
     final StreamShape getSourceShape() {
+        @SuppressWarnings("rawtypes")
         AbstractPipeline p = AbstractPipeline.this;
         while (p.depth > 0) {
             p = p.previousStage;
@@ -475,7 +490,9 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     final <P_IN> void copyIntoWithCancel(Sink<P_IN> wrappedSink, Spliterator<P_IN> spliterator) {
+        @SuppressWarnings({"rawtypes","unchecked"})
         AbstractPipeline p = AbstractPipeline.this;
         while (p.depth > 0) {
             p = p.previousStage;
@@ -495,16 +512,18 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     final <P_IN> Sink<P_IN> wrapSink(Sink<E_OUT> sink) {
         Objects.requireNonNull(sink);
 
-        for (AbstractPipeline p=AbstractPipeline.this; p.depth > 0; p=p.previousStage) {
+        for ( @SuppressWarnings("rawtypes") AbstractPipeline p=AbstractPipeline.this; p.depth > 0; p=p.previousStage) {
             sink = p.opWrapSink(p.previousStage.combinedFlags, sink);
         }
         return (Sink<P_IN>) sink;
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     final <P_IN> Spliterator<E_OUT> wrapSpliterator(Spliterator<P_IN> sourceSpliterator) {
         if (depth == 0) {
             return (Spliterator<E_OUT>) sourceSpliterator;
@@ -591,16 +610,19 @@
     /**
      * Make a node builder compatible with this stream shape.
      *
-     * @param exactSizeIfKnown if {@literal >=0}, then a node builder will be created that
-     * has a fixed capacity of at most sizeIfKnown elements. If {@literal < 0},
-     * then the node builder has an unfixed capacity. A fixed capacity node
-     * builder will throw exceptions if an element is added after builder has
-     * reached capacity, or is built before the builder has reached capacity.
+     * @param exactSizeIfKnown if {@literal >=0}, then a node builder will be
+     * created that has a fixed capacity of at most sizeIfKnown elements. If
+     * {@literal < 0}, then the node builder has an unfixed capacity. A fixed
+     * capacity node builder will throw exceptions if an element is added after
+     * builder has reached capacity, or is built before the builder has reached
+     * capacity.
+     *
      * @param generator the array generator to be used to create instances of a
      * T[] array. For implementations supporting primitive nodes, this parameter
      * may be ignored.
      * @return a node builder
      */
+    @Override
     abstract Node.Builder<E_OUT> makeNodeBuilder(long exactSizeIfKnown,
                                                  IntFunction<E_OUT[]> generator);
 
@@ -679,6 +701,7 @@
      * @param spliterator the source {@code Spliterator}
      * @return a {@code Spliterator} describing the result of the evaluation
      */
+    @SuppressWarnings("unchecked")
     <P_IN> Spliterator<E_OUT> opEvaluateParallelLazy(PipelineHelper<E_OUT> helper,
                                                      Spliterator<P_IN> spliterator) {
         return opEvaluateParallel(helper, spliterator, i -> (E_OUT[]) new Object[i]).spliterator();
--- a/jdk/src/share/classes/java/util/stream/AbstractShortCircuitTask.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/AbstractShortCircuitTask.java	Tue Aug 13 18:34:12 2013 -0700
@@ -39,6 +39,7 @@
  * @param <K> type of child and sibling tasks
  * @since 1.8
  */
+@SuppressWarnings("serial")
 abstract class AbstractShortCircuitTask<P_IN, P_OUT, R,
                                         K extends AbstractShortCircuitTask<P_IN, P_OUT, R, K>>
         extends AbstractTask<P_IN, P_OUT, R, K> {
@@ -219,7 +220,8 @@
      */
     protected void cancelLaterNodes() {
         // Go up the tree, cancel right siblings of this node and all parents
-        for (K parent = getParent(), node = (K) this; parent != null;
+        for (@SuppressWarnings("unchecked") K parent = getParent(), node = (K) this;
+             parent != null;
              node = parent, parent = parent.getParent()) {
             // If node is a left child of parent, then has a right sibling
             if (parent.leftChild == node) {
--- a/jdk/src/share/classes/java/util/stream/AbstractTask.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/AbstractTask.java	Tue Aug 13 18:34:12 2013 -0700
@@ -73,6 +73,9 @@
  *     }
  * }</pre>
  *
+ * <p>Serialization is not supported as there is no intention to serialize
+ * tasks managed by stream ops.
+ *
  * @param <P_IN> Type of elements input to the pipeline
  * @param <P_OUT> Type of elements output from the pipeline
  * @param <R> Type of intermediate result, which may be different from operation
@@ -80,6 +83,7 @@
  * @param <K> Type of parent, child and sibling tasks
  * @since 1.8
  */
+@SuppressWarnings("serial")
 abstract class AbstractTask<P_IN, P_OUT, R,
                             K extends AbstractTask<P_IN, P_OUT, R, K>>
         extends CountedCompleter<R> {
--- a/jdk/src/share/classes/java/util/stream/Collector.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/Collector.java	Tue Aug 13 18:34:12 2013 -0700
@@ -25,40 +25,45 @@
 package java.util.stream;
 
 import java.util.Collections;
+import java.util.EnumSet;
 import java.util.Set;
-import java.util.function.BiFunction;
+import java.util.function.BiConsumer;
 import java.util.function.BinaryOperator;
+import java.util.function.Function;
 import java.util.function.Supplier;
 
 /**
  * A <a href="package-summary.html#Reduction">reduction operation</a> that
- * supports folding input elements into a cumulative result.  The result may be
- * a value or may be a mutable result container.  Examples of operations
- * accumulating results into a mutable result container include: accumulating
- * input elements into a {@code Collection}; concatenating strings into a
- * {@code StringBuilder}; computing summary information about elements such as
- * sum, min, max, or average; computing "pivot table" summaries such as "maximum
- * valued transaction by seller", etc.  Reduction operations can be performed
- * either sequentially or in parallel.
+ * folds input elements into a mutable result container, optionally transforming
+ * the accumulated result into a final representation after all input elements
+ * have been processed.
+ *
+ * <p>Examples of mutable reduction operations include:
+ * accumulating elements into a {@code Collection}; concatenating
+ * strings using a {@code StringBuilder}; computing summary information about
+ * elements such as sum, min, max, or average; computing "pivot table" summaries
+ * such as "maximum valued transaction by seller", etc.  Reduction operations
+ * can be performed either sequentially or in parallel.
  *
  * <p>The following are examples of using the predefined {@code Collector}
  * implementations in {@link Collectors} with the {@code Stream} API to perform
  * mutable reduction tasks:
  * <pre>{@code
- *     // Accumulate elements into a List
- *     List<String> list = stream.collect(Collectors.toList());
+ *     // Accumulate names into a List
+ *     List<String> list = people.stream().map(Person::getName).collect(Collectors.toList());
  *
- *     // Accumulate elements into a TreeSet
- *     Set<String> list = stream.collect(Collectors.toCollection(TreeSet::new));
+ *     // Accumulate names into a TreeSet
+ *     Set<String> list = people.stream().map(Person::getName).collect(Collectors.toCollection(TreeSet::new));
  *
  *     // Convert elements to strings and concatenate them, separated by commas
- *     String joined = stream.map(Object::toString)
- *                           .collect(Collectors.toStringJoiner(", "))
- *                           .toString();
+ *     String joined = things.stream()
+ *                           .map(Object::toString)
+ *                           .collect(Collectors.joining(", "));
  *
  *     // Find highest-paid employee
  *     Employee highestPaid = employees.stream()
- *                                     .collect(Collectors.maxBy(Comparators.comparing(Employee::getSalary)));
+ *                                     .collect(Collectors.maxBy(Comparators.comparing(Employee::getSalary)))
+ *                                     .get();
  *
  *     // Group employees by department
  *     Map<Department, List<Employee>> byDept
@@ -66,7 +71,7 @@
  *                    .collect(Collectors.groupingBy(Employee::getDepartment));
  *
  *     // Find highest-paid employee by department
- *     Map<Department, Employee> highestPaidByDept
+ *     Map<Department, Optional<Employee>> highestPaidByDept
  *         = employees.stream()
  *                    .collect(Collectors.groupingBy(Employee::getDepartment,
  *                                                   Collectors.maxBy(Comparators.comparing(Employee::getSalary))));
@@ -74,43 +79,42 @@
  *     // Partition students into passing and failing
  *     Map<Boolean, List<Student>> passingFailing =
  *         students.stream()
- *                 .collect(Collectors.partitioningBy(s -> s.getGrade() >= PASS_THRESHOLD);
+ *                 .collect(Collectors.partitioningBy(s -> s.getGrade() >= PASS_THRESHOLD));
  *
  * }</pre>
  *
- * <p>A {@code Collector} is specified by three functions that work together to
- * manage a result or result container.  They are: creation of an initial
- * result, incorporating a new data element into a result, and combining two
- * results into one. The last function -- combining two results into one -- is
- * used during parallel operations, where subsets of the input are accumulated
- * in parallel, and then the subresults merged into a combined result. The
- * result may be a mutable container or a value.  If the result is mutable, the
- * accumulation and combination functions may either mutate their left argument
- * and return that (such as adding elements to a collection), or return a new
- * result, in which case it should not perform any mutation.
+ * <p>A {@code Collector} is specified by four functions that work together to
+ * accumulate entries into a mutable result container, and optionally perform
+ * a final transform on the result.  They are: creation of a new result container,
+ * incorporating a new data element into a result container, combining two
+ * result containers into one, and performing a final transform on the container.
+ * The combiner function is used during parallel operations, where
+ * subsets of the input are accumulated into separate result
+ * containers, and then the subresults merged into a combined result.  The
+ * combiner function may merge one set of subresults into the other and return
+ * that, or it may return a new object to describe the combined results.
  *
- * <p>Collectors also have a set of characteristics, including
- * {@link Characteristics#CONCURRENT} and
- * {@link Characteristics#STRICTLY_MUTATIVE}.  These characteristics provide
+ * <p>Collectors also have a set of characteristics, such as
+ * {@link Characteristics#CONCURRENT}.  These characteristics provide
  * hints that can be used by a reduction implementation to provide better
  * performance.
  *
  * <p>Libraries that implement reduction based on {@code Collector}, such as
  * {@link Stream#collect(Collector)}, must adhere to the following constraints:
  * <ul>
- *     <li>The first argument passed to the accumulator function, and both
- *     arguments passed to the combiner function, must be the result of a
- *     previous invocation of {@link #resultSupplier()}, {@link #accumulator()},
- *     or {@link #combiner()}.</li>
+ *     <li>The first argument passed to the accumulator function, both
+ *     arguments passed to the combiner function, and the argument passed to the
+ *     finisher function must be the result of a previous invocation of the
+ *     result supplier, accumulator, or combiner functions.</li>
  *     <li>The implementation should not do anything with the result of any of
  *     the result supplier, accumulator, or combiner functions other than to
- *     pass them again to the accumulator or combiner functions, or return them
- *     to the caller of the reduction operation.</li>
- *     <li>If a result is passed to the accumulator or combiner function, and
- *     the same object is not returned from that function, it is never used
- *     again.</li>
- *     <li>Once a result is passed to the combiner function, it is never passed
- *     to the accumulator function again.</li>
+ *     pass them again to the accumulator, combiner, or finisher functions,
+ *     or return them to the caller of the reduction operation.</li>
+ *     <li>If a result is passed to the combiner or finisher
+ *     function, and the same object is not returned from that function, it is
+ *     never used again.</li>
+ *     <li>Once a result is passed to the combiner or finisher function, it
+ *     is never passed to the accumulator function again.</li>
  *     <li>For non-concurrent collectors, any result returned from the result
  *     supplier, accumulator, or combiner functions must be serially
  *     thread-confined.  This enables collection to occur in parallel without
@@ -132,11 +136,10 @@
  * Performing a reduction operation with a {@code Collector} should produce a
  * result equivalent to:
  * <pre>{@code
- *     BiFunction<R,T,R> accumulator = collector.accumulator();
- *     R result = collector.resultSupplier().get();
+ *     R container = collector.supplier().get();
  *     for (T t : data)
- *         result = accumulator.apply(result, t);
- *     return result;
+ *         collector.accumulator().accept(container, t);
+ *     return collector.finisher().apply(container);
  * }</pre>
  *
  * <p>However, the library is free to partition the input, perform the reduction
@@ -149,7 +152,7 @@
  * is accumulating elements into a {@code TreeSet}. In this case, the {@code
  * resultSupplier()} function is {@code () -> new Treeset<T>()}, the
  * {@code accumulator} function is
- * {@code (set, element) -> { set.add(element); return set; }}, and the combiner
+ * {@code (set, element) -> set.add(element) }, and the combiner
  * function is {@code (left, right) -> { left.addAll(right); return left; }}.
  * (This behavior is implemented by
  * {@code Collectors.toCollection(TreeSet::new)}).
@@ -159,51 +162,49 @@
  * @see Stream#collect(Collector)
  * @see Collectors
  *
- * @param <T> the type of input element to the collect operation
- * @param <R> the result type of the collect operation
+ * @param <T> the type of input elements to the reduction operation
+ * @param <A> the mutable accumulation type of the reduction operation (often
+ *           hidden as an implementation detail)
+ * @param <R> the result type of the reduction operation
  * @since 1.8
  */
-public interface Collector<T, R> {
+public interface Collector<T, A, R> {
     /**
-     * A function that creates and returns a new result that represents
-     * "no values".  If the accumulator or combiner functions may mutate their
-     * arguments, this must be a new, empty result container.
+     * A function that creates and returns a new mutable result container.
      *
-     * @return a function which, when invoked, returns a result representing
-     * "no values"
+     * @return a function which returns a new, mutable result container
      */
-    Supplier<R> resultSupplier();
+    Supplier<A> supplier();
 
     /**
-     * A function that folds a new value into a cumulative result.  The result
-     * may be a mutable result container or a value.  The accumulator function
-     * may modify a mutable container and return it, or create a new result and
-     * return that, but if it returns a new result object, it must not modify
-     * any of its arguments.
+     * A function that folds a new value into a mutable result container.
      *
-     * <p>If the collector has the {@link Characteristics#STRICTLY_MUTATIVE}
-     * characteristic, then the accumulator function <em>must</em> always return
-     * its first argument, after possibly mutating its state.
-     *
-     * @return a function which folds a new value into a cumulative result
+     * @return a function which folds a new value into a mutable result container
      */
-    BiFunction<R, T, R> accumulator();
+    BiConsumer<A, T> accumulator();
 
     /**
      * A function that accepts two partial results and merges them.  The
      * combiner function may fold state from one argument into the other and
-     * return that, or may return a new result object, but if it returns
-     * a new result object, it must not modify the state of either of its
-     * arguments.
-     *
-     * <p>If the collector has the {@link Characteristics#STRICTLY_MUTATIVE}
-     * characteristic, then the combiner function <em>must</em> always return
-     * its first argument, after possibly mutating its state.
+     * return that, or may return a new result object.
      *
      * @return a function which combines two partial results into a cumulative
      * result
      */
-    BinaryOperator<R> combiner();
+    BinaryOperator<A> combiner();
+
+    /**
+     * Perform the final transformation from the intermediate accumulation type
+     * {@code A} to the final result representation {@code R}.
+     *
+     * <p>If the characteristic {@code IDENTITY_TRANSFORM} is
+     * set, this function may be presumed to be an identity transform with an
+     * unchecked cast from {@code A} to {@code R}.
+     *
+     * @return a function which transforms the intermediate result to the final
+     * result
+     */
+    Function<A, R> finisher();
 
     /**
      * Returns a {@code Set} of {@code Collector.Characteristics} indicating
@@ -214,6 +215,62 @@
     Set<Characteristics> characteristics();
 
     /**
+     * Returns a new {@code Collector} described by the given {@code supplier},
+     * {@code accumulator}, and {@code combiner} functions.  The resulting
+     * {@code Collector} has the {@code Collector.Characteristics.IDENTITY_FINISH}
+     * characteristic.
+     *
+     * @param supplier The supplier function for the new collector
+     * @param accumulator The accumulator function for the new collector
+     * @param combiner The combiner function for the new collector
+     * @param characteristics The collector characteristics for the new
+     *                        collector
+     * @param <T> The type of input elements for the new collector
+     * @param <R> The type of intermediate accumulation result, and final result,
+     *           for the new collector
+     * @return the new {@code Collector}
+     */
+    public static<T, R> Collector<T, R, R> of(Supplier<R> supplier,
+                                              BiConsumer<R, T> accumulator,
+                                              BinaryOperator<R> combiner,
+                                              Characteristics... characteristics) {
+        Set<Characteristics> cs = (characteristics.length == 0)
+                                  ? Collectors.CH_ID
+                                  : Collections.unmodifiableSet(EnumSet.of(Collector.Characteristics.IDENTITY_FINISH,
+                                                                           characteristics));
+        return new Collectors.CollectorImpl<>(supplier, accumulator, combiner, cs);
+    }
+
+    /**
+     * Returns a new {@code Collector} described by the given {@code supplier},
+     * {@code accumulator}, {@code combiner}, and {@code finisher} functions.
+     *
+     * @param supplier The supplier function for the new collector
+     * @param accumulator The accumulator function for the new collector
+     * @param combiner The combiner function for the new collector
+     * @param finisher The finisher function for the new collector
+     * @param characteristics The collector characteristics for the new
+     *                        collector
+     * @param <T> The type of input elements for the new collector
+     * @param <A> The intermediate accumulation type of the new collector
+     * @param <R> The final result type of the new collector
+     * @return the new {@code Collector}
+     */
+    public static<T, A, R> Collector<T, A, R> of(Supplier<A> supplier,
+                                                 BiConsumer<A, T> accumulator,
+                                                 BinaryOperator<A> combiner,
+                                                 Function<A, R> finisher,
+                                                 Characteristics... characteristics) {
+        Set<Characteristics> cs = Collectors.CH_NOID;
+        if (characteristics.length > 0) {
+            cs = EnumSet.noneOf(Characteristics.class);
+            Collections.addAll(cs, characteristics);
+            cs = Collections.unmodifiableSet(cs);
+        }
+        return new Collectors.CollectorImpl<>(supplier, accumulator, combiner, finisher, cs);
+    }
+
+    /**
      * Characteristics indicating properties of a {@code Collector}, which can
      * be used to optimize reduction implementations.
      */
@@ -222,8 +279,7 @@
          * Indicates that this collector is <em>concurrent</em>, meaning that
          * the result container can support the accumulator function being
          * called concurrently with the same result container from multiple
-         * threads. Concurrent collectors must also always have the
-         * {@code STRICTLY_MUTATIVE} characteristic.
+         * threads.
          *
          * <p>If a {@code CONCURRENT} collector is not also {@code UNORDERED},
          * then it should only be evaluated concurrently if applied to an
@@ -238,12 +294,10 @@
         UNORDERED,
 
         /**
-         * Indicates that this collector operates by strict mutation of its
-         * result container. This means that the {@link #accumulator()} and
-         * {@link #combiner()} functions will always modify the state of and
-         * return their first argument, rather than returning a different result
-         * container.
+         * Indicates that the finisher function is the identity function and
+         * can be elided.  If set, it must be the case that an unchecked cast
+         * from A to R will succeed.
          */
-        STRICTLY_MUTATIVE
+        IDENTITY_FINISH
     }
 }
--- a/jdk/src/share/classes/java/util/stream/Collectors.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/Collectors.java	Tue Aug 13 18:34:12 2013 -0700
@@ -27,6 +27,7 @@
 import java.util.AbstractMap;
 import java.util.AbstractSet;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
@@ -39,14 +40,16 @@
 import java.util.List;
 import java.util.LongSummaryStatistics;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
 import java.util.StringJoiner;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.function.BiConsumer;
 import java.util.function.BiFunction;
 import java.util.function.BinaryOperator;
+import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.function.Supplier;
@@ -64,20 +67,21 @@
  * mutable reduction tasks:
  *
  * <pre>{@code
- *     // Accumulate elements into a List
- *     List<Person> list = people.collect(Collectors.toList());
+ *     // Accumulate names into a List
+ *     List<String> list = people.stream().map(Person::getName).collect(Collectors.toList());
  *
- *     // Accumulate elements into a TreeSet
- *     List<Person> list = people.collect(Collectors.toCollection(TreeSet::new));
+ *     // Accumulate names into a TreeSet
+ *     Set<String> list = people.stream().map(Person::getName).collect(Collectors.toCollection(TreeSet::new));
  *
  *     // Convert elements to strings and concatenate them, separated by commas
- *     String joined = stream.map(Object::toString)
- *                           .collect(Collectors.toStringJoiner(", "))
- *                           .toString();
+ *     String joined = things.stream()
+ *                           .map(Object::toString)
+ *                           .collect(Collectors.joining(", "));
  *
  *     // Find highest-paid employee
  *     Employee highestPaid = employees.stream()
- *                                     .collect(Collectors.maxBy(Comparator.comparing(Employee::getSalary)));
+ *                                     .collect(Collectors.maxBy(Comparator.comparing(Employee::getSalary)))
+ *                                     .get();
  *
  *     // Group employees by department
  *     Map<Department, List<Employee>> byDept
@@ -85,7 +89,7 @@
  *                    .collect(Collectors.groupingBy(Employee::getDepartment));
  *
  *     // Find highest-paid employee by department
- *     Map<Department, Employee> highestPaidByDept
+ *     Map<Department, Optional<Employee>> highestPaidByDept
  *         = employees.stream()
  *                    .collect(Collectors.groupingBy(Employee::getDepartment,
  *                                                   Collectors.maxBy(Comparator.comparing(Employee::getSalary))));
@@ -93,7 +97,7 @@
  *     // Partition students into passing and failing
  *     Map<Boolean, List<Student>> passingFailing =
  *         students.stream()
- *                 .collect(Collectors.partitioningBy(s -> s.getGrade() >= PASS_THRESHOLD);
+ *                 .collect(Collectors.partitioningBy(s -> s.getGrade() >= PASS_THRESHOLD));
  *
  * }</pre>
  *
@@ -103,15 +107,19 @@
  */
 public final class Collectors {
 
-    private static final Set<Collector.Characteristics> CH_CONCURRENT
+    static final Set<Collector.Characteristics> CH_CONCURRENT_ID
             = Collections.unmodifiableSet(EnumSet.of(Collector.Characteristics.CONCURRENT,
-                                                     Collector.Characteristics.STRICTLY_MUTATIVE,
+                                                     Collector.Characteristics.UNORDERED,
+                                                     Collector.Characteristics.IDENTITY_FINISH));
+    static final Set<Collector.Characteristics> CH_CONCURRENT_NOID
+            = Collections.unmodifiableSet(EnumSet.of(Collector.Characteristics.CONCURRENT,
                                                      Collector.Characteristics.UNORDERED));
-    private static final Set<Collector.Characteristics> CH_STRICT
-            = Collections.unmodifiableSet(EnumSet.of(Collector.Characteristics.STRICTLY_MUTATIVE));
-    private static final Set<Collector.Characteristics> CH_STRICT_UNORDERED
-            = Collections.unmodifiableSet(EnumSet.of(Collector.Characteristics.STRICTLY_MUTATIVE,
-                                                     Collector.Characteristics.UNORDERED));
+    static final Set<Collector.Characteristics> CH_ID
+            = Collections.unmodifiableSet(EnumSet.of(Collector.Characteristics.IDENTITY_FINISH));
+    static final Set<Collector.Characteristics> CH_UNORDERED_ID
+            = Collections.unmodifiableSet(EnumSet.of(Collector.Characteristics.UNORDERED,
+                                                     Collector.Characteristics.IDENTITY_FINISH));
+    static final Set<Collector.Characteristics> CH_NOID = Collections.emptySet();
 
     private Collectors() { }
 
@@ -124,88 +132,64 @@
      *
      * @param <T> the type of input arguments to the merge function
      * @return a merge function which always throw {@code IllegalStateException}
-     *
-     * @see #firstWinsMerger()
-     * @see #lastWinsMerger()
      */
-    public static <T> BinaryOperator<T> throwingMerger() {
+    private static <T> BinaryOperator<T> throwingMerger() {
         return (u,v) -> { throw new IllegalStateException(String.format("Duplicate key %s", u)); };
     }
 
     /**
-     * Returns a merge function, suitable for use in
-     * {@link Map#merge(Object, Object, BiFunction) Map.merge()} or
-     * {@link #toMap(Function, Function, BinaryOperator) toMap()},
-     * which implements a "first wins" policy.
-     *
-     * @param <T> the type of input arguments to the merge function
-     * @return a merge function which always returns its first argument
-     * @see #lastWinsMerger()
-     * @see #throwingMerger()
-     */
-    public static <T> BinaryOperator<T> firstWinsMerger() {
-        return (u,v) -> u;
-    }
-
-    /**
-     * Returns a merge function, suitable for use in
-     * {@link Map#merge(Object, Object, BiFunction) Map.merge()} or
-     * {@link #toMap(Function, Function, BinaryOperator) toMap()},
-     * which implements a "last wins" policy.
-     *
-     * @param <T> the type of input arguments to the merge function
-     * @return a merge function which always returns its second argument
-     * @see #firstWinsMerger()
-     * @see #throwingMerger()
-     */
-    public static <T> BinaryOperator<T> lastWinsMerger() {
-        return (u,v) -> v;
-    }
-
-    /**
      * Simple implementation class for {@code Collector}.
      *
      * @param <T> the type of elements to be collected
      * @param <R> the type of the result
      */
-    private static final class CollectorImpl<T, R> implements Collector<T,R> {
-        private final Supplier<R> resultSupplier;
-        private final BiFunction<R, T, R> accumulator;
-        private final BinaryOperator<R> combiner;
+    static class CollectorImpl<T, A, R> implements Collector<T, A, R> {
+        private final Supplier<A> supplier;
+        private final BiConsumer<A, T> accumulator;
+        private final BinaryOperator<A> combiner;
+        private final Function<A, R> finisher;
         private final Set<Characteristics> characteristics;
 
-        CollectorImpl(Supplier<R> resultSupplier,
-                      BiFunction<R, T, R> accumulator,
-                      BinaryOperator<R> combiner,
+        CollectorImpl(Supplier<A> supplier,
+                      BiConsumer<A, T> accumulator,
+                      BinaryOperator<A> combiner,
+                      Function<A,R> finisher,
                       Set<Characteristics> characteristics) {
-            this.resultSupplier = resultSupplier;
+            this.supplier = supplier;
             this.accumulator = accumulator;
             this.combiner = combiner;
+            this.finisher = finisher;
             this.characteristics = characteristics;
         }
 
-        CollectorImpl(Supplier<R> resultSupplier,
-                      BiFunction<R, T, R> accumulator,
-                      BinaryOperator<R> combiner) {
-            this(resultSupplier, accumulator, combiner, Collections.emptySet());
+        CollectorImpl(Supplier<A> supplier,
+                      BiConsumer<A, T> accumulator,
+                      BinaryOperator<A> combiner,
+                      Set<Characteristics> characteristics) {
+            this(supplier, accumulator, combiner, i -> (R) i, characteristics);
         }
 
         @Override
-        public BiFunction<R, T, R> accumulator() {
+        public BiConsumer<A, T> accumulator() {
             return accumulator;
         }
 
         @Override
-        public Supplier<R> resultSupplier() {
-            return resultSupplier;
+        public Supplier<A> supplier() {
+            return supplier;
         }
 
         @Override
-        public BinaryOperator<R> combiner() {
+        public BinaryOperator<A> combiner() {
             return combiner;
         }
 
         @Override
+        public Function<A, R> finisher() {
+            return finisher;
+        }
+
+        @Override
         public Set<Characteristics> characteristics() {
             return characteristics;
         }
@@ -224,11 +208,10 @@
      * {@code Collection}, in encounter order
      */
     public static <T, C extends Collection<T>>
-    Collector<T, C> toCollection(Supplier<C> collectionFactory) {
-        return new CollectorImpl<>(collectionFactory,
-                                   (r, t) -> { r.add(t); return r; },
+    Collector<T, ?, C> toCollection(Supplier<C> collectionFactory) {
+        return new CollectorImpl<>(collectionFactory, Collection::add,
                                    (r1, r2) -> { r1.addAll(r2); return r1; },
-                                   CH_STRICT);
+                                   CH_ID);
     }
 
     /**
@@ -241,36 +224,10 @@
      * {@code List}, in encounter order
      */
     public static <T>
-    Collector<T, List<T>> toList() {
-        BiFunction<List<T>, T, List<T>> accumulator = (list, t) -> {
-            switch (list.size()) {
-                case 0:
-                    return Collections.singletonList(t);
-                case 1:
-                    List<T> newList = new ArrayList<>();
-                    newList.add(list.get(0));
-                    newList.add(t);
-                    return newList;
-                default:
-                    list.add(t);
-                    return list;
-            }
-        };
-        BinaryOperator<List<T>> combiner = (left, right) -> {
-            switch (left.size()) {
-                case 0:
-                    return right;
-                case 1:
-                    List<T> newList = new ArrayList<>(left.size() + right.size());
-                    newList.addAll(left);
-                    newList.addAll(right);
-                    return newList;
-                default:
-                    left.addAll(right);
-                    return left;
-            }
-        };
-        return new CollectorImpl<>(Collections::emptyList, accumulator, combiner);
+    Collector<T, ?, List<T>> toList() {
+        return new CollectorImpl<>((Supplier<List<T>>) ArrayList::new, List::add,
+                                   (left, right) -> { left.addAll(right); return left; },
+                                   CH_ID);
     }
 
     /**
@@ -286,44 +243,58 @@
      * {@code Set}
      */
     public static <T>
-    Collector<T, Set<T>> toSet() {
-        return new CollectorImpl<>((Supplier<Set<T>>) HashSet::new,
-                                   (r, t) -> { r.add(t); return r; },
-                                   (r1, r2) -> { r1.addAll(r2); return r1; },
-                                   CH_STRICT_UNORDERED);
+    Collector<T, ?, Set<T>> toSet() {
+        return new CollectorImpl<>((Supplier<Set<T>>) HashSet::new, Set::add,
+                                   (left, right) -> { left.addAll(right); return left; },
+                                   CH_UNORDERED_ID);
     }
 
     /**
      * Returns a {@code Collector} that concatenates the input elements into a
-     * new {@link StringBuilder}.
+     * {@code String}, in encounter order.
      *
-     * @return a {@code Collector} which collects String elements into a
-     * {@code StringBuilder}, in encounter order
+     * @return a {@code Collector} that concatenates the input elements into a
+     * {@code String}, in encounter order
      */
-    public static Collector<String, StringBuilder> toStringBuilder() {
-        return new CollectorImpl<>(StringBuilder::new,
-                                   (r, t) -> { r.append(t); return r; },
-                                   (r1, r2) -> { r1.append(r2); return r1; },
-                                   CH_STRICT);
+    public static Collector<CharSequence, ?, String> joining() {
+        return new CollectorImpl<CharSequence, StringBuilder, String>(
+                StringBuilder::new, StringBuilder::append,
+                (r1, r2) -> { r1.append(r2); return r1; },
+                StringBuilder::toString, CH_NOID);
     }
 
     /**
-     * Returns a {@code Collector} that concatenates the input elements into a
-     * new {@link StringJoiner}, using the specified delimiter.
+     * Returns a {@code Collector} that concatenates the input elements,
+     * separated by the specified delimiter, in encounter order.
      *
      * @param delimiter the delimiter to be used between each element
-     * @return A {@code Collector} which collects String elements into a
-     * {@code StringJoiner}, in encounter order
+     * @return A {@code Collector} which concatenates CharSequence elements,
+     * separated by the specified delimiter, in encounter order
      */
-    public static Collector<CharSequence, StringJoiner> toStringJoiner(CharSequence delimiter) {
-        BinaryOperator<StringJoiner> merger = (sj, other) -> {
-            if (other.length() > 0)
-                sj.add(other.toString());
-            return sj;
-        };
-        return new CollectorImpl<>(() -> new StringJoiner(delimiter),
-                                   (r, t) -> { r.add(t); return r; },
-                                   merger, CH_STRICT);
+    public static Collector<CharSequence, ?, String> joining(CharSequence delimiter) {
+        return joining(delimiter, "", "");
+    }
+
+    /**
+     * Returns a {@code Collector} that concatenates the input elements,
+     * separated by the specified delimiter, with the specified prefix and
+     * suffix, in encounter order.
+     *
+     * @param delimiter the delimiter to be used between each element
+     * @param  prefix the sequence of characters to be used at the beginning
+     *                of the joined result
+     * @param  suffix the sequence of characters to be used at the end
+     *                of the joined result
+     * @return A {@code Collector} which concatenates CharSequence elements,
+     * separated by the specified delimiter, in encounter order
+     */
+    public static Collector<CharSequence, ?, String> joining(CharSequence delimiter,
+                                                             CharSequence prefix,
+                                                             CharSequence suffix) {
+        return new CollectorImpl<>(
+                () -> new StringJoiner(delimiter, prefix, suffix),
+                StringJoiner::add, StringJoiner::merge,
+                StringJoiner::toString, CH_NOID);
     }
 
     /**
@@ -348,12 +319,13 @@
     }
 
     /**
-     * Adapts a {@code Collector<U,R>} to a {@code Collector<T,R>} by applying
-     * a mapping function to each input element before accumulation.
+     * Adapts a {@code Collector} accepting elements of type {@code U} to one
+     * accepting elements of type {@code T} by applying a mapping function to
+     * each input element before accumulation.
      *
      * @apiNote
      * The {@code mapping()} collectors are most useful when used in a
-     * multi-level reduction, downstream of {@code groupingBy} or
+     * multi-level reduction, such as downstream of a {@code groupingBy} or
      * {@code partitioningBy}.  For example, given a stream of
      * {@code Person}, to accumulate the set of last names in each city:
      * <pre>{@code
@@ -364,23 +336,27 @@
      *
      * @param <T> the type of the input elements
      * @param <U> type of elements accepted by downstream collector
+     * @param <A> intermediate accumulation type of the downstream collector
      * @param <R> result type of collector
      * @param mapper a function to be applied to the input elements
      * @param downstream a collector which will accept mapped values
      * @return a collector which applies the mapping function to the input
      * elements and provides the mapped results to the downstream collector
      */
-    public static <T, U, R> Collector<T, R>
-    mapping(Function<? super T, ? extends U> mapper, Collector<? super U, R> downstream) {
-        BiFunction<R, ? super U, R> downstreamAccumulator = downstream.accumulator();
-        return new CollectorImpl<>(downstream.resultSupplier(),
-                                   (r, t) -> downstreamAccumulator.apply(r, mapper.apply(t)),
-                                   downstream.combiner(), downstream.characteristics());
+    public static <T, U, A, R>
+    Collector<T, ?, R> mapping(Function<? super T, ? extends U> mapper,
+                               Collector<? super U, A, R> downstream) {
+        BiConsumer<A, ? super U> downstreamAccumulator = downstream.accumulator();
+        return new CollectorImpl<>(downstream.supplier(),
+                                   (r, t) -> downstreamAccumulator.accept(r, mapper.apply(t)),
+                                   downstream.combiner(), downstream.finisher(),
+                                   downstream.characteristics());
     }
 
     /**
-     * Returns a {@code Collector<T, Long>} that counts the number of input
-     * elements.
+     * Returns a {@code Collector} accepting elements of type {@code T} that
+     * counts the number of input elements.  If no elements are present, the
+     * result is 0.
      *
      * @implSpec
      * This produces a result equivalent to:
@@ -391,14 +367,14 @@
      * @param <T> the type of the input elements
      * @return a {@code Collector} that counts the input elements
      */
-    public static <T> Collector<T, Long>
+    public static <T> Collector<T, ?, Long>
     counting() {
         return reducing(0L, e -> 1L, Long::sum);
     }
 
     /**
-     * Returns a {@code Collector<T, T>} that produces the minimal element
-     * according to a given {@code Comparator}.
+     * Returns a {@code Collector} that produces the minimal element according
+     * to a given {@code Comparator}, described as an {@code Optional<T>}.
      *
      * @implSpec
      * This produces a result equivalent to:
@@ -410,14 +386,14 @@
      * @param comparator a {@code Comparator} for comparing elements
      * @return a {@code Collector} that produces the minimal value
      */
-    public static <T> Collector<T, T>
+    public static <T> Collector<T, ?, Optional<T>>
     minBy(Comparator<? super T> comparator) {
         return reducing(BinaryOperator.minBy(comparator));
     }
 
     /**
-     * Returns a {@code Collector<T, T>} that produces the maximal element
-     * according to a given {@code Comparator}.
+     * Returns a {@code Collector} that produces the maximal element according
+     * to a given {@code Comparator}, described as an {@code Optional<T>}.
      *
      * @implSpec
      * This produces a result equivalent to:
@@ -429,39 +405,143 @@
      * @param comparator a {@code Comparator} for comparing elements
      * @return a {@code Collector} that produces the maximal value
      */
-    public static <T> Collector<T, T>
+    public static <T> Collector<T, ?, Optional<T>>
     maxBy(Comparator<? super T> comparator) {
         return reducing(BinaryOperator.maxBy(comparator));
     }
 
     /**
-     * Returns a {@code Collector<T, Long>} that produces the sum of a
-     * long-valued function applied to the input element.
+     * Returns a {@code Collector} that produces the sum of a integer-valued
+     * function applied to the input elements.  If no elements are present,
+     * the result is 0.
+     *
+     * @param <T> the type of the input elements
+     * @param mapper a function extracting the property to be summed
+     * @return a {@code Collector} that produces the sum of a derived property
+     */
+    public static <T> Collector<T, ?, Integer>
+    summingInt(ToIntFunction<? super T> mapper) {
+        return new CollectorImpl<T, int[], Integer>(
+                () -> new int[1],
+                (a, t) -> { a[0] += mapper.applyAsInt(t); },
+                (a, b) -> { a[0] += b[0]; return a; },
+                a -> a[0], CH_NOID);
+    }
+
+    /**
+     * Returns a {@code Collector} that produces the sum of a long-valued
+     * function applied to the input elements.  If no elements are present,
+     * the result is 0.
      *
-     * @implSpec
-     * This produces a result equivalent to:
-     * <pre>{@code
-     *     reducing(0L, mapper, Long::sum)
-     * }</pre>
+     * @param <T> the type of the input elements
+     * @param mapper a function extracting the property to be summed
+     * @return a {@code Collector} that produces the sum of a derived property
+     */
+    public static <T> Collector<T, ?, Long>
+    summingLong(ToLongFunction<? super T> mapper) {
+        return new CollectorImpl<T, long[], Long>(
+                () -> new long[1],
+                (a, t) -> { a[0] += mapper.applyAsLong(t); },
+                (a, b) -> { a[0] += b[0]; return a; },
+                a -> a[0], CH_NOID);
+    }
+
+    /**
+     * Returns a {@code Collector} that produces the sum of a double-valued
+     * function applied to the input elements.  If no elements are present,
+     * the result is 0.
+     *
+     * <p>The sum returned can vary depending upon the order in which
+     * values are recorded, due to accumulated rounding error in
+     * addition of values of differing magnitudes. Values sorted by increasing
+     * absolute magnitude tend to yield more accurate results.  If any recorded
+     * value is a {@code NaN} or the sum is at any point a {@code NaN} then the
+     * sum will be {@code NaN}.
      *
      * @param <T> the type of the input elements
      * @param mapper a function extracting the property to be summed
      * @return a {@code Collector} that produces the sum of a derived property
      */
-    public static <T> Collector<T, Long>
-    sumBy(Function<? super T, Long> mapper) {
-        return reducing(0L, mapper, Long::sum);
+    public static <T> Collector<T, ?, Double>
+    summingDouble(ToDoubleFunction<? super T> mapper) {
+        return new CollectorImpl<T, double[], Double>(
+                () -> new double[1],
+                (a, t) -> { a[0] += mapper.applyAsDouble(t); },
+                (a, b) -> { a[0] += b[0]; return a; },
+                a -> a[0], CH_NOID);
+    }
+
+    /**
+     * Returns a {@code Collector} that produces the arithmetic mean of an integer-valued
+     * function applied to the input elements.  If no elements are present,
+     * the result is 0.
+     *
+     * @param <T> the type of the input elements
+     * @param mapper a function extracting the property to be summed
+     * @return a {@code Collector} that produces the sum of a derived property
+     */
+    public static <T> Collector<T, ?, Double>
+    averagingInt(ToIntFunction<? super T> mapper) {
+        return new CollectorImpl<T, long[], Double>(
+                () -> new long[2],
+                (a, t) -> { a[0] += mapper.applyAsInt(t); a[1]++; },
+                (a, b) -> { a[0] += b[0]; a[1] += b[1]; return a; },
+                a -> (a[1] == 0) ? 0.0d : (double) a[0] / a[1], CH_NOID);
     }
 
     /**
-     * Returns a {@code Collector<T,T>} which performs a reduction of its
-     * input elements under a specified {@code BinaryOperator}.
+     * Returns a {@code Collector} that produces the arithmetic mean of a long-valued
+     * function applied to the input elements.  If no elements are present,
+     * the result is 0.
+     *
+     * @param <T> the type of the input elements
+     * @param mapper a function extracting the property to be summed
+     * @return a {@code Collector} that produces the sum of a derived property
+     */
+    public static <T> Collector<T, ?, Double>
+    averagingLong(ToLongFunction<? super T> mapper) {
+        return new CollectorImpl<T, long[], Double>(
+                () -> new long[2],
+                (a, t) -> { a[0] += mapper.applyAsLong(t); a[1]++; },
+                (a, b) -> { a[0] += b[0]; a[1] += b[1]; return a; },
+                a -> (a[1] == 0) ? 0.0d : (double) a[0] / a[1], CH_NOID);
+    }
+
+    /**
+     * Returns a {@code Collector} that produces the arithmetic mean of a double-valued
+     * function applied to the input elements.  If no elements are present,
+     * the result is 0.
+     *
+     * <p>The average returned can vary depending upon the order in which
+     * values are recorded, due to accumulated rounding error in
+     * addition of values of differing magnitudes. Values sorted by increasing
+     * absolute magnitude tend to yield more accurate results.  If any recorded
+     * value is a {@code NaN} or the sum is at any point a {@code NaN} then the
+     * average will be {@code NaN}.
+     *
+     * @param <T> the type of the input elements
+     * @param mapper a function extracting the property to be summed
+     * @return a {@code Collector} that produces the sum of a derived property
+     */
+    public static <T> Collector<T, ?, Double>
+    averagingDouble(ToDoubleFunction<? super T> mapper) {
+        return new CollectorImpl<T, double[], Double>(
+                () -> new double[2],
+                (a, t) -> { a[0] += mapper.applyAsDouble(t); a[1]++; },
+                (a, b) -> { a[0] += b[0]; a[1] += b[1]; return a; },
+                a -> (a[1] == 0) ? 0.0d : a[0] / a[1], CH_NOID);
+    }
+
+    /**
+     * Returns a {@code Collector} which performs a reduction of its
+     * input elements under a specified {@code BinaryOperator} using the
+     * provided identity.
      *
      * @apiNote
      * The {@code reducing()} collectors are most useful when used in a
      * multi-level reduction, downstream of {@code groupingBy} or
      * {@code partitioningBy}.  To perform a simple reduction on a stream,
-     * use {@link Stream#reduce(BinaryOperator)} instead.
+     * use {@link Stream#reduce(Object, BinaryOperator)}} instead.
      *
      * @param <T> element type for the input and output of the reduction
      * @param identity the identity value for the reduction (also, the value
@@ -472,14 +552,25 @@
      * @see #reducing(BinaryOperator)
      * @see #reducing(Object, Function, BinaryOperator)
      */
-    public static <T> Collector<T, T>
+    public static <T> Collector<T, ?, T>
     reducing(T identity, BinaryOperator<T> op) {
-        return new CollectorImpl<>(() -> identity, (r, t) -> (r == null ? t : op.apply(r, t)), op);
+        return new CollectorImpl<>(
+                boxSupplier(identity),
+                (a, t) -> { a[0] = op.apply(a[0], t); },
+                (a, b) -> { a[0] = op.apply(a[0], b[0]); return a; },
+                a -> a[0],
+                CH_NOID);
+    }
+
+    @SuppressWarnings("unchecked")
+    private static <T> Supplier<T[]> boxSupplier(T identity) {
+        return () -> (T[]) new Object[] { identity };
     }
 
     /**
-     * Returns a {@code Collector<T,T>} which performs a reduction of its
-     * input elements under a specified {@code BinaryOperator}.
+     * Returns a {@code Collector} which performs a reduction of its
+     * input elements under a specified {@code BinaryOperator}.  The result
+     * is described as an {@code Optional<T>}.
      *
      * @apiNote
      * The {@code reducing()} collectors are most useful when used in a
@@ -491,15 +582,8 @@
      * person in each city:
      * <pre>{@code
      *     Comparator<Person> byHeight = Comparator.comparing(Person::getHeight);
-     *     BinaryOperator<Person> tallerOf = BinaryOperator.greaterOf(byHeight);
      *     Map<City, Person> tallestByCity
-     *         = people.stream().collect(groupingBy(Person::getCity, reducing(tallerOf)));
-     * }</pre>
-     *
-     * @implSpec
-     * The default implementation is equivalent to:
-     * <pre>{@code
-     *     reducing(null, op);
+     *         = people.stream().collect(groupingBy(Person::getCity, reducing(BinaryOperator.maxBy(byHeight))));
      * }</pre>
      *
      * @param <T> element type for the input and output of the reduction
@@ -509,13 +593,32 @@
      * @see #reducing(Object, BinaryOperator)
      * @see #reducing(Object, Function, BinaryOperator)
      */
-    public static <T> Collector<T, T>
+    public static <T> Collector<T, ?, Optional<T>>
     reducing(BinaryOperator<T> op) {
-        return reducing(null, op);
+        class OptionalBox implements Consumer<T> {
+            T value = null;
+            boolean present = false;
+
+            @Override
+            public void accept(T t) {
+                if (present) {
+                    value = op.apply(value, t);
+                }
+                else {
+                    value = t;
+                    present = true;
+                }
+            }
+        }
+
+        return new CollectorImpl<T, OptionalBox, Optional<T>>(
+                OptionalBox::new, OptionalBox::accept,
+                (a, b) -> { if (b.present) a.accept(b.value); return a; },
+                a -> Optional.ofNullable(a.value), CH_NOID);
     }
 
     /**
-     * Returns a {@code Collector<T,U>} which performs a reduction of its
+     * Returns a {@code Collector} which performs a reduction of its
      * input elements under a specified mapping function and
      * {@code BinaryOperator}. This is a generalization of
      * {@link #reducing(Object, BinaryOperator)} which allows a transformation
@@ -524,17 +627,17 @@
      * @apiNote
      * The {@code reducing()} collectors are most useful when used in a
      * multi-level reduction, downstream of {@code groupingBy} or
-     * {@code partitioningBy}.  To perform a simple reduction on a stream,
-     * use {@link Stream#reduce(BinaryOperator)} instead.
+     * {@code partitioningBy}.  To perform a simple map-reduce on a stream,
+     * use {@link Stream#map(Function)} and {@link Stream#reduce(Object, BinaryOperator)}
+     * instead.
      *
      * <p>For example, given a stream of {@code Person}, to calculate the longest
      * last name of residents in each city:
      * <pre>{@code
      *     Comparator<String> byLength = Comparator.comparing(String::length);
-     *     BinaryOperator<String> longerOf = BinaryOperator.greaterOf(byLength);
      *     Map<City, String> longestLastNameByCity
      *         = people.stream().collect(groupingBy(Person::getCity,
-     *                                              reducing(Person::getLastName, longerOf)));
+     *                                              reducing(Person::getLastName, BinaryOperator.maxBy(byLength))));
      * }</pre>
      *
      * @param <T> the type of the input elements
@@ -549,18 +652,20 @@
      * @see #reducing(BinaryOperator)
      */
     public static <T, U>
-    Collector<T, U> reducing(U identity,
-                             Function<? super T, ? extends U> mapper,
-                             BinaryOperator<U> op) {
-        return new CollectorImpl<>(() -> identity,
-                                   (r, t) -> (r == null ? mapper.apply(t) : op.apply(r, mapper.apply(t))),
-                                   op);
+    Collector<T, ?, U> reducing(U identity,
+                                Function<? super T, ? extends U> mapper,
+                                BinaryOperator<U> op) {
+        return new CollectorImpl<>(
+                boxSupplier(identity),
+                (a, t) -> { a[0] = op.apply(a[0], mapper.apply(t)); },
+                (a, b) -> { a[0] = op.apply(a[0], b[0]); return a; },
+                a -> a[0], CH_NOID);
     }
 
     /**
      * Returns a {@code Collector} implementing a "group by" operation on
      * input elements of type {@code T}, grouping elements according to a
-     * classification function.
+     * classification function, and returning the results in a {@code Map}.
      *
      * <p>The classification function maps elements to some key type {@code K}.
      * The collector produces a {@code Map<K, List<T>>} whose keys are the
@@ -586,9 +691,9 @@
      * @see #groupingBy(Function, Supplier, Collector)
      * @see #groupingByConcurrent(Function)
      */
-    public static <T, K>
-    Collector<T, Map<K, List<T>>> groupingBy(Function<? super T, ? extends K> classifier) {
-        return groupingBy(classifier, HashMap::new, toList());
+    public static <T, K> Collector<T, ?, Map<K, List<T>>>
+    groupingBy(Function<? super T, ? extends K> classifier) {
+        return groupingBy(classifier, toList());
     }
 
     /**
@@ -615,6 +720,7 @@
      *
      * @param <T> the type of the input elements
      * @param <K> the type of the keys
+     * @param <A> the intermediate accumulation type of the downstream collector
      * @param <D> the result type of the downstream reduction
      * @param classifier a classifier function mapping input elements to keys
      * @param downstream a {@code Collector} implementing the downstream reduction
@@ -624,9 +730,9 @@
      * @see #groupingBy(Function, Supplier, Collector)
      * @see #groupingByConcurrent(Function, Collector)
      */
-    public static <T, K, D>
-    Collector<T, Map<K, D>> groupingBy(Function<? super T, ? extends K> classifier,
-                                       Collector<? super T, D> downstream) {
+    public static <T, K, A, D>
+    Collector<T, ?, Map<K, D>> groupingBy(Function<? super T, ? extends K> classifier,
+                                          Collector<? super T, A, D> downstream) {
         return groupingBy(classifier, HashMap::new, downstream);
     }
 
@@ -653,6 +759,7 @@
      *
      * @param <T> the type of the input elements
      * @param <K> the type of the keys
+     * @param <A> the intermediate accumulation type of the downstream collector
      * @param <D> the result type of the downstream reduction
      * @param <M> the type of the resulting {@code Map}
      * @param classifier a classifier function mapping input elements to keys
@@ -665,25 +772,39 @@
      * @see #groupingBy(Function)
      * @see #groupingByConcurrent(Function, Supplier, Collector)
      */
-    public static <T, K, D, M extends Map<K, D>>
-    Collector<T, M> groupingBy(Function<? super T, ? extends K> classifier,
-                               Supplier<M> mapFactory,
-                               Collector<? super T, D> downstream) {
-        Supplier<D> downstreamSupplier = downstream.resultSupplier();
-        BiFunction<D, ? super T, D> downstreamAccumulator = downstream.accumulator();
-        BiFunction<M, T, M> accumulator = (m, t) -> {
+    public static <T, K, D, A, M extends Map<K, D>>
+    Collector<T, ?, M> groupingBy(Function<? super T, ? extends K> classifier,
+                                  Supplier<M> mapFactory,
+                                  Collector<? super T, A, D> downstream) {
+        Supplier<A> downstreamSupplier = downstream.supplier();
+        BiConsumer<A, ? super T> downstreamAccumulator = downstream.accumulator();
+        BiConsumer<Map<K, A>, T> accumulator = (m, t) -> {
             K key = Objects.requireNonNull(classifier.apply(t), "element cannot be mapped to a null key");
-            D oldContainer = m.computeIfAbsent(key, k -> downstreamSupplier.get());
-            D newContainer = downstreamAccumulator.apply(oldContainer, t);
-            if (newContainer != oldContainer)
-                m.put(key, newContainer);
-            return m;
+            A container = m.computeIfAbsent(key, k -> downstreamSupplier.get());
+            downstreamAccumulator.accept(container, t);
         };
-        return new CollectorImpl<>(mapFactory, accumulator, mapMerger(downstream.combiner()), CH_STRICT);
+        BinaryOperator<Map<K, A>> merger = Collectors.<K, A, Map<K, A>>mapMerger(downstream.combiner());
+        @SuppressWarnings("unchecked")
+        Supplier<Map<K, A>> mangledFactory = (Supplier<Map<K, A>>) mapFactory;
+
+        if (downstream.characteristics().contains(Collector.Characteristics.IDENTITY_FINISH)) {
+            return new CollectorImpl<>(mangledFactory, accumulator, merger, CH_ID);
+        }
+        else {
+            @SuppressWarnings("unchecked")
+            Function<A, A> downstreamFinisher = (Function<A, A>) downstream.finisher();
+            Function<Map<K, A>, M> finisher = intermediate -> {
+                intermediate.replaceAll((k, v) -> downstreamFinisher.apply(v));
+                @SuppressWarnings("unchecked")
+                M castResult = (M) intermediate;
+                return castResult;
+            };
+            return new CollectorImpl<>(mangledFactory, accumulator, merger, finisher, CH_NOID);
+        }
     }
 
     /**
-     * Returns a {@code Collector} implementing a concurrent "group by"
+     * Returns a concurrent {@code Collector} implementing a "group by"
      * operation on input elements of type {@code T}, grouping elements
      * according to a classification function.
      *
@@ -716,12 +837,13 @@
      * @see #groupingByConcurrent(Function, Supplier, Collector)
      */
     public static <T, K>
-    Collector<T, ConcurrentMap<K, List<T>>> groupingByConcurrent(Function<? super T, ? extends K> classifier) {
+    Collector<T, ?, ConcurrentMap<K, List<T>>>
+    groupingByConcurrent(Function<? super T, ? extends K> classifier) {
         return groupingByConcurrent(classifier, ConcurrentHashMap::new, toList());
     }
 
     /**
-     * Returns a {@code Collector} implementing a concurrent cascaded "group by"
+     * Returns a concurrent {@code Collector} implementing a cascaded "group by"
      * operation on input elements of type {@code T}, grouping elements
      * according to a classification function, and then performing a reduction
      * operation on the values associated with a given key using the specified
@@ -739,12 +861,13 @@
      * where the city names are sorted:
      * <pre>{@code
      *     ConcurrentMap<City, Set<String>> namesByCity
-     *         = people.stream().collect(groupingByConcurrent(Person::getCity, TreeMap::new,
+     *         = people.stream().collect(groupingByConcurrent(Person::getCity, ConcurrentSkipListMap::new,
      *                                                        mapping(Person::getLastName, toSet())));
      * }</pre>
      *
      * @param <T> the type of the input elements
      * @param <K> the type of the keys
+     * @param <A> the intermediate accumulation type of the downstream collector
      * @param <D> the result type of the downstream reduction
      * @param classifier a classifier function mapping input elements to keys
      * @param downstream a {@code Collector} implementing the downstream reduction
@@ -754,9 +877,9 @@
      * @see #groupingByConcurrent(Function)
      * @see #groupingByConcurrent(Function, Supplier, Collector)
      */
-    public static <T, K, D>
-    Collector<T, ConcurrentMap<K, D>> groupingByConcurrent(Function<? super T, ? extends K> classifier,
-                                                           Collector<? super T, D> downstream) {
+    public static <T, K, A, D>
+    Collector<T, ?, ConcurrentMap<K, D>> groupingByConcurrent(Function<? super T, ? extends K> classifier,
+                                                              Collector<? super T, A, D> downstream) {
         return groupingByConcurrent(classifier, ConcurrentHashMap::new, downstream);
     }
 
@@ -787,6 +910,7 @@
      *
      * @param <T> the type of the input elements
      * @param <K> the type of the keys
+     * @param <A> the intermediate accumulation type of the downstream collector
      * @param <D> the result type of the downstream reduction
      * @param <M> the type of the resulting {@code ConcurrentMap}
      * @param classifier a classifier function mapping input elements to keys
@@ -799,51 +923,46 @@
      * @see #groupingByConcurrent(Function, Collector)
      * @see #groupingBy(Function, Supplier, Collector)
      */
-    public static <T, K, D, M extends ConcurrentMap<K, D>>
-    Collector<T, M> groupingByConcurrent(Function<? super T, ? extends K> classifier,
-                                         Supplier<M> mapFactory,
-                                         Collector<? super T, D> downstream) {
-        Supplier<D> downstreamSupplier = downstream.resultSupplier();
-        BiFunction<D, ? super T, D> downstreamAccumulator = downstream.accumulator();
-        BinaryOperator<M> combiner = mapMerger(downstream.combiner());
+    public static <T, K, A, D, M extends ConcurrentMap<K, D>>
+    Collector<T, ?, M> groupingByConcurrent(Function<? super T, ? extends K> classifier,
+                                            Supplier<M> mapFactory,
+                                            Collector<? super T, A, D> downstream) {
+        Supplier<A> downstreamSupplier = downstream.supplier();
+        BiConsumer<A, ? super T> downstreamAccumulator = downstream.accumulator();
+        BinaryOperator<ConcurrentMap<K, A>> merger = Collectors.<K, A, ConcurrentMap<K, A>>mapMerger(downstream.combiner());
+        @SuppressWarnings("unchecked")
+        Supplier<ConcurrentMap<K, A>> mangledFactory = (Supplier<ConcurrentMap<K, A>>) mapFactory;
+        BiConsumer<ConcurrentMap<K, A>, T> accumulator;
         if (downstream.characteristics().contains(Collector.Characteristics.CONCURRENT)) {
-            BiFunction<M, T, M> accumulator = (m, t) -> {
+            accumulator = (m, t) -> {
                 K key = Objects.requireNonNull(classifier.apply(t), "element cannot be mapped to a null key");
-                downstreamAccumulator.apply(m.computeIfAbsent(key, k -> downstreamSupplier.get()), t);
-                return m;
-            };
-            return new CollectorImpl<>(mapFactory, accumulator, combiner, CH_CONCURRENT);
-        } else if (downstream.characteristics().contains(Collector.Characteristics.STRICTLY_MUTATIVE)) {
-            BiFunction<M, T, M> accumulator = (m, t) -> {
-                K key = Objects.requireNonNull(classifier.apply(t), "element cannot be mapped to a null key");
-                D resultContainer = m.computeIfAbsent(key, k -> downstreamSupplier.get());
-                synchronized (resultContainer) {
-                    downstreamAccumulator.apply(resultContainer, t);
-                }
-                return m;
+                A resultContainer = m.computeIfAbsent(key, k -> downstreamSupplier.get());
+                downstreamAccumulator.accept(resultContainer, t);
             };
-            return new CollectorImpl<>(mapFactory, accumulator, combiner, CH_CONCURRENT);
-        } else {
-            BiFunction<M, T, M> accumulator = (m, t) -> {
+        }
+        else {
+            accumulator = (m, t) -> {
                 K key = Objects.requireNonNull(classifier.apply(t), "element cannot be mapped to a null key");
-                do {
-                    D oldResult = m.computeIfAbsent(key, k -> downstreamSupplier.get());
-                    if (oldResult == null) {
-                        if (m.putIfAbsent(key, downstreamAccumulator.apply(null, t)) == null)
-                            return m;
-                    } else {
-                        synchronized (oldResult) {
-                            if (m.get(key) != oldResult)
-                                continue;
-                            D newResult = downstreamAccumulator.apply(oldResult, t);
-                            if (oldResult != newResult)
-                                m.put(key, newResult);
-                            return m;
-                        }
-                    }
-                } while (true);
+                A resultContainer = m.computeIfAbsent(key, k -> downstreamSupplier.get());
+                synchronized (resultContainer) {
+                    downstreamAccumulator.accept(resultContainer, t);
+                }
             };
-            return new CollectorImpl<>(mapFactory, accumulator, combiner, CH_CONCURRENT);
+        }
+
+        if (downstream.characteristics().contains(Collector.Characteristics.IDENTITY_FINISH)) {
+            return new CollectorImpl<>(mangledFactory, accumulator, merger, CH_CONCURRENT_ID);
+        }
+        else {
+            @SuppressWarnings("unchecked")
+            Function<A, A> downstreamFinisher = (Function<A, A>) downstream.finisher();
+            Function<ConcurrentMap<K, A>, M> finisher = intermediate -> {
+                intermediate.replaceAll((k, v) -> downstreamFinisher.apply(v));
+                @SuppressWarnings("unchecked")
+                M castResult = (M) intermediate;
+                return castResult;
+            };
+            return new CollectorImpl<>(mangledFactory, accumulator, merger, finisher, CH_CONCURRENT_NOID);
         }
     }
 
@@ -862,7 +981,7 @@
      * @see #partitioningBy(Predicate, Collector)
      */
     public static <T>
-    Collector<T, Map<Boolean, List<T>>> partitioningBy(Predicate<? super T> predicate) {
+    Collector<T, ?, Map<Boolean, List<T>>> partitioningBy(Predicate<? super T> predicate) {
         return partitioningBy(predicate, toList());
     }
 
@@ -877,6 +996,7 @@
      * serializability, or thread-safety of the {@code Map} returned.
      *
      * @param <T> the type of the input elements
+     * @param <A> the intermediate accumulation type of the downstream collector
      * @param <D> the result type of the downstream reduction
      * @param predicate a predicate used for classifying input elements
      * @param downstream a {@code Collector} implementing the downstream
@@ -886,52 +1006,43 @@
      *
      * @see #partitioningBy(Predicate)
      */
-    public static <T, D>
-    Collector<T, Map<Boolean, D>> partitioningBy(Predicate<? super T> predicate,
-                                                 Collector<? super T, D> downstream) {
-        BiFunction<D, ? super T, D> downstreamAccumulator = downstream.accumulator();
-        BiFunction<Map<Boolean, D>, T, Map<Boolean, D>> accumulator = (result, t) -> {
+    public static <T, D, A>
+    Collector<T, ?, Map<Boolean, D>> partitioningBy(Predicate<? super T> predicate,
+                                                    Collector<? super T, A, D> downstream) {
+        @SuppressWarnings("unchecked")
+        BiConsumer<D, ? super T> downstreamAccumulator = (BiConsumer<D, ? super T>) downstream.accumulator();
+        BiConsumer<Map<Boolean, A>, T> accumulator = (result, t) -> {
             Partition<D> asPartition = ((Partition<D>) result);
-            if (predicate.test(t)) {
-                D newResult = downstreamAccumulator.apply(asPartition.forTrue, t);
-                if (newResult != asPartition.forTrue)
-                    asPartition.forTrue = newResult;
-            } else {
-                D newResult = downstreamAccumulator.apply(asPartition.forFalse, t);
-                if (newResult != asPartition.forFalse)
-                    asPartition.forFalse = newResult;
-            }
-            return result;
+            downstreamAccumulator.accept(predicate.test(t) ? asPartition.forTrue : asPartition.forFalse, t);
+        };
+        BinaryOperator<A> op = downstream.combiner();
+        BinaryOperator<Map<Boolean, A>> merger = (m1, m2) -> {
+            Partition<A> left = (Partition<A>) m1;
+            Partition<A> right = (Partition<A>) m2;
+            return new Partition<>(op.apply(left.forTrue, right.forTrue),
+                                   op.apply(left.forFalse, right.forFalse));
         };
-        return new CollectorImpl<>(() -> new Partition<>(downstream.resultSupplier().get(),
-                                                         downstream.resultSupplier().get()),
-                                   accumulator, partitionMerger(downstream.combiner()), CH_STRICT);
+        Supplier<Map<Boolean, A>> supplier = () -> new Partition<>(downstream.supplier().get(),
+                                                                   downstream.supplier().get());
+        if (downstream.characteristics().contains(Collector.Characteristics.IDENTITY_FINISH)) {
+            return new CollectorImpl<>(supplier, accumulator, merger, CH_ID);
+        }
+        else {
+            Function<Map<Boolean, A>, Map<Boolean, D>> finisher = (Map<Boolean, A> par) -> {
+                Partition<A> asAPartition = (Partition<A>) par;
+                return new Partition<>(downstream.finisher().apply(asAPartition.forTrue),
+                                       downstream.finisher().apply(asAPartition.forFalse));
+            };
+            return new CollectorImpl<>(supplier, accumulator, merger, finisher, CH_NOID);
+        }
     }
 
     /**
-     * Merge function for two partitions, given a merge function for the
-     * elements.
-     */
-    private static <D> BinaryOperator<Map<Boolean, D>> partitionMerger(BinaryOperator<D> op) {
-        return (m1, m2) -> {
-            Partition<D> left = (Partition<D>) m1;
-            Partition<D> right = (Partition<D>) m2;
-            if (left.forFalse == null)
-                left.forFalse = right.forFalse;
-            else if (right.forFalse != null)
-                left.forFalse = op.apply(left.forFalse, right.forFalse);
-            if (left.forTrue == null)
-                left.forTrue = right.forTrue;
-            else if (right.forTrue != null)
-                left.forTrue = op.apply(left.forTrue, right.forTrue);
-            return left;
-        };
-    }
-
-    /**
-     * Accumulate elements into a {@code Map} whose keys and values are the
-     * result of applying mapping functions to the input elements.
-     * If the mapped keys contains duplicates (according to
+     * Returns a {@code Collector} that accumulate elements into a
+     * {@code Map} whose keys and values are the result of applying the provided
+     * mapping functions to the input elements.
+     *
+     * <p>If the mapped keys contains duplicates (according to
      * {@link Object#equals(Object)}), an {@code IllegalStateException} is
      * thrown when the collection operation is performed.  If the mapped keys
      * may have duplicates, use {@link #toMap(Function, Function, BinaryOperator)}
@@ -970,24 +1081,26 @@
      * @see #toConcurrentMap(Function, Function)
      */
     public static <T, K, U>
-    Collector<T, Map<K,U>> toMap(Function<? super T, ? extends K> keyMapper,
-                                 Function<? super T, ? extends U> valueMapper) {
+    Collector<T, ?, Map<K,U>> toMap(Function<? super T, ? extends K> keyMapper,
+                                    Function<? super T, ? extends U> valueMapper) {
         return toMap(keyMapper, valueMapper, throwingMerger(), HashMap::new);
     }
 
     /**
-     * Accumulate elements into a {@code Map} whose keys and values are the
-     * result of applying mapping functions to the input elements. If the mapped
+     * Returns a {@code Collector} that accumulate elements into a
+     * {@code Map} whose keys and values are the result of applying the provided
+     * mapping functions to the input elements.
+     *
+     * <p>If the mapped
      * keys contains duplicates (according to {@link Object#equals(Object)}),
      * the value mapping function is applied to each equal element, and the
      * results are merged using the provided merging function.
      *
      * @apiNote
      * There are multiple ways to deal with collisions between multiple elements
-     * mapping to the same key.  There are some predefined merging functions,
-     * such as {@link #throwingMerger()}, {@link #firstWinsMerger()}, and
-     * {@link #lastWinsMerger()}, that implement common policies, or you can
-     * implement custom policies easily.  For example, if you have a stream
+     * mapping to the same key.  The other forms of {@code toMap} simply use
+     * a merge function that throws unconditionally, but you can easily write
+     * more flexible merge policies.  For example, if you have a stream
      * of {@code Person}, and you want to produce a "phone book" mapping name to
      * address, but it is possible that two persons have the same name, you can
      * do as follows to gracefully deals with these collisions, and produce a
@@ -1018,15 +1131,18 @@
      * @see #toConcurrentMap(Function, Function, BinaryOperator)
      */
     public static <T, K, U>
-    Collector<T, Map<K,U>> toMap(Function<? super T, ? extends K> keyMapper,
-                                 Function<? super T, ? extends U> valueMapper,
-                                 BinaryOperator<U> mergeFunction) {
+    Collector<T, ?, Map<K,U>> toMap(Function<? super T, ? extends K> keyMapper,
+                                    Function<? super T, ? extends U> valueMapper,
+                                    BinaryOperator<U> mergeFunction) {
         return toMap(keyMapper, valueMapper, mergeFunction, HashMap::new);
     }
 
     /**
-     * Accumulate elements into a {@code Map} whose keys and values are the
-     * result of applying mapping functions to the input elements. If the mapped
+     * Returns a {@code Collector} that accumulate elements into a
+     * {@code Map} whose keys and values are the result of applying the provided
+     * mapping functions to the input elements.
+     *
+     * <p>If the mapped
      * keys contains duplicates (according to {@link Object#equals(Object)}),
      * the value mapping function is applied to each equal element, and the
      * results are merged using the provided merging function.  The {@code Map}
@@ -1054,22 +1170,22 @@
      * @see #toConcurrentMap(Function, Function, BinaryOperator, Supplier)
      */
     public static <T, K, U, M extends Map<K, U>>
-    Collector<T, M> toMap(Function<? super T, ? extends K> keyMapper,
-                          Function<? super T, ? extends U> valueMapper,
-                          BinaryOperator<U> mergeFunction,
-                          Supplier<M> mapSupplier) {
-        BiFunction<M, T, M> accumulator
-                = (map, element) -> {
-                      map.merge(keyMapper.apply(element), valueMapper.apply(element), mergeFunction);
-                      return map;
-                  };
-        return new CollectorImpl<>(mapSupplier, accumulator, mapMerger(mergeFunction), CH_STRICT);
+    Collector<T, ?, M> toMap(Function<? super T, ? extends K> keyMapper,
+                                Function<? super T, ? extends U> valueMapper,
+                                BinaryOperator<U> mergeFunction,
+                                Supplier<M> mapSupplier) {
+        BiConsumer<M, T> accumulator
+                = (map, element) -> map.merge(keyMapper.apply(element),
+                                              valueMapper.apply(element), mergeFunction);
+        return new CollectorImpl<>(mapSupplier, accumulator, mapMerger(mergeFunction), CH_ID);
     }
 
     /**
-     * Accumulate elements into a {@code ConcurrentMap} whose keys and values
-     * are the result of applying mapping functions to the input elements.
-     * If the mapped keys contains duplicates (according to
+     * Returns a {@code Collector} that accumulate elements into a
+     * {@code ConcurrentMap} whose keys and values are the result of applying
+     * the provided mapping functions to the input elements.
+     *
+     * <p>If the mapped keys contains duplicates (according to
      * {@link Object#equals(Object)}), an {@code IllegalStateException} is
      * thrown when the collection operation is performed.  If the mapped keys
      * may have duplicates, use
@@ -1112,24 +1228,25 @@
      * @see #toConcurrentMap(Function, Function, BinaryOperator, Supplier)
      */
     public static <T, K, U>
-    Collector<T, ConcurrentMap<K,U>> toConcurrentMap(Function<? super T, ? extends K> keyMapper,
-                                                     Function<? super T, ? extends U> valueMapper) {
+    Collector<T, ?, ConcurrentMap<K,U>> toConcurrentMap(Function<? super T, ? extends K> keyMapper,
+                                                        Function<? super T, ? extends U> valueMapper) {
         return toConcurrentMap(keyMapper, valueMapper, throwingMerger(), ConcurrentHashMap::new);
     }
 
     /**
-     * Accumulate elements into a {@code ConcurrentMap} whose keys and values
-     * are the result of applying mapping functions to the input elements. If
-     * the mapped keys contains duplicates (according to {@link Object#equals(Object)}),
+     * Returns a {@code Collector} that accumulate elements into a
+     * {@code ConcurrentMap} whose keys and values are the result of applying
+     * the provided mapping functions to the input elements.
+     *
+     * <p>If the mapped keys contains duplicates (according to {@link Object#equals(Object)}),
      * the value mapping function is applied to each equal element, and the
      * results are merged using the provided merging function.
      *
      * @apiNote
      * There are multiple ways to deal with collisions between multiple elements
-     * mapping to the same key.  There are some predefined merging functions,
-     * such as {@link #throwingMerger()}, {@link #firstWinsMerger()}, and
-     * {@link #lastWinsMerger()}, that implement common policies, or you can
-     * implement custom policies easily.  For example, if you have a stream
+     * mapping to the same key.  The other forms of {@code toConcurrentMap} simply use
+     * a merge function that throws unconditionally, but you can easily write
+     * more flexible merge policies.  For example, if you have a stream
      * of {@code Person}, and you want to produce a "phone book" mapping name to
      * address, but it is possible that two persons have the same name, you can
      * do as follows to gracefully deals with these collisions, and produce a
@@ -1163,16 +1280,19 @@
      * @see #toMap(Function, Function, BinaryOperator)
      */
     public static <T, K, U>
-    Collector<T, ConcurrentMap<K,U>> toConcurrentMap(Function<? super T, ? extends K> keyMapper,
-                                                     Function<? super T, ? extends U> valueMapper,
-                                                     BinaryOperator<U> mergeFunction) {
+    Collector<T, ?, ConcurrentMap<K,U>>
+    toConcurrentMap(Function<? super T, ? extends K> keyMapper,
+                    Function<? super T, ? extends U> valueMapper,
+                    BinaryOperator<U> mergeFunction) {
         return toConcurrentMap(keyMapper, valueMapper, mergeFunction, ConcurrentHashMap::new);
     }
 
     /**
-     * Accumulate elements into a {@code ConcurrentMap} whose keys and values
-     * are the result of applying mapping functions to the input elements. If
-     * the mapped keys contains duplicates (according to {@link Object#equals(Object)}),
+     * Returns a {@code Collector} that accumulate elements into a
+     * {@code ConcurrentMap} whose keys and values are the result of applying
+     * the provided mapping functions to the input elements.
+     *
+     * <p>If the mapped keys contains duplicates (according to {@link Object#equals(Object)}),
      * the value mapping function is applied to each equal element, and the
      * results are merged using the provided merging function.  The
      * {@code ConcurrentMap} is created by a provided supplier function.
@@ -1202,15 +1322,14 @@
      * @see #toMap(Function, Function, BinaryOperator, Supplier)
      */
     public static <T, K, U, M extends ConcurrentMap<K, U>>
-    Collector<T, M> toConcurrentMap(Function<? super T, ? extends K> keyMapper,
-                                    Function<? super T, ? extends U> valueMapper,
-                                    BinaryOperator<U> mergeFunction,
-                                    Supplier<M> mapSupplier) {
-        BiFunction<M, T, M> accumulator = (map, element) -> {
-            map.merge(keyMapper.apply(element), valueMapper.apply(element), mergeFunction);
-            return map;
-        };
-        return new CollectorImpl<>(mapSupplier, accumulator, mapMerger(mergeFunction), CH_CONCURRENT);
+    Collector<T, ?, M> toConcurrentMap(Function<? super T, ? extends K> keyMapper,
+                                       Function<? super T, ? extends U> valueMapper,
+                                       BinaryOperator<U> mergeFunction,
+                                       Supplier<M> mapSupplier) {
+        BiConsumer<M, T> accumulator
+                = (map, element) -> map.merge(keyMapper.apply(element),
+                                              valueMapper.apply(element), mergeFunction);
+        return new CollectorImpl<>(mapSupplier, accumulator, mapMerger(mergeFunction), CH_CONCURRENT_ID);
     }
 
     /**
@@ -1222,14 +1341,15 @@
      * @param mapper a mapping function to apply to each element
      * @return a {@code Collector} implementing the summary-statistics reduction
      *
-     * @see #toDoubleSummaryStatistics(ToDoubleFunction)
-     * @see #toLongSummaryStatistics(ToLongFunction)
+     * @see #summarizingDouble(ToDoubleFunction)
+     * @see #summarizingLong(ToLongFunction)
      */
     public static <T>
-    Collector<T, IntSummaryStatistics> toIntSummaryStatistics(ToIntFunction<? super T> mapper) {
-        return new CollectorImpl<>(IntSummaryStatistics::new,
-                                   (r, t) -> { r.accept(mapper.applyAsInt(t)); return r; },
-                                   (l, r) -> { l.combine(r); return l; }, CH_STRICT);
+    Collector<T, ?, IntSummaryStatistics> summarizingInt(ToIntFunction<? super T> mapper) {
+        return new CollectorImpl<T, IntSummaryStatistics, IntSummaryStatistics>(
+                IntSummaryStatistics::new,
+                (r, t) -> r.accept(mapper.applyAsInt(t)),
+                (l, r) -> { l.combine(r); return l; }, CH_ID);
     }
 
     /**
@@ -1241,14 +1361,15 @@
      * @param mapper the mapping function to apply to each element
      * @return a {@code Collector} implementing the summary-statistics reduction
      *
-     * @see #toDoubleSummaryStatistics(ToDoubleFunction)
-     * @see #toIntSummaryStatistics(ToIntFunction)
+     * @see #summarizingDouble(ToDoubleFunction)
+     * @see #summarizingInt(ToIntFunction)
      */
     public static <T>
-    Collector<T, LongSummaryStatistics> toLongSummaryStatistics(ToLongFunction<? super T> mapper) {
-        return new CollectorImpl<>(LongSummaryStatistics::new,
-                                   (r, t) -> { r.accept(mapper.applyAsLong(t)); return r; },
-                                   (l, r) -> { l.combine(r); return l; }, CH_STRICT);
+    Collector<T, ?, LongSummaryStatistics> summarizingLong(ToLongFunction<? super T> mapper) {
+        return new CollectorImpl<T, LongSummaryStatistics, LongSummaryStatistics>(
+                LongSummaryStatistics::new,
+                (r, t) -> r.accept(mapper.applyAsLong(t)),
+                (l, r) -> { l.combine(r); return l; }, CH_ID);
     }
 
     /**
@@ -1260,14 +1381,15 @@
      * @param mapper a mapping function to apply to each element
      * @return a {@code Collector} implementing the summary-statistics reduction
      *
-     * @see #toLongSummaryStatistics(ToLongFunction)
-     * @see #toIntSummaryStatistics(ToIntFunction)
+     * @see #summarizingLong(ToLongFunction)
+     * @see #summarizingInt(ToIntFunction)
      */
     public static <T>
-    Collector<T, DoubleSummaryStatistics> toDoubleSummaryStatistics(ToDoubleFunction<? super T> mapper) {
-        return new CollectorImpl<>(DoubleSummaryStatistics::new,
-                                   (r, t) -> { r.accept(mapper.applyAsDouble(t)); return r; },
-                                   (l, r) -> { l.combine(r); return l; }, CH_STRICT);
+    Collector<T, ?, DoubleSummaryStatistics> summarizingDouble(ToDoubleFunction<? super T> mapper) {
+        return new CollectorImpl<T, DoubleSummaryStatistics, DoubleSummaryStatistics>(
+                DoubleSummaryStatistics::new,
+                (r, t) -> r.accept(mapper.applyAsDouble(t)),
+                (l, r) -> { l.combine(r); return l; }, CH_ID);
     }
 
     /**
@@ -1276,8 +1398,8 @@
     private static final class Partition<T>
             extends AbstractMap<Boolean, T>
             implements Map<Boolean, T> {
-        T forTrue;
-        T forFalse;
+        final T forTrue;
+        final T forFalse;
 
         Partition(T forTrue, T forFalse) {
             this.forTrue = forTrue;
@@ -1289,24 +1411,9 @@
             return new AbstractSet<Map.Entry<Boolean, T>>() {
                 @Override
                 public Iterator<Map.Entry<Boolean, T>> iterator() {
-
-                    return new Iterator<Map.Entry<Boolean, T>>() {
-                        int state = 0;
-
-                        @Override
-                        public boolean hasNext() {
-                            return state < 2;
-                        }
-
-                        @Override
-                        public Map.Entry<Boolean, T> next() {
-                            if (state >= 2)
-                                throw new NoSuchElementException();
-                            return (state++ == 0)
-                                   ? new SimpleImmutableEntry<>(false, forFalse)
-                                   : new SimpleImmutableEntry<>(true, forTrue);
-                        }
-                    };
+                    Map.Entry<Boolean, T> falseEntry = new SimpleImmutableEntry<>(false, forFalse);
+                    Map.Entry<Boolean, T> trueEntry = new SimpleImmutableEntry<>(true, forTrue);
+                    return Arrays.asList(falseEntry, trueEntry).iterator();
                 }
 
                 @Override
--- a/jdk/src/share/classes/java/util/stream/DelegatingStream.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/DelegatingStream.java	Tue Aug 13 18:34:12 2013 -0700
@@ -209,7 +209,7 @@
     }
 
     @Override
-    public <R> R collect(Collector<? super T, R> collector) {
+    public <R, A> R collect(Collector<? super T, A, ? extends R> collector) {
         return delegate.collect(collector);
     }
 
--- a/jdk/src/share/classes/java/util/stream/DoublePipeline.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/DoublePipeline.java	Tue Aug 13 18:34:12 2013 -0700
@@ -147,6 +147,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     final Spliterator.OfDouble lazySpliterator(Supplier<? extends Spliterator<Double>> supplier) {
         return new StreamSpliterators.DelegatingSpliterator.OfDouble((Supplier<Spliterator.OfDouble>) supplier);
     }
@@ -209,6 +210,7 @@
             Sink<Double> opWrapSink(int flags, Sink<U> sink) {
                 return new Sink.ChainedDouble(sink) {
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(double t) {
                         downstream.accept(mapper.apply(t));
                     }
--- a/jdk/src/share/classes/java/util/stream/DoubleStream.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java	Tue Aug 13 18:34:12 2013 -0700
@@ -527,7 +527,7 @@
     long count();
 
     /**
-     * Returns an {@code OptionalDouble} describing the average of elements of
+     * Returns an {@code OptionalDouble} describing the arithmetic mean of elements of
      * this stream, or an empty optional if this stream is empty.  The average
      * returned can vary depending upon the order in which elements are
      * encountered. This is due to accumulated rounding error in addition of
--- a/jdk/src/share/classes/java/util/stream/FindOps.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/FindOps.java	Tue Aug 13 18:34:12 2013 -0700
@@ -246,6 +246,7 @@
      * @param <P_OUT> Output element type from the stream pipeline
      * @param <O> Result type from the find operation
      */
+    @SuppressWarnings("serial")
     private static final class FindTask<P_IN, P_OUT, O>
             extends AbstractShortCircuitTask<P_IN, P_OUT, O, FindTask<P_IN, P_OUT, O>> {
         private final FindOp<P_OUT, O> op;
--- a/jdk/src/share/classes/java/util/stream/ForEachOps.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/ForEachOps.java	Tue Aug 13 18:34:12 2013 -0700
@@ -249,6 +249,7 @@
     }
 
     /** A {@code ForkJoinTask} for performing a parallel for-each operation */
+    @SuppressWarnings("serial")
     static final class ForEachTask<S, T> extends CountedCompleter<Void> {
         private Spliterator<S> spliterator;
         private final Sink<S> sink;
@@ -314,6 +315,7 @@
      * A {@code ForkJoinTask} for performing a parallel for-each operation
      * which visits the elements in encounter order
      */
+    @SuppressWarnings("serial")
     static final class ForEachOrderedTask<S, T> extends CountedCompleter<Void> {
         private final PipelineHelper<T> helper;
         private Spliterator<S> spliterator;
--- a/jdk/src/share/classes/java/util/stream/IntPipeline.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/IntPipeline.java	Tue Aug 13 18:34:12 2013 -0700
@@ -150,6 +150,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     final Spliterator.OfInt lazySpliterator(Supplier<? extends Spliterator<Integer>> supplier) {
         return new StreamSpliterators.DelegatingSpliterator.OfInt((Supplier<Spliterator.OfInt>) supplier);
     }
@@ -190,6 +191,7 @@
             Sink<Integer> opWrapSink(int flags, Sink<Long> sink) {
                 return new Sink.ChainedInt(sink) {
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(int t) {
                         downstream.accept((long) t);
                     }
@@ -206,6 +208,7 @@
             Sink<Integer> opWrapSink(int flags, Sink<Double> sink) {
                 return new Sink.ChainedInt(sink) {
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(int t) {
                         downstream.accept((double) t);
                     }
@@ -245,6 +248,7 @@
             Sink<Integer> opWrapSink(int flags, Sink<U> sink) {
                 return new Sink.ChainedInt(sink) {
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(int t) {
                         downstream.accept(mapper.apply(t));
                     }
--- a/jdk/src/share/classes/java/util/stream/IntStream.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/IntStream.java	Tue Aug 13 18:34:12 2013 -0700
@@ -517,7 +517,7 @@
     long count();
 
     /**
-     * Returns an {@code OptionalDouble} describing the average of elements of
+     * Returns an {@code OptionalDouble} describing the arithmetic mean of elements of
      * this stream, or an empty optional if this stream is empty.  This is a
      * special case of a
      * <a href="package-summary.html#MutableReduction">reduction</a>.
--- a/jdk/src/share/classes/java/util/stream/LongPipeline.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/LongPipeline.java	Tue Aug 13 18:34:12 2013 -0700
@@ -148,6 +148,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     final Spliterator.OfLong lazySpliterator(Supplier<? extends Spliterator<Long>> supplier) {
         return new StreamSpliterators.DelegatingSpliterator.OfLong((Supplier<Spliterator.OfLong>) supplier);
     }
@@ -209,6 +210,7 @@
             Sink<Long> opWrapSink(int flags, Sink<Long> sink) {
                 return new Sink.ChainedLong(sink) {
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(long t) {
                         downstream.accept(mapper.applyAsLong(t));
                     }
@@ -226,6 +228,7 @@
             Sink<Long> opWrapSink(int flags, Sink<U> sink) {
                 return new Sink.ChainedLong(sink) {
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(long t) {
                         downstream.accept(mapper.apply(t));
                     }
@@ -243,6 +246,7 @@
             Sink<Long> opWrapSink(int flags, Sink<Integer> sink) {
                 return new Sink.ChainedLong(sink) {
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(long t) {
                         downstream.accept(mapper.applyAsInt(t));
                     }
--- a/jdk/src/share/classes/java/util/stream/LongStream.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/LongStream.java	Tue Aug 13 18:34:12 2013 -0700
@@ -517,7 +517,7 @@
     long count();
 
     /**
-     * Returns an {@code OptionalDouble} describing the average of elements of
+     * Returns an {@code OptionalDouble} describing the arithmetic mean of elements of
      * this stream, or an empty optional if this stream is empty.  This is a
      * special case of a
      * <a href="package-summary.html#MutableReduction">reduction</a>.
--- a/jdk/src/share/classes/java/util/stream/MatchOps.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/MatchOps.java	Tue Aug 13 18:34:12 2013 -0700
@@ -274,6 +274,7 @@
      * @param <P_IN> the type of source elements for the pipeline
      * @param <P_OUT> the type of output elements for the pipeline
      */
+    @SuppressWarnings("serial")
     private static final class MatchTask<P_IN, P_OUT>
             extends AbstractShortCircuitTask<P_IN, P_OUT, Boolean, MatchTask<P_IN, P_OUT>> {
         private final MatchOp<P_OUT> op;
--- a/jdk/src/share/classes/java/util/stream/Nodes.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/Nodes.java	Tue Aug 13 18:34:12 2013 -0700
@@ -60,6 +60,7 @@
      */
     static final long MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
 
+    @SuppressWarnings("raw")
     private static final Node EMPTY_NODE = new EmptyNode.OfRef();
     private static final Node.OfInt EMPTY_INT_NODE = new EmptyNode.OfInt();
     private static final Node.OfLong EMPTY_LONG_NODE = new EmptyNode.OfLong();
@@ -1786,6 +1787,10 @@
         }
     }
 
+    /*
+     * This and subclasses are not intended to be serializable
+     */
+    @SuppressWarnings("serial")
     private static abstract class SizedCollectorTask<P_IN, P_OUT, T_SINK extends Sink<P_OUT>,
                                                      K extends SizedCollectorTask<P_IN, P_OUT, T_SINK, K>>
             extends CountedCompleter<Void>
@@ -1855,6 +1860,7 @@
             fence = (int) offset + (int) length;
         }
 
+        @SuppressWarnings("serial")
         static final class OfRef<P_IN, P_OUT>
                 extends SizedCollectorTask<P_IN, P_OUT, Sink<P_OUT>, OfRef<P_IN, P_OUT>>
                 implements Sink<P_OUT> {
@@ -1886,6 +1892,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         static final class OfInt<P_IN>
                 extends SizedCollectorTask<P_IN, Integer, Sink.OfInt, OfInt<P_IN>>
                 implements Sink.OfInt {
@@ -1917,6 +1924,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         static final class OfLong<P_IN>
                 extends SizedCollectorTask<P_IN, Long, Sink.OfLong, OfLong<P_IN>>
                 implements Sink.OfLong {
@@ -1948,6 +1956,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         static final class OfDouble<P_IN>
                 extends SizedCollectorTask<P_IN, Double, Sink.OfDouble, OfDouble<P_IN>>
                 implements Sink.OfDouble {
@@ -1980,6 +1989,7 @@
         }
     }
 
+    @SuppressWarnings("serial")
     private static abstract class ToArrayTask<T, T_NODE extends Node<T>,
                                               K extends ToArrayTask<T, T_NODE, K>>
             extends CountedCompleter<Void> {
@@ -2025,6 +2035,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         private static final class OfRef<T>
                 extends ToArrayTask<T, Node<T>, OfRef<T>> {
             private final T[] array;
@@ -2050,6 +2061,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         private static class OfPrimitive<T, T_CONS, T_ARR,
                                          T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>,
                                          T_NODE extends Node.OfPrimitive<T, T_CONS, T_ARR, T_SPLITR, T_NODE>>
@@ -2077,6 +2089,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         private static final class OfInt
                 extends OfPrimitive<Integer, IntConsumer, int[], Spliterator.OfInt, Node.OfInt> {
             private OfInt(Node.OfInt node, int[] array, int offset) {
@@ -2084,6 +2097,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         private static final class OfLong
                 extends OfPrimitive<Long, LongConsumer, long[], Spliterator.OfLong, Node.OfLong> {
             private OfLong(Node.OfLong node, long[] array, int offset) {
@@ -2091,6 +2105,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         private static final class OfDouble
                 extends OfPrimitive<Double, DoubleConsumer, double[], Spliterator.OfDouble, Node.OfDouble> {
             private OfDouble(Node.OfDouble node, double[] array, int offset) {
@@ -2099,6 +2114,7 @@
         }
     }
 
+    @SuppressWarnings("serial")
     private static class CollectorTask<P_IN, P_OUT, T_NODE extends Node<P_OUT>, T_BUILDER extends Node.Builder<P_OUT>>
             extends AbstractTask<P_IN, P_OUT, T_NODE, CollectorTask<P_IN, P_OUT, T_NODE, T_BUILDER>> {
         protected final PipelineHelper<P_OUT> helper;
@@ -2135,12 +2151,13 @@
         }
 
         @Override
-        public void onCompletion(CountedCompleter caller) {
+        public void onCompletion(CountedCompleter<?> caller) {
             if (!isLeaf())
                 setLocalResult(concFactory.apply(leftChild.getLocalResult(), rightChild.getLocalResult()));
             super.onCompletion(caller);
         }
 
+        @SuppressWarnings("serial")
         private static final class OfRef<P_IN, P_OUT>
                 extends CollectorTask<P_IN, P_OUT, Node<P_OUT>, Node.Builder<P_OUT>> {
             OfRef(PipelineHelper<P_OUT> helper,
@@ -2150,6 +2167,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         private static final class OfInt<P_IN>
                 extends CollectorTask<P_IN, Integer, Node.OfInt, Node.Builder.OfInt> {
             OfInt(PipelineHelper<Integer> helper, Spliterator<P_IN> spliterator) {
@@ -2157,6 +2175,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         private static final class OfLong<P_IN>
                 extends CollectorTask<P_IN, Long, Node.OfLong, Node.Builder.OfLong> {
             OfLong(PipelineHelper<Long> helper, Spliterator<P_IN> spliterator) {
@@ -2164,6 +2183,7 @@
             }
         }
 
+        @SuppressWarnings("serial")
         private static final class OfDouble<P_IN>
                 extends CollectorTask<P_IN, Double, Node.OfDouble, Node.Builder.OfDouble> {
             OfDouble(PipelineHelper<Double> helper, Spliterator<P_IN> spliterator) {
--- a/jdk/src/share/classes/java/util/stream/ReduceOps.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/ReduceOps.java	Tue Aug 13 18:34:12 2013 -0700
@@ -43,7 +43,7 @@
 import java.util.function.Supplier;
 
 /**
- * Factory for the creating instances of {@code TerminalOp) that implement
+ * Factory for creating instances of {@code TerminalOp} that implement
  * reductions.
  *
  * @since 1.8
@@ -148,17 +148,17 @@
      * reference values.
      *
      * @param <T> the type of the input elements
-     * @param <R> the type of the result
+     * @param <I> the type of the intermediate reduction result
      * @param collector a {@code Collector} defining the reduction
      * @return a {@code ReduceOp} implementing the reduction
      */
-    public static <T,R> TerminalOp<T, R>
-    makeRef(Collector<? super T,R> collector) {
-        Supplier<R> supplier = Objects.requireNonNull(collector).resultSupplier();
-        BiFunction<R, ? super T, R> accumulator = collector.accumulator();
-        BinaryOperator<R> combiner = collector.combiner();
-        class ReducingSink extends Box<R>
-                implements AccumulatingSink<T, R, ReducingSink> {
+    public static <T, I> TerminalOp<T, I>
+    makeRef(Collector<? super T, I, ?> collector) {
+        Supplier<I> supplier = Objects.requireNonNull(collector).supplier();
+        BiConsumer<I, ? super T> accumulator = collector.accumulator();
+        BinaryOperator<I> combiner = collector.combiner();
+        class ReducingSink extends Box<I>
+                implements AccumulatingSink<T, I, ReducingSink> {
             @Override
             public void begin(long size) {
                 state = supplier.get();
@@ -166,9 +166,7 @@
 
             @Override
             public void accept(T t) {
-                R newResult = accumulator.apply(state, t);
-                if (state != newResult)
-                    state = newResult;
+                accumulator.accept(state, t);
             }
 
             @Override
@@ -176,7 +174,7 @@
                 state = combiner.apply(state, other.state);
             }
         }
-        return new ReduceOp<T, R, ReducingSink>(StreamShape.REFERENCE) {
+        return new ReduceOp<T, I, ReducingSink>(StreamShape.REFERENCE) {
             @Override
             public ReducingSink makeSink() {
                 return new ReducingSink();
@@ -720,6 +718,7 @@
     /**
      * A {@code ForkJoinTask} for performing a parallel reduce operation.
      */
+    @SuppressWarnings("serial")
     private static final class ReduceTask<P_IN, P_OUT, R,
                                           S extends AccumulatingSink<P_OUT, R, S>>
             extends AbstractTask<P_IN, P_OUT, S, ReduceTask<P_IN, P_OUT, R, S>> {
@@ -749,7 +748,7 @@
         }
 
         @Override
-        public void onCompletion(CountedCompleter caller) {
+        public void onCompletion(CountedCompleter<?> caller) {
             if (!isLeaf()) {
                 S leftResult = leftChild.getLocalResult();
                 leftResult.combine(rightChild.getLocalResult());
--- a/jdk/src/share/classes/java/util/stream/ReferencePipeline.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/ReferencePipeline.java	Tue Aug 13 18:34:12 2013 -0700
@@ -170,9 +170,10 @@
                     }
 
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(P_OUT u) {
                         if (predicate.test(u))
-                            downstream.accept(u);
+                            downstream.accept((Object) u);
                     }
                 };
             }
@@ -180,6 +181,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public final <R> Stream<R> map(Function<? super P_OUT, ? extends R> mapper) {
         Objects.requireNonNull(mapper);
         return new StatelessOp<P_OUT, R>(this, StreamShape.REFERENCE,
@@ -262,6 +264,7 @@
                     }
 
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(P_OUT u) {
                         // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
                         Stream<? extends R> result = mapper.apply(u);
@@ -363,6 +366,7 @@
             Sink<P_OUT> opWrapSink(int flags, Sink<P_OUT> sink) {
                 return new Sink.ChainedReference<P_OUT>(sink) {
                     @Override
+                    @SuppressWarnings("unchecked")
                     public void accept(P_OUT u) {
                         tee.accept(u);
                         downstream.accept(u);
@@ -439,6 +443,7 @@
         // The runtime type of U is never checked for equality with the component type of the runtime type of A[].
         // Runtime checking will be performed when an element is stored in A[], thus if A is not a
         // super type of U an ArrayStoreException will be thrown.
+        @SuppressWarnings("rawtypes")
         IntFunction rawGenerator = (IntFunction) generator;
         return (A[]) Nodes.flatten(evaluateToArrayNode(rawGenerator), rawGenerator)
                               .asArray(rawGenerator);
@@ -490,16 +495,21 @@
     }
 
     @Override
-    public final <R> R collect(Collector<? super P_OUT, R> collector) {
+    public final <R, A> R collect(Collector<? super P_OUT, A, ? extends R> collector) {
+        A container;
         if (isParallel()
                 && (collector.characteristics().contains(Collector.Characteristics.CONCURRENT))
                 && (!isOrdered() || collector.characteristics().contains(Collector.Characteristics.UNORDERED))) {
-            R container = collector.resultSupplier().get();
-            BiFunction<R, ? super P_OUT, R> accumulator = collector.accumulator();
-            forEach(u -> accumulator.apply(container, u));
-            return container;
+            container = collector.supplier().get();
+            BiConsumer<A, ? super P_OUT> accumulator = collector.accumulator();
+            forEach(u -> accumulator.accept(container, u));
         }
-        return evaluate(ReduceOps.makeRef(collector));
+        else {
+            container = evaluate(ReduceOps.makeRef(collector));
+        }
+        return collector.characteristics().contains(Collector.Characteristics.IDENTITY_FINISH)
+               ? (R) container
+               : collector.finisher().apply(container);
     }
 
     @Override
--- a/jdk/src/share/classes/java/util/stream/Sink.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/Sink.java	Tue Aug 13 18:34:12 2013 -0700
@@ -242,6 +242,7 @@
      * {@code accept()} method on the downstream {@code Sink}.
      */
     static abstract class ChainedReference<T> implements Sink<T> {
+        @SuppressWarnings("rawtypes")
         protected final Sink downstream;
 
         public ChainedReference(Sink downstream) {
@@ -274,6 +275,7 @@
      * {@code accept()} method on the downstream {@code Sink}.
      */
     static abstract class ChainedInt implements Sink.OfInt {
+        @SuppressWarnings("rawtypes")
         protected final Sink downstream;
 
         public ChainedInt(Sink downstream) {
@@ -306,6 +308,7 @@
      * {@code accept()} method on the downstream {@code Sink}.
      */
     static abstract class ChainedLong implements Sink.OfLong {
+        @SuppressWarnings("rawtypes")
         protected final Sink downstream;
 
         public ChainedLong(Sink downstream) {
@@ -338,6 +341,7 @@
      * {@code accept()} method on the downstream {@code Sink}.
      */
     static abstract class ChainedDouble implements Sink.OfDouble {
+        @SuppressWarnings("rawtypes")
         protected final Sink downstream;
 
         public ChainedDouble(Sink downstream) {
--- a/jdk/src/share/classes/java/util/stream/SliceOps.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/SliceOps.java	Tue Aug 13 18:34:12 2013 -0700
@@ -550,6 +550,7 @@
      * @param <P_IN> Input element type to the stream pipeline
      * @param <P_OUT> Output element type from the stream pipeline
      */
+    @SuppressWarnings("serial")
     private static final class SliceTask<P_IN, P_OUT>
             extends AbstractShortCircuitTask<P_IN, P_OUT, Node<P_OUT>, SliceTask<P_IN, P_OUT>> {
         private final AbstractPipeline<P_OUT, P_OUT, ?> op;
--- a/jdk/src/share/classes/java/util/stream/SortedOps.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/SortedOps.java	Tue Aug 13 18:34:12 2013 -0700
@@ -209,7 +209,7 @@
         }
 
         @Override
-        public Sink<Long> opWrapSink(int flags, Sink sink) {
+        public Sink<Long> opWrapSink(int flags, Sink<Long> sink) {
             Objects.requireNonNull(sink);
 
             if (StreamOpFlag.SORTED.isKnown(flags))
@@ -248,7 +248,7 @@
         }
 
         @Override
-        public Sink<Double> opWrapSink(int flags, Sink sink) {
+        public Sink<Double> opWrapSink(int flags, Sink<Double> sink) {
             Objects.requireNonNull(sink);
 
             if (StreamOpFlag.SORTED.isKnown(flags))
@@ -285,7 +285,7 @@
         private T[] array;
         private int offset;
 
-        SizedRefSortingSink(Sink sink, Comparator<? super T> comparator) {
+        SizedRefSortingSink(Sink<T> sink, Comparator<? super T> comparator) {
             super(sink);
             this.comparator = comparator;
         }
@@ -324,7 +324,7 @@
         private final Comparator<? super T> comparator;
         private ArrayList<T> list;
 
-        RefSortingSink(Sink sink, Comparator<? super T> comparator) {
+        RefSortingSink(Sink<T> sink, Comparator<? super T> comparator) {
             super(sink);
             this.comparator = comparator;
         }
--- a/jdk/src/share/classes/java/util/stream/SpinedBuffer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/SpinedBuffer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -28,6 +28,7 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
 import java.util.PrimitiveIterator;
 import java.util.Spliterator;
 import java.util.Spliterators;
@@ -317,6 +318,8 @@
 
             @Override
             public boolean tryAdvance(Consumer<? super E> consumer) {
+                Objects.requireNonNull(consumer);
+
                 if (splSpineIndex < lastSpineIndex
                     || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) {
                     consumer.accept(splChunk[splElementIndex++]);
@@ -334,6 +337,8 @@
 
             @Override
             public void forEachRemaining(Consumer<? super E> consumer) {
+                Objects.requireNonNull(consumer);
+
                 if (splSpineIndex < lastSpineIndex
                     || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) {
                     int i = splElementIndex;
@@ -634,6 +639,8 @@
 
             @Override
             public boolean tryAdvance(T_CONS consumer) {
+                Objects.requireNonNull(consumer);
+
                 if (splSpineIndex < lastSpineIndex
                     || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) {
                     arrayForOne(splChunk, splElementIndex++, consumer);
@@ -651,6 +658,8 @@
 
             @Override
             public void forEachRemaining(T_CONS consumer) {
+                Objects.requireNonNull(consumer);
+
                 if (splSpineIndex < lastSpineIndex
                     || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) {
                     int i = splElementIndex;
--- a/jdk/src/share/classes/java/util/stream/Stream.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/Stream.java	Tue Aug 13 18:34:12 2013 -0700
@@ -651,12 +651,13 @@
      * }</pre>
      *
      * @param <R> the type of the result
+     * @param <A> the intermediate accumulation type of the {@code Collector}
      * @param collector the {@code Collector} describing the reduction
      * @return the result of the reduction
      * @see #collect(Supplier, BiConsumer, BiConsumer)
      * @see Collectors
      */
-    <R> R collect(Collector<? super T, R> collector);
+    <R, A> R collect(Collector<? super T, A, ? extends R> collector);
 
     /**
      * Returns the minimum element of this stream according to the provided
@@ -827,6 +828,7 @@
      * @return the new stream
      */
     @SafeVarargs
+    @SuppressWarnings("varargs") // Creating a stream from an array is safe
     public static<T> Stream<T> of(T... values) {
         return Arrays.stream(values);
     }
--- a/jdk/src/share/classes/java/util/stream/StreamSpliterators.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/StreamSpliterators.java	Tue Aug 13 18:34:12 2013 -0700
@@ -25,6 +25,7 @@
 package java.util.stream;
 
 import java.util.Comparator;
+import java.util.Objects;
 import java.util.Spliterator;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.BooleanSupplier;
@@ -294,6 +295,7 @@
 
         @Override
         public boolean tryAdvance(Consumer<? super P_OUT> consumer) {
+            Objects.requireNonNull(consumer);
             boolean hasNext = doAdvance();
             if (hasNext)
                 consumer.accept(buffer.get(nextToConsume));
@@ -303,6 +305,7 @@
         @Override
         public void forEachRemaining(Consumer<? super P_OUT> consumer) {
             if (buffer == null && !finished) {
+                Objects.requireNonNull(consumer);
                 init();
 
                 ph.wrapAndCopyInto((Sink<P_OUT>) consumer::accept, spliterator);
@@ -350,6 +353,7 @@
 
         @Override
         public boolean tryAdvance(IntConsumer consumer) {
+            Objects.requireNonNull(consumer);
             boolean hasNext = doAdvance();
             if (hasNext)
                 consumer.accept(buffer.get(nextToConsume));
@@ -359,6 +363,7 @@
         @Override
         public void forEachRemaining(IntConsumer consumer) {
             if (buffer == null && !finished) {
+                Objects.requireNonNull(consumer);
                 init();
 
                 ph.wrapAndCopyInto((Sink.OfInt) consumer::accept, spliterator);
@@ -406,6 +411,7 @@
 
         @Override
         public boolean tryAdvance(LongConsumer consumer) {
+            Objects.requireNonNull(consumer);
             boolean hasNext = doAdvance();
             if (hasNext)
                 consumer.accept(buffer.get(nextToConsume));
@@ -415,6 +421,7 @@
         @Override
         public void forEachRemaining(LongConsumer consumer) {
             if (buffer == null && !finished) {
+                Objects.requireNonNull(consumer);
                 init();
 
                 ph.wrapAndCopyInto((Sink.OfLong) consumer::accept, spliterator);
@@ -462,6 +469,7 @@
 
         @Override
         public boolean tryAdvance(DoubleConsumer consumer) {
+            Objects.requireNonNull(consumer);
             boolean hasNext = doAdvance();
             if (hasNext)
                 consumer.accept(buffer.get(nextToConsume));
@@ -471,6 +479,7 @@
         @Override
         public void forEachRemaining(DoubleConsumer consumer) {
             if (buffer == null && !finished) {
+                Objects.requireNonNull(consumer);
                 init();
 
                 ph.wrapAndCopyInto((Sink.OfDouble) consumer::accept, spliterator);
@@ -696,6 +705,8 @@
 
             @Override
             public boolean tryAdvance(Consumer<? super T> action) {
+                Objects.requireNonNull(action);
+
                 if (sliceOrigin >= fence)
                     return false;
 
@@ -713,6 +724,8 @@
 
             @Override
             public void forEachRemaining(Consumer<? super T> action) {
+                Objects.requireNonNull(action);
+
                 if (sliceOrigin >= fence)
                     return;
 
@@ -754,6 +767,8 @@
 
             @Override
             public boolean tryAdvance(T_CONS action) {
+                Objects.requireNonNull(action);
+
                 if (sliceOrigin >= fence)
                     return false;
 
@@ -771,6 +786,8 @@
 
             @Override
             public void forEachRemaining(T_CONS action) {
+                Objects.requireNonNull(action);
+
                 if (sliceOrigin >= fence)
                     return;
 
@@ -895,7 +912,8 @@
             this.permits = new AtomicLong(limit >= 0 ? skip + limit : skip);
         }
 
-        UnorderedSliceSpliterator(T_SPLITR s, UnorderedSliceSpliterator parent) {
+        UnorderedSliceSpliterator(T_SPLITR s,
+                                  UnorderedSliceSpliterator<T, T_SPLITR> parent) {
             this.s = s;
             this.unlimited = parent.unlimited;
             this.permits = parent.permits;
@@ -974,7 +992,7 @@
                 super(s, skip, limit);
             }
 
-            OfRef(Spliterator<T> s, OfRef parent) {
+            OfRef(Spliterator<T> s, OfRef<T> parent) {
                 super(s, parent);
             }
 
@@ -985,6 +1003,8 @@
 
             @Override
             public boolean tryAdvance(Consumer<? super T> action) {
+                Objects.requireNonNull(action);
+
                 while (permitStatus() != PermitStatus.NO_MORE) {
                     if (!s.tryAdvance(this))
                         return false;
@@ -999,6 +1019,8 @@
 
             @Override
             public void forEachRemaining(Consumer<? super T> action) {
+                Objects.requireNonNull(action);
+
                 ArrayBuffer.OfRef<T> sb = null;
                 PermitStatus permitStatus;
                 while ((permitStatus = permitStatus()) != PermitStatus.NO_MORE) {
@@ -1051,6 +1073,8 @@
 
             @Override
             public boolean tryAdvance(T_CONS action) {
+                Objects.requireNonNull(action);
+
                 while (permitStatus() != PermitStatus.NO_MORE) {
                     if (!s.tryAdvance((T_CONS) this))
                         return false;
@@ -1066,6 +1090,8 @@
 
             @Override
             public void forEachRemaining(T_CONS action) {
+                Objects.requireNonNull(action);
+
                 T_BUFF sb = null;
                 PermitStatus permitStatus;
                 while ((permitStatus = permitStatus()) != PermitStatus.NO_MORE) {
@@ -1237,6 +1263,8 @@
 
             @Override
             public boolean tryAdvance(Consumer<? super T> action) {
+                Objects.requireNonNull(action);
+
                 action.accept(s.get());
                 return true;
             }
@@ -1260,6 +1288,8 @@
 
             @Override
             public boolean tryAdvance(IntConsumer action) {
+                Objects.requireNonNull(action);
+
                 action.accept(s.getAsInt());
                 return true;
             }
@@ -1283,6 +1313,8 @@
 
             @Override
             public boolean tryAdvance(LongConsumer action) {
+                Objects.requireNonNull(action);
+
                 action.accept(s.getAsLong());
                 return true;
             }
@@ -1306,6 +1338,8 @@
 
             @Override
             public boolean tryAdvance(DoubleConsumer action) {
+                Objects.requireNonNull(action);
+
                 action.accept(s.getAsDouble());
                 return true;
             }
--- a/jdk/src/share/classes/java/util/stream/Streams.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/Streams.java	Tue Aug 13 18:34:12 2013 -0700
@@ -25,6 +25,7 @@
 package java.util.stream;
 
 import java.util.Comparator;
+import java.util.Objects;
 import java.util.Spliterator;
 import java.util.function.Consumer;
 import java.util.function.DoubleConsumer;
@@ -80,6 +81,8 @@
 
         @Override
         public boolean tryAdvance(IntConsumer consumer) {
+            Objects.requireNonNull(consumer);
+
             final int i = from;
             if (i < upTo) {
                 from++;
@@ -96,6 +99,8 @@
 
         @Override
         public void forEachRemaining(IntConsumer consumer) {
+            Objects.requireNonNull(consumer);
+
             int i = from;
             final int hUpTo = upTo;
             int hLast = last;
@@ -199,6 +204,8 @@
 
         @Override
         public boolean tryAdvance(LongConsumer consumer) {
+            Objects.requireNonNull(consumer);
+
             final long i = from;
             if (i < upTo) {
                 from++;
@@ -215,6 +222,8 @@
 
         @Override
         public void forEachRemaining(LongConsumer consumer) {
+            Objects.requireNonNull(consumer);
+
             long i = from;
             final long hUpTo = upTo;
             int hLast = last;
@@ -388,6 +397,8 @@
 
         @Override
         public boolean tryAdvance(Consumer<? super T> action) {
+            Objects.requireNonNull(action);
+
             if (count == -2) {
                 action.accept(first);
                 count = -1;
@@ -400,6 +411,8 @@
 
         @Override
         public void forEachRemaining(Consumer<? super T> action) {
+            Objects.requireNonNull(action);
+
             if (count == -2) {
                 action.accept(first);
                 count = -1;
@@ -475,6 +488,8 @@
 
         @Override
         public boolean tryAdvance(IntConsumer action) {
+            Objects.requireNonNull(action);
+
             if (count == -2) {
                 action.accept(first);
                 count = -1;
@@ -487,6 +502,8 @@
 
         @Override
         public void forEachRemaining(IntConsumer action) {
+            Objects.requireNonNull(action);
+
             if (count == -2) {
                 action.accept(first);
                 count = -1;
@@ -562,6 +579,8 @@
 
         @Override
         public boolean tryAdvance(LongConsumer action) {
+            Objects.requireNonNull(action);
+
             if (count == -2) {
                 action.accept(first);
                 count = -1;
@@ -574,6 +593,8 @@
 
         @Override
         public void forEachRemaining(LongConsumer action) {
+            Objects.requireNonNull(action);
+
             if (count == -2) {
                 action.accept(first);
                 count = -1;
@@ -649,6 +670,8 @@
 
         @Override
         public boolean tryAdvance(DoubleConsumer action) {
+            Objects.requireNonNull(action);
+
             if (count == -2) {
                 action.accept(first);
                 count = -1;
@@ -661,6 +684,8 @@
 
         @Override
         public void forEachRemaining(DoubleConsumer action) {
+            Objects.requireNonNull(action);
+
             if (count == -2) {
                 action.accept(first);
                 count = -1;
--- a/jdk/src/share/classes/java/util/stream/package-info.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/java/util/stream/package-info.java	Tue Aug 13 18:34:12 2013 -0700
@@ -547,7 +547,7 @@
  *     List<String> l = new ArrayList(Arrays.asList("one", "two"));
  *     Stream<String> sl = l.stream();
  *     l.add("three");
- *     String s = sl.collect(toStringJoiner(" ")).toString();
+ *     String s = sl.collect(joining(" "));
  * }</pre>
  * First a list is created consisting of two strings: "one"; and "two". Then a stream is created from that list.
  * Next the list is modified by adding a third string: "three".  Finally the elements of the stream are collected
@@ -557,7 +557,7 @@
  * <pre>{@code
  *     List<String> l = new ArrayList(Arrays.asList("one", "two"));
  *     Stream<String> sl = l.stream();
- *     String s = sl.peek(s -> l.add("BAD LAMBDA")).collect(toStringJoiner(" ")).toString();
+ *     String s = sl.peek(s -> l.add("BAD LAMBDA")).collect(joining(" "));
  * }</pre>
  * then a {@code ConcurrentModificationException} will be thrown since the {@code peek} operation will attempt
  * to add the string "BAD LAMBDA" to the list after the terminal operation has commenced.
--- a/jdk/src/share/classes/javax/accessibility/Accessible.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/accessibility/Accessible.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
      * of an object that implements Accessible, and that subclass
      * is not Accessible, the developer should override the
      * getAccessibleContext method to return null.
+     * @return the AccessibleContext associated with this object
      */
     public AccessibleContext getAccessibleContext();
 }
--- a/jdk/src/share/classes/javax/accessibility/AccessibleBundle.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleBundle.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,6 +53,9 @@
     private final String defaultResourceBundleName
         = "com.sun.accessibility.internal.resources.accessibility";
 
+    /**
+     * Construct an {@code AccessibleBundle}.
+     */
     public AccessibleBundle() {
     }
 
--- a/jdk/src/share/classes/javax/accessibility/AccessibleExtendedTable.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleExtendedTable.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
       */
      public int getAccessibleColumn(int index);
 
-     /*
+    /**
       * Returns the index at a row and column in the table.
       *
       * @param r zero-based row of the table
--- a/jdk/src/share/classes/javax/accessibility/AccessibleRelationSet.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleRelationSet.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -163,6 +163,7 @@
 
     /**
      * Returns the number of relations in the relation set.
+     * @return the number of relations in the relation set
      */
     public int size() {
         if (relations == null) {
--- a/jdk/src/share/classes/javax/accessibility/AccessibleTable.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleTable.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,6 +90,8 @@
      * Returns the number of rows occupied by the Accessible at
      * a specified row and column in the table.
      *
+     * @param r zero-based row of the table
+     * @param c zero-based column of the table
      * @return the number of rows occupied by the Accessible at a
      * given specified (row, column)
      */
@@ -99,6 +101,8 @@
      * Returns the number of columns occupied by the Accessible at
      * a specified row and column in the table.
      *
+     * @param r zero-based row of the table
+     * @param c zero-based column of the table
      * @return the number of columns occupied by the Accessible at a
      * given specified row and column
      */
--- a/jdk/src/share/classes/javax/accessibility/AccessibleTableModelChange.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleTableModelChange.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,8 +71,8 @@
     public static final int DELETE = -1;
 
     /**
-     *  Returns the type of event
-     *
+     *  Returns the type of event.
+     *  @return the type of event
      *  @see #INSERT
      *  @see #UPDATE
      *  @see #DELETE
@@ -81,21 +81,25 @@
 
     /**
      * Returns the first row that changed.
+     * @return the first row that changed
      */
     public int getFirstRow();
 
     /**
      * Returns the last row that changed.
+     * @return the last row that changed
      */
     public int getLastRow();
 
     /**
      * Returns the first column that changed.
+     * @return the first column that changed
      */
     public int getFirstColumn();
 
     /**
      * Returns the last column that changed.
+     * @return the last column that changed
      */
     public int getLastColumn();
 }
--- a/jdk/src/share/classes/javax/accessibility/AccessibleTextSequence.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleTextSequence.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
  */
 public class AccessibleTextSequence {
 
-    /* The start index of the text sequence */
+    /** The start index of the text sequence */
     public int startIndex;
 
     /** The end index of the text sequence */
--- a/jdk/src/share/classes/javax/accessibility/AccessibleValue.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleValue.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,7 @@
     /**
      * Set the value of this object as a Number.
      *
+     * @param n the number to use for the value
      * @return True if the value was set; else False
      * @see #getCurrentAccessibleValue
      */
--- a/jdk/src/share/classes/javax/imageio/ImageIO.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/ImageIO.java	Tue Aug 13 18:34:12 2013 -0700
@@ -228,7 +228,7 @@
      * be used when creating <code>ImageInputStream</code>s and
      * <code>ImageOutputStream</code>s.
      *
-     * <p> When reading from a standard <code>InputStream</code>>, it
+     * <p> When reading from a standard <code>InputStream</code>, it
      * may be necessary to save previously read information in a cache
      * since the underlying stream does not allow data to be re-read.
      * Similarly, when writing to a standard
--- a/jdk/src/share/classes/javax/imageio/ImageReadParam.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/ImageReadParam.java	Tue Aug 13 18:34:12 2013 -0700
@@ -80,7 +80,7 @@
  *
  * <p> The resulting region is then subsampled according to the
  * factors given in {@link IIOParam#setSourceSubsampling
- * <code>IIOParam.setSourceSubsampling</code>}.  The first pixel,
+ * IIOParam.setSourceSubsampling}.  The first pixel,
  * the number of pixels per row, and the number of rows all depend
  * on the subsampling settings.
  * Call the minimum X and Y coordinates of the resulting rectangle
--- a/jdk/src/share/classes/javax/imageio/ImageReader.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/ImageReader.java	Tue Aug 13 18:34:12 2013 -0700
@@ -230,8 +230,8 @@
      * increased as each image (or thumbnail, or image metadata) is
      * read.  If <code>seekForwardOnly</code> is true, then a call to
      * <code>read(index)</code> will throw an
-     * <code>IndexOutOfBoundsException</code> if <code>index &lt
-     * this.minIndex</code>; otherwise, the value of
+     * <code>IndexOutOfBoundsException</code> if {@code index < this.minIndex};
+     * otherwise, the value of
      * <code>minIndex</code> will be set to <code>index</code>.  If
      * <code>seekForwardOnly</code> is <code>false</code>, the value of
      * <code>minIndex</code> will remain 0 regardless of any read
@@ -328,8 +328,8 @@
      * increased as each image (or thumbnail, or image metadata) is
      * read.  If <code>seekForwardOnly</code> is true, then a call to
      * <code>read(index)</code> will throw an
-     * <code>IndexOutOfBoundsException</code> if <code>index &lt
-     * this.minIndex</code>; otherwise, the value of
+     * <code>IndexOutOfBoundsException</code> if {@code index < this.minIndex};
+     * otherwise, the value of
      * <code>minIndex</code> will be set to <code>index</code>.  If
      * <code>seekForwardOnly</code> is <code>false</code>, the value of
      * <code>minIndex</code> will remain 0 regardless of any read
@@ -600,8 +600,7 @@
      * <p> Note that formats that return <code>false</code> from
      * this method may nonetheless allow tiling (<i>e.g.</i> Restart
      * Markers in JPEG), and random access will likely be reasonably
-     * efficient on tiles.  See {@link #isImageTiled
-     * <code>isImageTiled</code>}.
+     * efficient on tiles.  See {@link #isImageTiled isImageTiled}.
      *
      * <p> A reader for which all images are guaranteed to support
      * easy random access, or are guaranteed not to support easy
@@ -1212,11 +1211,10 @@
 
     /**
      * Returns <code>true</code> if this plug-in supports reading
-     * just a {@link java.awt.image.Raster <code>Raster</code>} of pixel data.
+     * just a {@link java.awt.image.Raster Raster} of pixel data.
      * If this method returns <code>false</code>, calls to
-     * {@link #readRaster <code>readRaster</code>} or {@link #readTileRaster
-     * <code>readTileRaster</code>} will throw an
-     * <code>UnsupportedOperationException</code>.
+     * {@link #readRaster readRaster} or {@link #readTileRaster readTileRaster}
+     * will throw an <code>UnsupportedOperationException</code>.
      *
      * <p> The default implementation returns <code>false</code>.
      *
@@ -1236,7 +1234,7 @@
      * application must determine how to interpret the pixel data by other
      * means.  Any destination or image-type parameters in the supplied
      * <code>ImageReadParam</code> object are ignored, but all other
-     * parameters are used exactly as in the {@link #read <code>read</code>}
+     * parameters are used exactly as in the {@link #read read}
      * method, except that any destination offset is used as a logical rather
      * than a physical offset.  The size of the returned <code>Raster</code>
      * will always be that of the source region clipped to the actual image.
@@ -1249,10 +1247,9 @@
      *
      * <p> Any registered <code>readUpdateListener</code>s are ignored, as
      * there is no <code>BufferedImage</code>, but all other listeners are
-     * called exactly as they are for the {@link #read <code>read</code>}
-     * method.
+     * called exactly as they are for the {@link #read read} method.
      *
-     * <p> If {@link #canReadRaster <code>canReadRaster()</code>} returns
+     * <p> If {@link #canReadRaster canReadRaster()} returns
      * <code>false</code>, this method throws an
      * <code>UnsupportedOperationException</code>.
      *
@@ -1481,13 +1478,13 @@
      * The application must determine how to interpret the pixel data by other
      * means.
      *
-     * <p> If {@link #canReadRaster <code>canReadRaster()</code>} returns
+     * <p> If {@link #canReadRaster canReadRaster()} returns
      * <code>false</code>, this method throws an
      * <code>UnsupportedOperationException</code>.
      *
      * <p> The default implementation checks if reading
      * <code>Raster</code>s is supported, and if so calls {@link
-     * #readRaster <code>readRaster(imageIndex, null)</code>} if
+     * #readRaster readRaster(imageIndex, null)} if
      * <code>tileX</code> and <code>tileY</code> are 0, or throws an
      * <code>IllegalArgumentException</code> otherwise.
      *
@@ -1548,8 +1545,8 @@
      * source render size or any format-specific settings), they will
      * be ignored.
      *
-     * <p> The default implementation just calls {@link #read
-     * <code>read(imageIndex, param)</code>}.
+     * <p> The default implementation just calls
+     * {@link #read read(imageIndex, param)}.
      *
      * @param imageIndex the index of the image to be retrieved.
      * @param param an <code>ImageReadParam</code> used to control
@@ -2544,9 +2541,8 @@
      * the supplied <code>ImageReadParam</code>.  The actual
      * subsampling factors, destination size, and destination offset
      * are <em>not</em> taken into consideration, thus further
-     * clipping must take place.  The {@link #computeRegions
-     * <code>computeRegions</code>} method performs all necessary
-     * clipping.
+     * clipping must take place.  The {@link #computeRegions computeRegions}
+     * method performs all necessary clipping.
      *
      * @param param the <code>ImageReadParam</code> being used, or
      * <code>null</code>.
@@ -2601,7 +2597,7 @@
      * width or height of 0, an <code>IllegalArgumentException</code>
      * is thrown.
      *
-     * <p> The {@link #getSourceRegion <code>getSourceRegion</code>}
+     * <p> The {@link #getSourceRegion getSourceRegion>}
      * method may be used if only source clipping is desired.
      *
      * @param param an <code>ImageReadParam</code>, or <code>null</code>.
--- a/jdk/src/share/classes/javax/imageio/ImageTypeSpecifier.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/ImageTypeSpecifier.java	Tue Aug 13 18:34:12 2013 -0700
@@ -840,7 +840,7 @@
      * not one of 1, 2, 4, 8, or 16.
      * @exception IllegalArgumentException if the
      * non-<code>null</code> LUT parameters do not have lengths of
-     * exactly <code>1 << bits</code>.
+     * exactly {@code 1 << bits}.
      * @exception IllegalArgumentException if <code>dataType</code> is
      * not one of <code>DataBuffer.TYPE_BYTE</code>,
      * <code>DataBuffer.TYPE_SHORT</code>,
--- a/jdk/src/share/classes/javax/imageio/ImageWriteParam.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/ImageWriteParam.java	Tue Aug 13 18:34:12 2013 -0700
@@ -49,7 +49,7 @@
  * and include additional pixels within the intersected bounds
  * according to the horizontal and vertical subsampling factors
  * specified by {@link IIOParam#setSourceSubsampling
- * <code>IIOParam.setSourceSubsampling</code>}.
+ * IIOParam.setSourceSubsampling}.
  *
  * <p> Individual features such as tiling, progressive encoding, and
  * compression may be set in one of four modes.
@@ -462,9 +462,8 @@
      * <code>IllegalStateException</code>.
      *
      * <li><code>MODE_EXPLICIT</code> - The image will be tiled
-     * according to parameters given in the {@link #setTiling
-     * <code>setTiling</code>} method.  Any previously set tiling
-     * parameters are discarded.
+     * according to parameters given in the {@link #setTiling setTiling}
+     * method.  Any previously set tiling parameters are discarded.
      *
      * <li><code>MODE_COPY_FROM_METADATA</code> - The image will
      * conform to the metadata object passed in to a write.
@@ -1421,7 +1420,7 @@
      * with <code>getCompressionQualityDescriptions</code> as part of a user
      * interface for setting or displaying the compression quality
      * level.  See {@link #getCompressionQualityDescriptions
-     * <code>getCompressionQualityDescriptions</code>} for more information.
+     * getCompressionQualityDescriptions} for more information.
      *
      * <p> If no descriptions are available, <code>null</code> is
      * returned.  If <code>null</code> is returned from
--- a/jdk/src/share/classes/javax/imageio/ImageWriter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/ImageWriter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -692,7 +692,7 @@
      * output prior to the current seek position may be flushed, and
      * need not be readable or writable, unless the plug-in needs to
      * be able to patch up the header information when
-     * <code>endWriteSequence</code> is called (<italic>e.g.</italic> TIFF).
+     * <code>endWriteSequence</code> is called (<i>e.g.</i> TIFF).
      *
      * <p> If <code>canWriteSequence</code> returns <code>false</code>,
      * this method will throw an
--- a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -729,6 +729,7 @@
      * @param required <code>true</code> if an object value must be present.
      * @param defaultValue the default value for the
      * <code>Object</code> reference, or <code>null</code>.
+     * @param <T> the type of the object.
      *
      * @exception IllegalArgumentException if <code>elementName</code>
      * is <code>null</code>, or is not a legal element name for this format.
@@ -765,6 +766,7 @@
      * @param enumeratedValues a <code>List</code> of
      * <code>Object</code>s containing the legal values for the
      * object reference.
+     * @param <T> the type of the object.
      *
      * @exception IllegalArgumentException if <code>elementName</code>
      * is <code>null</code>, or is not a legal element name for this format.
@@ -836,6 +838,7 @@
      * is inclusive.
      * @param maxInclusive <code>true</code> if <code>maxValue</code>
      * is inclusive.
+     * @param <T> the type of the object.
      *
      * @exception IllegalArgumentException if <code>elementName</code>
      * is <code>null</code>, or is not a legal element name for this
--- a/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java	Tue Aug 13 18:34:12 2013 -0700
@@ -56,9 +56,9 @@
  * <p><table border=1>
  * <caption><b>Compression Types</b></caption>
  * <tr><th>Type String</th> <th>Description</th>  <th>Image Types</th></tr>
- * <tr><td>BI_RGB</td>  <td>Uncompressed RLE</td> <td><= 8-bits/sample</td></tr>
- * <tr><td>BI_RLE8</td> <td>8-bit Run Length Encoding</td> <td><= 8-bits/sample</td></tr>
- * <tr><td>BI_RLE4</td> <td>4-bit Run Length Encoding</td> <td><= 4-bits/sample</td></tr>
+ * <tr><td>BI_RGB</td>  <td>Uncompressed RLE</td> <td>{@literal <= } 8-bits/sample</td></tr>
+ * <tr><td>BI_RLE8</td> <td>8-bit Run Length Encoding</td> <td>{@literal <=} 8-bits/sample</td></tr>
+ * <tr><td>BI_RLE4</td> <td>4-bit Run Length Encoding</td> <td>{@literal <=} 4-bits/sample</td></tr>
  * <tr><td>BI_BITFIELDS</td> <td>Packed data</td> <td> 16 or 32 bits/sample</td></tr>
  * </table>
  */
--- a/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageReadParam.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageReadParam.java	Tue Aug 13 18:34:12 2013 -0700
@@ -46,16 +46,15 @@
  * This class allows the tables to be specified directly from client
  * code.  If no tables are specified either in the stream or in a
  * <code>JPEGImageReadParam</code>, then the stream is presumed to use
- * the "standard" visually lossless tables.  See {@link JPEGQTable
- * <code>JPEGQTable</code>} and {@link JPEGHuffmanTable
- * <code>JPEGHuffmanTable</code>} for more information on the default
- * tables.
+ * the "standard" visually lossless tables.  See {@link JPEGQTable JPEGQTable}
+ * and {@link JPEGHuffmanTable JPEGHuffmanTable} for more information
+ *  on the default tables.
  *
  * <p> The default <code>JPEGImageReadParam</code> returned by the
  * <code>getDefaultReadParam</code> method of the builtin JPEG reader
  * contains no tables.  Default tables may be obtained from the table
- * classes {@link JPEGQTable <code>JPEGQTable</code>} and {@link
- * JPEGHuffmanTable <code>JPEGHuffmanTable</code>}.
+ * classes {@link JPEGQTable JPEGQTable} and
+ * {@link JPEGHuffmanTable JPEGHuffmanTable}.
  *
  * <p> If a stream does contain tables, the tables given in a
  * <code>JPEGImageReadParam</code> are ignored.  Furthermore, if the
@@ -64,13 +63,12 @@
  * abbreviated images.  Once tables have been read from a stream, they
  * can be overridden only by tables subsequently read from the same
  * stream.  In order to specify new tables, the {@link
- * javax.imageio.ImageReader#setInput <code>setInput</code>} method of
+ * javax.imageio.ImageReader#setInput setInput} method of
  * the reader must be called to change the stream.
  *
  * <p> Note that this class does not provide a means for obtaining the
  * tables found in a stream.  These may be extracted from a stream by
- * consulting the <code>IIOMetadata</code> object returned by the
- * reader.
+ * consulting the IIOMetadata object returned by the reader.
  *
  * <p>
  * For more information about the operation of the built-in JPEG plug-ins,
--- a/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageWriteParam.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageWriteParam.java	Tue Aug 13 18:34:12 2013 -0700
@@ -66,8 +66,8 @@
  * when an abbreviated stream must be written without writing any tables
  * to a stream first.  In order to use this class, the metadata object
  * passed into the writer must contain no tables, and no stream metadata
- * must be provided.  See {@link JPEGQTable <code>JPEGQTable</code>} and
- * {@link JPEGHuffmanTable <code>JPEGHuffmanTable</code>} for more
+ * must be provided.  See {@link JPEGQTable JPEGQTable} and
+ * {@link JPEGHuffmanTable JPEGHuffmanTable} for more
  * information on the default tables.
  *
  * <p> The default <code>JPEGImageWriteParam</code> returned by the
@@ -80,7 +80,7 @@
  * set of tables has been written, only tables in the metadata can
  * override them for subsequent writes, whether to the same stream or
  * a different one.  In order to specify new tables using this class,
- * the {@link javax.imageio.ImageWriter#reset <code>reset</code>}
+ * the {@link javax.imageio.ImageWriter#reset reset}
  * method of the writer must be called.
  *
  * <p>
--- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java	Tue Aug 13 18:34:12 2013 -0700
@@ -78,7 +78,7 @@
      * <code>ImageInputStream.class</code>, to be returned from
      * <code>getInputTypes</code>.
      * @deprecated Instead of using this field, directly create
-     * the equivalent array <code>{ ImageInputStream.class }<code>.
+     * the equivalent array <code>{ ImageInputStream.class }</code>.
      */
     @Deprecated
     public static final Class[] STANDARD_INPUT_TYPE =
--- a/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java	Tue Aug 13 18:34:12 2013 -0700
@@ -80,7 +80,7 @@
      * <code>ImageOutputStream.class</code>, to be returned from
      * <code>getOutputTypes</code>.
      * @deprecated Instead of using this field, directly create
-     * the equivalent array <code>{ ImageOutputStream.class }<code>.
+     * the equivalent array <code>{ ImageOutputStream.class }</code>.
      */
     @Deprecated
     public static final Class[] STANDARD_OUTPUT_TYPE =
--- a/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java	Tue Aug 13 18:34:12 2013 -0700
@@ -157,6 +157,8 @@
      * or <code>null</code> if the system class loader (or, failing that
      * the bootstrap class loader) is to be used.
      *
+     * @param <T> the type of the providerClass.
+     *
      * @return An <code>Iterator</code> that yields provider objects
      * for the given service, in some arbitrary order.  The iterator
      * will throw an <code>Error</code> if a provider-configuration
@@ -188,6 +190,8 @@
      * @param providerClass a <code>Class</code>object indicating the
      * class or interface of the service providers being detected.
      *
+     * @param <T> the type of the providerClass.
+     *
      * @return An <code>Iterator</code> that yields provider objects
      * for the given service, in some arbitrary order.  The iterator
      * will throw an <code>Error</code> if a provider-configuration
@@ -247,6 +251,7 @@
      * @param provider the service provide object to be registered.
      * @param category the category under which to register the
      * provider.
+     * @param <T> the type of the provider.
      *
      * @return true if no provider of the same class was previously
      * registered in the same category category.
@@ -348,6 +353,7 @@
      * @param provider the service provider object to be deregistered.
      * @param category the category from which to deregister the
      * provider.
+     * @param <T> the type of the provider.
      *
      * @return <code>true</code> if the provider was previously
      * registered in the same category category,
@@ -435,6 +441,7 @@
      * @param category the category to be retrieved from.
      * @param useOrdering <code>true</code> if pairwise orderings
      * should be taken account in ordering the returned objects.
+     * @param <T> the type of the category.
      *
      * @return an <code>Iterator</code> containing service provider
      * objects from the given category, possibly in order.
@@ -490,6 +497,7 @@
      * whose <code>filter</code> method will be invoked.
      * @param useOrdering <code>true</code> if pairwise orderings
      * should be taken account in ordering the returned objects.
+     * @param <T> the type of the category.
      *
      * @return an <code>Iterator</code> containing service provider
      * objects from the given category, possibly in order.
@@ -517,6 +525,7 @@
      *
      * @param providerClass the <code>Class</code> of the desired
      * service provider object.
+     * @param <T> the type of the provider.
      *
      * @return a currently registered service provider object with the
      * desired <code>Class</code>type, or <code>null</code> is none is
@@ -561,6 +570,7 @@
      * @param firstProvider the preferred provider.
      * @param secondProvider the provider to which
      * <code>firstProvider</code> is preferred.
+     * @param <T> the type of the category.
      *
      * @return <code>true</code> if a previously unset ordering
      * was established.
@@ -606,6 +616,7 @@
      * @param firstProvider the formerly preferred provider.
      * @param secondProvider the provider to which
      * <code>firstProvider</code> was formerly preferred.
+     * @param <T> the type of the category.
      *
      * @return <code>true</code> if a previously set ordering was
      * disestablished.
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java	Tue Aug 13 18:34:12 2013 -0700
@@ -183,7 +183,7 @@
      *
      * @return a boolean value from the stream.
      *
-     * @exception EOFException if the end of the stream is reached.
+     * @exception java.io.EOFException if the end of the stream is reached.
      * @exception IOException if an I/O error occurs.
      */
     boolean readBoolean() throws IOException;
@@ -201,7 +201,7 @@
      *
      * @return a signed byte value from the stream.
      *
-     * @exception EOFException if the end of the stream is reached.
+     * @exception java.io.EOFException if the end of the stream is reached.
      * @exception IOException if an I/O error occurs.
      */
     byte readByte() throws IOException;
@@ -225,7 +225,7 @@
      *
      * @return an unsigned byte value from the stream.
      *
-     * @exception EOFException if the end of the stream is reached.
+     * @exception java.io.EOFException if the end of the stream is reached.
      * @exception IOException if an I/O error occurs.
      */
     int readUnsignedByte() throws IOException;
@@ -240,7 +240,7 @@
      *
      * @return a signed short value from the stream.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      *
@@ -261,7 +261,7 @@
      *
      * @return an unsigned short value from the stream, as an int.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      *
@@ -278,7 +278,7 @@
      *
      * @return an unsigned char value from the stream.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      *
@@ -296,7 +296,7 @@
      *
      * @return a signed int value from the stream.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      *
@@ -316,7 +316,7 @@
      *
      * @return an unsigned int value from the stream, as a long.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      *
@@ -334,7 +334,7 @@
      *
      * @return a signed long value from the stream.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      *
@@ -352,7 +352,7 @@
      *
      * @return a float value from the stream.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      *
@@ -370,7 +370,7 @@
      *
      * @return a double value from the stream.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      *
@@ -469,7 +469,7 @@
      * then a <code>UTFDataFormatException</code> is thrown.
      *
      * <p> If end of file is encountered at any time during this
-     * entire process, then an <code>EOFException</code> is thrown.
+     * entire process, then an <code>java.io.EOFException</code> is thrown.
      *
      * <p> After every group has been converted to a character by this
      * process, the characters are gathered, in the same order in
@@ -488,10 +488,10 @@
      *
      * @return a String read from the stream.
      *
-     * @exception  EOFException  if this stream reaches the end
+     * @exception  java.io.EOFException  if this stream reaches the end
      * before reading all the bytes.
-     * @exception  UTFDataFormatException if the bytes do not represent a
-     * valid modified UTF-8 encoding of a string.
+     * @exception  java.io.UTFDataFormatException if the bytes do not represent
+     * a valid modified UTF-8 encoding of a string.
      * @exception IOException if an I/O error occurs.
      */
     String readUTF() throws IOException;
@@ -499,7 +499,7 @@
     /**
      * Reads <code>len</code> bytes from the stream, and stores them
      * into <code>b</code> starting at index <code>off</code>.
-     * If the end of the stream is reached, an <code>EOFException</code>
+     * If the end of the stream is reached, an <code>java.io.EOFException</code>
      * will be thrown.
      *
      * <p> The bit offset within the stream is reset to zero before
@@ -514,7 +514,7 @@
      * len</code> is greater than <code>b.length</code>.
      * @exception NullPointerException if <code>b</code> is
      * <code>null</code>.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      */
@@ -523,7 +523,7 @@
     /**
      * Reads <code>b.length</code> bytes from the stream, and stores them
      * into <code>b</code> starting at index <code>0</code>.
-     * If the end of the stream is reached, an <code>EOFException</code>
+     * If the end of the stream is reached, an <code>java.io.EOFException</code>
      * will be thrown.
      *
      * <p> The bit offset within the stream is reset to zero before
@@ -533,7 +533,7 @@
      *
      * @exception NullPointerException if <code>b</code> is
      * <code>null</code>.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      */
@@ -544,7 +544,7 @@
      * stream according to the current byte order, and
      * stores them into <code>s</code> starting at index
      * <code>off</code>.  If the end of the stream is reached, an
-     * <code>EOFException</code> will be thrown.
+     * <code>java.io.EOFException</code> will be thrown.
      *
      * <p> The bit offset within the stream is reset to zero before
      * the read occurs.
@@ -558,7 +558,7 @@
      * len</code> is greater than <code>s.length</code>.
      * @exception NullPointerException if <code>s</code> is
      * <code>null</code>.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      */
@@ -569,7 +569,7 @@
      * stream according to the current byte order, and
      * stores them into <code>c</code> starting at index
      * <code>off</code>.  If the end of the stream is reached, an
-     * <code>EOFException</code> will be thrown.
+     * <code>java.io.EOFException</code> will be thrown.
      *
      * <p> The bit offset within the stream is reset to zero before
      * the read occurs.
@@ -583,7 +583,7 @@
      * len</code> is greater than <code>c.length</code>.
      * @exception NullPointerException if <code>c</code> is
      * <code>null</code>.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      */
@@ -594,7 +594,7 @@
      * stream according to the current byte order, and
      * stores them into <code>i</code> starting at index
      * <code>off</code>.  If the end of the stream is reached, an
-     * <code>EOFException</code> will be thrown.
+     * <code>java.io.EOFException</code> will be thrown.
      *
      * <p> The bit offset within the stream is reset to zero before
      * the read occurs.
@@ -608,7 +608,7 @@
      * len</code> is greater than <code>i.length</code>.
      * @exception NullPointerException if <code>i</code> is
      * <code>null</code>.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      */
@@ -619,7 +619,7 @@
      * stream according to the current byte order, and
      * stores them into <code>l</code> starting at index
      * <code>off</code>.  If the end of the stream is reached, an
-     * <code>EOFException</code> will be thrown.
+     * <code>java.io.EOFException</code> will be thrown.
      *
      * <p> The bit offset within the stream is reset to zero before
      * the read occurs.
@@ -633,7 +633,7 @@
      * len</code> is greater than <code>l.length</code>.
      * @exception NullPointerException if <code>l</code> is
      * <code>null</code>.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      */
@@ -644,7 +644,7 @@
      * floats) from the stream according to the current byte order,
      * and stores them into <code>f</code> starting at
      * index <code>off</code>.  If the end of the stream is reached,
-     * an <code>EOFException</code> will be thrown.
+     * an <code>java.io.EOFException</code> will be thrown.
      *
      * <p> The bit offset within the stream is reset to zero before
      * the read occurs.
@@ -658,7 +658,7 @@
      * len</code> is greater than <code>f.length</code>.
      * @exception NullPointerException if <code>f</code> is
      * <code>null</code>.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      */
@@ -669,7 +669,7 @@
      * floats) from the stream according to the current byte order,
      * and stores them into <code>d</code> starting at
      * index <code>off</code>.  If the end of the stream is reached,
-     * an <code>EOFException</code> will be thrown.
+     * an <code>java.io.EOFException</code> will be thrown.
      *
      * <p> The bit offset within the stream is reset to zero before
      * the read occurs.
@@ -683,7 +683,7 @@
      * len</code> is greater than <code>d.length</code>.
      * @exception NullPointerException if <code>d</code> is
      * <code>null</code>.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bytes.
      * @exception IOException if an I/O error occurs.
      */
@@ -748,7 +748,7 @@
      * @return an <code>int</code> containing the value <code>0</code>
      * or <code>1</code>.
      *
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bits.
      * @exception IOException if an I/O error occurs.
      */
@@ -768,13 +768,13 @@
      * the right side of the return value, as shown by the following
      * pseudo-code:
      *
-     * <pre>
+     * <pre>{@code
      * long accum = 0L;
      * for (int i = 0; i < numBits; i++) {
      *   accum <<= 1; // Shift left one bit to make room
      *   accum |= readBit();
      * }
-     * </pre>
+     * }</pre>
      *
      * Note that the result of <code>readBits(32)</code> may thus not
      * be equal to that of <code>readInt()</code> if a reverse network
@@ -782,7 +782,7 @@
      * false</code>).
      *
      * <p> If the end of the stream is encountered before all the bits
-     * have been read, an <code>EOFException</code> is thrown.
+     * have been read, an <code>java.io.EOFException</code> is thrown.
      *
      * @param numBits the number of bits to read, as an <code>int</code>
      * between 0 and 64, inclusive.
@@ -791,7 +791,7 @@
      *
      * @exception IllegalArgumentException if <code>numBits</code>
      * is not between 0 and 64, inclusive.
-     * @exception EOFException if the stream reaches the end before
+     * @exception java.io.EOFException if the stream reaches the end before
      * reading all the bits.
      * @exception IOException if an I/O error occurs.
      */
@@ -850,7 +850,7 @@
      * returned by <code>getflushedPosition</code>).
      *
      * <p> It is legal to seek past the end of the file; an
-     * <code>EOFException</code> will be thrown only if a read is
+     * <code>java.io.EOFException</code> will be thrown only if a read is
      * performed.
      *
      * @param pos a <code>long</code> containing the desired file
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -88,7 +88,7 @@
     /**
      * The position prior to which data may be discarded.  Seeking
      * to a smaller position is not allowed.  <code>flushedPos</code>
-     * will always be >= 0.
+     * will always be {@literal >= 0}.
      */
     protected long flushedPos = 0;
 
--- a/jdk/src/share/classes/javax/imageio/stream/ImageOutputStream.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageOutputStream.java	Tue Aug 13 18:34:12 2013 -0700
@@ -59,9 +59,9 @@
      * remainder of the current byte is padded with 0s
      * and written out first.  The bit offset will be 0 after the
      * write.  Implementers can use the
-     * {@link ImageOutputStreamImpl#flushBits <code>flushBits</code>}
-     * method of {@link ImageOutputStreamImpl
-     * <code>ImageOutputStreamImpl</code>} to guarantee this.
+     * {@link ImageOutputStreamImpl#flushBits flushBits}
+     * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
+     * to guarantee this.
      *
      * @param b an <code>int</code> whose lower 8 bits are to be
      * written.
@@ -99,9 +99,9 @@
      * remainder of the current byte is padded with 0s
      * and written out first.  The bit offset will be 0 after the
      * write.  Implementers can use the
-     * {@link ImageOutputStreamImpl#flushBits <code>flushBits</code>}
-     * method of {@link ImageOutputStreamImpl
-     * <code>ImageOutputStreamImpl</code>} to guarantee this.
+     * {@link ImageOutputStreamImpl#flushBits flushBits}
+     * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
+     * to guarantee this.
      *
      * @param b an array of <code>byte</code>s to be written.
      * @param off the start offset in the data.
@@ -182,8 +182,7 @@
     void writeShort(int v) throws IOException;
 
     /**
-     * This method is a synonym for
-     * {@link #writeShort <code>writeShort</code>}.
+     * This method is a synonym for {@link #writeShort writeShort}.
      *
      * @param v an <code>int</code> containing the char (unsigned
      * short) value to be written.
@@ -430,7 +429,7 @@
      *
      * @exception NullPointerException if <code>s</code> is
      * <code>null</code>.
-     * @exception UTFDataFormatException if the modified UTF-8
+     * @exception java.io.UTFDataFormatException if the modified UTF-8
      * representation of <code>s</code> requires more than 65536 bytes.
      * @exception IOException if an I/O error occurs.
      */
--- a/jdk/src/share/classes/javax/management/relation/RelationNotification.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/management/relation/RelationNotification.java	Tue Aug 13 18:34:12 2013 -0700
@@ -260,7 +260,7 @@
 
         super(notifType, sourceObj, sequence, timeStamp, message);
 
-        if (!isValidBasic(notifType,sourceObj,id,typeName) || !isValidCreate(notifType)) {
+        if (!isValidBasicStrict(notifType,sourceObj,id,typeName) || !isValidCreate(notifType)) {
             throw new IllegalArgumentException("Invalid parameter.");
         }
 
@@ -310,7 +310,7 @@
 
         super(notifType, sourceObj, sequence, timeStamp, message);
 
-        if (!isValidBasic(notifType,sourceObj,id,typeName) || !isValidUpdate(notifType,name,newValue,oldValue)) {
+        if (!isValidBasicStrict(notifType,sourceObj,id,typeName) || !isValidUpdate(notifType,name,newValue,oldValue)) {
             throw new IllegalArgumentException("Invalid parameter.");
         }
 
@@ -457,14 +457,26 @@
     //  - no role old value (for role update)
     //  - no role new value (for role update)
 
+    // Despite the fact, that validation in constructor of RelationNotification prohibit
+    // creation of the class instance with null sourceObj its possible to set it to null later
+    // by public setSource() method.
+    // So we should relax validation rules to preserve serialization behavior compatibility.
+
+    private boolean isValidBasicStrict(String notifType, Object sourceObj, String id, String typeName){
+        if (sourceObj == null) {
+            return false;
+        }
+        return isValidBasic(notifType,sourceObj,id,typeName);
+    }
+
     private boolean isValidBasic(String notifType, Object sourceObj, String id, String typeName){
-        if (notifType == null || sourceObj == null ||
-            id == null || typeName == null) {
+        if (notifType == null || id == null || typeName == null) {
             return false;
         }
 
-        if (!(sourceObj instanceof RelationService) &&
-            !(sourceObj instanceof ObjectName)) {
+        if (sourceObj != null && (
+            !(sourceObj instanceof RelationService) &&
+            !(sourceObj instanceof ObjectName))) {
             return false;
         }
 
--- a/jdk/src/share/classes/javax/print/DocFlavor.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/DocFlavor.java	Tue Aug 13 18:34:12 2013 -0700
@@ -286,7 +286,7 @@
  * "autosensing" works is implementation dependent. In general, preformatted
  * autosense print data is provided in a byte oriented representation class
  * (byte array, InputStream, URL).
- *
+ * </UL>
  * <P>
  * <HR>
  * <H3>Service Formatted Print Data</H3>
@@ -545,7 +545,7 @@
      * the match.
      * @return String representing a mime parameter, or
      * null if that parameter is not in the mime type string.
-     * @exception throws NullPointerException if paramName is null.
+     * @exception NullPointerException if paramName is null.
      */
     public String getParameter(String paramName) {
         return
--- a/jdk/src/share/classes/javax/print/MultiDocPrintJob.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/MultiDocPrintJob.java	Tue Aug 13 18:34:12 2013 -0700
@@ -47,7 +47,7 @@
      * PrintJobListener.
      *
      * @param multiDoc The documents to be printed. ALL must be a flavor
-     *                          supported by the PrintJob & PrintService.
+     *        supported by the PrintJob {@literal &} PrintService.
      *
      * @param attributes The job attributes to be applied to this print job.
      *        If this parameter is null then the default attributes are used.
--- a/jdk/src/share/classes/javax/print/PrintService.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/PrintService.java	Tue Aug 13 18:34:12 2013 -0700
@@ -40,7 +40,7 @@
  * a printer's supported attributes.
  * <P>
  * Example:
- *   <PRE>
+ *   <PRE>{@code
  *   DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
  *   PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
  *   aset.add(MediaSizeName.ISO_A4);
@@ -56,7 +56,7 @@
  *        } catch (PrintException e) {
  *        }
  *   }
- *   </PRE>
+ *   }</PRE>
  */
 public interface PrintService {
 
--- a/jdk/src/share/classes/javax/print/ServiceUI.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/ServiceUI.java	Tue Aug 13 18:34:12 2013 -0700
@@ -118,7 +118,7 @@
      * any changes made by the user.
      *
      * A typical basic usage of this method may be :
-     * <pre>
+     * <pre>{@code
      * PrintService[] services = PrintServiceLookup.lookupPrintServices(
      *                            DocFlavor.INPUT_STREAM.JPEG, null);
      * PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
@@ -131,7 +131,7 @@
      *     ... print ...
      *    }
      * }
-     * </pre>
+     * }</pre>
      * <p>
 
      * @param gc used to select screen. null means primary or default screen.
--- a/jdk/src/share/classes/javax/print/ServiceUIFactory.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/ServiceUIFactory.java	Tue Aug 13 18:34:12 2013 -0700
@@ -39,8 +39,8 @@
  * initialize services only when needed without any API dependencies
  * except in an environment in which they are used.
  * <p>
- * Swing UIs are preferred as they provide a more consistent L&F and
- * can support accessibility APIs.
+ * Swing UIs are preferred as they provide a more consistent {@literal L&F}
+ * and can support accessibility APIs.
  * <p>
  * Example usage:
  * <pre>
--- a/jdk/src/share/classes/javax/print/attribute/AttributeSet.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/AttributeSet.java	Tue Aug 13 18:34:12 2013 -0700
@@ -42,7 +42,7 @@
  * class rather than the attribute object's class itself. An attribute
  * object's
  * category is determined by calling the {@link Attribute#getCategory()
- * <CODE>getCategory()</CODE>} method defined in interface {@link Attribute
+ * getCategory()} method defined in interface {@link Attribute
  * Attribute}.
  * <P>
  * The interfaces of an AttributeSet resemble those of the Java Collections
@@ -217,7 +217,7 @@
     /**
      * Adds all of the elements in the specified set to this attribute.
      * The outcome is the same as if the =
-     * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
+     * {@link #add(Attribute) add(Attribute)}
      * operation had been applied to this attribute set successively with each
      * element from the specified set.
      * The behavior of the <CODE>addAll(AttributeSet)</CODE>
@@ -301,7 +301,7 @@
      * This ensures that <tt>t1.equals(t2)</tt> implies that
      * <tt>t1.hashCode()==t2.hashCode()</tt> for any two attribute sets
      * <tt>t1</tt> and <tt>t2</tt>, as required by the general contract of
-     * {@link java.lang.Object#hashCode() <CODE>Object.hashCode()</CODE>}.
+     * {@link java.lang.Object#hashCode() Object.hashCode()}.
      *
      * @return  The hash code value for this attribute set.
      */
--- a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java	Tue Aug 13 18:34:12 2013 -0700
@@ -36,9 +36,9 @@
  * <P>
  * Under the hood, a date-time attribute is stored as a value of class <code>
  * java.util.Date</code>. You can get a date-time attribute's Date value by
- * calling {@link #getValue() <CODE>getValue()</CODE>}. A date-time attribute's
+ * calling {@link #getValue() getValue()}. A date-time attribute's
  * Date value is established when it is constructed (see {@link
- * #DateTimeSyntax(Date) <CODE>DateTimeSyntax(Date)</CODE>}). Once
+ * #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once
  * constructed, a date-time attribute's value is immutable.
  * <P>
  * To construct a date-time attribute from separate values of the year, month,
--- a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java	Tue Aug 13 18:34:12 2013 -0700
@@ -37,8 +37,8 @@
  * constructors and mutating operations guarantee an additional invariant,
  * namely that all attribute values in the DocAttributeSet must be instances
  * of interface {@link DocAttribute DocAttribute}.
- * The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and
- * {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations
+ * The {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
  * are respecified below to guarantee this additional invariant.
  * <P>
  *
@@ -74,7 +74,7 @@
     /**
      * Adds all of the elements in the specified set to this attribute.
      * The outcome is  the same as if the
-     * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
+     * {@link #add(Attribute) add(Attribute)}
      * operation had been applied to this attribute set successively with
      * each element from the specified set. If none of the categories in the
      * specified set  are the same as any categories in this attribute set,
--- a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java	Tue Aug 13 18:34:12 2013 -0700
@@ -81,15 +81,15 @@
  * for identical objects (<CODE>==</CODE>).
  * <P>
  * You can convert an enumeration value to a string by calling {@link
- * #toString() <CODE>toString()</CODE>}. The string is obtained from a table
+ * #toString() toString()}. The string is obtained from a table
  * supplied by the enumeration class.
  * <P>
  * Under the hood, an enumeration value is just an integer, a different integer
  * for each enumeration value within an enumeration class. You can get an
  * enumeration value's integer value by calling {@link #getValue()
- * <CODE>getValue()</CODE>}. An enumeration value's integer value is established
+ * getValue()}. An enumeration value's integer value is established
  * when it is constructed (see {@link #EnumSyntax(int)
- * <CODE>EnumSyntax(int)</CODE>}). Since the constructor is protected, the only
+ * EnumSyntax(int)}). Since the constructor is protected, the only
  * possible enumeration values are the singleton objects declared in the
  * enumeration class; additional enumeration values cannot be created at run
  * time.
@@ -170,10 +170,10 @@
      *
      * @return  The enumeration singleton value stored at index
      *          <I>i</I>-<I>L</I> in the enumeration value table returned by
-     *          {@link #getEnumValueTable() <CODE>getEnumValueTable()</CODE>},
+     *          {@link #getEnumValueTable() getEnumValueTable()},
      *          where <I>i</I> is this enumeration value's integer value and
      *          <I>L</I> is the value returned by {@link #getOffset()
-     *          <CODE>getOffset()</CODE>}.
+     *          getOffset()}.
      *
      * @throws ObjectStreamException if the stream can't be deserialised
      * @throws  InvalidObjectException
@@ -220,18 +220,18 @@
      * Returns the string table for this enumeration value's enumeration class.
      * The enumeration class's integer values are assumed to lie in the range
      * <I>L</I>..<I>L</I>+<I>N</I>-1, where <I>L</I> is the value returned by
-     * {@link #getOffset() <CODE>getOffset()</CODE>} and <I>N</I> is the length
+     * {@link #getOffset() getOffset()} and <I>N</I> is the length
      * of the string table. The element in the string table at index
      * <I>i</I>-<I>L</I> is the value returned by {@link #toString()
-     * <CODE>toString()</CODE>} for the enumeration value whose integer value
+     * toString()} for the enumeration value whose integer value
      * is <I>i</I>. If an integer within the above range is not used by any
      * enumeration value, leave the corresponding table element null.
      * <P>
      * The default implementation returns null. If the enumeration class (a
      * subclass of class EnumSyntax) does not override this method to return a
      * non-null string table, and the subclass does not override the {@link
-     * #toString() <CODE>toString()</CODE>} method, the base class {@link
-     * #toString() <CODE>toString()</CODE>} method will return just a string
+     * #toString() toString()} method, the base class {@link
+     * #toString() toString()} method will return just a string
      * representation of this enumeration value's integer value.
      * @return the string table
      */
@@ -243,11 +243,11 @@
      * Returns the enumeration value table for this enumeration value's
      * enumeration class. The enumeration class's integer values are assumed to
      * lie in the range <I>L</I>..<I>L</I>+<I>N</I>-1, where <I>L</I> is the
-     * value returned by {@link #getOffset() <CODE>getOffset()</CODE>} and
+     * value returned by {@link #getOffset() getOffset()} and
      * <I>N</I> is the length of the enumeration value table. The element in the
      * enumeration value table at index <I>i</I>-<I>L</I> is the enumeration
      * value object whose integer value is <I>i</I>; the {@link #readResolve()
-     * <CODE>readResolve()</CODE>} method needs this to preserve singleton
+     * readResolve()} method needs this to preserve singleton
      * semantics during deserialization of an enumeration instance. If an
      * integer within the above range is not used by any enumeration value,
      * leave the corresponding table element null.
@@ -255,8 +255,8 @@
      * The default implementation returns null. If the enumeration class (a
      * subclass of class EnumSyntax) does not override this method to return
      * a non-null enumeration value table, and the subclass does not override
-     * the {@link #readResolve() <CODE>readResolve()</CODE>} method, the base
-     * class {@link #readResolve() <CODE>readResolve()</CODE>} method will throw
+     * the {@link #readResolve() readResolve()} method, the base
+     * class {@link #readResolve() readResolve()} method will throw
      * an exception whenever an enumeration instance is deserialized from an
      * object input stream.
      * @return the value table
--- a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java	Tue Aug 13 18:34:12 2013 -0700
@@ -388,7 +388,7 @@
     /**
      * Adds all of the elements in the specified set to this attribute.
      * The outcome is the same as if the
-     * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
+     * {@link #add(Attribute) add(Attribute)}
      * operation had been applied to this attribute set successively with
      * each element from the specified set.
      * The behavior of the <CODE>addAll(AttributeSet)</CODE>
@@ -512,7 +512,7 @@
      * This ensures that <tt>t1.equals(t2)</tt> implies that
      * <tt>t1.hashCode()==t2.hashCode()</tt> for any two attribute sets
      * <tt>t1</tt> and <tt>t2</tt>, as required by the general contract of
-     * {@link java.lang.Object#hashCode() <CODE>Object.hashCode()</CODE>}.
+     * {@link java.lang.Object#hashCode() Object.hashCode()}.
      *
      * @return  The hash code value for this attribute set.
      */
--- a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java	Tue Aug 13 18:34:12 2013 -0700
@@ -33,9 +33,9 @@
  * <P>
  * Under the hood, an integer attribute is just an integer. You can get an
  * integer attribute's integer value by calling {@link #getValue()
- * <CODE>getValue()</CODE>}. An integer attribute's integer value is
+ * getValue()}. An integer attribute's integer value is
  * established when it is constructed (see {@link #IntegerSyntax(int)
- * <CODE>IntegerSyntax(int)</CODE>}). Once constructed, an integer attribute's
+ * IntegerSyntax(int)}). Once constructed, an integer attribute's
  * value is immutable.
  * <P>
  *
--- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java	Tue Aug 13 18:34:12 2013 -0700
@@ -36,8 +36,8 @@
  * constructors and mutating operations guarantee an additional invariant,
  * namely that all attribute values in the PrintJobAttributeSet must be
  * instances of interface {@link PrintJobAttribute PrintJobAttribute}.
- * The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and
- * {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations
+ * The {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations
  * are respecified below to guarantee this additional invariant.
  * <P>
  *
@@ -72,7 +72,7 @@
     /**
      * Adds all of the elements in the specified set to this attribute.
      * The outcome is  the same as if the
-     * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
+     * {@link #add(Attribute) add(Attribute)}
      * operation had been applied to this attribute set successively with
      * each element from the specified set. If none of the categories in the
      * specified set  are the same as any categories in this attribute set,
--- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java	Tue Aug 13 18:34:12 2013 -0700
@@ -37,8 +37,8 @@
  * constructors and mutating operations guarantee an additional invariant,
  * namely that all attribute values in the PrintRequestAttributeSet must be
  * instances of interface {@link PrintRequestAttribute PrintRequestAttribute}.
- * The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and
- * {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations
+ * The {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
  * are respecified below to guarantee this additional invariant.
  * <P>
  *
@@ -73,7 +73,7 @@
     /**
      * Adds all of the elements in the specified set to this attribute.
      * The outcome is  the same as if the
-     * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
+     * {@link #add(Attribute) add(Attribute)}
      * operation had been applied to this attribute set successively with
      * each element from the specified set. If none of the categories in the
      * specified set  are the same as any categories in this attribute set,
--- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java	Tue Aug 13 18:34:12 2013 -0700
@@ -39,8 +39,8 @@
  * invariant,
  * namely that all attribute values in the PrintServiceAttributeSet must be
  * instances of interface {@link PrintServiceAttribute PrintServiceAttribute}.
- * The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and
- * {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations
+ * The {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
  * are respecified below to guarantee this additional invariant.
  * <P>
  *
@@ -77,7 +77,7 @@
     /**
      * Adds all of the elements in the specified set to this attribute.
      * The outcome is  the same as if the
-     * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
+     * {@link #add(Attribute) add(Attribute)}
      * operation had been applied to this attribute set successively with
      * each element from the specified set. If none of the categories in the
      * specified set  are the same as any categories in this attribute set,
--- a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java	Tue Aug 13 18:34:12 2013 -0700
@@ -39,7 +39,7 @@
  * resolution attribute's values, indicating the units in which the values are
  * to be returned. The two most common resolution units are dots per inch (dpi)
  * and dots per centimeter (dpcm), and exported constants {@link #DPI
- * <CODE>DPI</CODE>} and {@link #DPCM <CODE>DPCM</CODE>} are provided for
+ * DPI} and {@link #DPCM DPCM} are provided for
  * indicating those units.
  * <P>
  * Once constructed, a resolution attribute's value is immutable.
@@ -68,9 +68,9 @@
  * done, which would not be guaranteed if a floating point representation were
  * used.
  * <P>
- * The exported constant {@link #DPI <CODE>DPI</CODE>} is actually the
+ * The exported constant {@link #DPI DPI} is actually the
  * conversion factor by which to multiply a value in dpi to get the value in
- * dphi. Likewise, the exported constant {@link #DPCM <CODE>DPCM</CODE>} is the
+ * dphi. Likewise, the exported constant {@link #DPCM DPCM} is the
  * conversion factor by which to multiply a value in dpcm to get the value in
  * dphi. A client can specify a resolution value in units other than dpi or dpcm
  * by supplying its own conversion factor. However, since the internal units of
@@ -120,12 +120,12 @@
      * @param  feedResolution
      *     Feed direction resolution.
      * @param units
-     *     Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or
-     * {@link    #DPCM <CODE>DPCM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #DPI DPI} or
+     * {@link    #DPCM DPCM}.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>crossFeedResolution</CODE> <
-     *     1 or <CODE>feedResolution</CODE> < 1 or <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code crossFeedResolution < 1}
+     *     or {@code feedResolution < 1} or {@code units < 1}.
      */
     public ResolutionSyntax(int crossFeedResolution, int feedResolution,
                             int units) {
@@ -172,14 +172,14 @@
      * The values are rounded to the nearest integer.
      *
      * @param  units
-     *     Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or
-     * {@link   #DPCM <CODE>DPCM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #DPI DPI} or
+     * {@link   #DPCM DPCM}.
      *
      * @return  A two-element array with the cross feed direction resolution
      *          at index 0 and the feed direction resolution at index 1.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public int[] getResolution(int units) {
         return new int[] { getCrossFeedResolution(units),
@@ -192,13 +192,13 @@
      * the given units. The value is rounded to the nearest integer.
      *
      * @param  units
-     *     Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or
-     * {@link  #DPCM <CODE>DPCM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #DPI DPI} or
+     * {@link  #DPCM DPCM}.
      *
      * @return  Cross feed direction resolution.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public int getCrossFeedResolution(int units) {
         return convertFromDphi (crossFeedResolution, units);
@@ -209,13 +209,13 @@
      * given units. The value is rounded to the nearest integer.
      *
      * @param  units
-     *     Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or {@link
-     *     #DPCM <CODE>DPCM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #DPI DPI} or {@link
+     *     #DPCM DPCM}.
      *
      * @return  Feed direction resolution.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public int getFeedResolution(int units) {
         return convertFromDphi (feedResolution, units);
@@ -229,8 +229,8 @@
      * rounded to the nearest integer.
      *
      * @param  units
-     *     Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or {@link
-     *     #DPCM <CODE>DPCM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link
+     *     #DPCM DPCM}.
      * @param  unitsName
      *     Units name string, e.g. <CODE>"dpi"</CODE> or <CODE>"dpcm"</CODE>. If
      *     null, no units name is appended to the result.
@@ -238,7 +238,7 @@
      * @return  String version of this resolution attribute.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public String toString(int units, String unitsName) {
         StringBuffer result = new StringBuffer();
--- a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java	Tue Aug 13 18:34:12 2013 -0700
@@ -38,8 +38,8 @@
  * values are measured. Methods are provided to return a two-dimensional size
  * attribute's values, indicating the units in which the values are to be
  * returned. The two most common size units are inches (in) and millimeters
- * (mm), and exported constants {@link #INCH <CODE>INCH</CODE>} and {@link #MM
- * <CODE>MM</CODE>} are provided for indicating those units.
+ * (mm), and exported constants {@link #INCH INCH} and {@link #MM
+ * MM} are provided for indicating those units.
  * <P>
  * Once constructed, a two-dimensional size attribute's value is immutable.
  * <P>
@@ -66,9 +66,9 @@
  * units, you have to search for a media size of 215.9 x 279.4 mm; rounding off
  * to an integral 216 x 279 mm will not match.
  * <P>
- * The exported constant {@link #INCH <CODE>INCH</CODE>} is actually the
+ * The exported constant {@link #INCH INCH} is actually the
  * conversion factor by which to multiply a value in inches to get the value in
- * &#181;m. Likewise, the exported constant {@link #MM <CODE>MM</CODE>} is the
+ * &#181;m. Likewise, the exported constant {@link #MM MM} is the
  * conversion factor by which to multiply a value in mm to get the value in
  * &#181;m. A client can specify a resolution value in units other than inches
  * or mm by supplying its own conversion factor. However, since the internal
@@ -117,12 +117,12 @@
      * @param  x  X dimension.
      * @param  y  Y dimension.
      * @param  units
-     *     Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or
-     *     {@link #MM <CODE>MM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #INCH INCH} or
+     *     {@link #MM MM}.
      *
      * @exception  IllegalArgumentException
-     *     (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE>
-     *     < 0 or <CODE>units</CODE> < 1.
+     *     (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+     *     {@code units < 1}.
      */
     protected Size2DSyntax(float x, float y, int units) {
         if (x < 0.0f) {
@@ -145,12 +145,12 @@
      * @param  x  X dimension.
      * @param  y  Y dimension.
      * @param  units
-     *     Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or
-     *     {@link #MM <CODE>MM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #INCH INCH} or
+     *     {@link #MM MM}.
      *
      * @exception  IllegalArgumentException
-     *   (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE>
-     *    < 0 or <CODE>units</CODE> < 1.
+     *   (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0}
+     *    or {@code units < 1}.
      */
     protected Size2DSyntax(int x, int y, int units) {
         if (x < 0) {
@@ -193,14 +193,13 @@
      * as floating-point values.
      *
      * @param  units
-     *     Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or
-     *     {@link #MM <CODE>MM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
      *
      * @return  A two-element array with the X dimension at index 0 and the Y
      *          dimension at index 1.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public float[] getSize(int units) {
         return new float[] {getX(units), getY(units)};
@@ -211,13 +210,12 @@
      * units as a floating-point value.
      *
      * @param  units
-     *     Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or
-     *     {@link #MM <CODE>MM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
      *
      * @return  X dimension.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public float getX(int units) {
         return convertFromMicrometers(x, units);
@@ -228,13 +226,12 @@
      * units as a floating-point value.
      *
      * @param  units
-     *     Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or
-     *     {@link #MM <CODE>MM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
      *
      * @return  Y dimension.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public float getY(int units) {
         return convertFromMicrometers(y, units);
@@ -248,16 +245,16 @@
      * floating point.
      *
      * @param  units
-     *     Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or
-     *     {@link #MM <CODE>MM</CODE>}.
+     *     Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
+     *
      * @param  unitsName
-     *     Units name string, e.g. <CODE>"in"</CODE> or <CODE>"mm"</CODE>. If
+     *     Units name string, e.g. {@code in} or {@code mm}. If
      *     null, no units name is appended to the result.
      *
      * @return  String version of this two-dimensional size attribute.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public String toString(int units, String unitsName) {
         StringBuffer result = new StringBuffer();
--- a/jdk/src/share/classes/javax/print/attribute/standard/Chromaticity.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Chromaticity.java	Tue Aug 13 18:34:12 2013 -0700
@@ -40,11 +40,11 @@
  * can be verified to support color printing.
  * <P>
  * The table below shows the effects of specifying a Chromaticity attribute of
- * {@link #MONOCHROME <CODE>MONOCHROME</CODE>} or {@link #COLOR
- * <CODE>COLOR</CODE>} for a monochrome or color document.
+ * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR}
+ * for a monochrome or color document.
  * <P>
  * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes">
- * <TR BGCOLOR="#E5E5E5">
+ * <TR>
  * <TH>
  * Chromaticity<BR>Attribute
  * </TH>
@@ -57,7 +57,7 @@
  * </TR>
  * <TR>
  * <TD>
- * {@link #MONOCHROME <CODE>MONOCHROME</CODE>}
+ * {@link #MONOCHROME MONOCHROME}
  * </TD>
  * <TD>
  * Printed as is, in monochrome
@@ -68,7 +68,7 @@
  * </TR>
  * <TR>
  * <TD>
- * {@link #COLOR <CODE>COLOR</CODE>}
+ * {@link #COLOR COLOR}
  * </TD>
  * <TD>
  * Printed as is, in monochrome
--- a/jdk/src/share/classes/javax/print/attribute/standard/Compression.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Compression.java	Tue Aug 13 18:34:12 2013 -0700
@@ -34,7 +34,7 @@
  * print data (the doc), not of the Print Job. If a Compression attribute is not
  * specified for a doc, the printer assumes the doc's print data is uncompressed
  * (i.e., the default Compression value is always {@link #NONE
- * <CODE>NONE</CODE>}).
+ * NONE}).
  * <P>
  * <B>IPP Compatibility:</B> The category name returned by
  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
--- a/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java	Tue Aug 13 18:34:12 2013 -0700
@@ -46,13 +46,13 @@
  * &nbsp;
  * </TD>
  * <TD WIDTH=27%>
- * {@link #NONE <CODE>NONE</CODE>}
+ * {@link #NONE NONE}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE <CODE>STAPLE</CODE>}
+ * {@link #STAPLE STAPLE}
  * </TD>
  * <TD WIDTH=36%>
- * {@link #EDGE_STITCH <CODE>EDGE_STITCH</CODE>}
+ * {@link #EDGE_STITCH EDGE_STITCH}
  * </TD>
  * </TR>
  * <TR>
@@ -60,13 +60,13 @@
  * &nbsp;
  * </TD>
  * <TD>
- * {@link #BIND <CODE>BIND</CODE>}
+ * {@link #BIND BIND}
  * </TD>
  * <TD>
- * {@link #SADDLE_STITCH <CODE>SADDLE_STITCH</CODE>}
+ * {@link #SADDLE_STITCH SADDLE_STITCH}
  * </TD>
  * <TD>
- * {@link #COVER <CODE>COVER</CODE>}
+ * {@link #COVER COVER}
  * </TD>
  * <TD>
  * &nbsp;
@@ -82,13 +82,13 @@
  * &nbsp;
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE_TOP_LEFT <CODE>STAPLE_TOP_LEFT</CODE>}
+ * {@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #EDGE_STITCH_LEFT <CODE>EDGE_STITCH_LEFT</CODE>}
+ * {@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE_DUAL_LEFT <CODE>STAPLE_DUAL_LEFT</CODE>}
+ * {@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
  * </TD>
  * <TD WIDTH=9%>
  * &nbsp;
@@ -99,13 +99,13 @@
  * &nbsp;
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE_BOTTOM_LEFT <CODE>STAPLE_BOTTOM_LEFT</CODE>}
+ * {@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #EDGE_STITCH_TOP <CODE>EDGE_STITCH_TOP</CODE>}
+ * {@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE_DUAL_TOP <CODE>STAPLE_DUAL_TOP</CODE>}
+ * {@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
  * </TD>
  * <TD WIDTH=9%>
  * &nbsp;
@@ -116,13 +116,13 @@
  * &nbsp;
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE_TOP_RIGHT <CODE>STAPLE_TOP_RIGHT</CODE>}
+ * {@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #EDGE_STITCH_RIGHT <CODE>EDGE_STITCH_RIGHT</CODE>}
+ * {@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE_DUAL_RIGHT <CODE>STAPLE_DUAL_RIGHT</CODE>}
+ * {@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
  * </TD>
  * <TD WIDTH=9%>
  * &nbsp;
@@ -133,13 +133,13 @@
  * &nbsp;
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE_BOTTOM_RIGHT <CODE>STAPLE_BOTTOM_RIGHT</CODE>}
+ * {@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #EDGE_STITCH_BOTTOM <CODE>EDGE_STITCH_BOTTOM</CODE>}
+ * {@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
  * </TD>
  * <TD WIDTH=27%>
- * {@link #STAPLE_DUAL_BOTTOM <CODE>STAPLE_DUAL_BOTTOM</CODE>}
+ * {@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
  * </TD>
  * <TD WIDTH=9%>
  * &nbsp;
@@ -147,16 +147,16 @@
  * </TR>
  * </TABLE>
  * <P>
- * The <CODE>STAPLE_<I>XXX</I></CODE> values are specified with respect to the
+ * The STAPLE_<I>XXX</I> values are specified with respect to the
  * document as if the document were a portrait document. If the document is
  * actually a landscape or a reverse-landscape document, the client supplies the
  * appropriate transformed value. For example, to position a staple in the upper
  * left hand corner of a landscape document when held for reading, the client
- * supplies the <CODE>STAPLE_BOTTOM_LEFT</CODE> value (since landscape is
+ * supplies the STAPLE_BOTTOM_LEFT value (since landscape is
  * defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the
  * other hand, to position a staple in the upper left hand corner of a
  * reverse-landscape document when held for reading, the client supplies the
- * <CODE>STAPLE_TOP_RIGHT</CODE> value (since reverse-landscape is defined as a
+ * STAPLE_TOP_RIGHT value (since reverse-landscape is defined as a
  * -90 degree rotation from portrait, i.e., clockwise).
  * <P>
  * The angle (vertical, horizontal, angled) of each staple with respect to the
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java	Tue Aug 13 18:34:12 2013 -0700
@@ -67,7 +67,7 @@
  * shown in the table below.
  * <P>
  * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Table showing computation of doc sizes">
- * <TR BGCOLOR="#E5E5E5">
+ * <TR>
  * <TH>Representation Class</TH>
  * <TH>Document Size</TH>
  * </TR>
--- a/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java	Tue Aug 13 18:34:12 2013 -0700
@@ -62,7 +62,7 @@
  * The (x,y) origin is positioned at the top-left of the paper in portrait
  * mode regardless of the orientation specified in the requesting context.
  * For example a printable area for A4 paper in portrait or landscape
- * orientation will have height > width.
+ * orientation will have height {@literal >} width.
  * <p>
  * A printable area attribute's values are stored
  * internally as integers in units of micrometers (&#181;m), where 1 micrometer
@@ -107,9 +107,9 @@
       * @param units  in which the values are expressed.
       *
       * @exception  IllegalArgumentException
-      *     Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> < 0
-      *     or <CODE>w</CODE> <= 0 or <CODE>h</CODE> <= 0 or
-      *     <CODE>units</CODE> < 1.
+      *     Thrown if {@code x < 0} or {@code y < 0}
+      *     or {@code w <= 0} or {@code h <= 0} or
+      *     {@code units < 1}.
       */
     public MediaPrintableArea(float x, float y, float w, float h, int units) {
         if ((x < 0.0) || (y < 0.0) || (w <= 0.0) || (h <= 0.0) ||
@@ -133,9 +133,9 @@
       * @param units  in which the values are expressed.
       *
       * @exception  IllegalArgumentException
-      *     Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> < 0
-      *     or <CODE>w</CODE> <= 0 or <CODE>h</CODE> <= 0 or
-      *     <CODE>units</CODE> < 1.
+      *     Thrown if {@code x < 0} or {@code y < 0}
+      *     or {@code w <= 0} or {@code h <= 0} or
+      *     {@code units < 1}.
       */
     public MediaPrintableArea(int x, int y, int w, int h, int units) {
         if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) ||
@@ -159,7 +159,7 @@
      * @return printable area as array of x, y, w, h in the specified units.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public float[] getPrintableArea(int units) {
         return new float[] { getX(units), getY(units),
@@ -177,7 +177,7 @@
      * specified units.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
      public float getX(int units) {
         return convertFromMicrometers(x, units);
@@ -194,7 +194,7 @@
      * specified units.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
      public float getY(int units) {
         return convertFromMicrometers(y, units);
@@ -209,7 +209,7 @@
      * @return  width of the printable area in the specified units.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
      public float getWidth(int units) {
         return convertFromMicrometers(w, units);
@@ -224,7 +224,7 @@
      * @return  height of the printable area in the specified units.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
      public float getHeight(int units) {
         return convertFromMicrometers(h, units);
@@ -301,7 +301,7 @@
      * @return  String version of this two-dimensional size attribute.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public String toString(int units, String unitsName) {
         if (unitsName == null) {
--- a/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java	Tue Aug 13 18:34:12 2013 -0700
@@ -45,7 +45,7 @@
  * <code>MediaSize.getMediaSizeForName(MediaSizeName)</code>
  * to find the physical dimensions of the MediaSizeName instances
  * enumerated in this API. This is useful for clients which need this
- * information to format & paginate printing.
+ * information to format {@literal &} paginate printing.
  * <P>
  *
  * @author  Phil Race, Alan Kaminsky
@@ -71,8 +71,8 @@
      *     <CODE>Size2DSyntax.MM</CODE>.
      *
      * @exception  IllegalArgumentException
-     *   (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE>
-     *     < 0 or <CODE>units</CODE> < 1 or <CODE>x</CODE> > <CODE>y</CODE>.
+     *   (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+     *   {@code units < 1} or {@code x > y}.
      */
     public MediaSize(float x, float y,int units) {
         super (x, y, units);
@@ -92,8 +92,8 @@
      *     <CODE>Size2DSyntax.MM</CODE>.
      *
      * @exception  IllegalArgumentException
-     *   (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE>
-     *     < 0 or <CODE>units</CODE> < 1 or <CODE>x</CODE> > <CODE>y</CODE>.
+     *   (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+     *   {@code units < 1} or {@code x > y}.
      */
     public MediaSize(int x, int y,int units) {
         super (x, y, units);
@@ -115,8 +115,8 @@
      * @param media a media name to associate with this MediaSize
      *
      * @exception  IllegalArgumentException
-     *   (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE>
-     *     < 0 or <CODE>units</CODE> < 1 or <CODE>x</CODE> > <CODE>y</CODE>.
+     *   (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+     *   {@code units < 1} or {@code x > y}.
      */
     public MediaSize(float x, float y,int units, MediaSizeName media) {
         super (x, y, units);
@@ -141,8 +141,8 @@
      * @param media a media name to associate with this MediaSize
      *
      * @exception  IllegalArgumentException
-     *   (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE>
-     *     < 0 or <CODE>units</CODE> < 1 or <CODE>x</CODE> > <CODE>y</CODE>.
+     *   (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+     *   {@code units < 1} or {@code x > y}.
      */
     public MediaSize(int x, int y,int units, MediaSizeName media) {
         super (x, y, units);
@@ -194,7 +194,8 @@
      *     Unit conversion factor, e.g. <CODE>Size2DSyntax.INCH</CODE> or
      *     <CODE>Size2DSyntax.MM</CODE>
      * @return MediaSizeName matching these dimensions, or null.
-     * @exception IllegalArgumentException if x <= 0, y <= 0, or units < 1
+     * @exception IllegalArgumentException if {@code x <= 0},
+     *      {@code y <= 0}, or {@code units < 1}.
      *
      */
     public static MediaSizeName findMedia(float x, float y, int units) {
--- a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java	Tue Aug 13 18:34:12 2013 -0700
@@ -56,56 +56,56 @@
 
     /**
      * Pages are laid out in columns starting at the top left,
-     * proceeeding towards the bottom & right.
+     * proceeeding towards the bottom {@literal &} right.
      */
     public static final PresentationDirection TOBOTTOM_TORIGHT =
         new PresentationDirection(0);
 
     /**
      * Pages are laid out in columns starting at the top right,
-     * proceeeding towards the bottom & left.
+     * proceeeding towards the bottom {@literal &} left.
      */
     public static final PresentationDirection TOBOTTOM_TOLEFT =
         new PresentationDirection(1);
 
     /**
      * Pages are laid out in columns starting at the bottom left,
-     * proceeeding towards the top & right.
+     * proceeeding towards the top {@literal &} right.
      */
     public static final PresentationDirection TOTOP_TORIGHT =
         new PresentationDirection(2);
 
     /**
      * Pages are laid out in columns starting at the bottom right,
-     * proceeeding towards the top & left.
+     * proceeeding towards the top {@literal &} left.
      */
     public static final PresentationDirection TOTOP_TOLEFT =
         new PresentationDirection(3);
 
     /**
      * Pages are laid out in rows starting at the top left,
-     * proceeeding towards the right & bottom.
+     * proceeeding towards the right {@literal &} bottom.
      */
     public static final PresentationDirection TORIGHT_TOBOTTOM =
         new PresentationDirection(4);
 
     /**
      * Pages are laid out in rows starting at the bottom left,
-     * proceeeding towards the right & top.
+     * proceeeding towards the right {@literal &} top.
      */
     public static final PresentationDirection TORIGHT_TOTOP =
         new PresentationDirection(5);
 
     /**
      * Pages are laid out in rows starting at the top right,
-     * proceeeding towards the left & bottom.
+     * proceeeding towards the left {@literal &} bottom.
      */
     public static final PresentationDirection TOLEFT_TOBOTTOM =
         new PresentationDirection(6);
 
     /**
      * Pages are laid out in rows starting at the bottom right,
-     * proceeeding towards the left & top.
+     * proceeeding towards the left {@literal &} top.
      */
     public static final PresentationDirection TOLEFT_TOTOP =
         new PresentationDirection(7);
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -40,7 +40,7 @@
  * details on color support). The information is intended to be germane to
  * this kind of printer without regard to site specific modifications or
  * services.
- * <P
+ * <P>
  * In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used
  * to find out more information about this specific printer rather than this
  * general kind of printer.
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java	Tue Aug 13 18:34:12 2013 -0700
@@ -84,11 +84,11 @@
      *     Feed direction resolution.
      * @param  units
      *    Unit conversion factor, e.g. <code>ResolutionSyntax.DPI</CODE>
-     * or <code>ResolutionSyntax.>DPCM</CODE>.
+     * or <code>ResolutionSyntax.DPCM</CODE>.
      *
      * @exception  IllegalArgumentException
-     *     (unchecked exception) Thrown if <CODE>crossFeedResolution</CODE> <
-     *     1 or <CODE>feedResolution</CODE> < 1 or <CODE>units</CODE> < 1.
+     *     (unchecked exception) Thrown if {@code crossFeedResolution < 1} or
+     *     {@code feedResolution < 1} or {@code units < 1}.
      */
     public PrinterResolution(int crossFeedResolution, int feedResolution,
                              int units) {
--- a/jdk/src/share/classes/javax/sound/midi/MetaMessage.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/MetaMessage.java	Tue Aug 13 18:34:12 2013 -0700
@@ -149,7 +149,7 @@
      * @param data              the data bytes in the MIDI message
      * @param length    the number of bytes in the <code>data</code>
      * byte array
-     * @throws                  <code>InvalidMidiDataException</code>  if the
+     * @throws                  InvalidMidiDataException  if the
      * parameter values do not specify a valid MIDI meta message
      */
     public void setMessage(int type, byte[] data, int length) throws InvalidMidiDataException {
--- a/jdk/src/share/classes/javax/sound/midi/MidiDevice.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/MidiDevice.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,13 +86,13 @@
  * To detect if a MidiDevice represents a hardware MIDI port, the
  * following programming technique can be used:
  *
- * <pre>
+ * <pre>{@code
  * MidiDevice device = ...;
  * if ( ! (device instanceof Sequencer) && ! (device instanceof Synthesizer)) {
  *   // we're now sure that device represents a MIDI port
  *   // ...
  * }
- * </pre>
+ * }</pre>
  *
  * <p>
  * A <code>MidiDevice</code> includes a <code>{@link MidiDevice.Info}</code> object
--- a/jdk/src/share/classes/javax/sound/midi/MidiDeviceReceiver.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/MidiDeviceReceiver.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,9 @@
  * @since 1.7
  */
 public interface MidiDeviceReceiver extends Receiver {
-    /** Obtains a MidiDevice object which is an owner of this Receiver.
+    /**
+     * Obtains a MidiDevice object which is an owner of this Receiver.
+     * @return a MidiDevice object which is an owner of this Receiver
      */
     public MidiDevice getMidiDevice();
 }
--- a/jdk/src/share/classes/javax/sound/midi/MidiDeviceTransmitter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/MidiDeviceTransmitter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,9 @@
  */
 public interface MidiDeviceTransmitter extends Transmitter {
 
-    /** Obtains a MidiDevice object which is an owner of this Transmitter.
+    /**
+     * Obtains a MidiDevice object which is an owner of this Transmitter.
+     * @return a MidiDevice object which is an owner of this Transmitter
      */
     public MidiDevice getMidiDevice();
 }
--- a/jdk/src/share/classes/javax/sound/midi/MidiFileFormat.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/MidiFileFormat.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,6 +50,7 @@
  * be used in implementations:
  *
  * <table border=1>
+    <caption>MIDI File Format Properties</caption>
  *  <tr>
  *   <th>Property key</th>
  *   <th>Value type</th>
--- a/jdk/src/share/classes/javax/sound/midi/MidiMessage.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/MidiMessage.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, 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
@@ -55,7 +55,7 @@
  * processing MIDI data that originated outside Java Sound and now
  * is encoded as signed bytes, the bytes can
  * can be converted to integers using this conversion:
- * <center><code>int i = (int)(byte & 0xFF)</code></center>
+ * <center>{@code int i = (int)(byte & 0xFF)}</center>
  * <p>
  * If you simply need to pass a known MIDI byte value as a method parameter,
  * it can be expressed directly as an integer, using (for example) decimal or
@@ -118,6 +118,10 @@
      * method is called by concrete subclasses, which should
      * ensure that the data array specifies a complete, valid MIDI
      * message.
+     *
+     * @param data the data bytes in the MIDI message
+     * @param length the number of bytes in the data byte array
+     * @throws InvalidMidiDataException if the parameter values do not specify a valid MIDI meta message
      */
     protected void setMessage(byte[] data, int length) throws InvalidMidiDataException {
         if (length < 0 || (length > 0 && length > data.length)) {
--- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,7 @@
  * consider them:
  *
  * <table border=0>
+ *  <caption>MIDI System Property Keys</caption>
  *  <tr>
  *   <th>Property Key</th>
  *   <th>Interface</th>
@@ -425,6 +426,8 @@
      * it is used to identify the default sequencer.
      * For details, refer to the {@link MidiSystem class description}.
      *
+     * @param connected whether or not the returned {@code Sequencer}
+     * is connected to the default {@code Synthesizer}
      * @return the default sequencer
      * @throws MidiUnavailableException if the sequencer is not
      *         available due to resource restrictions,
--- a/jdk/src/share/classes/javax/sound/midi/ShortMessage.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/ShortMessage.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, 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
@@ -283,7 +283,7 @@
     /**
      * Sets the parameters for a MIDI message that takes no data bytes.
      * @param status    the MIDI status byte
-     * @throws  <code>InvalidMidiDataException</code> if <code>status</code> does not
+     * @throws  InvalidMidiDataException if <code>status</code> does not
      * specify a valid MIDI status byte for a message that requires no data bytes.
      * @see #setMessage(int, int, int)
      * @see #setMessage(int, int, int, int)
@@ -307,7 +307,7 @@
      * @param status    the MIDI status byte
      * @param data1             the first data byte
      * @param data2             the second data byte
-     * @throws  <code>InvalidMidiDataException</code> if the
+     * @throws  InvalidMidiDataException if the
      * the status byte, or all data bytes belonging to the message, do
      * not specify a valid MIDI message.
      * @see #setMessage(int, int, int, int)
@@ -357,7 +357,7 @@
      * @param channel   the channel associated with the message
      * @param data1             the first data byte
      * @param data2             the second data byte
-     * @throws          <code>InvalidMidiDataException</code> if the
+     * @throws          InvalidMidiDataException if the
      * status byte or all data bytes belonging to the message, do
      * not specify a valid MIDI message
      *
@@ -397,6 +397,7 @@
      * Obtains the MIDI command associated with this event.  This method
      * assumes that the event is a MIDI channel message; if not, the return
      * value will not be meaningful.
+     * @return the MIDI command associated with this event
      * @see #setMessage(int, int, int, int)
      */
     public int getCommand() {
@@ -450,7 +451,7 @@
      * status byte value.
      * @param status status byte value, which must represent a short MIDI message
      * @return data length in bytes (0, 1, or 2)
-     * @throws <code>InvalidMidiDataException</code> if the
+     * @throws InvalidMidiDataException if the
      * <code>status</code> argument does not represent the status byte for any
      * short message
      */
--- a/jdk/src/share/classes/javax/sound/midi/Synthesizer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/Synthesizer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -170,7 +170,7 @@
      * already had been), <code>false</code> if the instrument could not be
      * loaded (for example, if the synthesizer has insufficient
      * memory to load it)
-     * @throws <code>IllegalArgumentException</code> if this
+     * @throws IllegalArgumentException if this
      * <code>Synthesizer</code> doesn't support the specified instrument's
      * soundbank
      * @see #unloadInstrument
@@ -186,7 +186,7 @@
     /**
      * Unloads a particular instrument.
      * @param instrument instrument to unload
-     * @throws <code>IllegalArgumentException</code> if this
+     * @throws IllegalArgumentException if this
      * <code>Synthesizer</code> doesn't support the specified instrument's
      * soundbank
      * @see #loadInstrument
@@ -214,10 +214,10 @@
      * of the old instrument, it should be loaded into the synthesizer
      * @return <code>true</code> if the instrument succeessfully remapped,
      * <code>false</code> if feature is not implemented by synthesizer
-     * @throws <code>IllegalArgumentException</code> if instrument
+     * @throws IllegalArgumentException if instrument
      * <code>from</code> or instrument <code>to</code> aren't supported by
      * synthesizer or if instrument <code>to</code> is not loaded
-     * @throws <code>NullPointerException</code> if <code>from</code> or
+     * @throws NullPointerException if <code>from</code> or
      * <code>to</code> parameters have null value
      * @see #loadInstrument
      * @see #loadInstruments
--- a/jdk/src/share/classes/javax/sound/midi/SysexMessage.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/SysexMessage.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2002, 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
@@ -204,6 +204,7 @@
      * @param data the system exclusive message data
      * @param length the length of the valid message data in
      * the array
+     * @throws InvalidMidiDataException if the status byte is invalid for a sysex message
      */
     public void setMessage(int status, byte[] data, int length) throws InvalidMidiDataException {
         if ( (status != 0xF0) && (status != 0xF7) ) {
--- a/jdk/src/share/classes/javax/sound/midi/Track.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/midi/Track.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -211,10 +211,11 @@
     /**
      * Obtains the event at the specified index.
      * @param index the location of the desired event in the event vector
-     * @throws <code>ArrayIndexOutOfBoundsException</code>  if the
+     * @throws ArrayIndexOutOfBoundsException  if the
      * specified index is negative or not less than the current size of
      * this track.
      * @see #size
+     * @return the event at the specified index
      */
     public MidiEvent get(int index) throws ArrayIndexOutOfBoundsException {
         try {
--- a/jdk/src/share/classes/javax/sound/sampled/AudioFileFormat.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/sampled/AudioFileFormat.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,7 @@
  * be used in implementations:
  *
  * <table border=1>
+ *  <caption>Audio File Format Property Keys</caption>
  *  <tr>
  *   <th>Property key</th>
  *   <th>Value type</th>
--- a/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,6 +85,7 @@
  * service providers should use, if applicable:
  *
  * <table border=0>
+ *  <caption>Audio Format Property Keys</caption>
  *  <tr>
  *   <th>Property key</th>
  *   <th>Value type</th>
--- a/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,6 +75,7 @@
  * consider them:
  *
  * <table border=0>
+ *  <caption>Audio System Property Keys</caption>
  *  <tr>
  *   <th>Property Key</th>
  *   <th>Interface</th>
--- a/jdk/src/share/classes/javax/sound/sampled/BooleanControl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/sampled/BooleanControl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -125,6 +125,7 @@
 
     /**
      * Obtains the label for the specified state.
+     * @param state the state whose label will be returned
      * @return the label for the specified state, such as "true" or "on"
      * for <code>true</code>, or "false" or "off" for <code>false</code>.
      */
--- a/jdk/src/share/classes/javax/sound/sampled/Mixer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/sampled/Mixer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -133,6 +133,8 @@
      * <code>DataLine</code>.
      *
      * @param info describes the desired line
+     * @return a line that is available for use and that matches the description
+     * in the specified {@code Line.Info} object
      * @throws LineUnavailableException if a matching line
      * is not available due to resource restrictions
      * @throws IllegalArgumentException if this mixer does
--- a/jdk/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -116,6 +116,7 @@
      * given a particular source format.
      * If no target format encodings are supported for this source format,
      * an array of length 0 is returned.
+     * @param sourceFormat format of the incoming data
      * @return array of supported target format encodings.
      */
     public abstract AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat);
@@ -146,6 +147,8 @@
      * supported by the format converter
      * If no target formats with the specified encoding are supported
      * for this source format, an array of length 0 is returned.
+     * @param targetEncoding desired encoding of the stream after processing
+     * @param sourceFormat format of the incoming data
      * @return array of supported target formats.
      */
     public abstract AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat);
--- a/jdk/src/share/classes/javax/swing/SwingWorker.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/swing/SwingWorker.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -405,6 +405,7 @@
      *
      */
     @SafeVarargs
+    @SuppressWarnings("varargs") // Passing chunks to add is safe
     protected final void publish(V... chunks) {
         synchronized (this) {
             if (doProcess == null) {
--- a/jdk/src/share/classes/javax/swing/text/GlyphView.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -514,7 +514,7 @@
             int x1 = x0 + (int) painter.getSpan(this, p0, p1, getTabExpander(), x0);
 
             // calculate y coordinate
-            int y = alloc.y + alloc.height - (int) painter.getDescent(this);
+            int y = alloc.y + (int)(painter.getHeight(this) - painter.getDescent(this));
             if (underline) {
                 int yTmp = y + 1;
                 g.drawLine(x0, yTmp, x1, yTmp);
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -75,7 +75,10 @@
             throw new ClassCastException
                 ("context must be of type DOMCryptoContext");
         }
-        if (parent == null || !(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
+        if (parent == null) {
+            throw new NullPointerException();
+        }
+        if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
             throw new ClassCastException("parent must be of type DOMStructure");
         }
         transformElem = (Element)
@@ -90,7 +93,10 @@
             throw new ClassCastException
                 ("context must be of type DOMCryptoContext");
         }
-        if (parent == null || !(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
+        if (parent == null) {
+            throw new NullPointerException();
+        }
+        if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
             throw new ClassCastException("parent must be of type DOMStructure");
         }
         transformElem = (Element)
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java	Tue Aug 13 18:34:12 2013 -0700
@@ -76,7 +76,10 @@
             throw new ClassCastException
                 ("context must be of type DOMCryptoContext");
         }
-        if (parent == null || !(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
+        if (parent == null) {
+            throw new NullPointerException();
+        }
+        if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
             throw new ClassCastException("parent must be of type DOMStructure");
         }
         transformElem = (Element)
@@ -91,7 +94,10 @@
             throw new ClassCastException
                 ("context must be of type DOMCryptoContext");
         }
-        if (parent == null || !(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
+        if (parent == null) {
+            throw new NullPointerException();
+        }
+        if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
             throw new ClassCastException("parent must be of type DOMStructure");
         }
         transformElem = (Element)
--- a/jdk/src/share/classes/sun/awt/AppContext.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/awt/AppContext.java	Tue Aug 13 18:34:12 2013 -0700
@@ -310,11 +310,13 @@
                     // and excludes applets because by the time applet starts
                     // a number of contexts have already been created by the plugin.
                     if (numAppContexts.get() == 0) {
-                        // This check is not necessary, its purpose is to help
-                        // Plugin devs to catch all the cases of main AC creation.
                         if (System.getProperty("javaplugin.version") == null &&
                                 System.getProperty("javawebstart.version") == null) {
                             initMainAppContext();
+                        } else if (System.getProperty("javafx.version") != null &&
+                                threadGroup.getParent() != null) {
+                            // Swing inside JavaFX case
+                            SunToolkit.createNewAppContext();
                         }
                     }
 
--- a/jdk/src/share/classes/sun/invoke/anon/ConstantPoolPatch.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/invoke/anon/ConstantPoolPatch.java	Tue Aug 13 18:34:12 2013 -0700
@@ -418,7 +418,7 @@
 
     private static final Map<Class<?>, Byte> CONSTANT_VALUE_CLASS_TAG
         = new IdentityHashMap<Class<?>, Byte>();
-    private static final Class[] CONSTANT_VALUE_CLASS = new Class[16];
+    private static final Class<?>[] CONSTANT_VALUE_CLASS = new Class<?>[16];
     static {
         Object[][] values = {
             {Integer.class, CONSTANT_Integer},
--- a/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheValue.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthCacheValue.java	Tue Aug 13 18:34:12 2013 -0700
@@ -37,6 +37,8 @@
 
 public abstract class AuthCacheValue implements Serializable {
 
+    static final long serialVersionUID = 735249334068211611L;
+
     public enum Type {
         Proxy,
         Server
--- a/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java	Tue Aug 13 18:34:12 2013 -0700
@@ -51,6 +51,8 @@
 
 public abstract class AuthenticationInfo extends AuthCacheValue implements Cloneable {
 
+    static final long serialVersionUID = -2588378268010453259L;
+
     // Constants saying what kind of authroization this is.  This determines
     // the namespace in the hash table lookup.
     public static final char SERVER_AUTHENTICATION = 's';
--- a/jdk/src/share/classes/sun/reflect/annotation/AnnotationParser.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/reflect/annotation/AnnotationParser.java	Tue Aug 13 18:34:12 2013 -0700
@@ -88,6 +88,7 @@
      * @param selectAnnotationClasses an array of annotation types to select when parsing
      */
     @SafeVarargs
+    @SuppressWarnings("varargs") // selectAnnotationClasses is used safely
     static Map<Class<? extends Annotation>, Annotation> parseSelectAnnotations(
                 byte[] rawAnnotations,
                 ConstantPool constPool,
--- a/jdk/src/share/classes/sun/rmi/runtime/Log.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/runtime/Log.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,6 +61,7 @@
  * @author Laird Dornin
  * @since 1.4
  */
+@SuppressWarnings("deprecation")
 public abstract class Log {
 
     /** Logger re-definition of old RMI log values */
--- a/jdk/src/share/classes/sun/rmi/server/ActivatableRef.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/server/ActivatableRef.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@
 import java.rmi.server.RemoteRef;
 import java.rmi.server.RemoteStub;
 
+@SuppressWarnings("deprecation")
 public class ActivatableRef implements RemoteRef {
 
     private static final long serialVersionUID = 7579060052569229166L;
--- a/jdk/src/share/classes/sun/rmi/server/Dispatcher.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/server/Dispatcher.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 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
@@ -31,6 +31,7 @@
  * The Dispatcher interface allows the transport to make
  * the upcall to the server side remote reference.
  */
+@SuppressWarnings("deprecation")
 public interface Dispatcher {
 
     /**
--- a/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -67,6 +67,7 @@
  * @author      Peter Jones
  * @author      Laird Dornin
  */
+@SuppressWarnings("deprecation")
 public final class LoaderHandler {
 
     /** RMI class loader log level */
--- a/jdk/src/share/classes/sun/rmi/server/UnicastRef.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/server/UnicastRef.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -49,7 +49,8 @@
  * NOTE: There is a JDK-internal dependency on the existence of this
  * class's getLiveRef method (as it is inherited by UnicastRef2) in
  * the implementation of javax.management.remote.rmi.RMIConnector.
- **/
+ */
+@SuppressWarnings("deprecation")
 public class UnicastRef implements RemoteRef {
 
     /**
--- a/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -67,6 +67,7 @@
  * @author  Roger Riggs
  * @author  Peter Jones
  */
+@SuppressWarnings("deprecation")
 public class UnicastServerRef extends UnicastRef
     implements ServerRef, Dispatcher
 {
--- a/jdk/src/share/classes/sun/rmi/server/Util.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/server/Util.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -64,6 +64,7 @@
  * A utility class with static methods for creating stubs/proxies and
  * skeletons for remote objects.
  */
+@SuppressWarnings("deprecation")
 public final class Util {
 
     /** "server" package log level */
--- a/jdk/src/share/classes/sun/rmi/transport/DGCImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/transport/DGCImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -59,6 +59,7 @@
  *
  * @author Ann Wollrath
  */
+@SuppressWarnings("deprecation")
 final class DGCImpl implements DGC {
 
     /* dgc system log */
--- a/jdk/src/share/classes/sun/rmi/transport/StreamRemoteCall.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/transport/StreamRemoteCall.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -45,6 +45,7 @@
  *
  * @author Ann Wollrath
  */
+@SuppressWarnings("deprecation")
 public class StreamRemoteCall implements RemoteCall {
     private ConnectionInputStream in = null;
     private ConnectionOutputStream out = null;
--- a/jdk/src/share/classes/sun/rmi/transport/Transport.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/transport/Transport.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -47,6 +47,7 @@
  *
  * @author Ann Wollrath
  */
+@SuppressWarnings("deprecation")
 public abstract class Transport {
 
     /** "transport" package log level */
--- a/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -44,6 +44,7 @@
  * connect to the same host will automatically use the same
  * mechanism.
  */
+@SuppressWarnings("deprecation")
 public class RMIMasterSocketFactory extends RMISocketFactory {
 
     /** "proxy" package log level */
--- a/jdk/src/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -43,6 +43,7 @@
  *
  * @author Peter Jones
  */
+@SuppressWarnings("deprecation")
 final class ConnectionMultiplexer {
 
     /** "multiplex" log level */
--- a/jdk/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, 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
@@ -84,6 +84,7 @@
  * @author Ann Wollrath
  * @author Peter Jones
  */
+@SuppressWarnings("deprecation")
 public class TCPTransport extends Transport {
 
     /* tcp package log */
--- a/jdk/src/share/classes/sun/security/ec/ECDSASignature.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/security/ec/ECDSASignature.java	Tue Aug 13 18:34:12 2013 -0700
@@ -323,6 +323,7 @@
 
     // set parameter, not supported. See JCA doc
     @Override
+    @Deprecated
     protected void engineSetParameter(String param, Object value)
             throws InvalidParameterException {
         throw new UnsupportedOperationException("setParameter() not supported");
@@ -330,6 +331,7 @@
 
     // get parameter, not supported. See JCA doc
     @Override
+    @Deprecated
     protected Object engineGetParameter(String param)
             throws InvalidParameterException {
         throw new UnsupportedOperationException("getParameter() not supported");
--- a/jdk/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,10 +96,15 @@
         }
     }
 
-    // SecretKeySpec does not allow zero length keys, so we define our own class.
+    // SecretKeySpec does not allow zero length keys, so we define our
+    // own class.
+    //
+    // As an anonymous class cannot make any guarantees about serialization
+    // compatibility, it is nonsensical for an anonymous class to define a
+    // serialVersionUID. Suppress warnings relative to missing serialVersionUID
+    // field in the anonymous subclass of serializable SecretKey.
+    @SuppressWarnings("serial")
     private static final SecretKey NULL_KEY = new SecretKey() {
-        private static final long serialVersionUID = -8090049519656411362L;
-
         public byte[] getEncoded() {
             return new byte[0];
         }
--- a/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Tue Aug 13 18:34:12 2013 -0700
@@ -775,7 +775,7 @@
                 }
             }
             if (params != null) {
-                if (algorithm.equals(pbes2_OID)) {
+                if (algorithm.equals((Object)pbes2_OID)) {
                     algParams = AlgorithmParameters.getInstance("PBES2");
                 } else {
                     algParams = AlgorithmParameters.getInstance("PBE");
@@ -912,7 +912,7 @@
     private static String mapPBEParamsToAlgorithm(ObjectIdentifier algorithm,
         AlgorithmParameters algParams) throws NoSuchAlgorithmException {
         // Check for PBES2 algorithms
-        if (algorithm.equals(pbes2_OID) && algParams != null) {
+        if (algorithm.equals((Object)pbes2_OID) && algParams != null) {
             return algParams.toString();
         }
         return algorithm.toString();
@@ -1921,7 +1921,7 @@
                 }
 
                 safeContentsData = safeContents.getData();
-            } else if (contentType.equals(ContentInfo.ENCRYPTED_DATA_OID)) {
+            } else if (contentType.equals((Object)ContentInfo.ENCRYPTED_DATA_OID)) {
                 if (password == null) {
                    continue;
                 }
--- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -169,7 +169,7 @@
     /*
      * Drives the protocol state machine.
      */
-    private int                 connectionState;
+    private volatile int        connectionState;
 
     /*
      * Flag indicating if the next record we receive MUST be a Finished
@@ -1467,7 +1467,7 @@
      */
     @Override
     public boolean isClosed() {
-        return getConnectionState() == cs_APP_CLOSED;
+        return connectionState == cs_APP_CLOSED;
     }
 
     /**
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java	Tue Aug 13 18:34:12 2013 -0700
@@ -291,7 +291,8 @@
 
             String flags = args[n];
             String modifier = null;
-            if (flags.charAt(0) == '-') {
+
+            if (flags.startsWith("-")) {
                 int pos = flags.indexOf(':');
                 if (pos > 0) {
                     modifier = flags.substring(pos+1);
@@ -299,7 +300,14 @@
                 }
             }
 
-            if (collator.compare(flags, "-keystore") == 0) {
+            if (!flags.startsWith("-")) {
+                if (jarfile == null) {
+                    jarfile = flags;
+                } else {
+                    alias = flags;
+                    ckaliases.add(alias);
+                }
+            } else if (collator.compare(flags, "-keystore") == 0) {
                 if (++n == args.length) usageNoArg();
                 keystore = args[n];
             } else if (collator.compare(flags, "-storepass") ==0) {
@@ -380,18 +388,9 @@
                         collator.compare(flags, "-help") == 0) {
                 fullusage();
             } else {
-                if (!flags.startsWith("-")) {
-                    if (jarfile == null) {
-                        jarfile = flags;
-                    } else {
-                        alias = flags;
-                        ckaliases.add(alias);
-                    }
-                } else {
-                    System.err.println(
-                            rb.getString("Illegal.option.") + flags);
-                    usage();
-                }
+                System.err.println(
+                        rb.getString("Illegal.option.") + flags);
+                usage();
             }
         }
 
--- a/jdk/src/share/classes/sun/swing/AccumulativeRunnable.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/swing/AccumulativeRunnable.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -121,6 +121,7 @@
      * @param args the arguments to accumulate
      */
     @SafeVarargs
+    @SuppressWarnings("varargs") // Copying args is safe
     public final synchronized void add(T... args) {
         boolean isSubmitted = true;
         if (arguments == null) {
--- a/jdk/src/share/classes/sun/tools/asm/Assembler.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/tools/asm/Assembler.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -91,9 +91,9 @@
         add(new Instruction(where, opc, flagNoCovered));
     }
 
-    static Vector SourceClassList = new Vector();
+    static Vector<String> SourceClassList = new Vector<>();
 
-    static Vector TmpCovTable = new Vector();
+    static Vector<String> TmpCovTable = new Vector<>();
 
     static int[]  JcovClassCountArray = new int[CT_LAST_KIND + 1];
 
@@ -177,8 +177,8 @@
               case opc_lookupswitch: {
                 SwitchData sw = (SwitchData)inst.value;
                 optimize(env, sw.defaultLabel);
-                for (Enumeration e = sw.tab.elements() ; e.hasMoreElements();) {
-                    optimize(env, (Label)e.nextElement());
+                for (Enumeration<Label> e = sw.tab.elements() ; e.hasMoreElements();) {
+                    optimize(env, e.nextElement());
                 }
                 return;
               }
@@ -186,8 +186,8 @@
               case opc_try: {
                 TryData td = (TryData)inst.value;
                 td.getEndLabel().pc = NEEDED;
-                for (Enumeration e = td.catches.elements() ; e.hasMoreElements();) {
-                    CatchData cd = (CatchData)e.nextElement();
+                for (Enumeration<CatchData> e = td.catches.elements() ; e.hasMoreElements();) {
+                    CatchData cd = e.nextElement();
                     optimize(env, cd.getLabel());
                 }
                 break;
@@ -237,9 +237,11 @@
         // Collect constants for arguments only
         // if a local variable table is generated
         if ((field != null) && env.debug_vars()) {
-            if (field.getArguments() != null) {
-                for (Enumeration e = field.getArguments().elements() ; e.hasMoreElements() ;) {
-                    MemberDefinition f = (MemberDefinition)e.nextElement();
+            @SuppressWarnings("unchecked")
+            Vector<MemberDefinition> v = (Vector<MemberDefinition>)field.getArguments();
+            if (v != null) {
+                for (Enumeration<MemberDefinition> e = v.elements() ; e.hasMoreElements() ;) {
+                    MemberDefinition f = e.nextElement();
                     tab.put(f.getName().toString());
                     tab.put(f.getType().getTypeSignature());
                 }
@@ -355,16 +357,16 @@
               case opc_lookupswitch: {
                 SwitchData sw = (SwitchData)inst.value;
                 balance(sw.defaultLabel, depth);
-                for (Enumeration e = sw.tab.elements() ; e.hasMoreElements();) {
-                    balance((Label)e.nextElement(), depth);
+                for (Enumeration<Label> e = sw.tab.elements() ; e.hasMoreElements();) {
+                    balance(e.nextElement(), depth);
                 }
                 return;
               }
 
               case opc_try: {
                 TryData td = (TryData)inst.value;
-                for (Enumeration e = td.catches.elements() ; e.hasMoreElements();) {
-                    CatchData cd = (CatchData)e.nextElement();
+                for (Enumeration<CatchData> e = td.catches.elements() ; e.hasMoreElements();) {
+                    CatchData cd = e.nextElement();
                     balance(cd.getLabel(), depth + 1);
                 }
                 break;
@@ -383,9 +385,10 @@
 
         if ((field != null) && field.getArguments() != null) {
               int sum = 0;
-              Vector v = field.getArguments();
-              for (Enumeration e = v.elements(); e.hasMoreElements(); ) {
-                  MemberDefinition f = ((MemberDefinition)e.nextElement());
+              @SuppressWarnings("unchecked")
+              Vector<MemberDefinition> v = (Vector<MemberDefinition>)field.getArguments();
+              for (Enumeration<MemberDefinition> e = v.elements(); e.hasMoreElements(); ) {
+                  MemberDefinition f = e.nextElement();
                   sum += f.getType().stackSize();
               }
               maxvar = sum;
@@ -441,8 +444,8 @@
             if (inst.opc == opc_try) {
                 TryData td = (TryData)inst.value;
                 writeExceptions(env, out, tab, inst.next, td.getEndLabel());
-                for (Enumeration e = td.catches.elements() ; e.hasMoreElements();) {
-                    CatchData cd = (CatchData)e.nextElement();
+                for (Enumeration<CatchData> e = td.catches.elements() ; e.hasMoreElements();) {
+                    CatchData cd = e.nextElement();
                     //System.out.println("EXCEPTION: " + env.getSource() + ", pc=" + inst.pc + ", end=" + td.getEndLabel().pc + ", hdl=" + cd.getLabel().pc + ", tp=" + cd.getType());
                     out.writeShort(inst.pc);
                     out.writeShort(td.getEndLabel().pc);
@@ -463,11 +466,12 @@
      * Write the coverage table
      */
     public void writeCoverageTable(Environment env, ClassDefinition c, DataOutputStream out, ConstantPool tab, long whereField) throws IOException {
-        Vector TableLot = new Vector();         /* Coverage table */
+        Vector<Cover> TableLot = new Vector<>();         /* Coverage table */
         boolean begseg = false;
         boolean begmeth = false;
+        @SuppressWarnings("deprecation")
         long whereClass = ((SourceClass)c).getWhere();
-        Vector whereTry = new Vector();
+        Vector<Long> whereTry = new Vector<>();
         int numberTry = 0;
         int count = 0;
 
@@ -484,8 +488,8 @@
                 }
                 if (!begseg && !inst.flagNoCovered ) {
                   boolean findTry = false;
-                  for (Enumeration e = whereTry.elements(); e.hasMoreElements();) {
-                       if ( ((Long)(e.nextElement())).longValue() == inst.where) {
+                  for (Enumeration<Long> e = whereTry.elements(); e.hasMoreElements();) {
+                       if (e.nextElement().longValue() == inst.where) {
                               findTry = true;
                               break;
                        }
@@ -546,7 +550,7 @@
               }
 
               case opc_try: {
-                whereTry.addElement(new Long(inst.where));
+                whereTry.addElement(Long.valueOf(inst.where));
                 begseg = false;
                 break;
               }
@@ -569,8 +573,8 @@
               }
               case opc_lookupswitch: {
                 SwitchData sw = (SwitchData)inst.value;
-                for (Enumeration e = sw.sortedKeys(); e.hasMoreElements() ; ) {
-                     Integer v = (Integer)e.nextElement();
+                for (Enumeration<Integer> e = sw.sortedKeys(); e.hasMoreElements() ; ) {
+                     Integer v = e.nextElement();
                      TableLot.addElement(new Cover(CT_CASE, sw.whereCase(v), inst.pc));
                      count++;
                 }
@@ -591,7 +595,7 @@
 
         out.writeShort(count);
         for (int i = 0; i < count; i++) {
-           Lot = (Cover)TableLot.elementAt(i);
+           Lot = TableLot.elementAt(i);
            ln = (Lot.Addr >> WHEREOFFSETBITS);
            pos = (Lot.Addr << (64 - WHEREOFFSETBITS)) >> (64 - WHEREOFFSETBITS);
            out.writeShort(Lot.NumCommand);
@@ -646,6 +650,7 @@
  */
 
 public void GenVecJCov(Environment env, ClassDefinition c, long Time) {
+        @SuppressWarnings("deprecation")
         String SourceFile = ((SourceClass)c).getAbsoluteName();
 
         TmpCovTable.addElement(createClassJcovElement(env, c));
@@ -667,6 +672,7 @@
  * generate file of coverage data
  */
 
+@SuppressWarnings("deprecation") // for JCovd.readLine() calls
 public void GenJCov(Environment env) {
 
      try {
@@ -686,14 +692,14 @@
                    while((CurrLine = JCovd.readLine()) != null ) {
                       if ( CurrLine.startsWith(JcovClassLine) ) {
                              first = true;
-                             for(Enumeration e = SourceClassList.elements(); e.hasMoreElements();) {
+                             for(Enumeration<String> e = SourceClassList.elements(); e.hasMoreElements();) {
                                  String clsName = CurrLine.substring(JcovClassLine.length());
                                  int idx = clsName.indexOf(' ');
 
                                  if (idx != -1) {
                                      clsName = clsName.substring(0, idx);
                                  }
-                                 Class = (String)e.nextElement();
+                                 Class = e.nextElement();
                                  if ( Class.compareTo(clsName) == 0) {
                                      first = false;
                                      break;
@@ -708,7 +714,7 @@
         }
         PrintStream CovFile = new PrintStream(new DataOutputStream(new FileOutputStream(outFile)));
         CovFile.println(JcovMagicLine);
-        for(Enumeration e = TmpCovTable.elements(); e.hasMoreElements();) {
+        for(Enumeration<String> e = TmpCovTable.elements(); e.hasMoreElements();) {
               CovFile.println(e.nextElement());
         }
         CovFile.close();
@@ -821,16 +827,16 @@
               case opc_lookupswitch: {
                 SwitchData sw = (SwitchData)inst.value;
                 flowFields(env, sw.defaultLabel, locals);
-                for (Enumeration e = sw.tab.elements() ; e.hasMoreElements();) {
-                    flowFields(env, (Label)e.nextElement(), locals);
+                for (Enumeration<Label> e = sw.tab.elements() ; e.hasMoreElements();) {
+                    flowFields(env, e.nextElement(), locals);
                 }
                 return;
               }
 
               case opc_try: {
-                Vector catches = ((TryData)inst.value).catches;
-                for (Enumeration e = catches.elements(); e.hasMoreElements();) {
-                    CatchData cd = (CatchData)e.nextElement();
+                Vector<CatchData> catches = ((TryData)inst.value).catches;
+                for (Enumeration<CatchData> e = catches.elements(); e.hasMoreElements();) {
+                    CatchData cd = e.nextElement();
                     flowFields(env, cd.getLabel(), locals);
                 }
                 break;
@@ -851,9 +857,10 @@
         // Initialize arguments
         if ((field != null) && (field.getArguments() != null)) {
             int reg = 0;
-            Vector v = field.getArguments();
-            for (Enumeration e = v.elements(); e.hasMoreElements(); ) {
-                MemberDefinition f = ((MemberDefinition)e.nextElement());
+            @SuppressWarnings("unchecked")
+            Vector<MemberDefinition> v = (Vector<MemberDefinition>)field.getArguments();
+            for (Enumeration<MemberDefinition> e = v.elements(); e.hasMoreElements(); ) {
+                MemberDefinition f = e.nextElement();
                 locals[reg] = f;
                 reg += f.getType().stackSize();
             }
@@ -867,9 +874,10 @@
             locals[i] = null;
         if ((field != null) && (field.getArguments() != null)) {
             int reg = 0;
-            Vector v = field.getArguments();
-            for (Enumeration e = v.elements(); e.hasMoreElements(); ) {
-                MemberDefinition f = ((MemberDefinition)e.nextElement());
+            @SuppressWarnings("unchecked")
+            Vector<MemberDefinition> v = (Vector<MemberDefinition>)field.getArguments();
+            for (Enumeration<MemberDefinition> e = v.elements(); e.hasMoreElements(); ) {
+                MemberDefinition f = e.nextElement();
                 locals[reg] = f;
                 lvtab.define(f, reg, 0, maxpc);
                 reg += f.getType().stackSize();
--- a/jdk/src/share/classes/sun/tools/asm/ConstantPool.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/tools/asm/ConstantPool.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,20 +42,20 @@
  */
 public final
 class ConstantPool implements RuntimeConstants {
-    Hashtable hash = new Hashtable(101);
+    Hashtable<Object,ConstantPoolData> hash = new Hashtable<>(101);
 
     /**
      * Find an entry, may return 0
      */
     public int index(Object obj) {
-        return ((ConstantPoolData)hash.get(obj)).index;
+        return hash.get(obj).index;
     }
 
     /**
      * Add an entry
      */
     public void put(Object obj) {
-        ConstantPoolData data = (ConstantPoolData)hash.get(obj);
+        ConstantPoolData data = hash.get(obj);
         if (data == null) {
             if (obj instanceof String) {
                 data = new StringConstantData(this, (String)obj);
@@ -87,8 +87,8 @@
         // Make a list of all the constant pool items
         for (int n = 0 ; n < 5 ; n++) {
             int first = count;
-            for (Enumeration e = hash.elements() ; e.hasMoreElements() ;) {
-                ConstantPoolData data = (ConstantPoolData)e.nextElement();
+            for (Enumeration<ConstantPoolData> e = hash.elements() ; e.hasMoreElements() ;) {
+                ConstantPoolData data = e.nextElement();
                 if (data.order() == n) {
                     keys[count] = sortKey(data);
                     list[count++] = data;
--- a/jdk/src/share/classes/sun/tools/asm/Instruction.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/tools/asm/Instruction.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -274,9 +274,9 @@
           case opc_lookupswitch: {
             SwitchData sw = (SwitchData)value;
             sw.defaultLabel = sw.defaultLabel.getDestination();
-            for (Enumeration e = sw.tab.keys() ; e.hasMoreElements() ; ) {
-                Integer k = (Integer)e.nextElement();
-                Label lbl = (Label)sw.tab.get(k);
+            for (Enumeration<Integer> e = sw.tab.keys() ; e.hasMoreElements() ; ) {
+                Integer k = e.nextElement();
+                Label lbl = sw.tab.get(k);
                 sw.tab.put(k, lbl.getDestination());
             }
 
@@ -389,8 +389,8 @@
             return;
 
           case opc_try:
-            for (Enumeration e = ((TryData)value).catches.elements() ; e.hasMoreElements() ;) {
-                CatchData cd = (CatchData)e.nextElement();
+            for (Enumeration<CatchData> e = ((TryData)value).catches.elements() ; e.hasMoreElements() ;) {
+                CatchData cd = e.nextElement();
                 if (cd.getType() != null) {
                     tab.put(cd.getType());
                 }
@@ -641,6 +641,7 @@
     /**
      * Generate code
      */
+    @SuppressWarnings("fallthrough")
     void write(DataOutputStream out, ConstantPool tab) throws IOException {
         switch (opc) {
           case opc_try:         case opc_label:         case opc_dead:
@@ -770,8 +771,8 @@
             }
             out.writeInt(sw.defaultLabel.pc - pc);
             out.writeInt(sw.tab.size());
-            for (Enumeration e = sw.sortedKeys(); e.hasMoreElements() ; ) {
-                Integer v = (Integer)e.nextElement();
+            for (Enumeration<Integer> e = sw.sortedKeys(); e.hasMoreElements() ; ) {
+                Integer v = e.nextElement();
                 out.writeInt(v.intValue());
                 out.writeInt(sw.get(v).pc - pc);
             }
--- a/jdk/src/share/classes/sun/tools/asm/SwitchData.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/tools/asm/SwitchData.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,23 +39,23 @@
 class SwitchData {
     int minValue, maxValue;
     Label defaultLabel = new Label();
-    Hashtable tab = new Hashtable();
+    Hashtable<Integer,Label> tab = new Hashtable<>();
 // JCOV
-    Hashtable whereCaseTab = null;
+    Hashtable<Integer,Long> whereCaseTab = null;
 // end JCOV
 
     /**
      * Get a label
      */
     public Label get(int n) {
-        return (Label)tab.get(new Integer(n));
+        return tab.get(n);
     }
 
     /**
      * Get a label
      */
     public Label get(Integer n) {
-        return (Label)tab.get(n);
+        return tab.get(n);
     }
 
     /**
@@ -73,7 +73,7 @@
                 maxValue = n;
             }
         }
-        tab.put(new Integer(n), lbl);
+        tab.put(Integer.valueOf(n), lbl);
     }
 
     /**
@@ -86,33 +86,35 @@
     /**
      * Return the keys of this enumaration sorted in ascending order
      */
-    public synchronized Enumeration sortedKeys() {
+    public synchronized Enumeration<Integer> sortedKeys() {
         return new SwitchDataEnumeration(tab);
     }
 
 // JCOV
     public void initTableCase() {
-        whereCaseTab = new Hashtable();
+        whereCaseTab = new Hashtable<Integer,Long>();
     }
     public void addTableCase(int index, long where) {
         if (whereCaseTab != null)
-            whereCaseTab.put(new Integer(index), new Long(where));
+            whereCaseTab.put(Integer.valueOf(index), Long.valueOf(where));
     }
+    // this puts String key into Hashtable<Integer,Long>
+    @SuppressWarnings("unchecked")
     public void addTableDefault(long where) {
         if (whereCaseTab != null)
-            whereCaseTab.put("default", new Long(where));
+            ((Hashtable)whereCaseTab).put("default", Long.valueOf(where));
     }
     public long whereCase(Object key) {
-        Long i = (Long) whereCaseTab.get(key);
-        return (i == null) ? 0 : i.longValue();
+        Long i = whereCaseTab.get(key);
+        return (i == null) ? 0L : i.longValue();
     }
     public boolean getDefault() {
-         return (whereCase("default") != 0);
+         return (whereCase("default") != 0L);
     }
 // end JCOV
 }
 
-class SwitchDataEnumeration implements Enumeration {
+class SwitchDataEnumeration implements Enumeration<Integer> {
     private Integer table[];
     private int current_index = 0;
 
@@ -121,11 +123,11 @@
      * hash table will be an Integer, with the value being a label.  The
      * enumeration returns the keys in sorted order.
      */
-    SwitchDataEnumeration(Hashtable tab) {
+    SwitchDataEnumeration(Hashtable<Integer,Label> tab) {
         table = new Integer[tab.size()];
         int i = 0;
-        for (Enumeration e = tab.keys() ; e.hasMoreElements() ; ) {
-            table[i++] = (Integer)e.nextElement();
+        for (Enumeration<Integer> e = tab.keys() ; e.hasMoreElements() ; ) {
+            table[i++] = e.nextElement();
         }
         Arrays.sort(table);
         current_index = 0;
@@ -141,7 +143,7 @@
     /**
      * Return the next key.
      */
-    public Object nextElement() {
+    public Integer nextElement() {
         return table[current_index++];
     }
 }
--- a/jdk/src/share/classes/sun/tools/asm/TryData.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/tools/asm/TryData.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
  */
 public final
 class TryData {
-    Vector catches = new Vector();
+    Vector<CatchData> catches = new Vector<>();
     Label endLabel = new Label();
 
     /**
@@ -51,7 +51,7 @@
      * Get a label
      */
     public CatchData getCatch(int n) {
-        return (CatchData)catches.elementAt(n);
+        return catches.elementAt(n);
     }
 
     /**
--- a/jdk/src/share/classes/sun/tools/jar/JarException.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/classes/sun/tools/jar/JarException.java	Tue Aug 13 18:34:12 2013 -0700
@@ -29,6 +29,9 @@
 
 public
 class JarException extends IOException {
+
+    static final long serialVersionUID = -4351820108009811497L;
+
     public JarException() {
         super();
     }
--- a/jdk/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/demo/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -54,7 +54,7 @@
  * jconsole's script console.
  */
 
-class ScriptShellPanel extends JPanel {
+public class ScriptShellPanel extends JPanel {
 
     private static final long serialVersionUID = 4116273141148726319L;
 
--- a/jdk/src/share/demo/scripting/jconsole-plugin/src/resources/jconsole.js	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/demo/scripting/jconsole-plugin/src/resources/jconsole.js	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -77,12 +77,37 @@
 function jcontext() {
     return plugin.getContext();
 }
-jcontext.docString = "returns JConsoleContext for the current jconsole plugin" 
+jcontext.docString = "returns JConsoleContext for the current jconsole plugin";
 
 function mbeanConnection() {
     return jcontext().getMBeanServerConnection();
 }
-mbeanConnection.docString = "returns current MBeanServer connection"
+mbeanConnection.docString = "returns current MBeanServer connection";
+
+// check if there is a build in sync function, define one if missing
+if (typeof sync === "undefined") {
+    var sync = function(func, obj) {
+        if (arguments.length < 1 || arguments.length > 2 ) {
+            throw "sync(function [,object]) parameter count mismatch";
+        }
+
+        var syncobj = (arguments.length == 2 ? obj : this);
+
+        if (!syncobj._syncLock) {
+            syncobj._syncLock = new Lock();
+        }
+
+        return function() {
+            syncobj._syncLock.lock();
+            try {
+                func.apply(null, arguments);
+            } finally {
+                syncobj._syncLock.unlock();
+            }
+        };
+    };
+    sync.docString = "synchronize a function, optionally on an object";
+}
 
 /**
  * Prints one liner help message for each function exposed here
@@ -188,22 +213,12 @@
 
 // wraps a script array as java.lang.Object[]
 function objectArray(array) {
-    var len = array.length;
-    var res = java.lang.reflect.Array.newInstance(java.lang.Object, len);
-    for (var i = 0; i < array.length; i++) {
-        res[i] = array[i];
-    }
-    return res;
+    return Java.to(array, "java.lang.Object[]");
 }
 
 // wraps a script (string) array as java.lang.String[]
 function stringArray(array) {
-    var len = array.length;
-    var res = java.lang.reflect.Array.newInstance(java.lang.String, len);
-    for (var i = 0; i < array.length; i++) {
-        res[i] = String(array[i]);
-    }
-    return res;
+    return Java.to(array, "java.lang.String[]");
 }
 
 // script array to Java List
@@ -286,16 +301,18 @@
  * will be of type FutureTask. When you need value, call 'get' on it.
  */
 function mbean(objName, async) {
+    var index;
+
     objName = objectName(objName);
     var info = mbeanInfo(objName);
     var attrs = info.attributes;
     var attrMap = new Object;
-    for (var index in attrs) {
+    for (index in attrs) {
         attrMap[attrs[index].name] = attrs[index];
     }
     var opers = info.operations;
     var operMap = new Object;
-    for (var index in opers) {
+    for (index in opers) {
         operMap[opers[index].name] = opers[index];
     }
 
@@ -318,21 +335,30 @@
                 } else {
                     return getMBeanAttribute(objName, name); 
                 }
-            } else if (isOperation(name)) {
+            } else {
+                return undefined;
+            }
+        },
+        __call__: function(name) {
+            if (isOperation(name)) {
                 var oper = operMap[name];
-                return function() {
-                    var params = objectArray(arguments);
-                    var sigs = oper.signature;
-                    var sigNames = new Array(sigs.length);
-                    for (var index in sigs) {
-                        sigNames[index] = sigs[index].getType();
-                    }
-                    if (async) {
-                        return invokeMBean.future(objName, name, 
-                                                  params, sigNames);
-                    } else {
-                        return invokeMBean(objName, name, params, sigNames);
-                    }
+
+                var params = [];
+                for (var j = 1; j < arguments.length; j++) {
+                    params[j-1]= arguments[j];
+                }
+
+                var sigs = oper.signature;
+
+                var sigNames = new Array(sigs.length);
+                for (var index in sigs) {
+                    sigNames[index] = sigs[index].getType();
+                }
+
+                if (async) {
+                    return invokeMBean.future(objName, name, params, sigNames);
+                } else {
+                    return invokeMBean(objName, name, params, sigNames);
                 }
             } else {
                 return undefined;
@@ -520,7 +546,7 @@
     } finally {
         lock.unlock();
     }
-}
+};
 
 /**
  * Causes current thread to sleep for specified
@@ -534,8 +560,7 @@
 sleep.docString = "wrapper for java.lang.Thread.sleep method";
 
 /**
- * Schedules a task to be executed once in
- * every N milliseconds specified. 
+ * Schedules a task to be executed once in N milliseconds specified.
  *
  * @param callback function or expression to evaluate
  * @param interval in milliseconds to sleep
@@ -549,15 +574,15 @@
     // start a new thread that sleeps given time
     // and calls callback in an infinite loop
     return (function() {
-         while (true) {
+         try {
              sleep(interval);
-             callback();
-         }
+         } catch (x) { }
+         callback();
     }).daemon();
 }
-setTimeout.docString = "calls given callback once after specified interval"
+setTimeout.docString = "calls given callback once after specified interval";
 
-/** 
+/**
  * Cancels a timeout set earlier.
  * @param tid timeout ID returned from setTimeout
  */
@@ -565,6 +590,45 @@
     // we just interrupt the timer thread
     tid.interrupt();
 }
+clearTimeout.docString = "interrupt a setTimeout timer";
+
+/**
+ * Schedules a task to be executed once in
+ * every N milliseconds specified.
+ *
+ * @param callback function or expression to evaluate
+ * @param interval in milliseconds to sleep
+ * @return timeout ID (which is nothing but Thread instance)
+ */
+function setInterval(callback, interval) {
+    if (! (callback instanceof Function)) {
+        callback = new Function(callback);
+    }
+
+    // start a new thread that sleeps given time
+    // and calls callback in an infinite loop
+    return (function() {
+         while (true) {
+             try {
+                 sleep(interval);
+             } catch (x) {
+                 break;
+             }
+             callback();
+         }
+    }).daemon();
+}
+setInterval.docString = "calls given callback every specified interval";
+
+/**
+ * Cancels a timeout set earlier.
+ * @param tid timeout ID returned from setTimeout
+ */
+function clearInterval(tid) {
+    // we just interrupt the timer thread
+    tid.interrupt();
+}
+clearInterval.docString = "interrupt a setInterval timer";
 
 /**
  * Simple access to thread local storage. 
@@ -680,7 +744,7 @@
         if (msg === undefined) msg = "undefined";
         if (msg === null) msg = "null";
         if (title == undefined) title = msg;
-        if (msgType == undefined) type = JOptionPane.INFORMATION_MESSAGE;
+        if (msgType == undefined) msgType = JOptionPane.INFORMATION_MESSAGE;
         JOptionPane.showMessageDialog(window, msg, title, msgType);
     }
     if (isEventThread()) {
@@ -800,7 +864,7 @@
  * Clear the screen
  */
 function clear() {
-    (function() { window.clear(false) }).invokeLater();
+    (function() { window.clear(false); }).invokeLater();
 }
 clear.docString = "clears interactive console screen";
 
--- a/jdk/src/share/demo/scripting/jconsole-plugin/src/scripts/invoke.js	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/demo/scripting/jconsole-plugin/src/scripts/invoke.js	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -53,6 +53,6 @@
  *
  */
 function resetPeakThreadCount() {
-    return invokeMBean("java.lang:type=Threading", "resetPeakThreadCount", [], "");    
+    return invokeMBean("java.lang:type=Threading", "resetPeakThreadCount", [], {});    
 }
 
--- a/jdk/src/share/demo/scripting/jconsole-plugin/src/scripts/jstack.js	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/demo/scripting/jconsole-plugin/src/scripts/jstack.js	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,16 +43,16 @@
  * threads.'jstack' function which can be called once or periodically 
  * from a timer thread (calling it periodically would slow down the target
  * application). To call this once, just call 'jstack()' in script
- * console prompt. To call jtop in a timer thread, you can use
+ * console prompt. To call jstack in a timer thread, you can use
  *
- *     var t = setTimeout(function () { jstack(print); }, 5000); 
+ *     var t = setInterval(function () { jstack(print); }, 5000);
  *
  * The above call prints threads in sorted order for every 5 seconds.
  * The print output goes to OS console window from which jconsole was 
  * started. The timer can be cancelled later by clearTimeout() function
  * as shown below:
  * 
- *     clearTimeout(t);    
+ *     clearInterval(t);
  */
 
 
@@ -87,7 +87,7 @@
 
     var tmbean = newPlatformMXBeanProxy(
         "java.lang:type=Threading",
-        java.lang.management.ThreadMXBean);
+        java.lang.management.ThreadMXBean.class);
 
     var tids = tmbean.allThreadIds;
     var tinfos = tmbean["getThreadInfo(long[],int)"](tids, maxFrames);
--- a/jdk/src/share/demo/scripting/jconsole-plugin/src/scripts/jtop.js	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/demo/scripting/jconsole-plugin/src/scripts/jtop.js	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -45,14 +45,14 @@
  * To call this once, just call 'jtop()' in script console prompt. 
  * To call jtop in a timer thread, you can use
  *
- *     var t = setTimeout(function () { jtop(print); }, 2000); 
+ *     var t = setInterval(function () { jtop(print); }, 2000); 
  *
  * The above call prints threads in sorted order for every 2 seconds.
  * The print output goes to OS console window from which jconsole was 
  * started. The timer can be cancelled later by clearTimeout() function
  * as shown below:
- * 
- *     clearTimeout(t);    
+ *
+ *     clearInterval(t);
  */
 
 /**
@@ -62,10 +62,10 @@
 function getThreadList() {
     var tmbean = newPlatformMXBeanProxy(
         "java.lang:type=Threading",
-        java.lang.management.ThreadMXBean);
+        java.lang.management.ThreadMXBean.class);
 
     if (!tmbean.isThreadCpuTimeSupported()) {
-        return;
+        return java.util.Collections.EMPTY_LIST;
     }
 
     tmbean.setThreadCpuTimeEnabled(true);
--- a/jdk/src/share/demo/scripting/jconsole-plugin/src/scripts/sysprops.js	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/demo/scripting/jconsole-plugin/src/scripts/sysprops.js	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,16 +43,16 @@
  * properties.'sysprops' function which can be called once or periodically 
  * from a timer thread (calling it periodically would slow down the target
  * application). To call this once, just call 'sysprops()' in script
- * console prompt. To call jtop in a timer thread, you can use
+ * console prompt. To call sysprops in a timer thread, you can use
  *
- *     var t = setTimeout(function () { sysprops(print); }, 5000); 
+ *     var t = setInterval(function () { sysprops(print); }, 5000);
  *
  * The above call prints threads in sorted order for every 5 seconds.
  * The print output goes to OS console window from which jconsole was 
  * started. The timer can be cancelled later by clearTimeout() function
  * as shown below:
  * 
- *     clearTimeout(t);    
+ *     clearInterval(t);
  */
 
 
@@ -62,7 +62,7 @@
 function getSystemProps() {
     var runtimeBean = newPlatformMXBeanProxy(
                 "java.lang:type=Runtime",
-                java.lang.management.RuntimeMXBean);
+                java.lang.management.RuntimeMXBean.class);
     return runtimeBean.systemProperties;
 }
 
--- a/jdk/src/share/sample/scripting/scriptpad/README.txt	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/sample/scripting/scriptpad/README.txt	Tue Aug 13 18:34:12 2013 -0700
@@ -108,7 +108,7 @@
       java -Dcom.sun.management.jmxremote.port=1090          \
            -Dcom.sun.management.jmxremote.ssl=false          \
            -Dcom.sun.management.jmxremote.authenticate=false \
-           -jar $JDK_HOME/demo/jfc/Java2D/Java2Demo.jar
+           -jar $JDK_HOME/demo/jfc/Font2DTest/Font2DTest.jar
 
 (2) Start scriptpad and click on "Tools->JMX Connect" menu.
     In the prompt, enter "localhost:1090" to connect to the above
--- a/jdk/src/share/sample/scripting/scriptpad/src/resources/conc.js	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/sample/scripting/scriptpad/src/resources/conc.js	Tue Aug 13 18:34:12 2013 -0700
@@ -221,7 +221,7 @@
  * @return timeout ID (which is nothing but Thread instance)
  */
 function setTimeout(callback, interval) {
-    if (! (callback instanceof Function) && typeof callback !== "function") {
+    if (! (callback instanceof Function)) {
         callback = new Function(callback);
     }
 
@@ -255,7 +255,7 @@
  * @return timeout ID (which is nothing but Thread instance)
  */
 function setInterval(callback, interval) {
-    if (! (callback instanceof Function) && typeof callback !== "function") {
+    if (! (callback instanceof Function)) {
         callback = new Function(callback);
     }
 
--- a/jdk/src/share/sample/scripting/scriptpad/src/resources/mm.js	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/share/sample/scripting/scriptpad/src/resources/mm.js	Tue Aug 13 18:34:12 2013 -0700
@@ -159,22 +159,12 @@
 
 // wraps a script array as java.lang.Object[]
 function objectArray(array) {
-    var len = array.length;
-    var res = java.lang.reflect.Array.newInstance(java.lang.Object, len);
-    for (var i = 0; i < array.length; i++) {
-        res[i] = array[i];
-    }
-    return res;
+    return Java.to(array, "java.lang.Object[]");
 }
 
 // wraps a script (string) array as java.lang.String[]
 function stringArray(array) {
-    var len = array.length;
-    var res = java.lang.reflect.Array.newInstance(java.lang.String, len);
-    for (var i = 0; i < array.length; i++) {
-        res[i] = String(array[i]);
-    }
-    return res;
+    return Java.to(array, "java.lang.String[]");
 }
 
 // script array to Java List
@@ -284,26 +274,35 @@
         __get__: function (name) {
             if (isAttribute(name)) {
                 if (async) {
-                    return getMBeanAttribute.future(objName, name);
+                    return getMBeanAttribute.future(objName, name); 
                 } else {
-                    return getMBeanAttribute(objName, name);
+                    return getMBeanAttribute(objName, name); 
                 }
-            } else if (isOperation(name)) {
+            } else {
+                return undefined;
+            }
+        },
+        __call__: function(name) {
+            if (isOperation(name)) {
                 var oper = operMap[name];
-                return function() {
-                    var params = objectArray(arguments);
-                    var sigs = oper.signature;
-                    var sigNames = new Array(sigs.length);
-                    for (var index in sigs) {
-                        sigNames[index] = sigs[index].getType();
-                    }
-                    if (async) {
-                        return invokeMBean.future(objName, name,
-                                                  params, sigNames);
-                    } else {
-                        return invokeMBean(objName, name, params, sigNames);
-                    }
-                };
+
+                var params = [];
+                for (var j = 1; j < arguments.length; j++) {
+                    params[j-1]= arguments[j];
+                }
+
+                var sigs = oper.signature;
+
+                var sigNames = new Array(sigs.length);
+                for (var index in sigs) {
+                    sigNames[index] = sigs[index].getType();
+                }
+
+                if (async) {
+                    return invokeMBean.future(objName, name, params, sigNames);
+                } else {
+                    return invokeMBean(objName, name, params, sigNames);
+                }
             } else {
                 return undefined;
             }
--- a/jdk/src/solaris/classes/sun/print/UnixPrintJob.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintJob.java	Tue Aug 13 18:34:12 2013 -0700
@@ -334,6 +334,10 @@
             throw new PrintException("can't get print data: " + e.toString());
         }
 
+        if (data == null) {
+            throw new PrintException("Null print data.");
+        }
+
         if (flavor == null || (!service.isDocFlavorSupported(flavor))) {
             notifyEvent(PrintJobEvent.JOB_FAILED);
             throw new PrintJobFlavorException("invalid flavor", flavor);
--- a/jdk/src/solaris/native/java/lang/java_props_md.c	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/solaris/native/java/lang/java_props_md.c	Tue Aug 13 18:34:12 2013 -0700
@@ -361,6 +361,25 @@
             *std_encoding = "Big5-HKSCS-2001";
         }
 #endif
+#ifdef MACOSX
+        /*
+         * For the case on MacOS X where encoding is set to US-ASCII, but we
+         * don't have any encoding hints from LANG/LC_ALL/LC_CTYPE, use UTF-8
+         * instead.
+         *
+         * The contents of ASCII files will still be read and displayed
+         * correctly, but so will files containing UTF-8 characters beyond the
+         * standard ASCII range.
+         *
+         * Specifically, this allows apps launched by double-clicking a .jar
+         * file to correctly read UTF-8 files using the default encoding (see
+         * 8011194).
+         */
+        if (strcmp(p,"US-ASCII") == 0 && getenv("LANG") == NULL &&
+            getenv("LC_ALL") == NULL && getenv("LC_CTYPE") == NULL) {
+            *std_encoding = "UTF-8";
+        }
+#endif
     }
 
     free(temp);
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Tue Aug 13 18:34:12 2013 -0700
@@ -794,6 +794,7 @@
             }
             putenv (new_env);
             free (new_env);
+            free (tmp_env);
         }
     }
 
--- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Tue Aug 13 18:34:12 2013 -0700
@@ -269,6 +269,13 @@
     static jboolean firstTime = JNI_TRUE;
 
     if (firstTime) {
+#ifdef DISABLE_XRENDER_BY_DEFAULT
+        if (verbose == JNI_FALSE) {
+            xrenderAvailable = JNI_FALSE;
+            firstTime = JNI_FALSE;
+            return xrenderAvailable;
+        }
+#endif
         AWT_LOCK();
         xrenderAvailable = IsXRenderAvailable(verbose);
         AWT_UNLOCK();
--- a/jdk/src/windows/classes/sun/print/Win32PrintJob.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/windows/classes/sun/print/Win32PrintJob.java	Tue Aug 13 18:34:12 2013 -0700
@@ -340,6 +340,10 @@
             throw new PrintException("can't get print data: " + e.toString());
         }
 
+        if (data == null) {
+            throw new PrintException("Null print data.");
+        }
+
         if (flavor == null || (!service.isDocFlavorSupported(flavor))) {
             notifyEvent(PrintJobEvent.JOB_FAILED);
             throw new PrintJobFlavorException("invalid flavor", flavor);
--- a/jdk/src/windows/native/java/lang/java_props_md.c	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/windows/native/java/lang/java_props_md.c	Tue Aug 13 18:34:12 2013 -0700
@@ -443,6 +443,7 @@
                     case  0: sprops.os_name = "Windows Vista";        break;
                     case  1: sprops.os_name = "Windows 7";            break;
                     case  2: sprops.os_name = "Windows 8";            break;
+                    case  3: sprops.os_name = "Windows 8.1";          break;
                     default: sprops.os_name = "Windows NT (unknown)";
                     }
                 } else {
@@ -450,6 +451,7 @@
                     case  0: sprops.os_name = "Windows Server 2008";    break;
                     case  1: sprops.os_name = "Windows Server 2008 R2"; break;
                     case  2: sprops.os_name = "Windows Server 2012";    break;
+                    case  3: sprops.os_name = "Windows Server 2012 R2"; break;
                     default: sprops.os_name = "Windows NT (unknown)";
                     }
                 }
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp	Tue Aug 13 18:34:12 2013 -0700
@@ -3528,8 +3528,12 @@
     if (ops == SAVE) {
         transTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
                        reinterpret_cast<void*>(static_cast<INT_PTR>(translation)));
-        deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
-                       reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag)));
+        if (deadKeyFlag) {
+            deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
+                         reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag)));
+        } else {
+            deadKeyFlagTable.remove(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)));
+        }
     }
 
     isDeadKey = deadKeyFlag;
--- a/jdk/src/windows/resource/java.manifest	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/src/windows/resource/java.manifest	Tue Aug 13 18:34:12 2013 -0700
@@ -44,8 +44,14 @@
   <!-- Indicate this JDK version is Windows 7 compatible -->
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
       <application>
+        <!-- Windows Vista -->
+        <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+        <!-- Windows 7 -->
         <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
-        <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+        <!-- Windows 8 -->
+        <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+        <!-- Windows 8.1 -->
+        <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
       </application>
     </compatibility>
 
--- a/jdk/test/ProblemList.txt	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/ProblemList.txt	Tue Aug 13 18:34:12 2013 -0700
@@ -138,6 +138,9 @@
 java/lang/instrument/RedefineBigClass.sh                        linux-x64
 java/lang/instrument/RetransformBigClass.sh                     linux-x64
 
+# 8021230
+java/lang/ThreadLocal/ThreadLocalSupplierTest.java              generic-all
+
 
 ############################################################################
 
@@ -367,9 +370,6 @@
 # Filed 6772009
 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
 
-# 8020435
-java/util/concurrent/CompletableFuture/Basic.java                generic-all
-
 # 7041639, Solaris DSA keypair generation bug
 java/util/TimeZone/TimeZoneDatePermissionCheck.sh               solaris-all
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8007267
+ * @summary [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
+ * @author leonid.romanov@oracle.com
+ * @run main DefaultMenuBarTest
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import sun.awt.*;
+import java.lang.reflect.Method;
+
+
+public class DefaultMenuBarTest {
+    static KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.META_MASK);
+
+    static volatile int listenerCallCounter = 0;
+    public static void main(String[] args) throws Exception {
+        if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {
+            System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
+            return;
+        }
+
+        System.setProperty("apple.laf.useScreenMenuBar", "true");
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(100);
+
+        robot.keyPress(KeyEvent.VK_META);
+        robot.keyPress(ks.getKeyCode());
+        robot.keyRelease(ks.getKeyCode());
+        robot.keyRelease(KeyEvent.VK_META);
+
+        toolkit.realSync();
+
+        if (listenerCallCounter != 1) {
+            throw new Exception("Test failed: ActionListener either wasn't called or was called more than once");
+        }
+    }
+
+    private static void createAndShowGUI() {
+        JMenu menu = new JMenu("File");
+        JMenuItem newItem = new JMenuItem("Open");
+
+        newItem.setAccelerator(ks);
+        newItem.addActionListener(
+            new ActionListener(){
+                public void actionPerformed(ActionEvent e) {
+                    listenerCallCounter++;
+                }
+            }
+        );
+        menu.add(newItem);
+
+        JMenuBar defaultMenu = new JMenuBar();
+        defaultMenu.add(menu);
+
+        // Application.getApplication().setDefaultMenuBar(defaultMenu);
+        try {
+            Class appClass = Class.forName("com.apple.eawt.Application");
+            if (appClass != null) {
+                Method method = appClass.getMethod("getApplication");
+                if (method != null) {
+                    Object app = method.invoke(null, new Object[]{});
+                    if (app != null) {
+                        method = appClass.getMethod("setDefaultMenuBar", new Class[]{JMenuBar.class});
+                        if (method != null) {
+                            method.invoke(app, new Object[]{defaultMenu});
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
--- a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, 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
@@ -49,6 +49,8 @@
     public static volatile boolean otherExceptionsCaught = false;
 
     public static void main(String [] args) throws Exception {
+        SunToolkit.createNewAppContext();
+
         ThreadGroup mainThreadGroup = Thread.currentThread().getThreadGroup();
 
         long at;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/event/KeyEvent/DeadKey/DeadKeySystemAssertionDialog.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Frame;
+import java.awt.Robot;
+import java.awt.TextField;
+import java.awt.Toolkit;
+import java.awt.event.KeyEvent;
+import sun.awt.SunToolkit;
+/*
+ * @test
+ * @bug 8013849
+ * @summary Awt assert on Hashtable.cpp:124
+ * @author alexandr.scherbatiy area=awt.event
+ * @run main/timeout=5 DeadKeySystemAssertionDialog
+ */
+
+public class DeadKeySystemAssertionDialog {
+
+    public static void main(String[] args) throws Exception {
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Frame frame = new Frame();
+        frame.setSize(300, 200);
+
+        TextField textField = new TextField();
+        frame.add(textField);
+
+        frame.setVisible(true);
+        toolkit.realSync();
+
+        textField.requestFocus();
+        toolkit.realSync();
+
+        // Check that the system assertion dialog does not block Java
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+        robot.keyPress(KeyEvent.VK_A);
+        robot.keyRelease(KeyEvent.VK_A);
+        toolkit.realSync();
+
+        frame.setVisible(false);
+        frame.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/System/MacEncoding/ExpectedEncoding.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/**
+ * Check that the value of file.encoding and sun.jnu.encoding match the expected
+ * values passed in on the command-line.
+ */
+public class ExpectedEncoding {
+    public static void main(String[] args) {
+        boolean failed = false;
+        if (args.length != 2) {
+            System.out.println("Usage:");
+            System.out.println("$ java ExpectedEncoding <expected file.encoding> <expected sun.jnu.encoding>");
+            System.out.println("$   use \"skip\" to skip checking property's value");
+            System.exit(1);
+        }
+        String expectFileEnc = args[0];
+        String expectSunJnuEnc = args[1];
+
+        String fileEnc = System.getProperty("file.encoding");
+        String jnuEnc = System.getProperty("sun.jnu.encoding");
+
+        if ("skip".equals(expectFileEnc)) {
+            System.err.println("Expected file.encoding is \"skip\", ignoring");
+        } else {
+            System.err.println("Expected file.encoding: " + expectFileEnc);
+            System.err.println("Actual file.encoding: " + fileEnc);
+            if (fileEnc == null || !fileEnc.equals(expectFileEnc)) {
+                failed = true;
+            }
+        }
+        if ("skip".equals(expectSunJnuEnc)) {
+            System.err.println("Expected sun.jnu.encoding is \"skip\", ignoring");
+        } else {
+            if (jnuEnc == null || !jnuEnc.equals(expectSunJnuEnc)) {
+                System.err.println("Expected sun.jnu.encoding: " + expectSunJnuEnc);
+                System.err.println("Actual sun.jnu.encoding: " + jnuEnc);
+                failed = true;
+            }
+        }
+
+        if (failed) {
+            throw new RuntimeException("Test Failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/System/MacEncoding/MacJNUEncoding.sh	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+#
+# 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.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+
+# @test
+# @bug 8003228
+# @summary Test the value of sun.jnu.encoding on Mac
+# @author Brent Christian
+#
+# @run shell MacJNUEncoding.sh
+
+# Only run test on Mac
+OS=`uname -s`
+case "$OS" in
+  Darwin )  ;;
+  * )
+    exit 0
+    ;;
+esac
+
+if [ "${TESTJAVA}" = "" ]
+then
+  echo "TESTJAVA not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+
+
+if [ "${TESTSRC}" = "" ]
+then
+  echo "TESTSRC not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+if [ "${TESTCLASSES}" = "" ]
+then
+  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+JAVAC="${COMPILEJAVA}"/bin/javac
+JAVA="${TESTJAVA}"/bin/java
+
+echo "Building test classes..."
+"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}"/ExpectedEncoding.java 
+
+echo ""
+echo "Running test for C locale"
+export LANG=C
+export LC_ALL=C
+"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" ExpectedEncoding US-ASCII UTF-8
+result1=$?
+
+echo ""
+echo "Running test for en_US.UTF-8 locale"
+export LANG=en_US.UTF-8
+export LC_ALL=en_US.UTF-8
+"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" ExpectedEncoding UTF-8 UTF-8
+result2=$?
+
+echo ""
+echo "Cleanup"
+rm ${TESTCLASSES}/ExpectedEncoding.class
+
+if [ ${result1} -ne 0 ] ; then
+    echo "Test failed for C locale"
+    echo "  LANG=\"${LANG}\""
+    echo "  LC_ALL=\"${LC_ALL}\""
+    exit ${result1}
+fi
+if [ ${result2} -ne 0 ] ; then
+    echo "Test failed for en_US.UTF-8 locale"
+    echo "  LANG=\"${LANG}\""
+    echo "  LC_ALL=\"${LC_ALL}\""
+    exit ${result2}
+fi
+exit 0
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/System/MacEncoding/TestFileEncoding.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.*;
+
+/*
+ * @test
+ * @bug 8011194
+ * @summary Test value of file.encoding for corresponding value of LANG, etc
+ * @library ../../../../tools/launcher/ ../
+ * @build TestHelper TestFileEncoding ExpectedEncoding
+ * @run main TestFileEncoding UTF-8
+ * @run main/othervm -Dfile.encoding=MyEncoding -DuserEncoding=MyEncoding TestFileEncoding MyEncoding
+ * @run main TestFileEncoding UTF-8 en_US.UTF-8
+ * @run main/othervm -Dfile.encoding=MyEncoding -DuserEncoding=MyEncoding TestFileEncoding MyEncoding en_US.UTF-8
+ * @run main TestFileEncoding US-ASCII C
+ * @run main/othervm -Dfile.encoding=MyEncoding -DuserEncoding=MyEncoding TestFileEncoding MyEncoding C
+ * @author Brent Christian
+ */
+
+/**
+ * Setup the environment and run a sub-test to check the expected value of
+ * file.encoding, based on the value(s) of encoding-related environment vars
+ * (LANG, LC_ALL, LC_CTYPE).
+ *
+ * The first argument (required) is the expected value of the
+ * file.encoding System property.
+ * The second argument (optional) is the value to set to the LANG/etc env vars.
+ */
+public class TestFileEncoding {
+    private static final String TEST_NAME = "ExpectedEncoding";
+
+    private String expectedEncoding; // Expected value for file.encoding
+    private String langVar = null; // Value to set for LANG, etc
+
+    private static Set<String> envToRm = new HashSet<>(3);
+    static {
+        // Take these vars out of the test's run environment, possibly adding
+        // our own value back in.
+        envToRm.add("LANG");
+        envToRm.add("LC_ALL");
+        envToRm.add("LC_CTYPE");
+    }
+
+    public TestFileEncoding(String expectedEncoding) {
+        this.expectedEncoding = expectedEncoding;
+    }
+
+    public TestFileEncoding(String expectedEncoding, String langVar) {
+        this.expectedEncoding = expectedEncoding;
+        this.langVar = langVar;
+    }
+
+    /*
+     * Launch ExpectedEncoding with the given parameters, check for the
+     * expected file.encoding.
+     */
+    private void run() {
+        String testClasses = System.getProperty("test.classes");
+
+        // Pick up VM opts
+        String vmOptsStr = System.getProperty("test.vm.opts");
+        System.out.println("test.vm.opts: " + vmOptsStr);
+        String[] vmOpts = new String[0];
+        if (vmOptsStr != null && !"".equals(vmOptsStr)) {
+            vmOpts = vmOptsStr.split(" ");
+            System.out.println("found vm options:");
+            for (String opt : vmOpts) {
+                System.out.println("  <" + opt + ">");
+            }
+        }
+
+        // Build java cmd
+        LinkedList<String> cmdList = new LinkedList<>();
+        cmdList.add(TestHelper.javaCmd);
+        for (String vmOpt : vmOpts) {
+            if (vmOpt != null && !vmOpt.equals("")) {
+                cmdList.add(vmOpt);
+            }
+        }
+
+        // See if the user specified a file.encoding that we should pass through
+        String userEncoding = System.getProperty("userEncoding");
+        if (userEncoding != null) {
+            cmdList.add("-Dfile.encoding="+userEncoding);
+        }
+
+        cmdList.add("-cp");
+        cmdList.add(testClasses);
+        cmdList.add(TEST_NAME);
+        cmdList.add(expectedEncoding);
+        cmdList.add("skip"); // ignore sun.jnu.encoding for this test
+
+        String cmdArray[] = new String[cmdList.size()];
+        cmdList.toArray(cmdArray);
+
+        // Run the test(s)
+        if (langVar == null) {
+            System.out.println("TestFileEncoding: Running with no envvars set");
+            TestHelper.TestResult tr = TestHelper.doExec(null, envToRm,
+                                                         cmdArray);
+            checkResult(tr);
+        } else {
+            runWithEnvVar("LANG", cmdArray);
+            runWithEnvVar("LC_ALL", cmdArray);
+            runWithEnvVar("LC_CTYPE", cmdArray);
+        }
+    }
+
+    /*
+     * Run the test, setting the environment named by envVarName to the value
+     * in langVar.
+     */
+    private void runWithEnvVar(String envVarName, String[] cmdArray) {
+        Map<String, String> envToAdd = new HashMap<>(1);
+        TestHelper.TestResult tr = null;
+
+        System.out.println("TestFileEncoding: Running with " + envVarName + "=" + langVar);
+        envToAdd.put(envVarName, langVar);
+        tr = TestHelper.doExec(envToAdd, envToRm, cmdArray);
+        checkResult(tr);
+    }
+
+    private void checkResult(TestHelper.TestResult tr) {
+        System.out.println(tr);
+        if (!tr.isOK()) {
+            throw new RuntimeException("TEST FAILED: !tr.isOK()");
+        }
+    }
+
+    public static void main(String[] args) {
+        TestFileEncoding cfe = null;
+        if (!TestHelper.isMacOSX) {
+            System.out.println("Test is currently only for Mac OS X - pass.");
+            return;
+        }
+        if (args.length == 1) {
+            cfe = new TestFileEncoding(args[0]);
+        } else if (args.length == 2) {
+            cfe = new TestFileEncoding(args[0], args[1]);
+        } else {
+            System.out.println("Usage: TestFileEncoding <expected file.encoding>");
+            System.out.println("       TestFileEncoding <expected file.encoding> <value for LANG/etc env var>");
+            return;
+        }
+        cfe.run();
+    }
+}
--- a/jdk/test/java/lang/System/MacJNUEncoding/ExpectedEncoding.java	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +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.
- *
- * 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.
- */
-
-/**
- * Check that the value of file.encoding and sun.jnu.encoding match the expected
- * values passed in on the command-line.
- */
-public class ExpectedEncoding {
-    public static void main(String[] args) {
-        boolean failed = false;
-        if (args.length != 2) {
-            System.out.println("Usage:");
-            System.out.println("$ java ExpectedEncoding <expected file.encoding> <expected sun.jnu.encoding>");
-            System.exit(1);
-        }
-        String expectFileEnc = args[0];
-        String expectSunJnuEnc = args[1];
-
-        String fileEnc = System.getProperty("file.encoding");
-        String jnuEnc = System.getProperty("sun.jnu.encoding");
-
-        if (fileEnc == null || !fileEnc.equals(expectFileEnc)) {
-            System.err.println("Expected file.encoding: " + expectFileEnc);
-            System.err.println("Actual file.encoding: " + fileEnc);
-            failed = true;
-        }
-        if (jnuEnc == null || !jnuEnc.equals(expectSunJnuEnc)) {
-            System.err.println("Expected sun.jnu.encoding: " + expectSunJnuEnc);
-            System.err.println("Actual sun.jnu.encoding: " + jnuEnc);
-            failed = true;
-        }
-        if (failed) {
-            throw new RuntimeException("Test Failed");
-        }
-    }
-}
--- a/jdk/test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh	Mon Aug 12 20:37:09 2013 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-#!/bin/sh
-
-#
-# 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.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-
-# @test
-# @bug 8003228
-# @summary Test the value of sun.jnu.encoding on Mac
-# @author Brent Christian
-#
-# @run shell MacJNUEncoding.sh
-
-# Only run test on Mac
-OS=`uname -s`
-case "$OS" in
-  Darwin )  ;;
-  * )
-    exit 0
-    ;;
-esac
-
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-if [ "${COMPILEJAVA}" = "" ]; then
-  COMPILEJAVA="${TESTJAVA}"
-fi
-
-
-if [ "${TESTSRC}" = "" ]
-then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-JAVAC="${COMPILEJAVA}"/bin/javac
-JAVA="${TESTJAVA}"/bin/java
-
-echo "Building test classes..."
-"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}"/ExpectedEncoding.java 
-
-echo ""
-echo "Running test for C locale"
-export LANG=C
-export LC_ALL=C
-"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" ExpectedEncoding US-ASCII UTF-8
-result1=$?
-
-echo ""
-echo "Running test for en_US.UTF-8 locale"
-export LANG=en_US.UTF-8
-export LC_ALL=en_US.UTF-8
-"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" ExpectedEncoding UTF-8 UTF-8
-result2=$?
-
-echo ""
-echo "Cleanup"
-rm ${TESTCLASSES}/ExpectedEncoding.class
-
-if [ ${result1} -ne 0 ] ; then
-    echo "Test failed for C locale"
-    echo "  LANG=\"${LANG}\""
-    echo "  LC_ALL=\"${LC_ALL}\""
-    exit ${result1}
-fi
-if [ ${result2} -ne 0 ] ; then
-    echo "Test failed for en_US.UTF-8 locale"
-    echo "  LANG=\"${LANG}\""
-    echo "  LC_ALL=\"${LC_ALL}\""
-    exit ${result2}
-fi
-exit 0
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/reflect/DefaultStaticTest/DefaultStaticInvokeTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Test locating and invoking default/static method that defined
+ *          in interfaces and/or in inheritance
+ * @bug 7184826
+ * @build helper.Mod helper.Declared DefaultStaticTestData
+ * @run testng DefaultStaticInvokeTest
+ * @author Yong Lu
+ */
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import org.testng.annotations.Test;
+
+import static helper.Mod.*;
+import static helper.Declared.*;
+import helper.Mod;
+
+public class DefaultStaticInvokeTest {
+
+    @Test(dataProvider = "testCasesAll",
+            dataProviderClass = DefaultStaticTestData.class)
+    public void testGetMethods(String testTarget, Object param)
+            throws Exception {
+        // test the methods retrieved by getMethods()
+        testMethods(ALL_METHODS, testTarget, param);
+    }
+
+    @Test(dataProvider = "testCasesAll",
+            dataProviderClass = DefaultStaticTestData.class)
+    public void testGetDeclaredMethods(String testTarget, Object param)
+            throws Exception {
+        // test the methods retrieved by getDeclaredMethods()
+        testMethods(DECLARED_ONLY, testTarget, param);
+    }
+
+    @Test(dataProvider = "testCasesAll",
+            dataProviderClass = DefaultStaticTestData.class)
+    public void testMethodInvoke(String testTarget, Object param)
+            throws Exception {
+        Class<?> typeUnderTest = Class.forName(testTarget);
+        MethodDesc[] expectedMethods = typeUnderTest.getAnnotationsByType(MethodDesc.class);
+
+        // test the method retrieved by Class.getMethod(String, Object[])
+        for (MethodDesc toTest : expectedMethods) {
+            String name = toTest.name();
+            Method m = getTestMethod(typeUnderTest, name, param);
+            testThisMethod(toTest, m, typeUnderTest, param);
+        }
+    }
+
+    @Test(dataProvider = "testCasesAll",
+            dataProviderClass = DefaultStaticTestData.class)
+    public void testMethodHandleInvoke(String testTarget, Object param)
+            throws Throwable {
+        Class<?> typeUnderTest = Class.forName(testTarget);
+        MethodDesc[] expectedMethods = typeUnderTest.getAnnotationsByType(MethodDesc.class);
+
+        for (MethodDesc toTest : expectedMethods) {
+            String mName = toTest.name();
+            Mod mod = toTest.mod();
+            if (mod != STATIC && typeUnderTest.isInterface()) {
+                return;
+            }
+
+            String result = null;
+            String expectedReturn = toTest.retval();
+
+            MethodHandle methodHandle = getTestMH(typeUnderTest, mName, param);
+            if (mName.equals("staticMethod")) {
+                result = (param == null)
+                        ? (String) methodHandle.invoke()
+                        : (String) methodHandle.invoke(param);
+            } else {
+                result = (param == null)
+                        ? (String) methodHandle.invoke(typeUnderTest.newInstance())
+                        : (String) methodHandle.invoke(typeUnderTest.newInstance(), param);
+            }
+
+            assertEquals(result, expectedReturn);
+        }
+
+    }
+
+    @Test(dataProvider = "testClasses",
+            dataProviderClass = DefaultStaticTestData.class)
+    public void testIAE(String testTarget, Object param)
+            throws ClassNotFoundException {
+
+        Class<?> typeUnderTest = Class.forName(testTarget);
+        MethodDesc[] expectedMethods = typeUnderTest.getAnnotationsByType(MethodDesc.class);
+
+        for (MethodDesc toTest : expectedMethods) {
+            String mName = toTest.name();
+            Mod mod = toTest.mod();
+            if (mod != STATIC && typeUnderTest.isInterface()) {
+                return;
+            }
+            Exception caught = null;
+            try {
+                getTestMH(typeUnderTest, mName, param, true);
+            } catch (Exception e) {
+                caught = e;
+            }
+            assertTrue(caught != null);
+            assertEquals(caught.getClass(), IllegalAccessException.class);
+        }
+    }
+    private static final String[] OBJECT_METHOD_NAMES = {
+        "equals",
+        "hashCode",
+        "getClass",
+        "notify",
+        "notifyAll",
+        "toString",
+        "wait",
+        "wait",
+        "wait",};
+    private static final String LAMBDA_METHOD_NAMES = "lambda$";
+    private static final HashSet<String> OBJECT_NAMES = new HashSet<>(Arrays.asList(OBJECT_METHOD_NAMES));
+    private static final boolean DECLARED_ONLY = true;
+    private static final boolean ALL_METHODS = false;
+
+    private void testMethods(boolean declaredOnly, String testTarget, Object param)
+            throws Exception {
+        Class<?> typeUnderTest = Class.forName(testTarget);
+        Method[] methods = declaredOnly
+                ? typeUnderTest.getDeclaredMethods()
+                : typeUnderTest.getMethods();
+
+        MethodDesc[] baseExpectedMethods = typeUnderTest.getAnnotationsByType(MethodDesc.class);
+        MethodDesc[] expectedMethods;
+
+        // If only declared filter out non-declared from expected result
+        if (declaredOnly) {
+            int nonDeclared = 0;
+            for (MethodDesc desc : baseExpectedMethods) {
+                if (desc.declared() == NO) {
+                    nonDeclared++;
+                }
+            }
+            expectedMethods = new MethodDesc[baseExpectedMethods.length - nonDeclared];
+            int i = 0;
+            for (MethodDesc desc : baseExpectedMethods) {
+                if (desc.declared() == YES) {
+                    expectedMethods[i++] = desc;
+                }
+            }
+        } else {
+            expectedMethods = baseExpectedMethods;
+        }
+
+        HashMap<String, Method> myMethods = new HashMap<>(methods.length);
+        for (Method m : methods) {
+            String mName = m.getName();
+            // don't add Object methods and method created from lambda expression
+            if ((!OBJECT_NAMES.contains(mName)) && (!mName.contains(LAMBDA_METHOD_NAMES))) {
+                myMethods.put(mName, m);
+            }
+        }
+        assertEquals(expectedMethods.length, myMethods.size());
+
+        for (MethodDesc toTest : expectedMethods) {
+
+            String name = toTest.name();
+            Method candidate = myMethods.get(name);
+
+            assertNotNull(candidate);
+            myMethods.remove(name);
+
+            testThisMethod(toTest, candidate, typeUnderTest, param);
+
+        }
+
+        // Should be no methods left since we remove all we expect to see
+        assertTrue(myMethods.isEmpty());
+    }
+
+    private void testThisMethod(MethodDesc toTest, Method method,
+            Class<?> typeUnderTest, Object param) throws Exception {
+        // Test modifiers, and invoke
+        Mod mod = toTest.mod();
+        String expectedReturn = toTest.retval();
+        switch (mod) {
+            case STATIC:
+                //assert candidate is static
+                assertTrue(Modifier.isStatic(method.getModifiers()));
+                assertFalse(method.isDefault());
+
+                // Test invoke it
+                assertEquals(tryInvoke(method, null, param), expectedReturn);
+                break;
+            case DEFAULT:
+                // if typeUnderTest is a class then instantiate and invoke
+                if (!typeUnderTest.isInterface()) {
+                    assertEquals(tryInvoke(
+                            method,
+                            typeUnderTest,
+                            param),
+                            expectedReturn);
+                }
+
+                //assert candidate is default
+                assertFalse(Modifier.isStatic(method.getModifiers()));
+                assertTrue(method.isDefault());
+                break;
+            case REGULAR:
+                // if typeUnderTest must be a class
+                assertEquals(tryInvoke(
+                        method,
+                        typeUnderTest,
+                        param),
+                        expectedReturn);
+
+                //assert candidate is neither default nor static
+                assertFalse(Modifier.isStatic(method.getModifiers()));
+                assertFalse(method.isDefault());
+                break;
+            case ABSTRACT:
+                //assert candidate is neither default nor static
+                assertFalse(Modifier.isStatic(method.getModifiers()));
+                assertFalse(method.isDefault());
+                break;
+            default:
+                assertFalse(true); //this should never happen
+                break;
+        }
+
+    }
+
+    private Object tryInvoke(Method m, Class<?> receiverType, Object param)
+            throws Exception {
+        Object receiver = receiverType == null ? null : receiverType.newInstance();
+        Object result = null;
+        if (param == null) {
+            result = m.invoke(receiver);
+        } else {
+            result = m.invoke(receiver, param);
+        }
+        return result;
+    }
+
+    private Method getTestMethod(Class clazz, String methodName, Object param)
+            throws NoSuchMethodException {
+        Class[] paramsType = (param != null)
+                ? new Class[]{Object.class}
+                : new Class[]{};
+        return clazz.getMethod(methodName, paramsType);
+    }
+
+    private MethodHandle getTestMH(Class clazz, String methodName, Object param)
+            throws Exception {
+        return getTestMH(clazz, methodName, param, false);
+    }
+
+    private MethodHandle getTestMH(Class clazz, String methodName,
+            Object param, boolean isNegativeTest)
+            throws Exception {
+        MethodType mType = (param != null)
+                ? MethodType.genericMethodType(1)
+                : MethodType.methodType(String.class);
+        MethodHandles.Lookup lookup = MethodHandles.lookup();
+        if (!isNegativeTest) {
+            return methodName.equals("staticMethod")
+                    ? lookup.findStatic(clazz, methodName, mType)
+                    : lookup.findVirtual(clazz, methodName, mType);
+        } else {
+            return methodName.equals("staticMethod")
+                    ? lookup.findVirtual(clazz, methodName, mType)
+                    : lookup.findStatic(clazz, methodName, mType);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/reflect/DefaultStaticTest/DefaultStaticTestData.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,401 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Test Data used for testing default/static method
+ *
+ * @author Yong Lu
+ */
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.testng.annotations.DataProvider;
+import org.testng.collections.Lists;
+
+import static helper.Mod.*;
+import static helper.Declared.*;
+import helper.Mod;
+import helper.Declared;
+import java.lang.annotation.Repeatable;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF1.defaultMethod", mod = DEFAULT, declared = YES)
+interface TestIF1 {
+
+    default String defaultMethod() {
+        return "TestIF1.defaultMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF1.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass1 implements TestIF1 {
+}
+
+@MethodDesc(name = "staticMethod", retval = "TestIF2.staticMethod", mod = STATIC, declared = YES)
+interface TestIF2 {
+
+    static String staticMethod() {
+        return "TestIF2.staticMethod";
+    }
+}
+
+@MethodDesc(name = "method", retval = "TestIF2.staticMethod", mod = REGULAR, declared = YES)
+class TestClass2 implements TestIF2 {
+
+    public String method() {
+        return TestIF2.staticMethod();
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF3.defaultMethod", mod = DEFAULT, declared = YES)
+@MethodDesc(name = "method", retval = "", mod = ABSTRACT, declared = YES)
+interface TestIF3 {
+
+    String method();
+
+    default String defaultMethod() {
+        return "TestIF3.defaultMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF3.defaultMethod", mod = DEFAULT, declared = NO)
+@MethodDesc(name = "method", retval = "TestClass3.method", mod = REGULAR, declared = YES)
+class TestClass3 implements TestIF3 {
+
+    public String method() {
+        return "TestClass3.method";
+    }
+}
+
+@MethodDesc(name = "staticMethod", retval = "TestIF4.staticMethod", mod = STATIC, declared = YES)
+@MethodDesc(name = "method", retval = "", mod = ABSTRACT, declared = YES)
+interface TestIF4 {
+
+    String method();
+
+    static String staticMethod() {
+        return "TestIF4.staticMethod";
+    }
+}
+
+@MethodDesc(name = "method", retval = "TestClass4.method", mod = REGULAR, declared = YES)
+class TestClass4 implements TestIF4 {
+
+    public String method() {
+        return "TestClass4.method";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF5.defaultMethod", mod = DEFAULT, declared = YES)
+@MethodDesc(name = "staticMethod", retval = "TestIF5.staticMethod", mod = STATIC, declared = YES)
+interface TestIF5 {
+
+    default String defaultMethod() {
+        return "TestIF5.defaultMethod";
+    }
+
+    static String staticMethod() {
+        return "TestIF5.staticMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF5.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass5 implements TestIF5 {
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF6.defaultMethod", mod = DEFAULT, declared = YES)
+@MethodDesc(name = "staticMethod", retval = "TestIF6.staticMethod", mod = STATIC, declared = YES)
+@MethodDesc(name = "method", retval = "", mod = ABSTRACT, declared = YES)
+interface TestIF6 {
+
+    String method();
+
+    default String defaultMethod() {
+        return "TestIF6.defaultMethod";
+    }
+
+    static String staticMethod() {
+        return "TestIF6.staticMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF6.defaultMethod", mod = DEFAULT, declared = NO)
+@MethodDesc(name = "method", retval = "TestClass6.method", mod = REGULAR, declared = YES)
+class TestClass6 implements TestIF6 {
+
+    public String method() {
+        return "TestClass6.method";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF7.TestClass7", mod = DEFAULT, declared = YES)
+interface TestIF7<T> {
+
+    default T defaultMethod(T t) {
+        return t;
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF7.TestClass7", mod = DEFAULT, declared = NO)
+class TestClass7<T> implements TestIF7<T> {
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF8.TestClass8", mod = DEFAULT, declared = YES)
+interface TestIF8<E> {
+
+    default <E> E defaultMethod(E e) {
+        return e;
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF8.TestClass8", mod = DEFAULT, declared = NO)
+class TestClass8<T> implements TestIF8<T> {
+};
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF9.defaultMethod", mod = DEFAULT, declared = YES)
+interface TestIF9 extends TestIF1 {
+
+    default String defaultMethod() {
+        return "TestIF9.defaultMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF9.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass9 implements TestIF9 {
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF9.defaultMethod", mod = DEFAULT, declared = NO)
+@MethodDesc(name = "method", retval = "TestIF9.defaultMethod", mod = REGULAR, declared = YES)
+class TestClass91 implements TestIF9, TestIF1 {
+
+    public String method() {
+        return defaultMethod();
+    }
+}
+
+@MethodDesc(name = "staticMethod", retval = "TestIF10.staticMethod", mod = STATIC, declared = YES)
+interface TestIF10 extends TestIF2 {
+
+    static String staticMethod() {
+
+        return "TestIF10.staticMethod";
+    }
+}
+
+@MethodDesc(name = "staticMethod", retval = "TestIF11.staticMethod", mod = STATIC, declared = YES)
+@MethodDesc(name = "defaultMethod", retval = "TestIF1.defaultMethod", mod = DEFAULT, declared = NO)
+interface TestIF11 extends TestIF1 {
+
+    static String staticMethod() {
+        return "TestIF11.staticMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF1.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass11 implements TestIF11 {
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF12.defaultMethod", mod = DEFAULT, declared = YES)
+@MethodDesc(name = "staticMethod", retval = "TestIF2.staticMethod", mod = STATIC, declared = NO)
+interface TestIF12 extends TestIF2 {
+
+    default String defaultMethod() {
+        return "TestIF12.defaultMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF12.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass12 implements TestIF12 {
+}
+
+//Diamond Case
+@MethodDesc(name = "defaultMethod", retval = "TestIF1.defaultMethod", mod = DEFAULT, declared = NO)
+interface TestIF1A extends TestIF1 {
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF1.defaultMethod", mod = DEFAULT, declared = NO)
+interface TestIF1B extends TestIF1 {
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF1.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass13 implements TestIF1A, TestIF1B {
+}
+
+//Diamond Override Case
+@MethodDesc(name = "defaultMethod", retval = "TestIF1C.defaultMethod", mod = DEFAULT, declared = YES)
+interface TestIF1C extends TestIF1 {
+
+    default String defaultMethod() {
+        return "TestIF1C.defaultMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF1D.defaultMethod", mod = DEFAULT, declared = YES)
+interface TestIF1D extends TestIF1 {
+
+    default String defaultMethod() {
+        return "TestIF1D.defaultMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestClass14.defaultMethod", mod = REGULAR, declared = YES)
+class TestClass14 implements TestIF1C, TestIF1D {
+
+    public String defaultMethod() {
+        return "TestClass14.defaultMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "", mod = ABSTRACT, declared = YES)
+interface TestIF15 extends TestIF1 {
+
+    String defaultMethod();
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestClass15.defaultMethod", mod = REGULAR, declared = YES)
+class TestClass15 implements TestIF15 {
+
+    public String defaultMethod() {
+        return "TestClass15.defaultMethod";
+    }
+}
+
+interface FuncInterface<T> {
+
+    String test(T t);
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF16.defaultMethod", mod = DEFAULT, declared = YES)
+interface TestIF16 {
+
+    default String defaultMethod() {
+        FuncInterface<Object> fi = o -> o.toString();
+        Object o = "TestIF16.defaultMethod";
+        return fi.test(o);
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF16.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass16 implements TestIF16 {
+};
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF17.defaultMethod", mod = DEFAULT, declared = YES)
+@MethodDesc(name = "staticMethod", retval = "TestIF17.staticMethod", mod = STATIC, declared = YES)
+interface TestIF17 {
+
+    default String defaultMethod() {
+        return staticMethod().replace("staticMethod", "defaultMethod");
+    }
+
+    public static String staticMethod() {
+        return "TestIF17.staticMethod";
+    }
+}
+
+@MethodDesc(name = "defaultMethod", retval = "TestIF17.defaultMethod", mod = DEFAULT, declared = NO)
+class TestClass17 implements TestIF17 {
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(MethodDescs.class)
+@interface MethodDesc {
+    String name();
+    String retval();
+    Mod mod();
+    Declared declared();
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface MethodDescs {
+    MethodDesc[] value();
+}
+
+public class DefaultStaticTestData {
+
+    /**
+     * Test data for DefaultStaticInvokeTest The format of inner array is: First
+     * data is the name of the class under test Second data used in test as the
+     * arguments used for the method call.
+     */
+    @DataProvider
+    static Object[][] testClasses() {
+        return new Object[][]{
+            {"TestClass1", null},
+            //{"TestClass2", null}, @ignore due to JDK-8009411
+            {"TestClass3", null},
+            //{"TestClass4", null}, @ignore due to JDK-8009411
+            //{"TestClass5", null}, @ignore due to JDK-8009411
+            //{"TestClass6", null}, @ignore due to JDK-8009411
+            {"TestClass7", "TestIF7.TestClass7"},
+            {"TestClass8", "TestIF8.TestClass8"},
+            {"TestClass9", null},
+            {"TestClass91", null},
+            //{"TestClass11", null}, @ignore due to JDK-8009411
+            //{"TestClass12", null}, @ignore due to JDK-8009411
+            {"TestClass13", null},
+            {"TestClass14", null},
+            {"TestClass15", null},
+            {"TestClass16", null}
+        //{"TestClass17", null} @ignore due to JDK-8009411
+        };
+    }
+
+    /**
+     * Test data for DefaultStaticInvokeTest The format of inner array is: First
+     * data is the name of the interface under test Second data used in test as
+     * the arguments used for the method call.
+     */
+    @DataProvider
+    static Object[][] testInterfaces() {
+        return new Object[][]{
+            {"TestIF1", null},
+            {"TestIF2", null},
+            {"TestIF3", null},
+            {"TestIF4", null},
+            {"TestIF5", null},
+            {"TestIF6", null},
+            {"TestIF7", "TestIF7.TestClass7"},
+            {"TestIF8", "TestIF8.TestClass8"},
+            {"TestIF9", null},
+            {"TestIF10", null},
+            {"TestIF11", null},
+            {"TestIF12", null},
+            {"TestIF1A", null},
+            {"TestIF1B", null},
+            {"TestIF1C", null},
+            {"TestIF1D", null},
+            {"TestIF15", null},
+            {"TestIF16", null},
+            {"TestIF17", null},};
+    }
+
+    @DataProvider
+    static Object[][] testCasesAll() {
+        List<Object[]> result = Lists.newArrayList();
+        result.addAll(Arrays.asList(testClasses()));
+        result.addAll(Arrays.asList(testInterfaces()));
+        return result.toArray(new Object[result.size()][]);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/reflect/DefaultStaticTest/helper/Declared.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Helper class used for testing default/static method
+ *
+ * @author Yong Lu
+ */
+
+package helper;
+
+public enum Declared {
+    YES,
+    NO
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/reflect/DefaultStaticTest/helper/Mod.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Helper class used for testing default/static method
+ *
+ * @author Yong Lu
+ */
+
+package helper;
+
+public enum Mod {
+    DEFAULT,
+    STATIC,
+    REGULAR,
+    ABSTRACT
+}
--- a/jdk/test/java/lang/reflect/Method/DefaultMethodModeling.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/lang/reflect/Method/DefaultMethodModeling.java	Tue Aug 13 18:34:12 2013 -0700
@@ -43,7 +43,7 @@
                               SuperIwithDefault.class, SuperIwithDefaultChild.class,
                               Base.class, Combo1.class, Combo2.class,
                               SonSuperIwithDefault.class, DaughterSuperIwithDefault.class, GrandchildSuperIwithDefault.class, D.class,
-                              B.class, C.class
+                              B.class, C.class, B1.class, D1.class
         };
 
         for(Class<?> clazz : classes) {
@@ -202,6 +202,17 @@
     public void quux(){}
 }
 
+class D1 implements SonSuperIwithDefault, DaughterSuperIwithDefault {
+    @ExpectedModel(declaringClass=D1.class)
+    public void foo(){}
+
+    @ExpectedModel(declaringClass=D1.class)
+    public void  baz(){}
+
+    @ExpectedModel(declaringClass=D1.class)
+    public void quux(){}
+}
+
 // -=-=-=-
 
 // What does re-abstraction look like?
@@ -222,3 +233,21 @@
     @ExpectedModel(declaringClass=C.class)
     public void bar(){}
 }
+
+abstract class A1 implements SonSuperIwithDefault {
+    @ExpectedModel(modifiers=PUBLIC|ABSTRACT, declaringClass=A1.class)
+    public abstract void baz();
+
+    @ExpectedModel(modifiers=PUBLIC|ABSTRACT, declaringClass=A1.class)
+    public abstract void foo();
+}
+
+class B1 extends A1 {
+    @ExpectedModel(declaringClass=B1.class)
+    @Override
+    public void foo(){;}
+
+    @ExpectedModel(declaringClass=B1.class)
+    @Override
+    public void baz(){}
+}
--- a/jdk/test/java/lang/reflect/Method/IsDefaultTest.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/lang/reflect/Method/IsDefaultTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -42,6 +42,12 @@
         classList.add(TestType2.class);
         classList.add(TestType3.class);
         classList.add(TestType4.class);
+        classList.add(TestType2.nestedTestType2.class);
+        classList.add(TestType5.class);
+        classList.add(TestType5.nestedTestType5.class);
+        classList.add(TestType6.class);
+        classList.add(TestType6.nestedTestType6.class);
+        classList.add(TestType7.class);
 
         for(Class<?> clazz: classList) {
             for(Method method: clazz.getDeclaredMethods()) {
@@ -78,11 +84,22 @@
 
     @ExpectedIsDefault(true)
     default void bar() {}; // Default method
+
+    @ExpectedIsDefault(true)
+    default void bar(int i) {}; // Default method
+
+    @ExpectedIsDefault(true)
+    default void bar(String i) {}; // Default method
 }
 
 class TestType2 {
     @ExpectedIsDefault(false)
     void bar() {};
+
+    interface nestedTestType2 {
+        @ExpectedIsDefault(true)
+        default void nestedBar() {};
+   }
 }
 
 class TestType3 implements TestType1 {
@@ -92,6 +109,10 @@
     @ExpectedIsDefault(false)
     @Override
     public void bar() {};
+
+    @ExpectedIsDefault(false)
+    @Override
+    public void bar(int i) {};
 }
 
 @interface TestType4 {
@@ -102,6 +123,51 @@
     String anotherValue() default "";
 }
 
+interface TestType5 {
+    @ExpectedIsDefault(false)
+    abstract void aFoo();
+
+    @ExpectedIsDefault(false)
+    static void sFoo() {};
+
+    @ExpectedIsDefault(true)
+    public default void pBar() {};
+
+    @ExpectedIsDefault(true)
+    public default String sBar() {return "";};
+
+    interface nestedTestType5{
+        @ExpectedIsDefault(false)
+        void nestedFoo();
+
+        @ExpectedIsDefault(true)
+        default void nestedBar() {};
+    }
+}
+
+class TestType6{
+    interface nestedTestType6 {
+        @ExpectedIsDefault(true)
+        default void nestedBar() {};
+
+        @ExpectedIsDefault(false)
+        void nestedFoo();
+   }
+
+    @ExpectedIsDefault(false)
+    void foo(nestedTestType6 n) {}
+}
+
+class TestType7 implements TestType6.nestedTestType6 {
+
+    @ExpectedIsDefault(false)
+    public void nestedFoo() {}
+
+    @ExpectedIsDefault(false)
+    @Override
+    public void nestedBar() {};
+}
+
 @Retention(RetentionPolicy.RUNTIME)
 @interface ExpectedIsDefault {
     boolean value();
--- a/jdk/test/java/math/BigDecimal/CompareToTests.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/math/BigDecimal/CompareToTests.java	Tue Aug 13 18:34:12 2013 -0700
@@ -53,12 +53,29 @@
             {valueOf(5,-1),     valueOf(2),     ONE},
 
             // Boundary and near boundary values
-            {valueOf(Long.MAX_VALUE),   valueOf(Long.MAX_VALUE),        ZERO},
-            {valueOf(Long.MAX_VALUE-1), valueOf(Long.MAX_VALUE),        MINUS_ONE},
-            {valueOf(Long.MIN_VALUE),   valueOf(Long.MAX_VALUE),        MINUS_ONE},
-            {valueOf(Long.MIN_VALUE+1), valueOf(Long.MAX_VALUE),        MINUS_ONE},
-            {valueOf(Long.MIN_VALUE),   valueOf(Long.MIN_VALUE),        ZERO},
-            {valueOf(Long.MIN_VALUE+1), valueOf(Long.MAX_VALUE),        ONE},
+            {valueOf(Long.MAX_VALUE),            valueOf(Long.MAX_VALUE), ZERO},
+            {valueOf(Long.MAX_VALUE).negate(),   valueOf(Long.MAX_VALUE), MINUS_ONE},
+
+            {valueOf(Long.MAX_VALUE-1),          valueOf(Long.MAX_VALUE), MINUS_ONE},
+            {valueOf(Long.MAX_VALUE-1).negate(), valueOf(Long.MAX_VALUE), MINUS_ONE},
+
+            {valueOf(Long.MIN_VALUE),            valueOf(Long.MAX_VALUE), MINUS_ONE},
+            {valueOf(Long.MIN_VALUE).negate(),   valueOf(Long.MAX_VALUE), ONE},
+
+            {valueOf(Long.MIN_VALUE+1),          valueOf(Long.MAX_VALUE), MINUS_ONE},
+            {valueOf(Long.MIN_VALUE+1).negate(), valueOf(Long.MAX_VALUE), ZERO},
+
+            {valueOf(Long.MAX_VALUE),            valueOf(Long.MIN_VALUE), ONE},
+            {valueOf(Long.MAX_VALUE).negate(),   valueOf(Long.MIN_VALUE), ONE},
+
+            {valueOf(Long.MAX_VALUE-1),          valueOf(Long.MIN_VALUE), ONE},
+            {valueOf(Long.MAX_VALUE-1).negate(), valueOf(Long.MIN_VALUE), ONE},
+
+            {valueOf(Long.MIN_VALUE),            valueOf(Long.MIN_VALUE), ZERO},
+            {valueOf(Long.MIN_VALUE).negate(),   valueOf(Long.MIN_VALUE), ONE},
+
+            {valueOf(Long.MIN_VALUE+1),          valueOf(Long.MIN_VALUE), ONE},
+            {valueOf(Long.MIN_VALUE+1).negate(), valueOf(Long.MIN_VALUE), ONE},
         };
 
         for (BigDecimal[] testCase : testCases) {
@@ -69,8 +86,6 @@
             int expected = testCase[2].intValue();
 
             failures += compareToTest(a,        b,         expected);
-            failures += compareToTest(a_negate, b,        -1);
-            failures += compareToTest(a,        b_negate,  1);
             failures += compareToTest(a_negate, b_negate, -expected);
         }
 
@@ -81,11 +96,11 @@
     private static int compareToTest(BigDecimal a, BigDecimal b, int expected) {
         int result = a.compareTo(b);
         int failed = (result==expected) ? 0 : 1;
-        if (result == 1) {
+        if (failed == 1) {
             System.err.println("(" + a + ").compareTo(" + b + ") => " + result +
                                "\n\tExpected " + expected);
         }
-        return result;
+        return failed;
     }
 
     public static void main(String argv[]) {
--- a/jdk/test/java/math/BigInteger/CompareToTests.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/math/BigInteger/CompareToTests.java	Tue Aug 13 18:34:12 2013 -0700
@@ -24,20 +24,23 @@
 /*
  * @test
  * @bug 6473768
- * @summary Tests of BigDecimal.compareTo
+ * @summary Tests of BigInteger.compareTo
  * @author Joseph D. Darcy
  */
 import java.math.*;
-import static java.math.BigDecimal.*;
+import static java.math.BigInteger.*;
 
 public class CompareToTests {
     private static int compareToTests() {
         int failures = 0;
 
-        final BigDecimal MINUS_ONE = BigDecimal.ONE.negate();
+        final BigInteger MINUS_ONE = BigInteger.ONE.negate();
+        final BigInteger TWO_POW_126 = ONE.shiftLeft(126);
+        final BigInteger TWO_POW_127 = ONE.shiftLeft(127);
+        final BigInteger TWO_POW_128 = ONE.shiftLeft(128);
 
         // First operand, second operand, expected compareTo result
-        BigDecimal [][] testCases = {
+        BigInteger [][] testCases = {
             // Basics
             {valueOf(0),        valueOf(0),     ZERO},
             {valueOf(0),        valueOf(1),     MINUS_ONE},
@@ -45,32 +48,56 @@
             {valueOf(2),        valueOf(1),     ONE},
             {valueOf(10),       valueOf(10),    ZERO},
 
-            // Significands would compare differently than scaled value
-            {valueOf(2,1),      valueOf(2),     MINUS_ONE},
-            {valueOf(2,-1),     valueOf(2),     ONE},
-            {valueOf(1,1),      valueOf(2),     MINUS_ONE},
-            {valueOf(1,-1),     valueOf(2),     ONE},
-            {valueOf(5,-1),     valueOf(2),     ONE},
+            // Various relative lengths of internal mag array.
+            {TWO_POW_127,                 TWO_POW_127,                 ZERO},
+            {TWO_POW_127.negate(),        TWO_POW_127,                 MINUS_ONE},
+
+            {TWO_POW_128.or(TWO_POW_126), TWO_POW_128,                 ONE},
+            {TWO_POW_128.or(TWO_POW_126), TWO_POW_128.negate(),        ONE},
+
+            {TWO_POW_128,                 TWO_POW_128.or(TWO_POW_126), MINUS_ONE},
+            {TWO_POW_128.negate(),        TWO_POW_128.or(TWO_POW_126), MINUS_ONE},
+
+            {TWO_POW_127,                 TWO_POW_128,                 MINUS_ONE},
+            {TWO_POW_127.negate(),        TWO_POW_128,                 MINUS_ONE},
+
+            {TWO_POW_128,                 TWO_POW_127,                 ONE},
+            {TWO_POW_128.negate(),        TWO_POW_127,                 MINUS_ONE},
+
+            // Long boundary and near boundary values
+            {valueOf(Long.MAX_VALUE),            valueOf(Long.MAX_VALUE), ZERO},
+            {valueOf(Long.MAX_VALUE).negate(),   valueOf(Long.MAX_VALUE), MINUS_ONE},
 
-            // Boundary and near boundary values
-            {valueOf(Long.MAX_VALUE),   valueOf(Long.MAX_VALUE),        ZERO},
-            {valueOf(Long.MAX_VALUE-1), valueOf(Long.MAX_VALUE),        MINUS_ONE},
-            {valueOf(Long.MIN_VALUE),   valueOf(Long.MAX_VALUE),        MINUS_ONE},
-            {valueOf(Long.MIN_VALUE+1), valueOf(Long.MAX_VALUE),        MINUS_ONE},
-            {valueOf(Long.MIN_VALUE),   valueOf(Long.MIN_VALUE),        ZERO},
-            {valueOf(Long.MIN_VALUE+1), valueOf(Long.MAX_VALUE),        ONE},
+            {valueOf(Long.MAX_VALUE-1),          valueOf(Long.MAX_VALUE), MINUS_ONE},
+            {valueOf(Long.MAX_VALUE-1).negate(), valueOf(Long.MAX_VALUE), MINUS_ONE},
+
+            {valueOf(Long.MIN_VALUE),            valueOf(Long.MAX_VALUE), MINUS_ONE},
+            {valueOf(Long.MIN_VALUE).negate(),   valueOf(Long.MAX_VALUE), ONE},
+
+            {valueOf(Long.MIN_VALUE+1),          valueOf(Long.MAX_VALUE), MINUS_ONE},
+            {valueOf(Long.MIN_VALUE+1).negate(), valueOf(Long.MAX_VALUE), ZERO},
+
+            {valueOf(Long.MAX_VALUE),            valueOf(Long.MIN_VALUE), ONE},
+            {valueOf(Long.MAX_VALUE).negate(),   valueOf(Long.MIN_VALUE), ONE},
+
+            {valueOf(Long.MAX_VALUE-1),          valueOf(Long.MIN_VALUE), ONE},
+            {valueOf(Long.MAX_VALUE-1).negate(), valueOf(Long.MIN_VALUE), ONE},
+
+            {valueOf(Long.MIN_VALUE),            valueOf(Long.MIN_VALUE), ZERO},
+            {valueOf(Long.MIN_VALUE).negate(),   valueOf(Long.MIN_VALUE), ONE},
+
+            {valueOf(Long.MIN_VALUE+1),          valueOf(Long.MIN_VALUE), ONE},
+            {valueOf(Long.MIN_VALUE+1).negate(), valueOf(Long.MIN_VALUE), ONE},
         };
 
-        for (BigDecimal[] testCase : testCases) {
-            BigDecimal a = testCase[0];
-            BigDecimal a_negate = a.negate();
-            BigDecimal b = testCase[1];
-            BigDecimal b_negate = b.negate();
+        for (BigInteger[] testCase : testCases) {
+            BigInteger a = testCase[0];
+            BigInteger a_negate = a.negate();
+            BigInteger b = testCase[1];
+            BigInteger b_negate = b.negate();
             int expected = testCase[2].intValue();
 
             failures += compareToTest(a,        b,         expected);
-            failures += compareToTest(a_negate, b,        -1);
-            failures += compareToTest(a,        b_negate,  1);
             failures += compareToTest(a_negate, b_negate, -expected);
         }
 
@@ -78,14 +105,14 @@
         return failures;
     }
 
-    private static int compareToTest(BigDecimal a, BigDecimal b, int expected) {
+    private static int compareToTest(BigInteger a, BigInteger b, int expected) {
         int result = a.compareTo(b);
         int failed = (result==expected) ? 0 : 1;
-        if (result == 1) {
+        if (failed == 1) {
             System.err.println("(" + a + ").compareTo(" + b + ") => " + result +
                                "\n\tExpected " + expected);
         }
-        return result;
+        return failed;
     }
 
     public static void main(String argv[]) {
--- a/jdk/test/java/net/NetworkInterface/IndexTest.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/net/NetworkInterface/IndexTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -27,7 +27,10 @@
  */
 
 import java.net.*;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.Enumeration;
+import static java.lang.System.out;
 
 public class IndexTest {
     public static void main(String[] args) throws Exception {
@@ -39,12 +42,17 @@
             if (index >= 0) {
                 NetworkInterface nif2 = NetworkInterface.getByIndex(index);
                 if (! nif.equals(nif2)) {
+                    out.printf("%nExpected interfaces to be the same, but got:%n");
+                    displayInterfaceInformation(nif);
+                    displayInterfaceInformation(nif2);
                     throw new RuntimeException("both interfaces should be equal");
                 }
             }
         }
         try {
             nif = NetworkInterface.getByIndex(-1);
+            out.printf("%ngetByIndex(-1) should have thrown, but instead returned:%n");
+            displayInterfaceInformation(nif);
             throw new RuntimeException("Should have thrown IllegalArgumentException");
         } catch (IllegalArgumentException e) {
             // OK
@@ -52,7 +60,29 @@
         // In all likelyhood, this interface should not exist.
         nif = NetworkInterface.getByIndex(Integer.MAX_VALUE - 1);
         if (nif != null) {
+            out.printf("%ngetByIndex(MAX_VALUE - 1), expected null, got:%n");
+            displayInterfaceInformation(nif);
             throw new RuntimeException("getByIndex() should have returned null");
         }
     }
+
+    static void displayInterfaceInformation(NetworkInterface netint) throws SocketException {
+        out.printf("Display name: %s%n", netint.getDisplayName());
+        out.printf("Name: %s%n", netint.getName());
+        Enumeration<InetAddress> inetAddresses = netint.getInetAddresses();
+
+        for (InetAddress inetAddress : Collections.list(inetAddresses))
+            out.printf("InetAddress: %s%n", inetAddress);
+
+        out.printf("Up? %s%n", netint.isUp());
+        out.printf("Loopback? %s%n", netint.isLoopback());
+        out.printf("PointToPoint? %s%n", netint.isPointToPoint());
+        out.printf("Supports multicast? %s%n", netint.supportsMulticast());
+        out.printf("Virtual? %s%n", netint.isVirtual());
+        out.printf("Hardware address: %s%n",
+                    Arrays.toString(netint.getHardwareAddress()));
+        out.printf("MTU: %s%n", netint.getMTU());
+        out.printf("Index: %s%n", netint.getIndex());
+        out.printf("%n");
+     }
 }
--- a/jdk/test/java/nio/file/Files/BytesAndLines.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/nio/file/Files/BytesAndLines.java	Tue Aug 13 18:34:12 2013 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 7006126
+ * @bug 7006126 8020669
  * @summary Unit test for methods for Files readAllBytes, readAllLines and
  *     and write methods.
  */
@@ -82,6 +82,16 @@
             write(file, lines, Charset.defaultCharset(), opts);
             throw new RuntimeException("NullPointerException expected");
         } catch (NullPointerException ignore) { }
+
+        // read from procfs
+        if (System.getProperty("os.name").equals("Linux")) {
+            // Refer to the Linux proc(5) man page for details about /proc/self/stat file
+            // procfs reports it to be zero sized, even though data can be read from it
+            String statFile = "/proc/self/stat";
+            Path pathStat = Paths.get(statFile);
+            byte[] data = Files.readAllBytes(pathStat);
+            assertTrue(data.length > 0, "Files.readAllBytes('" + statFile + "') failed to read");
+        }
     }
 
 
@@ -174,6 +184,16 @@
                 throw new RuntimeException("NullPointerException expected");
             } catch (NullPointerException ignore) { }
 
+            // read from procfs
+            if (System.getProperty("os.name").equals("Linux")) {
+                // Refer to the Linux proc(5) man page for details about /proc/self/status file
+                // procfs reports this file to be zero sized, even though data can be read from it
+                String statusFile = "/proc/self/status";
+                Path pathStatus = Paths.get(statusFile);
+                lines = Files.readAllLines(pathStatus, US_ASCII);
+                assertTrue(lines.size() > 0, "Files.readAllLines('" + pathStatus + "') failed to read");
+            }
+
         } finally {
             delete(tmpfile);
         }
@@ -242,7 +262,6 @@
         } finally {
             delete(tmpfile);
         }
-
     }
 
     static void assertTrue(boolean expr, String errmsg) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/Security/AddProvider.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8001319
+ * @summary check that SecurityPermission insertProvider permission is enforced
+ *          correctly
+ * @run main/othervm/policy=AddProvider.policy.1 AddProvider 1
+ * @run main/othervm/policy=AddProvider.policy.2 AddProvider 2
+ * @run main/othervm/policy=AddProvider.policy.3 AddProvider 3
+ */
+import java.security.Provider;
+import java.security.Security;
+
+public class AddProvider {
+
+    public static void main(String[] args) throws Exception {
+        boolean legacy = args[0].equals("2");
+        Security.addProvider(new TestProvider("Test1"));
+        Security.insertProviderAt(new TestProvider("Test2"), 1);
+        try {
+            Security.addProvider(new TestProvider("Test3"));
+            if (legacy) {
+                throw new Exception("Expected SecurityException");
+            }
+        } catch (SecurityException se) {
+            if (!legacy) {
+                throw se;
+            }
+        }
+    }
+
+    private static class TestProvider extends Provider {
+        TestProvider(String name) {
+            super(name, 0.0, "Not for use in production systems!");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/Security/AddProvider.policy.1	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,7 @@
+grant codeBase "file:${{java.ext.dirs}}/*" {
+	permission java.security.AllPermission;
+};
+
+grant {
+    permission java.security.SecurityPermission "insertProvider";
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/Security/AddProvider.policy.2	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,8 @@
+grant codeBase "file:${{java.ext.dirs}}/*" {
+	permission java.security.AllPermission;
+};
+
+grant {
+    permission java.security.SecurityPermission "insertProvider.Test1";
+    permission java.security.SecurityPermission "insertProvider.Test2";
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/Security/AddProvider.policy.3	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,7 @@
+grant codeBase "file:${{java.ext.dirs}}/*" {
+	permission java.security.AllPermission;
+};
+
+grant {
+    permission java.security.SecurityPermission "insertProvider.*";
+};
--- a/jdk/test/java/util/Formatter/Basic-X.java.template	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/Formatter/Basic-X.java.template	Tue Aug 13 18:34:12 2013 -0700
@@ -1319,10 +1319,8 @@
              Math.nextDown(DoubleConsts.MIN_NORMAL));
         test("%.1a", "0x1.0p-1022",
              Math.nextDown(DoubleConsts.MIN_NORMAL));
-        test("%.11a", "0x1.ffffffffffep-1023",
-             Double.parseDouble("0x0.fffffffffffp-1022"));
-        test("%.1a", "0x1.0p-1022",
-             Double.parseDouble("0x0.fffffffffffp-1022"));
+        test("%.11a", "0x1.ffffffffffep-1023", 0x0.fffffffffffp-1022);
+        test("%.1a", "0x1.0p-1022", 0x0.fffffffffffp-1022);
         test("%.30a", "0x0.000000000000100000000000000000p-1022", Double.MIN_VALUE);
         test("%.13a", "0x0.0000000000001p-1022", Double.MIN_VALUE);
         test("%.11a", "0x1.00000000000p-1074", Double.MIN_VALUE);
@@ -1336,19 +1334,50 @@
         test("%.13a", "0x1.fffffffffffffp1023", Double.MAX_VALUE);
         test("%.11a", "0x1.00000000000p1024", Double.MAX_VALUE);
         test("%.1a", "0x1.0p1024", Double.MAX_VALUE);
-        test("%.11a", "0x1.18000000000p0", Double.parseDouble("0x1.18p0"));
-        test("%.1a", "0x1.2p0", Double.parseDouble("0x1.18p0"));
+        test("%.11a", "0x1.18000000000p0", 0x1.18p0);
+        test("%.1a", "0x1.2p0", 0x1.18p0);
+
+        test("%.11a", "0x1.18000000000p0", 0x1.180000000001p0);
+        test("%.1a", "0x1.2p0", 0x1.180000000001p0);
+        test("%.11a", "0x1.28000000000p0", 0x1.28p0);
+        test("%.1a", "0x1.2p0", 0x1.28p0);
+
+        test("%.11a", "0x1.28000000000p0", 0x1.280000000001p0);
+        test("%.1a", "0x1.3p0", 0x1.280000000001p0);
+
+        test("%a", "0x0.123p-1022", 0x0.123p-1022);
+        test("%1.3a", "0x1.230p-1026", 0x0.123p-1022);
+        test("%1.12a", "0x1.230000000000p-1026", 0x0.123p-1022);
+        test("%1.15a", "0x0.123000000000000p-1022", 0x0.123p-1022);
+        test("%1.5a", "0x1.00000p-1074", 0x0.0000000000001p-1022);
+        test("%1.7a", "0x1.0000000p-1022", 0x0.fffffffffffffp-1022);
 
-        test("%.11a", "0x1.18000000000p0",
-             Double.parseDouble("0x1.180000000001p0"));
-        test("%.1a", "0x1.2p0",
-             Double.parseDouble("0x1.180000000001p0"));
-        test("%.11a", "0x1.28000000000p0", Double.parseDouble("0x1.28p0"));
-        test("%.1a", "0x1.2p0", Double.parseDouble("0x1.28p0"));
+        test("%1.6a", "0x1.230000p-1026", 0x0.123000057p-1022);
+        test("%1.7a", "0x1.2300005p-1026", 0x0.123000057p-1022);
+        test("%1.8a", "0x1.23000057p-1026", 0x0.123000057p-1022);
+        test("%1.9a", "0x1.230000570p-1026", 0x0.123000057p-1022);
+
+        test("%1.6a", "0x1.230000p-1026", 0x0.123000058p-1022);
+        test("%1.7a", "0x1.2300006p-1026", 0x0.123000058p-1022);
+        test("%1.8a", "0x1.23000058p-1026", 0x0.123000058p-1022);
+        test("%1.9a", "0x1.230000580p-1026", 0x0.123000058p-1022);
 
-        test("%.11a", "0x1.28000000000p0",
-             Double.parseDouble("0x1.280000000001p0"));
-        test("%.1a", "0x1.3p0", Double.parseDouble("0x1.280000000001p0"));
+        test("%1.6a", "0x1.230000p-1026", 0x0.123000059p-1022);
+        test("%1.7a", "0x1.2300006p-1026", 0x0.123000059p-1022);
+        test("%1.8a", "0x1.23000059p-1026", 0x0.123000059p-1022);
+        test("%1.9a", "0x1.230000590p-1026", 0x0.123000059p-1022);
+
+        test("%1.4a", "0x1.0000p-1022", Math.nextDown(Double.MIN_NORMAL));
+
+        test("%a", "0x1.fffffffffffffp1023", Double.MAX_VALUE);
+        test("%1.1a", "0x1.0p1024", Double.MAX_VALUE);
+        test("%1.2a", "0x1.00p1024", Double.MAX_VALUE);
+        test("%1.6a", "0x1.000000p1024", Double.MAX_VALUE);
+        test("%1.9a", "0x1.000000000p1024", Double.MAX_VALUE);
+        test("%1.11a", "0x1.00000000000p1024", Double.MAX_VALUE);
+        test("%1.12a", "0x1.000000000000p1024", Double.MAX_VALUE);
+        test("%1.13a", "0x1.fffffffffffffp1023", Double.MAX_VALUE);
+
 #end[double]
 
         //---------------------------------------------------------------------
--- a/jdk/test/java/util/Formatter/Basic.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/Formatter/Basic.java	Tue Aug 13 18:34:12 2013 -0700
@@ -25,7 +25,7 @@
  * @summary Unit test for formatter
  * @bug 4906370 4962433 4973103 4989961 5005818 5031150 4970931 4989491 5002937
  *      5005104 5007745 5061412 5055180 5066788 5088703 6317248 6318369 6320122
- *      6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160
+ *      6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 6476168
  *
  * @run shell/timeout=240 Basic.sh
  */
--- a/jdk/test/java/util/Formatter/BasicDouble.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/Formatter/BasicDouble.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1319,10 +1319,8 @@
              Math.nextDown(DoubleConsts.MIN_NORMAL));
         test("%.1a", "0x1.0p-1022",
              Math.nextDown(DoubleConsts.MIN_NORMAL));
-        test("%.11a", "0x1.ffffffffffep-1023",
-             Double.parseDouble("0x0.fffffffffffp-1022"));
-        test("%.1a", "0x1.0p-1022",
-             Double.parseDouble("0x0.fffffffffffp-1022"));
+        test("%.11a", "0x1.ffffffffffep-1023", 0x0.fffffffffffp-1022);
+        test("%.1a", "0x1.0p-1022", 0x0.fffffffffffp-1022);
         test("%.30a", "0x0.000000000000100000000000000000p-1022", Double.MIN_VALUE);
         test("%.13a", "0x0.0000000000001p-1022", Double.MIN_VALUE);
         test("%.11a", "0x1.00000000000p-1074", Double.MIN_VALUE);
@@ -1336,19 +1334,50 @@
         test("%.13a", "0x1.fffffffffffffp1023", Double.MAX_VALUE);
         test("%.11a", "0x1.00000000000p1024", Double.MAX_VALUE);
         test("%.1a", "0x1.0p1024", Double.MAX_VALUE);
-        test("%.11a", "0x1.18000000000p0", Double.parseDouble("0x1.18p0"));
-        test("%.1a", "0x1.2p0", Double.parseDouble("0x1.18p0"));
-
-        test("%.11a", "0x1.18000000000p0",
-             Double.parseDouble("0x1.180000000001p0"));
-        test("%.1a", "0x1.2p0",
-             Double.parseDouble("0x1.180000000001p0"));
-        test("%.11a", "0x1.28000000000p0", Double.parseDouble("0x1.28p0"));
-        test("%.1a", "0x1.2p0", Double.parseDouble("0x1.28p0"));
-
-        test("%.11a", "0x1.28000000000p0",
-             Double.parseDouble("0x1.280000000001p0"));
-        test("%.1a", "0x1.3p0", Double.parseDouble("0x1.280000000001p0"));
+        test("%.11a", "0x1.18000000000p0", 0x1.18p0);
+        test("%.1a", "0x1.2p0", 0x1.18p0);
+
+        test("%.11a", "0x1.18000000000p0", 0x1.180000000001p0);
+        test("%.1a", "0x1.2p0", 0x1.180000000001p0);
+        test("%.11a", "0x1.28000000000p0", 0x1.28p0);
+        test("%.1a", "0x1.2p0", 0x1.28p0);
+
+        test("%.11a", "0x1.28000000000p0", 0x1.280000000001p0);
+        test("%.1a", "0x1.3p0", 0x1.280000000001p0);
+
+        test("%a", "0x0.123p-1022", 0x0.123p-1022);
+        test("%1.3a", "0x1.230p-1026", 0x0.123p-1022);
+        test("%1.12a", "0x1.230000000000p-1026", 0x0.123p-1022);
+        test("%1.15a", "0x0.123000000000000p-1022", 0x0.123p-1022);
+        test("%1.5a", "0x1.00000p-1074", 0x0.0000000000001p-1022);
+        test("%1.7a", "0x1.0000000p-1022", 0x0.fffffffffffffp-1022);
+
+        test("%1.6a", "0x1.230000p-1026", 0x0.123000057p-1022);
+        test("%1.7a", "0x1.2300005p-1026", 0x0.123000057p-1022);
+        test("%1.8a", "0x1.23000057p-1026", 0x0.123000057p-1022);
+        test("%1.9a", "0x1.230000570p-1026", 0x0.123000057p-1022);
+
+        test("%1.6a", "0x1.230000p-1026", 0x0.123000058p-1022);
+        test("%1.7a", "0x1.2300006p-1026", 0x0.123000058p-1022);
+        test("%1.8a", "0x1.23000058p-1026", 0x0.123000058p-1022);
+        test("%1.9a", "0x1.230000580p-1026", 0x0.123000058p-1022);
+
+        test("%1.6a", "0x1.230000p-1026", 0x0.123000059p-1022);
+        test("%1.7a", "0x1.2300006p-1026", 0x0.123000059p-1022);
+        test("%1.8a", "0x1.23000059p-1026", 0x0.123000059p-1022);
+        test("%1.9a", "0x1.230000590p-1026", 0x0.123000059p-1022);
+
+        test("%1.4a", "0x1.0000p-1022", Math.nextDown(Double.MIN_NORMAL));
+
+        test("%a", "0x1.fffffffffffffp1023", Double.MAX_VALUE);
+        test("%1.1a", "0x1.0p1024", Double.MAX_VALUE);
+        test("%1.2a", "0x1.00p1024", Double.MAX_VALUE);
+        test("%1.6a", "0x1.000000p1024", Double.MAX_VALUE);
+        test("%1.9a", "0x1.000000000p1024", Double.MAX_VALUE);
+        test("%1.11a", "0x1.00000000000p1024", Double.MAX_VALUE);
+        test("%1.12a", "0x1.000000000000p1024", Double.MAX_VALUE);
+        test("%1.13a", "0x1.fffffffffffffp1023", Double.MAX_VALUE);
+
 
 
         //---------------------------------------------------------------------
--- a/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -25,6 +25,7 @@
  * @test
  * @summary Spliterator traversing and splitting tests
  * @run testng SpliteratorTraversingAndSplittingTest
+ * @bug 8020016
  */
 
 import org.testng.annotations.DataProvider;
@@ -386,11 +387,23 @@
 
             db.addCollection(CopyOnWriteArraySet::new);
 
-            if (size == 1) {
+            if (size == 0) {
+                db.addCollection(c -> Collections.<Integer>emptySet());
+                db.addList(c -> Collections.<Integer>emptyList());
+            }
+            else if (size == 1) {
                 db.addCollection(c -> Collections.singleton(exp.get(0)));
                 db.addCollection(c -> Collections.singletonList(exp.get(0)));
             }
 
+            {
+                Integer[] ai = new Integer[size];
+                Arrays.fill(ai, 1);
+                db.add(String.format("Collections.nCopies(%d, 1)", exp.size()),
+                       Arrays.asList(ai),
+                       () -> Collections.nCopies(exp.size(), 1).spliterator());
+            }
+
             // Collections.synchronized/unmodifiable/checked wrappers
             db.addCollection(Collections::unmodifiableCollection);
             db.addCollection(c -> Collections.unmodifiableSet(new HashSet<>(c)));
@@ -454,6 +467,13 @@
             db.addMap(ConcurrentHashMap::new);
 
             db.addMap(ConcurrentSkipListMap::new);
+
+            if (size == 0) {
+                db.addMap(m -> Collections.<Integer, Integer>emptyMap());
+            }
+            else if (size == 1) {
+                db.addMap(m -> Collections.singletonMap(exp.get(0), exp.get(0)));
+            }
         }
 
         return spliteratorDataProvider = data.toArray(new Object[0][]);
--- a/jdk/test/java/util/concurrent/CompletableFuture/Basic.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/concurrent/CompletableFuture/Basic.java	Tue Aug 13 18:34:12 2013 -0700
@@ -34,6 +34,8 @@
 /*
  * @test
  * @bug 8005696
+ * @run main Basic
+ * @run main/othervm -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 Basic
  * @summary Basic tests for CompletableFuture
  * @author Chris Hegarty
  */
--- a/jdk/test/java/util/stream/bootlib/java/util/stream/SpliteratorTestHelper.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/stream/bootlib/java/util/stream/SpliteratorTestHelper.java	Tue Aug 13 18:34:12 2013 -0700
@@ -22,6 +22,8 @@
  */
 package java.util.stream;
 
+import org.testng.annotations.Test;
+
 import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -154,6 +156,7 @@
 
         Collection<T> exp = Collections.unmodifiableList(fromForEach);
 
+        testNullPointerException(supplier);
         testForEach(exp, supplier, boxingAdapter, asserter);
         testTryAdvance(exp, supplier, boxingAdapter, asserter);
         testMixedTryAdvanceForEach(exp, supplier, boxingAdapter, asserter);
@@ -166,6 +169,31 @@
 
     //
 
+    private static <T, S extends Spliterator<T>> void testNullPointerException(Supplier<S> s) {
+        S sp = s.get();
+        // Have to check instances and use casts to avoid tripwire messages and
+        // directly test the primitive methods
+        if (sp instanceof Spliterator.OfInt) {
+            Spliterator.OfInt psp = (Spliterator.OfInt) sp;
+            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((IntConsumer) null));
+            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((IntConsumer) null));
+        }
+        else if (sp instanceof Spliterator.OfLong) {
+            Spliterator.OfLong psp = (Spliterator.OfLong) sp;
+            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((LongConsumer) null));
+            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((LongConsumer) null));
+        }
+        else if (sp instanceof Spliterator.OfDouble) {
+            Spliterator.OfDouble psp = (Spliterator.OfDouble) sp;
+            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((DoubleConsumer) null));
+            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((DoubleConsumer) null));
+        }
+        else {
+            executeAndCatch(NullPointerException.class, () -> sp.forEachRemaining(null));
+            executeAndCatch(NullPointerException.class, () -> sp.tryAdvance(null));
+        }
+    }
+
     private static <T, S extends Spliterator<T>> void testForEach(
             Collection<T> exp,
             Supplier<S> supplier,
@@ -573,6 +601,23 @@
         }
     }
 
+    private static void executeAndCatch(Class<? extends Exception> expected, Runnable r) {
+        Exception caught = null;
+        try {
+            r.run();
+        }
+        catch (Exception e) {
+            caught = e;
+        }
+
+        assertNotNull(caught,
+                      String.format("No Exception was thrown, expected an Exception of %s to be thrown",
+                                    expected.getName()));
+        assertTrue(expected.isInstance(caught),
+                   String.format("Exception thrown %s not an instance of %s",
+                                 caught.getClass().getName(), expected.getName()));
+    }
+
     static<U> void mixedTraverseAndSplit(Consumer<U> b, Spliterator<U> splTop) {
         Spliterator<U> spl1, spl2, spl3;
         splTop.tryAdvance(b);
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/FillableStringTest.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/FillableStringTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -40,17 +40,17 @@
     }
 
     public void testStringBuilder() {
-        String s = generate().collect(Collectors.toStringBuilder()).toString();
+        String s = generate().collect(Collectors.joining());
         assertEquals(s, "THREEFOURFIVE");
     }
 
     public void testStringBuffer() {
-        String s = generate().collect(Collectors.toStringBuilder()).toString();
+        String s = generate().collect(Collectors.joining());
         assertEquals(s, "THREEFOURFIVE");
     }
 
     public void testStringJoiner() {
-        String s = generate().collect(Collectors.toStringJoiner("-")).toString();
+        String s = generate().collect(Collectors.joining("-"));
         assertEquals(s, "THREE-FOUR-FIVE");
     }
 }
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/GroupByOpTest.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/GroupByOpTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -36,7 +36,6 @@
 import java.util.stream.LambdaTestHelpers;
 import java.util.stream.OpTestCase;
 import java.util.stream.Stream;
-import java.util.stream.StreamOpFlagTestHelper;
 import java.util.stream.StreamTestDataProvider;
 import java.util.stream.TestData;
 
@@ -59,13 +58,14 @@
 public class GroupByOpTest extends OpTestCase {
 
     public void testBypassCollect() {
-        Collector<Integer, Map<Boolean, List<Integer>>> collector
-                = Collectors.groupingBy(LambdaTestHelpers.forPredicate(pEven, true, false));
+        @SuppressWarnings("unchecked")
+        Collector<Integer, Map<Boolean, List<Integer>>, Map<Boolean, List<Integer>>> collector
+                = (Collector<Integer, Map<Boolean, List<Integer>>, Map<Boolean, List<Integer>>>) Collectors.groupingBy(LambdaTestHelpers.forPredicate(pEven, true, false));
 
-        Map<Boolean, List<Integer>> m = collector.resultSupplier().get();
+        Map<Boolean, List<Integer>> m = collector.supplier().get();
         int[] ints = countTo(10).stream().mapToInt(e -> (int) e).toArray();
         for (int i : ints)
-            m = collector.accumulator().apply(m, i);
+            collector.accumulator().accept(m, i);
 
         assertEquals(2, m.keySet().size());
         for(Collection<Integer> group : m.values()) {
@@ -130,7 +130,7 @@
         //     - Total number of values equals size of data
 
         for (MapperData<Integer, ?> md : getMapperData(data)) {
-            Collector<Integer, Map<Object, List<Integer>>> tab = Collectors.groupingBy(md.m);
+            Collector<Integer, ?, Map<Object, List<Integer>>> tab = Collectors.groupingBy(md.m);
             Map<Object, List<Integer>> result =
                     withData(data)
                     .terminal(s -> s, s -> s.collect(tab))
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SummaryStatisticsTest.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SummaryStatisticsTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -43,9 +43,9 @@
 public class SummaryStatisticsTest extends OpTestCase {
     public void testIntStatistics() {
         List<IntSummaryStatistics> instances = new ArrayList<>();
-        instances.add(countTo(1000).stream().collect(Collectors.toIntSummaryStatistics(i -> i)));
+        instances.add(countTo(1000).stream().collect(Collectors.summarizingInt(i -> i)));
         instances.add(countTo(1000).stream().mapToInt(i -> i).summaryStatistics());
-        instances.add(countTo(1000).parallelStream().collect(Collectors.toIntSummaryStatistics(i -> i)));
+        instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingInt(i -> i)));
         instances.add(countTo(1000).parallelStream().mapToInt(i -> i).summaryStatistics());
 
         for (IntSummaryStatistics stats : instances) {
@@ -58,9 +58,9 @@
 
     public void testLongStatistics() {
         List<LongSummaryStatistics> instances = new ArrayList<>();
-        instances.add(countTo(1000).stream().collect(Collectors.toLongSummaryStatistics(i -> i)));
+        instances.add(countTo(1000).stream().collect(Collectors.summarizingLong(i -> i)));
         instances.add(countTo(1000).stream().mapToLong(i -> i).summaryStatistics());
-        instances.add(countTo(1000).parallelStream().collect(Collectors.toLongSummaryStatistics(i -> i)));
+        instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingLong(i -> i)));
         instances.add(countTo(1000).parallelStream().mapToLong(i -> i).summaryStatistics());
 
         for (LongSummaryStatistics stats : instances) {
@@ -73,9 +73,9 @@
 
     public void testDoubleStatistics() {
         List<DoubleSummaryStatistics> instances = new ArrayList<>();
-        instances.add(countTo(1000).stream().collect(Collectors.toDoubleSummaryStatistics(i -> i)));
+        instances.add(countTo(1000).stream().collect(Collectors.summarizingDouble(i -> i)));
         instances.add(countTo(1000).stream().mapToDouble(i -> i).summaryStatistics());
-        instances.add(countTo(1000).parallelStream().collect(Collectors.toDoubleSummaryStatistics(i -> i)));
+        instances.add(countTo(1000).parallelStream().collect(Collectors.summarizingDouble(i -> i)));
         instances.add(countTo(1000).parallelStream().mapToDouble(i -> i).summaryStatistics());
 
         for (DoubleSummaryStatistics stats : instances) {
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -23,13 +23,17 @@
 package org.openjdk.tests.java.util.stream;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.Set;
+import java.util.StringJoiner;
 import java.util.TreeMap;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentSkipListMap;
@@ -53,7 +57,10 @@
 import static java.util.stream.Collectors.partitioningBy;
 import static java.util.stream.Collectors.reducing;
 import static java.util.stream.Collectors.toCollection;
+import static java.util.stream.Collectors.toConcurrentMap;
 import static java.util.stream.Collectors.toList;
+import static java.util.stream.Collectors.toMap;
+import static java.util.stream.Collectors.toSet;
 import static java.util.stream.LambdaTestHelpers.assertContents;
 import static java.util.stream.LambdaTestHelpers.assertContentsUnordered;
 import static java.util.stream.LambdaTestHelpers.mDoubler;
@@ -65,16 +72,6 @@
  */
 @SuppressWarnings({"rawtypes", "unchecked"})
 public class TabulatorsTest extends OpTestCase {
-    // There are 8 versions of groupingBy:
-    //   groupingBy: { map supplier, not } x { downstream collector, not } x { concurrent, not }
-    // There are 2 versions of partition: { map supplier, not }
-    // There are 4 versions of toMap
-    //   mappedTo(function, mapSupplier?, mergeFunction?)
-    // Each variety needs at least one test
-    // Plus a variety of multi-level tests (groupBy(..., partition), partition(..., groupBy))
-    // Plus negative tests for mapping to null
-    // Each test should be matched by a nest of asserters (see TabulationAssertion...)
-
 
     private static abstract class TabulationAssertion<T, U> {
         abstract void assertValue(U value,
@@ -101,7 +98,7 @@
                          boolean ordered) throws ReflectiveOperationException {
             if (!clazz.isAssignableFrom(map.getClass()))
                 fail(String.format("Class mismatch in GroupedMapAssertion: %s, %s", clazz, map.getClass()));
-            assertContentsUnordered(map.keySet(), source.get().map(classifier).collect(Collectors.toSet()));
+            assertContentsUnordered(map.keySet(), source.get().map(classifier).collect(toSet()));
             for (Map.Entry<K, ? extends V> entry : map.entrySet()) {
                 K key = entry.getKey();
                 downstream.assertValue(entry.getValue(),
@@ -111,6 +108,39 @@
         }
     }
 
+    static class ToMapAssertion<T, K, V, M extends Map<K,V>> extends TabulationAssertion<T, M> {
+        private final Class<? extends Map> clazz;
+        private final Function<T, K> keyFn;
+        private final Function<T, V> valueFn;
+        private final BinaryOperator<V> mergeFn;
+
+        ToMapAssertion(Function<T, K> keyFn,
+                       Function<T, V> valueFn,
+                       BinaryOperator<V> mergeFn,
+                       Class<? extends Map> clazz) {
+            this.clazz = clazz;
+            this.keyFn = keyFn;
+            this.valueFn = valueFn;
+            this.mergeFn = mergeFn;
+        }
+
+        @Override
+        void assertValue(M map, Supplier<Stream<T>> source, boolean ordered) throws ReflectiveOperationException {
+            Set<K> uniqueKeys = source.get().map(keyFn).collect(toSet());
+            assertTrue(clazz.isAssignableFrom(map.getClass()));
+            assertEquals(uniqueKeys, map.keySet());
+            source.get().forEach(t -> {
+                K key = keyFn.apply(t);
+                V v = source.get()
+                            .filter(e -> key.equals(keyFn.apply(e)))
+                            .map(valueFn)
+                            .reduce(mergeFn)
+                            .get();
+                assertEquals(map.get(key), v);
+            });
+        }
+    }
+
     static class PartitionAssertion<T, D> extends TabulationAssertion<T, Map<Boolean,D>> {
         private final Predicate<T> predicate;
         private final TabulationAssertion<T,D> downstream;
@@ -204,7 +234,7 @@
 
     private <T> ResultAsserter<T> mapTabulationAsserter(boolean ordered) {
         return (act, exp, ord, par) -> {
-            if (par & (!ordered || !ord)) {
+            if (par && (!ordered || !ord)) {
                 TabulatorsTest.nestedMapEqualityAssertion(act, exp);
             }
             else {
@@ -215,7 +245,7 @@
 
     private<T, M extends Map>
     void exerciseMapTabulation(TestData<T, Stream<T>> data,
-                               Collector<T, ? extends M> collector,
+                               Collector<T, ?, ? extends M> collector,
                                TabulationAssertion<T, M> assertion)
             throws ReflectiveOperationException {
         boolean ordered = !collector.characteristics().contains(Collector.Characteristics.UNORDERED);
@@ -248,6 +278,172 @@
             assertEquals(o1, o2);
     }
 
+    private<T, R> void assertCollect(TestData.OfRef<T> data,
+                                     Collector<T, ?, R> collector,
+                                     Function<Stream<T>, R> streamReduction) {
+        R check = streamReduction.apply(data.stream());
+        withData(data).terminal(s -> s.collect(collector)).expectedResult(check).exercise();
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testReduce(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        assertCollect(data, Collectors.reducing(0, Integer::sum),
+                      s -> s.reduce(0, Integer::sum));
+        assertCollect(data, Collectors.reducing(Integer.MAX_VALUE, Integer::min),
+                      s -> s.min(Integer::compare).orElse(Integer.MAX_VALUE));
+        assertCollect(data, Collectors.reducing(Integer.MIN_VALUE, Integer::max),
+                      s -> s.max(Integer::compare).orElse(Integer.MIN_VALUE));
+
+        assertCollect(data, Collectors.reducing(Integer::sum),
+                      s -> s.reduce(Integer::sum));
+        assertCollect(data, Collectors.minBy(Comparator.naturalOrder()),
+                      s -> s.min(Integer::compare));
+        assertCollect(data, Collectors.maxBy(Comparator.naturalOrder()),
+                      s -> s.max(Integer::compare));
+
+        assertCollect(data, Collectors.reducing(0, x -> x*2, Integer::sum),
+                      s -> s.map(x -> x*2).reduce(0, Integer::sum));
+
+        assertCollect(data, Collectors.summingLong(x -> x * 2L),
+                      s -> s.map(x -> x*2L).reduce(0L, Long::sum));
+        assertCollect(data, Collectors.summingInt(x -> x * 2),
+                      s -> s.map(x -> x*2).reduce(0, Integer::sum));
+        assertCollect(data, Collectors.summingDouble(x -> x * 2.0d),
+                      s -> s.map(x -> x * 2.0d).reduce(0.0d, Double::sum));
+
+        assertCollect(data, Collectors.averagingInt(x -> x * 2),
+                      s -> s.mapToInt(x -> x * 2).average().orElse(0));
+        assertCollect(data, Collectors.averagingLong(x -> x * 2),
+                      s -> s.mapToLong(x -> x * 2).average().orElse(0));
+        assertCollect(data, Collectors.averagingDouble(x -> x * 2),
+                      s -> s.mapToDouble(x -> x * 2).average().orElse(0));
+
+        // Test explicit Collector.of
+        Collector<Integer, long[], Double> avg2xint = Collector.of(() -> new long[2],
+                                                                   (a, b) -> {
+                                                                       a[0] += b * 2;
+                                                                       a[1]++;
+                                                                   },
+                                                                   (a, b) -> {
+                                                                       a[0] += b[0];
+                                                                       a[1] += b[1];
+                                                                       return a;
+                                                                   },
+                                                                   a -> a[1] == 0 ? 0.0d : (double) a[0] / a[1]);
+        assertCollect(data, avg2xint,
+                      s -> s.mapToInt(x -> x * 2).average().orElse(0));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testJoin(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        withData(data)
+                .terminal(s -> s.map(Object::toString).collect(Collectors.joining()))
+                .expectedResult(join(data, ""))
+                .exercise();
+
+        Collector<String, StringBuilder, String> likeJoining = Collector.of(StringBuilder::new, StringBuilder::append, (sb1, sb2) -> sb1.append(sb2.toString()), StringBuilder::toString);
+        withData(data)
+                .terminal(s -> s.map(Object::toString).collect(likeJoining))
+                .expectedResult(join(data, ""))
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString).collect(Collectors.joining(",")))
+                .expectedResult(join(data, ","))
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString).collect(Collectors.joining(",", "[", "]")))
+                .expectedResult("[" + join(data, ",") + "]")
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString)
+                                .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append)
+                                .toString())
+                .expectedResult(join(data, ""))
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString)
+                                .collect(() -> new StringJoiner(","),
+                                         (sj, cs) -> sj.add(cs),
+                                         (j1, j2) -> j1.merge(j2))
+                                .toString())
+                .expectedResult(join(data, ","))
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString)
+                                .collect(() -> new StringJoiner(",", "[", "]"),
+                                         (sj, cs) -> sj.add(cs),
+                                         (j1, j2) -> j1.merge(j2))
+                                .toString())
+                .expectedResult("[" + join(data, ",") + "]")
+                .exercise();
+    }
+
+    private<T> String join(TestData.OfRef<T> data, String delim) {
+        StringBuilder sb = new StringBuilder();
+        boolean first = true;
+        for (T i : data) {
+            if (!first)
+                sb.append(delim);
+            sb.append(i.toString());
+            first = false;
+        }
+        return sb.toString();
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testSimpleToMap(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Function<Integer, Integer> keyFn = i -> i * 2;
+        Function<Integer, Integer> valueFn = i -> i * 4;
+
+        List<Integer> dataAsList = Arrays.asList(data.stream().toArray(Integer[]::new));
+        Set<Integer> dataAsSet = new HashSet<>(dataAsList);
+
+        BinaryOperator<Integer> sum = Integer::sum;
+        for (BinaryOperator<Integer> op : Arrays.asList((u, v) -> u,
+                                                        (u, v) -> v,
+                                                        sum)) {
+            try {
+                exerciseMapTabulation(data, toMap(keyFn, valueFn),
+                                      new ToMapAssertion<>(keyFn, valueFn, op, HashMap.class));
+                if (dataAsList.size() != dataAsSet.size())
+                    fail("Expected ISE on input with duplicates");
+            }
+            catch (IllegalStateException e) {
+                if (dataAsList.size() == dataAsSet.size())
+                    fail("Expected no ISE on input without duplicates");
+            }
+
+            exerciseMapTabulation(data, toMap(keyFn, valueFn, op),
+                                  new ToMapAssertion<>(keyFn, valueFn, op, HashMap.class));
+
+            exerciseMapTabulation(data, toMap(keyFn, valueFn, op, TreeMap::new),
+                                  new ToMapAssertion<>(keyFn, valueFn, op, TreeMap.class));
+        }
+
+        // For concurrent maps, only use commutative merge functions
+        try {
+            exerciseMapTabulation(data, toConcurrentMap(keyFn, valueFn),
+                                  new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentHashMap.class));
+            if (dataAsList.size() != dataAsSet.size())
+                fail("Expected ISE on input with duplicates");
+        }
+        catch (IllegalStateException e) {
+            if (dataAsList.size() == dataAsSet.size())
+                fail("Expected no ISE on input without duplicates");
+        }
+
+        exerciseMapTabulation(data, toConcurrentMap(keyFn, valueFn, sum),
+                              new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentHashMap.class));
+
+        exerciseMapTabulation(data, toConcurrentMap(keyFn, valueFn, sum, ConcurrentSkipListMap::new),
+                              new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentSkipListMap.class));
+    }
+
     @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
     public void testSimpleGroupBy(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
         Function<Integer, Integer> classifier = i -> i % 3;
--- a/jdk/test/javax/print/attribute/autosense/PrintAutoSenseData.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/javax/print/attribute/autosense/PrintAutoSenseData.java	Tue Aug 13 18:34:12 2013 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4468109
+ * @bug 4468109 8021583
  * @summary Test for printing AUTOSENSE DocFlavor.  No exception should be thrown.
  * @run main PrintAutoSenseData
 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/print/attribute/autosense/sample.txt	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,1 @@
+This is a program for testing AutoSense data.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTabbedPane/4361477/bug4361477.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import javax.swing.event.*;
+import sun.awt.SunToolkit;
+
+/*
+ * @test
+ * @bug 4361477
+ * @summary JTabbedPane throws ArrayOutOfBoundsException
+ * @author Oleg Mokhovikov
+ * @run main bug4361477
+ */
+public class bug4361477 {
+
+    static JTabbedPane tabbedPane;
+    volatile static boolean bStateChanged = false;
+    volatile static Rectangle bounds;
+
+    public static void main(String args[]) throws Exception {
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                createAndShowUI();
+            }
+        });
+
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                bounds = tabbedPane.getUI().getTabBounds(tabbedPane, 0);
+            }
+        });
+
+        Point location = bounds.getLocation();
+        SwingUtilities.convertPointToScreen(location, tabbedPane);
+        robot.mouseMove(location.x + 1, location.y + 1);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        if (!bStateChanged) {
+            throw new RuntimeException("Tabbed pane state is not changed");
+        }
+    }
+
+    static void createAndShowUI() {
+
+        final JFrame frame = new JFrame();
+        tabbedPane = new JTabbedPane();
+        tabbedPane.add("Tab0", new JPanel());
+        tabbedPane.add("Tab1", new JPanel());
+        tabbedPane.add("Tab2", new JPanel());
+        tabbedPane.setSelectedIndex(2);
+        tabbedPane.addChangeListener(new ChangeListener() {
+
+            public void stateChanged(final ChangeEvent pick) {
+                bStateChanged = true;
+                if (tabbedPane.getTabCount() == 3) {
+                    tabbedPane.remove(2);
+                }
+            }
+        });
+
+        frame.getContentPane().add(tabbedPane);
+        frame.setSize(300, 200);
+        frame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTabbedPane/6495408/bug6495408.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import sun.awt.SunToolkit;
+/*
+ * @test
+ * @bug 6495408
+ * @summary REGRESSION: JTabbedPane throws ArrayIndexOutOfBoundsException
+ * @author Alexander Potochkin
+ * @run main bug6495408
+ */
+
+public class bug6495408 {
+
+    static JTabbedPane tabbedPane;
+
+    public static void main(String[] args) throws Exception {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        final Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            public void run() {
+                final JFrame frame = new JFrame();
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                tabbedPane = new JTabbedPane();
+                tabbedPane.setTabPlacement(JTabbedPane.LEFT);
+                tabbedPane.addTab("Hello", null);
+                frame.add(tabbedPane);
+                frame.setSize(400, 400);
+                frame.setLocationRelativeTo(null);
+                frame.setVisible(true);
+            }
+        });
+
+        toolkit.realSync();
+
+        final Rectangle d = new Rectangle();
+        final Point p = new Point();
+
+        for (int i = 0; i < 7; i++) {
+            SwingUtilities.invokeLater(new Runnable() {
+
+                public void run() {
+                    int tab = tabbedPane.getTabCount() - 1;
+                    Rectangle bounds = tabbedPane.getBoundsAt(tab);
+                    if (bounds != null) {
+                        d.setBounds(bounds);
+                        p.setLocation(d.x + d.width / 2, d.y + d.height / 2);
+                        SwingUtilities.convertPointToScreen(p, tabbedPane);
+                        robot.mouseMove(p.x, p.y + d.height);
+                        tabbedPane.addTab("Hello", null);
+                    }
+                }
+            });
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTabbedPane/7161568/bug7161568.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.awt.*;
+import javax.swing.*;
+import java.awt.event.*;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 7161568
+ * @author Alexander Scherbatiy
+ * @summary Tests that navigating tabs in the JTAbbedPane does not throw NPE
+ * @run main bug7161568
+ */
+public class bug7161568 {
+
+    private static final int N = 50;
+    private static JTabbedPane tabbedPane;
+
+    public static void main(String[] args) throws Exception {
+        UIManager.put("TabbedPane.selectionFollowsFocus", Boolean.FALSE);
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                createAndShowUI();
+            }
+        });
+
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+
+            @Override
+            public void run() {
+                tabbedPane.requestFocus();
+            }
+        });
+
+        toolkit.realSync();
+
+        for (int i = 0; i < N; i++) {
+            robot.keyPress(KeyEvent.VK_LEFT);
+            robot.keyRelease(KeyEvent.VK_LEFT);
+            toolkit.realSync();
+        }
+    }
+
+    static void createAndShowUI() {
+        JFrame frame = new JFrame("Test");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setSize(100, 100);
+
+        tabbedPane = new JTabbedPane();
+
+        for (int i = 0; i < N; i++) {
+            tabbedPane.addTab("Tab: " + i, new JLabel("Test"));
+        }
+
+        tabbedPane.setSelectedIndex(0);
+
+        frame.getContentPane().add(tabbedPane);
+        frame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 8016833
+   @summary underlines and strikethroughs should be  painted at the correct
+            positions for different kind of text styles: normal, superscript and subscript
+   @author Anton Nashatyrev
+   @run main bug8016833
+*/
+import javax.swing.*;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Style;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.StyledDocument;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.lang.reflect.InvocationTargetException;
+
+public class bug8016833 {
+
+    void drawText(final Graphics g, final boolean underline, final boolean strikethrough, final boolean background) {
+        drawText(g, "mama", underline, strikethrough, background);
+    }
+
+    void drawText(final Graphics g, final String text, final boolean underline, final boolean strikethrough, final boolean background) {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    final JTextPane comp = new JTextPane();
+                    final StyledDocument doc = comp.getStyledDocument();
+
+                    Style style = comp.addStyle("superscript", null);
+                    setNormalStyle(style);
+
+                    if (underline) {
+                        StyleConstants.setUnderline(style, true);
+                    }
+                    if (strikethrough) {
+                        StyleConstants.setStrikeThrough(style, true);
+                    }
+                    if (background) {
+                        StyleConstants.setBackground(style, Color.BLUE);
+                    }
+                    try {
+                        doc.insertString(doc.getLength(), "mama", style);
+                    } catch (BadLocationException e) {
+                        throw new RuntimeException(e);
+                    }
+
+                    comp.setSize(200, 100);
+                    comp.paint(g);
+                }
+            });
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        } catch (InvocationTargetException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    void setNormalStyle(Style style) {
+        StyleConstants.setSuperscript(style, true);
+    }
+
+    int getEmptyPixel() {
+        return 0xFFFFFFFF;
+    }
+
+    boolean isPixelEmpty(int argb) {
+        return (argb & 0x00FFFFFF) == (getEmptyPixel() & 0x00FFFFFF);
+    }
+
+    boolean isLineEmpty(BufferedImage img, int coord, boolean isHorizontal) {
+        int len = isHorizontal ? img.getWidth() : img.getHeight();
+        for (int i = 0; i < len; i++) {
+            int pixel = isHorizontal ? img.getRGB(i, coord) : img.getRGB(coord, i);
+            if (!isPixelEmpty(pixel)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    Rectangle getPixelsOutline(BufferedImage img) {
+        int x1 = 0;
+        while (x1 < img.getWidth() && isLineEmpty(img, x1, false)) {
+            x1++;
+        }
+        int x2 = img.getWidth() - 1;
+        while (x2 >= 0 && isLineEmpty(img, x2, false)) {
+            x2--;
+        }
+        int y1 = 0;
+        while (y1 < img.getHeight() && isLineEmpty(img, y1, true)) {
+            y1++;
+        }
+        int y2 = img.getHeight() - 1;
+        while (y2 >= 0 && isLineEmpty(img, y2, true)) {
+            y2--;
+        }
+
+        return new Rectangle(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
+    }
+
+    BufferedImage createImage() {
+        final BufferedImage img = new BufferedImage(200, 100, BufferedImage.TYPE_INT_ARGB);
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    Graphics g = img.getGraphics();
+                    g.setColor(new Color(getEmptyPixel()));
+                    g.fillRect(0, 0, 10000, 10000);
+                }
+            });
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        } catch (InvocationTargetException e) {
+            throw new RuntimeException(e);
+        }
+        return img;
+    }
+
+    int subPixels(int pix1, int pix2) {
+        if (pix1 == pix2) {
+            return getEmptyPixel();
+        }
+        return pix1;
+    }
+
+    /**
+     * Subtracts img2 from img1
+     */
+    BufferedImage subImages(BufferedImage img1, BufferedImage img2) {
+        if (img1.getHeight() != img2.getHeight() ||
+                img1.getWidth() != img2.getWidth()) {
+            throw new RuntimeException("Different sizes");
+        }
+        BufferedImage ret = new BufferedImage(img1.getWidth(), img1.getHeight(), img1.getType());
+
+        for (int x = 0; x < ret.getWidth(); x++) {
+            for (int y = 0; y < ret.getHeight(); y++) {
+                ret.setRGB(x, y, subPixels(img1.getRGB(x, y), img2.getRGB(x, y)));
+            }
+        }
+        return ret;
+    }
+
+    void testUnderline() {
+        System.out.println("  testUnderline()");
+
+        final BufferedImage img1 = createImage();
+        drawText(img1.getGraphics(), true, false, false);
+        final Rectangle out1 = getPixelsOutline(img1);
+        System.out.println("   Underlined: " + out1);
+
+        final BufferedImage img2 = createImage();
+        drawText(img2.getGraphics(), false, false, false);
+        final Rectangle out2 = getPixelsOutline(img2);
+        System.out.println("   Normal: " + out2);
+
+        final BufferedImage img3 = subImages(img1, img2);
+        final Rectangle out3 = getPixelsOutline(img3);
+        System.out.println("   Sub: " + out3);
+
+        // underline is not too thick
+        assertTrue(out3.getHeight() <= 2);
+        // not too wide
+        assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
+        // not too low
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 3);
+        // not too high
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) > 0);
+    }
+
+    void testStrikthrough() {
+        System.out.println("  testStrikthrough()");
+
+        final BufferedImage img1 = createImage();
+        drawText(img1.getGraphics(), false, true, false);
+        final Rectangle out1 = getPixelsOutline(img1);
+        System.out.println("   Striked: " + out1);
+
+        final BufferedImage img2 = createImage();
+        drawText(img2.getGraphics(), false, false, false);
+        final Rectangle out2 = getPixelsOutline(img2);
+        System.out.println("   Normal: " + out2);
+
+        final BufferedImage img3 = subImages(img1, img2);
+        final Rectangle out3 = getPixelsOutline(img3);
+        System.out.println("   Sub: " + out3);
+
+        // strikethrough is not too thick
+        assertTrue(out3.getHeight() <= 2);
+        // not too wide
+        assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
+        // not too low
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 0);
+        // not too high
+        assertTrue(out3.getY() - out1.getY() > 1);
+    }
+    void assertTrue(boolean b) {
+        if (!b) {
+            throw new RuntimeException("Assertion failed");
+        }
+    }
+
+    static void testSuperScript() {
+        System.out.println("testSuperScript()");
+        bug8016833 b = new bug8016833() {
+            @Override
+            void setNormalStyle(Style style) {
+                StyleConstants.setSuperscript(style, true);
+            }
+        };
+        b.testUnderline();
+        b.testStrikthrough();
+    }
+
+    static void testSubScript() {
+        System.out.println("testSubScript()");
+        bug8016833 b = new bug8016833() {
+            @Override
+            void setNormalStyle(Style style) {
+                StyleConstants.setSubscript(style, true);
+            }
+        };
+        b.testUnderline();
+        b.testStrikthrough();
+    }
+
+    static void testNormalScript() {
+        System.out.println("testNormalScript()");
+        bug8016833 b = new bug8016833() {
+            @Override
+            void setNormalStyle(Style style) {
+            }
+        };
+        b.testUnderline();
+        b.testStrikthrough();
+    }
+
+    public static void main(String[] args) {
+        testSubScript();
+        testSuperScript();
+        testNormalScript();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/xml/crypto/dsig/TransformService/NullParent.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8022120
+ * @summary check that the init and marshalParams methods throw
+ *          NullPointerException when the parent parameter is null
+ */
+
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.Transform;
+import javax.xml.crypto.dsig.TransformService;
+
+public class NullParent {
+
+    public static void main(String[] args) throws Exception {
+        String[] transforms = new String[]
+            { Transform.BASE64, Transform.ENVELOPED, Transform.XPATH,
+              Transform.XPATH2, Transform.XSLT,
+              CanonicalizationMethod.EXCLUSIVE,
+              CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS,
+              CanonicalizationMethod.INCLUSIVE,
+              CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS };
+
+        for (String transform : transforms) {
+            System.out.println("Testing " + transform);
+            TransformService ts = TransformService.getInstance(transform,
+                                                               "DOM");
+            try {
+                ts.init(null, null);
+                throw new Exception("init must throw NullPointerException " +
+                                    "when the parent parameter is null");
+            } catch (NullPointerException npe) { }
+            try {
+                ts.marshalParams(null, null);
+                throw new Exception("marshalParams must throw " +
+                                    "NullPointerException when the parent " +
+                                    "parameter is null");
+            } catch (NullPointerException npe) { }
+        }
+    }
+}
--- a/jdk/test/jdk/lambda/MethodReferenceTestInstanceMethod.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/jdk/lambda/MethodReferenceTestInstanceMethod.java	Tue Aug 13 18:34:12 2013 -0700
@@ -47,7 +47,7 @@
     }
 
     public void testStringBuffer() {
-        String s = generate().collect(Collectors.toStringBuilder()).toString();
+        String s = generate().collect(Collectors.joining());
         assertEquals(s, "THREEFOURFIVE");
     }
 
--- a/jdk/test/jdk/lambda/separate/TestHarness.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/jdk/test/jdk/lambda/separate/TestHarness.java	Tue Aug 13 18:34:12 2013 -0700
@@ -119,7 +119,7 @@
         Class stub = new Class(specimen.getName(), cm);
 
         String params =
-            Arrays.asList(args).stream().collect(Collectors.toStringJoiner(", ")).toString();
+            Arrays.asList(args).stream().collect(Collectors.joining(", ")).toString();
 
         ConcreteMethod sm = new ConcreteMethod(
             method.getReturnType(), method.getName(),
@@ -150,7 +150,7 @@
             null, Arrays.asList((Method)method));
         Class cstub = new Class(specimen.getName());
 
-        String params = Arrays.asList(args).stream().collect(Collectors.toStringJoiner(", ")).toString();
+        String params = Arrays.asList(args).stream().collect(Collectors.joining(", ")).toString();
 
         ConcreteMethod sm = new ConcreteMethod(
             "int", SourceModel.stdMethodName,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/tools/jarsigner/collator.sh	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,76 @@
+#
+# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# @test
+# @bug 8021789
+# @summary jarsigner parses alias as command line option (depending on locale)
+#
+
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVAC_CMD=`which javac`
+  TESTJAVA=`dirname $JAVAC_CMD`/..
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  Windows_* )
+    FS="\\"
+    ;;
+  * )
+    FS="/"
+    ;;
+esac
+
+F=collator
+KS=collator.jks
+JFILE=collator.jar
+
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
+        -keystore $KS"
+JAR=$TESTJAVA${FS}bin${FS}jar
+JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner -keystore $KS -storepass changeit"
+
+rm $F $KS $JFILE 2> /dev/null
+
+echo 12345 > $F
+$JAR cvf $JFILE $F
+
+ERR=""
+
+$KT -alias debug -dname CN=debug -genkey -validity 300 || ERR="$ERR 1"
+
+# use "debug" as alias name
+$JARSIGNER $JFILE debug || ERR="$ERR 2"
+
+# use "" as alias name (although there will be a warning)
+$JARSIGNER -verify $JFILE "" || ERR="$ERR 3"
+
+if [ "$ERR" = "" ]; then
+    exit 0
+else
+    echo "ERR is $ERR"
+    exit 1
+fi
+
+
--- a/langtools/.hgtags	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/.hgtags	Tue Aug 13 18:34:12 2013 -0700
@@ -223,3 +223,4 @@
 6d85acab769eb79bc058f5640fa86a6ef096a583 jdk8-b99
 82f68da70e471ee5640016e3f38c014347a5c785 jdk8-b100
 0324dbf07b0f1cc51ad9fa18976489d02d23b60d jdk8-b101
+453a305e116507847cc6577b80b4d9794bcb08bf jdk8-b102
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -101,7 +101,7 @@
             Content tdSummary) {
         ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
         String name = emd.name();
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getDocLink(context, cd, (MemberDoc) emd,
                 name, false));
         Content code = HtmlTree.CODE(strong);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -225,7 +225,7 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getDocLink(context, (MemberDoc) member, member.name(), false));
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -262,7 +262,7 @@
         annotationInfoTree.addContent(hr);
         Tag[] deprs = annotationType.tags("deprecated");
         if (Util.isDeprecated(annotationType)) {
-            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
             Content div = HtmlTree.DIV(HtmlStyle.block, strong);
             if (deprs.length > 0) {
                 Tag[] commentTags = deprs[0].inlineTags();
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -547,7 +547,7 @@
         classInfoTree.addContent(hr);
         Tag[] deprs = classDoc.tags("deprecated");
         if (Util.isDeprecated(classDoc)) {
-            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
             Content div = HtmlTree.DIV(HtmlStyle.block, strong);
             if (deprs.length > 0) {
                 Tag[] commentTags = deprs[0].inlineTags();
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -222,7 +222,7 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getDocLink(context, (MemberDoc) member, member.name(), false));
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -139,7 +139,7 @@
                             holder.typeName() : holder.qualifiedTypeName(),
                             false);
                 Content codeLink = HtmlTree.CODE(link);
-                Content strong = HtmlTree.STRONG(holder.isClass()?
+                Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
                    writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
                 strong.addContent(writer.getSpace());
                 strong.addContent(codeLink);
@@ -256,7 +256,7 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false));
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -316,7 +316,7 @@
         liConst.addContent(constPara);
         ul.addContent(liConst);
         Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
-        Content line30 = HtmlTree.EM(getResource("doclet.Help_line_30"));
+        Content line30 = HtmlTree.SPAN(HtmlStyle.italic, getResource("doclet.Help_line_30"));
         divContent.addContent(line30);
         contentTree.addContent(divContent);
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -467,8 +467,7 @@
             }
         }
         Content rawContent = new RawHtml(content);
-        Content em = HtmlTree.EM(rawContent);
-        return em;
+        return rawContent;
     }
 
     /**
@@ -1029,7 +1028,7 @@
 
     public Content italicsClassName(ClassDoc cd, boolean qual) {
         Content name = new StringContent((qual)? cd.qualifiedName(): cd.name());
-        return (cd.isInterface())?  HtmlTree.I(name): name;
+        return (cd.isInterface())?  HtmlTree.SPAN(HtmlStyle.italic, name): name;
     }
 
     /**
@@ -1545,7 +1544,7 @@
         Content div;
         Content result = commentTagsToContent(null, doc, tags, first);
         if (depr) {
-            Content italic = HtmlTree.I(result);
+            Content italic = HtmlTree.SPAN(HtmlStyle.italic, result);
             div = HtmlTree.DIV(HtmlStyle.block, italic);
             htmltree.addContent(div);
         }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -159,7 +159,7 @@
                             holder.typeName() : holder.qualifiedTypeName(),
                             false);
                 Content codelLink = HtmlTree.CODE(link);
-                Content strong = HtmlTree.STRONG(holder.asClassDoc().isClass()?
+                Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.asClassDoc().isClass()?
                     writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
                 strong.addContent(writer.getSpace());
                 strong.addContent(codelLink);
@@ -309,7 +309,7 @@
                 label = writer.specifiedByLabel;
                 context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY;
             }
-            Content dt = HtmlTree.DT(HtmlTree.STRONG(label));
+            Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, label));
             dl.addContent(dt);
             Content overriddenTypeLink =
                     writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType));
@@ -364,7 +364,7 @@
             Content intfaclink = writer.getLink(new LinkInfoImpl(
                     writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac));
             Content codeIntfacLink = HtmlTree.CODE(intfaclink);
-            Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel));
+            Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, writer.specifiedByLabel));
             dl.addContent(dt);
             Content methlink = writer.getDocLink(
                     LinkInfoImpl.Kind.MEMBER, implementedMeth,
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -164,7 +164,7 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
                 writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member)));
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -183,7 +183,7 @@
                     printedHeader = true;
                 }
                 Content arr_i_name = new StringContent(arr[i].name());
-                if (arr[i].isInterface()) arr_i_name = HtmlTree.I(arr_i_name);
+                if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
                 Content link = getLink(new LinkInfoImpl(configuration,
                         LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
                 Content li = HtmlTree.LI(link);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -174,7 +174,7 @@
                     printedHeader = true;
                 }
                 Content arr_i_name = new StringContent(arr[i].name());
-                if (arr[i].isInterface()) arr_i_name = HtmlTree.I(arr_i_name);
+                if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
                 Content link = getLink(new LinkInfoImpl(configuration,
                         LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
                 Content li = HtmlTree.LI(link);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -135,7 +135,7 @@
                             holder.typeName() : holder.qualifiedTypeName(),
                             false);
                 Content codeLink = HtmlTree.CODE(link);
-                Content strong = HtmlTree.STRONG(holder.isClass()?
+                Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
                    writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
                 strong.addContent(writer.getSpace());
                 strong.addContent(codeLink);
@@ -252,13 +252,12 @@
      */
     protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
             Content tdSummary) {
-        Content strong = HtmlTree.STRONG(
-                writer.getDocLink(context,
-                        cd,
-                        (MemberDoc) member,
-                        member.name().substring(0, member.name().lastIndexOf("Property")),
-                        false,
-                        true));
+        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+                writer.getDocLink(context, cd,
+                (MemberDoc) member,
+                member.name().substring(0, member.name().lastIndexOf("Property")),
+                false,
+                true));
 
         Content code = HtmlTree.CODE(strong);
         tdSummary.addContent(code);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Tue Aug 13 18:34:12 2013 -0700
@@ -175,7 +175,7 @@
         Tag[] deprs = member.tags("deprecated");
         Content div;
         if (Util.isDeprecated((ProgramElementDoc) member)) {
-            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
             div = HtmlTree.DIV(HtmlStyle.block, strong);
             div.addContent(getSpace());
             if (deprs.length > 0) {
@@ -186,7 +186,7 @@
         } else {
             ClassDoc cd = ((ProgramElementDoc)member).containingClass();
             if (cd != null && Util.isDeprecated(cd)) {
-                Content strong = HtmlTree.STRONG(deprecatedPhrase);
+                Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
                 div = HtmlTree.DIV(HtmlStyle.block, strong);
                 div.addContent(getSpace());
                 tdSummary.addContent(div);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Tue Aug 13 18:34:12 2013 -0700
@@ -118,7 +118,7 @@
                 if (deprs.length > 0) {
                     Content body = commentTagsToOutput(null, doc,
                         deprs[0].inlineTags(), false);
-                    result.addContent(HtmlTree.I(body));
+                    result.addContent(HtmlTree.SPAN(HtmlStyle.italic, body));
                 }
             } else {
                 if (Util.isDeprecated(member.containingClass())) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,7 @@
     indexContainer,
     indexHeader,
     inheritance,
+    italic,
     legalCopy,
     nameValue,
     navBarCell1Rev,
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Tue Aug 13 18:34:12 2013 -0700
@@ -282,17 +282,6 @@
     }
 
     /**
-     * Generates a EM tag with some content.
-     *
-     * @param body content to be added to the tag
-     * @return an HtmlTree object for the EM tag
-     */
-    public static HtmlTree EM(Content body) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.EM, nullCheck(body));
-        return htmltree;
-    }
-
-    /**
      * Generates a FRAME tag.
      *
      * @param src the url of the document to be shown in the frame
@@ -416,17 +405,6 @@
     }
 
     /**
-     * Generates a I tag with some content.
-     *
-     * @param body content for the tag
-     * @return an HtmlTree object for the I tag
-     */
-    public static HtmlTree I(Content body) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.I, nullCheck(body));
-        return htmltree;
-    }
-
-    /**
      * Generates a LI tag with some content.
      *
      * @param body content for the tag
@@ -559,17 +537,6 @@
     }
 
     /**
-     * Generates a STRONG tag with some content.
-     *
-     * @param body content for the tag
-     * @return an HtmlTree object for the STRONG tag
-     */
-    public static HtmlTree STRONG(Content body) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.STRONG, nullCheck(body));
-        return htmltree;
-    }
-
-    /**
      * Generates a SPAN tag with some content.
      *
      * @param body content for the tag
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Tue Aug 13 18:34:12 2013 -0700
@@ -77,6 +77,7 @@
     float:right;
     padding:0px 21px;
     font-size:.8em;
+    font-style:italic;
     z-index:200;
     margin-top:-7px;
 }
@@ -519,3 +520,6 @@
 .strong {
     font-weight:bold;
 }
+.italic {
+    font-style:italic;
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/Main.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/javac/Main.java	Tue Aug 13 18:34:12 2013 -0700
@@ -26,8 +26,6 @@
 package com.sun.tools.javac;
 
 import java.io.PrintWriter;
-import java.lang.reflect.*;
-
 
 /**
  * The programmatic interface for the Java Programming Language
@@ -44,23 +42,12 @@
 @jdk.Supported
 public class Main {
 
-    /** Unsupported command line interface.
-     * @param args   The command line parameters.
+    /** Main entry point for the launcher.
+     *  Note: This method calls System.exit.
+     *  @param args command line arguments
      */
     public static void main(String[] args) throws Exception {
-      if (args.length > 0 && args[0].equals("-Xjdb")) {
-        String[] newargs = new String[args.length + 2];
-        Class<?> c = Class.forName("com.sun.tools.example.debug.tty.TTY");
-        Method method = c.getDeclaredMethod ("main", new Class<?>[] {args.getClass()});
-        method.setAccessible(true);
-        System.arraycopy(args, 1, newargs, 3, args.length - 1);
-        newargs[0] = "-connect";
-        newargs[1] = "com.sun.jdi.CommandLineLaunch:options=-esa -ea:com.sun.tools...";
-        newargs[2] = "com.sun.tools.javac.Main";
-        method.invoke(null, new Object[] { newargs });
-      } else {
         System.exit(compile(args));
-      }
     }
 
     /** Programmatic interface to the Java Programming Language
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1478,74 +1478,82 @@
             code.statBegin(TreeInfo.endPos(body));
             genFinalizer(env);
             code.statBegin(TreeInfo.endPos(env.tree));
-            Chain exitChain = code.branch(goto_);
+            Chain exitChain;
+            if (startpc != endpc) {
+                exitChain = code.branch(goto_);
+            } else {
+                exitChain = code.branch(dontgoto);
+            }
             endFinalizerGap(env);
-            if (startpc != endpc) for (List<JCCatch> l = catchers; l.nonEmpty(); l = l.tail) {
-                // start off with exception on stack
-                code.entryPoint(stateTry, l.head.param.sym.type);
-                genCatch(l.head, env, startpc, endpc, gaps);
-                genFinalizer(env);
-                if (hasFinalizer || l.tail.nonEmpty()) {
-                    code.statBegin(TreeInfo.endPos(env.tree));
-                    exitChain = Code.mergeChains(exitChain,
-                                                 code.branch(goto_));
+            if (startpc != endpc) {
+                for (List<JCCatch> l = catchers; l.nonEmpty(); l = l.tail) {
+                    // start off with exception on stack
+                    code.entryPoint(stateTry, l.head.param.sym.type);
+                    genCatch(l.head, env, startpc, endpc, gaps);
+                    genFinalizer(env);
+                    if (hasFinalizer || l.tail.nonEmpty()) {
+                        code.statBegin(TreeInfo.endPos(env.tree));
+                        exitChain = Code.mergeChains(exitChain,
+                                                     code.branch(goto_));
+                    }
+                    endFinalizerGap(env);
                 }
-                endFinalizerGap(env);
-            }
-            if (hasFinalizer) {
-                // Create a new register segement to avoid allocating
-                // the same variables in finalizers and other statements.
-                code.newRegSegment();
-
-                // Add a catch-all clause.
-
-                // start off with exception on stack
-                int catchallpc = code.entryPoint(stateTry, syms.throwableType);
 
-                // Register all exception ranges for catch all clause.
-                // The range of the catch all clause is from the beginning
-                // of the try or synchronized block until the present
-                // code pointer excluding all gaps in the current
-                // environment's GenContext.
-                int startseg = startpc;
-                while (env.info.gaps.nonEmpty()) {
-                    int endseg = env.info.gaps.next().intValue();
-                    registerCatch(body.pos(), startseg, endseg,
-                                  catchallpc, 0);
-                    startseg = env.info.gaps.next().intValue();
-                }
-                code.statBegin(TreeInfo.finalizerPos(env.tree));
-                code.markStatBegin();
+                if (hasFinalizer) {
+                    // Create a new register segement to avoid allocating
+                    // the same variables in finalizers and other statements.
+                    code.newRegSegment();
+
+                    // Add a catch-all clause.
+
+                    // start off with exception on stack
+                    int catchallpc = code.entryPoint(stateTry, syms.throwableType);
 
-                Item excVar = makeTemp(syms.throwableType);
-                excVar.store();
-                genFinalizer(env);
-                excVar.load();
-                registerCatch(body.pos(), startseg,
-                              env.info.gaps.next().intValue(),
-                              catchallpc, 0);
-                code.emitop0(athrow);
-                code.markDead();
-
-                // If there are jsr's to this finalizer, ...
-                if (env.info.cont != null) {
-                    // Resolve all jsr's.
-                    code.resolve(env.info.cont);
-
-                    // Mark statement line number
+                    // Register all exception ranges for catch all clause.
+                    // The range of the catch all clause is from the beginning
+                    // of the try or synchronized block until the present
+                    // code pointer excluding all gaps in the current
+                    // environment's GenContext.
+                    int startseg = startpc;
+                    while (env.info.gaps.nonEmpty()) {
+                        int endseg = env.info.gaps.next().intValue();
+                        registerCatch(body.pos(), startseg, endseg,
+                                      catchallpc, 0);
+                        startseg = env.info.gaps.next().intValue();
+                    }
                     code.statBegin(TreeInfo.finalizerPos(env.tree));
                     code.markStatBegin();
 
-                    // Save return address.
-                    LocalItem retVar = makeTemp(syms.throwableType);
-                    retVar.store();
+                    Item excVar = makeTemp(syms.throwableType);
+                    excVar.store();
+                    genFinalizer(env);
+                    excVar.load();
+                    registerCatch(body.pos(), startseg,
+                                  env.info.gaps.next().intValue(),
+                                  catchallpc, 0);
+                    code.emitop0(athrow);
+                    code.markDead();
+
+                    // If there are jsr's to this finalizer, ...
+                    if (env.info.cont != null) {
+                        // Resolve all jsr's.
+                        code.resolve(env.info.cont);
 
-                    // Generate finalizer code.
-                    env.info.finalize.genLast();
+                        // Mark statement line number
+                        code.statBegin(TreeInfo.finalizerPos(env.tree));
+                        code.markStatBegin();
+
+                        // Save return address.
+                        LocalItem retVar = makeTemp(syms.throwableType);
+                        retVar.store();
 
-                    // Return.
-                    code.emitop1w(ret, retVar.reg);
-                    code.markDead();
+                        // Generate finalizer code.
+                        env.info.finalize.genLast();
+
+                        // Return.
+                        code.emitop1w(ret, retVar.reg);
+                        code.markDead();
+                    }
                 }
             }
             // Resolve all breaks.
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java	Tue Aug 13 18:34:12 2013 -0700
@@ -172,8 +172,8 @@
         }
 
         // So we have a containing type
-        String annoTypeName = annoType.getSimpleName();
-        String containerTypeName = containerType.getSimpleName();
+        String annoTypeName = annoType.getName();
+        String containerTypeName = containerType.getName();
         int directIndex = -1, containerIndex = -1;
         Attribute.Compound direct = null, container = null;
         // Find directly (explicit or implicit) present annotations
@@ -303,8 +303,8 @@
         }
 
         // So we have a containing type
-        String annoTypeName = annoType.getSimpleName();
-        String containerTypeName = containerType.getSimpleName();
+        String annoTypeName = annoType.getName();
+        String containerTypeName = containerType.getName();
         int directIndex = -1, containerIndex = -1;
         Attribute.Compound direct = null, container = null;
         // Find directly (explicit or implicit) present annotations
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Tue Aug 13 18:34:12 2013 -0700
@@ -973,7 +973,6 @@
                     printBrackets((JCArrayTypeTree) elem);
             }
             if (tree.elems != null) {
-                if (tree.elemtype != null) print("[]");
                 print("{");
                 printExprs(tree.elems);
                 print("}");
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Tue Aug 13 18:34:12 2013 -0700
@@ -781,7 +781,7 @@
     class AnnotationBuilder implements Attribute.Visitor {
         JCExpression result = null;
         public void visitConstant(Attribute.Constant v) {
-            result = Literal(v.value);
+            result = Literal(v.type.getTag(), v.value);
         }
         public void visitClass(Attribute.Class clazz) {
             result = ClassLiteral(clazz.classType).setType(syms.classType);
--- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd(java.math.BigInteger)\" " +
                 "title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>"},
         {BUG_ID + FS + "C.html",
-            "<dl>" + NL + "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dl>" + NL + "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
             "<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>" + NL +
             "</dl>"}
     };
--- a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,13 +39,13 @@
     private static final String BUG_ID = "4857717";
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "XReader.html",
-            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
             "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read()\" " +
             "title=\"class or interface in java.io\">read</a></code>&nbsp;in class&nbsp;<code>" +
             "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\" " +
             "title=\"class or interface in java.io\">FilterReader</a></code></dd>"},
         {BUG_ID + FS + "pkg" + FS + "XReader.html",
-            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
             "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt()\" " +
             "title=\"class or interface in java.io\">readInt</a></code>&nbsp;in interface&nbsp;<code>" +
             "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\" " +
--- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Tue Aug 13 18:34:12 2013 -0700
@@ -94,18 +94,18 @@
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">This field indicates whether the C1 is " +
                  "undecorated.</div>" + NL + "&nbsp;" + NL + "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
                  "<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">Reads the object stream.</div>" + NL +
                  "<dl>" + NL + "<dt><span class=\"strong\">Throws:" +
                  "</span></dt>" + NL + "<dd><code><code>" +
@@ -153,18 +153,18 @@
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">This field indicates whether the C1 is " +
                  "undecorated.</div>" + NL + "&nbsp;" + NL + "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
                  "<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">Reads the object stream.</div>" + NL +
                  "<dl>" + NL + "<dt><span class=\"strong\">Throws:" +
                  "</span></dt>" + NL + "<dd><code><code>" +
@@ -187,14 +187,14 @@
                  "APPLICATION_EXCLUDE</pre>" + NL + "</li>"},
         {BUG_ID + FS + "serialized-form.html", "<pre>boolean " +
                  "undecorated</pre>" + NL + "<div class=\"block\"><span class=\"strong\">" +
-                 "Deprecated.</span>&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "Deprecated.</span>&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\"><code>" +
-                 "setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"},
+                 "setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
-                 "Deprecated.</span>&nbsp;<i>As of JDK version" +
+                 "Deprecated.</span>&nbsp;<span class=\"italic\">As of JDK version" +
                  " 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"}};
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}};
 
     // Test for valid HTML generation which should not comprise of empty
     // definition list tags.
--- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@
         },
         //Make sure "Specified By" has substituted type parameters.
         {BUG_ID + FS + "pkg" + FS + "Child.html",
-            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg/Interface.html#method()\">method</a>" +
             "</code>&nbsp;in interface&nbsp;<code>" +
             "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
@@ -92,7 +92,7 @@
          },
         //Make sure "Overrides" has substituted type parameters.
         {BUG_ID + FS + "pkg" + FS + "Child.html",
-            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg/Parent.html#method()\">method</a>" +
             "</code>&nbsp;in class&nbsp;<code><a href=\"../pkg/Parent.html\" " +
             "title=\"class in pkg\">Parent</a>&lt;<a href=\"../pkg/Child.html\" " +
--- a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java	Tue Aug 13 18:34:12 2013 -0700
@@ -49,7 +49,7 @@
                 "<div class=\"block\">Gets the value of the property rate.</div>" + NL +
                 "<dl>" + NL + "<dt><span class=\"strong\">Property description:</span></dt>" },
             {"./" + BUG_ID + "/C.html",
-                "<td class=\"colLast\"><code><strong><a href=\"C.html#rateProperty\">rate</a></strong></code>" + NL +
+                "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"C.html#rateProperty\">rate</a></span></code>" + NL +
                 "<div class=\"block\">Defines the direction/speed at which the <code>Timeline</code> is expected to"},
 
             {"./" + BUG_ID + "/C.html",
@@ -63,7 +63,7 @@
             {"./" + BUG_ID + "/C.html",
                 "<span class=\"strong\">Property description:</span>"},
             {"./" + BUG_ID + "/C.html",
-                "<td class=\"colLast\"><code><strong><a href=\"C.html#setTestMethodProperty()\">setTestMethodProperty</a></strong>()</code>&nbsp;</td>" },
+                "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"C.html#setTestMethodProperty()\">setTestMethodProperty</a></span>()</code>&nbsp;</td>" },
             {"./" + BUG_ID + "/C.html",
                 "<h4>isPaused</h4>" + NL +
                 "<pre>public final&nbsp;double&nbsp;isPaused()</pre>" + NL +
--- a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@
 
          // Test overriding/implementing methods with generic parameters.
                  {BUG_ID + FS + "pkg" + FS + "BaseClass.html",
-         "<dl>" + NL + "<dt><strong>Specified by:</strong></dt>" + NL +
+         "<dl>" + NL + "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
                           "<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation(java.lang.Class)\">" +
                           "getAnnotation</a></code>&nbsp;in interface&nbsp;<code>" +
                           "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" +
--- a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,8 +49,8 @@
         // Check return type in member summary.
         {BUG_ID + FS + "pkg" + FS + "PublicChild.html",
             "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>" + NL +
-            "<td class=\"colLast\"><code><strong><a href=\"../pkg/PublicChild.html#returnTypeTest()\">" +
-            "returnTypeTest</a></strong>()</code>"
+            "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../pkg/PublicChild.html#returnTypeTest()\">" +
+            "returnTypeTest</a></span>()</code>"
         },
         // Check return type in member detail.
         {BUG_ID + FS + "pkg" + FS + "PublicChild.html",
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Tue Aug 13 18:34:12 2013 -0700
@@ -62,7 +62,7 @@
                      "</span><span class=\"tabEnd\">&nbsp;</span></caption>"},
             //Detail for enum constant
             {BUG_ID + FS + "pkg" + FS + "Coin.html",
-                "<strong><a href=\"../pkg/Coin.html#Dime\">Dime</a></strong>"},
+                "<span class=\"strong\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>"},
             //Automatically insert documentation for values() and valueOf().
             {BUG_ID + FS + "pkg" + FS + "Coin.html",
                 "Returns an array containing the constants of this enum type,"},
@@ -320,11 +320,11 @@
                      "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
                      "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
-                     "Foo2</a>&gt;</strong></code>&nbsp;</td>"
+                     "Foo2</a>&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -334,8 +334,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest1." +
-                     "</span><code><strong><a href=\"../../pkg2/" +
-                     "ClassUseTest1.html#method(T)\">method</a></strong>" +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+                     "ClassUseTest1.html#method(T)\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
@@ -372,11 +372,11 @@
                     "</span></caption>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
-                    "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " +
+                    "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
                      "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
-                     "Foo2</a>&gt;</strong></code>&nbsp;</td>"
+                     "Foo2</a>&gt;</span></code>&nbsp;</td>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
                     "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -387,8 +387,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
                      "<td class=\"colLast\"><span class=\"strong\">" +
-                     "ClassUseTest1.</span><code><strong><a href=\"../../" +
-                     "pkg2/ClassUseTest1.html#method(T)\">method</a></strong>" +
+                     "ClassUseTest1.</span><code><span class=\"strong\"><a href=\"../../" +
+                     "pkg2/ClassUseTest1.html#method(T)\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
 
@@ -401,11 +401,11 @@
                      "&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
                      "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
-                     "Foo3</a>&gt;&gt;</strong></code>&nbsp;</td>"
+                     "Foo3</a>&gt;&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -416,8 +416,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
-                     "</span><code><strong><a href=\"../../pkg2/" +
-                     "ClassUseTest2.html#method(T)\">method</a></strong>" +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+                     "ClassUseTest2.html#method(T)\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
@@ -456,11 +456,11 @@
                      "Foo3</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
                      "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
-                     "Foo3</a>&gt;&gt;</strong></code>&nbsp;</td>"
+                     "Foo3</a>&gt;&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -471,8 +471,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
-                     "</span><code><strong><a href=\"../../pkg2/" +
-                     "ClassUseTest2.html#method(T)\">method</a></strong>" +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
+                     "ClassUseTest2.html#method(T)\">method</a></span>" +
                      "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
@@ -500,12 +500,12 @@
                      "&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
                      "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
                      "ParamTest2</a>&lt;java.util.List&lt;? extends " +
                      "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
-                     "Foo4</a>&gt;&gt;&gt;</strong></code>&nbsp;</td>"
+                     "Foo4</a>&gt;&gt;&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -516,8 +516,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3" +
-                     ".</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
-                     "html#method(T)\">method</a></strong>(T&nbsp;t)</code>&nbsp;</td>"
+                     ".</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+                     "html#method(T)\">method</a></span>(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../" +
@@ -538,12 +538,12 @@
                      "</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " +
+                     "<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
                      "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
                      "ParamTest2</a>&lt;java.util.List&lt;? extends " +
                      "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
-                     "Foo4</a>&gt;&gt;&gt;</strong></code>&nbsp;</td>"
+                     "Foo4</a>&gt;&gt;&gt;</span></code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                      "<caption><span>Methods in <a href=\"../../pkg2/" +
@@ -553,8 +553,8 @@
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
-                     "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
-                     "html#method(T)\">method</a></strong>(T&nbsp;t)</code>" +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+                     "html#method(T)\">method</a></span>(T&nbsp;t)</code>" +
                      "&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
@@ -587,8 +587,8 @@
                      "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" + NL +
                      "<td class=\"colFirst\"><code>void</code></td>" + NL +
                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
-                     "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
-                     "html#method(java.util.Set)\">method</a></strong>(java." +
+                     "</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
+                     "html#method(java.util.Set)\">method</a></span>(java." +
                      "util.Set&lt;<a href=\"../../pkg2/Foo4.html\" title=\"" +
                      "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code>&nbsp;</td>" + NL +
                      "</tr>" + NL + "</tbody>"
@@ -698,25 +698,25 @@
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\"," + NL +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
-            "public class <strong>AnnotationTypeUsage</strong></dt><dt>extends java.lang.Object</dt>"},
+            "public class <span class=\"strong\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>"},
 
         //FIELD
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\"," + NL +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
-            "public int <strong>field</strong>"},
+            "public int <span class=\"strong\">field</span>"},
 
         //CONSTRUCTOR
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\"," + NL +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
-            "public <strong>AnnotationTypeUsage</strong>()"},
+            "public <span class=\"strong\">AnnotationTypeUsage</span>()"},
 
         //METHOD
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\"," + NL +
             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
-            "public void <strong>method</strong>()"},
+            "public void <span class=\"strong\">method</span>()"},
 
         //=================================
         // Make sure annotation types do not
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testOptions/TestOptions.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug      4749567
+ * @summary  Test the output for -header and -footer options.
+ * @author   Bhavesh Patel
+ * @library  ../lib/
+ * @build    JavadocTester TestOptions
+ * @run main TestOptions
+ */
+
+public class TestOptions extends JavadocTester {
+
+    //Test information.
+    private static final String BUG_ID = "4749567";
+
+    //Javadoc arguments.
+    private static final String[] ARGS = new String[] {
+        "-d", BUG_ID, "-header", "Test header", "-footer", "Test footer",
+        "-sourcepath", SRC_DIR, "pkg"
+    };
+
+    private static final String[][] TEST = {
+        {BUG_ID + FS + "pkg" + FS + "package-summary.html",
+            "<div class=\"aboutLanguage\">Test header</div>"},
+        {BUG_ID + FS + "pkg" + FS + "package-summary.html",
+            "<div class=\"aboutLanguage\">Test footer</div>"}
+    };
+
+    private static final String[][] NEGATED_TEST = NO_TEST;
+
+    /**
+     * The entry point of the test.
+     * @param args the array of command line arguments.
+     */
+    public static void main(String[] args) {
+        TestOptions tester = new TestOptions();
+        run(tester, ARGS, TEST, NEGATED_TEST);
+        tester.printSummary();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBugId() {
+        return BUG_ID;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBugName() {
+        return getClass().getName();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testOptions/pkg/Foo.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public class Foo {}
+
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,9 +46,9 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-            "<strong>Description copied from class:&nbsp;<code>" +
+            "<span class=\"strong\">Description copied from class:&nbsp;<code>" +
             "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy()\">" +
-            "BaseClass</a></code></strong>"
+            "BaseClass</a></code></span>"
         }
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,12 +40,12 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}
     };
 
@@ -54,23 +54,23 @@
         //The package private method should be overriden since the base and sub class are in the same
         //package.  However, the link should not show up because the package private methods are not documented.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</strong></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
+         "Overrides:</span></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
     };
 
     private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,14 +40,14 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod()\">" +
                  "publicMethod</a></code>&nbsp;in class&nbsp;<code>" +
                  "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod()\">" +
                  "publicMethod</a></code>&nbsp;in class&nbsp;<code>" +
                  "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
@@ -55,7 +55,7 @@
         //The package private method should be overriden since the base and sub class are in the same
         //package.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">" +
                  "packagePrivateMethod</a></code>&nbsp;in class&nbsp;<code>" +
                  "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"}
@@ -65,18 +65,18 @@
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">"},
     };
 
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,18 +40,18 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
 
         //The package private method should be overriden since the base and sub class are in the same
         //package.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
     };
 
@@ -59,18 +59,18 @@
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "<dt><strong>Overrides:</strong></dt>" + NL +
+         "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
 
 
--- a/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java	Tue Aug 13 18:34:12 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,8 @@
     private static final String[][] TEST1 = {
         {BUG_ID + "-1" + FS + "pkg1" + FS + "package-summary.html",
             "<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>" + NL +
-            "<div class=\"block\"><i>This package is Deprecated.</i></div>"
+            "<div class=\"block\"><span class=\"italic\">This package is Deprecated." +
+            "</span></div>"
         },
         {BUG_ID + "-1" + FS + "deprecated-list.html",
             "<li><a href=\"#package\">Deprecated Packages</a></li>"
--- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Tue Aug 13 18:34:12 2013 -0700
@@ -112,12 +112,12 @@
     private static final String[][] NEGATED_TEST1 = {
        // Should not document that a method overrides method from private class.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-        "<strong>Overrides:</strong>"},
+        "<span class=\"strong\">Overrides:</span>"},
       // Should not document that a method specified by private interface.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-        "<strong>Specified by:</strong>"},
+        "<span class=\"strong\">Specified by:</span>"},
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
-        "<strong>Specified by:</strong>"},
+        "<span class=\"strong\">Specified by:</span>"},
       // Should not mention that any documentation was copied.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
         "Description copied from"},
@@ -139,7 +139,7 @@
         //Do not inherit private interface method with generic parameters.
         //This method has been implemented.
         {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
-            "<strong><a href=\"../pkg2/I.html#hello(T)\">hello</a></strong>"},
+            "<span class=\"strong\"><a href=\"../pkg2/I.html#hello(T)\">hello</a></span>"},
     };
 
     // Test output when -private flag is used.
@@ -176,14 +176,14 @@
         },
         // Should document that a method overrides method from private class.
        {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
             "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>" +
             "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
             "PrivateParent</a></code></dd>"},
        // Should document that a method is specified by private interface.
        {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
             "methodInterface</a></code>&nbsp;in interface&nbsp;<code>" +
             "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
@@ -227,11 +227,11 @@
       //Since private flag is used, we can document that private interface method
       //with generic parameters has been implemented.
       {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
-            "<strong>Description copied from interface:&nbsp;<code>" +
-            "<a href=\"../pkg2/I.html#hello(T)\">I</a></code></strong>"},
+            "<span class=\"strong\">Description copied from interface:&nbsp;<code>" +
+            "<a href=\"../pkg2/I.html#hello(T)\">I</a></code></span>"},
 
       {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
-            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
             "<dd><code><a href=\"../pkg2/I.html#hello(T)\">hello</a></code>" +
             "&nbsp;in interface&nbsp;<code>" +
             "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
--- a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Mon Aug 12 20:37:09 2013 +0530
+++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Tue Aug 13 18:34:12 2013 -0700
@@ -47,9 +47,9 @@
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">This field indicates whether the C1 " +
                  "is undecorated.</div>" + NL + "&nbsp;" + NL +
                  "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
@@ -57,9 +57,9 @@
                  "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
                  "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
-                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 "&nbsp;<span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
                  "<div class=\"block\">Reads the object stream.</div>" + NL +
                  "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL + "<dd><code><code>" +
                  "IOException</code></code></dd>" + NL +
@@ -73,15 +73,15 @@
     // information if any.
     private static final String[][] TEST_NOCMNT = {
         {BUG_ID + FS + "serialized-form.html", "<pre>boolean undecorated</pre>" + NL +
-                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>" +
+                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<span class=\"italic\">" +
                  "As of JDK version 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\"><code>" +
-                 "setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"},
+                 "setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"},
         {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
-                 "Deprecated.</span>&nbsp;<i>As of JDK version" +
+                 "Deprecated.</span>&nbsp;<span class=\"italic\">As of JDK version" +
                  " 1.5, replaced by" + NL +
                  " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"}};
+                 "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}};
 
     // Test with -nodeprecated option. The serialized-form.html should
     // ignore the -nodeprecated tag and display the deprecation info. This
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8020997/CannotCompileRepeatedAnnoTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,46 @@
+
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8020997
+ * @summary Cannot compile class with repeating annotation
+ * @compile CannotCompileRepeatedAnnoTest.java
+ */
+
+import java.lang.annotation.*;
+
+@Anno(req = true)
+@Anno()
+public class CannotCompileRepeatedAnnoTest {
+}
+
+@Repeatable(Container.class)
+@interface Anno {
+    boolean req() default false;
+}
+
+@interface Container{
+    Anno[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8022186/DeadCodeGeneratedForEmptyTryTest.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8022186
+ * @summary javac generates dead code if a try with an empty body has a finalizer
+ */
+
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.ConstantPool;
+import com.sun.tools.classfile.ConstantPool.CONSTANT_String_info;
+import com.sun.tools.classfile.ConstantPool.CPInfo;
+import com.sun.tools.classfile.ConstantPool.InvalidIndex;
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Instruction.KindVisitor;
+import com.sun.tools.classfile.Instruction.TypeKind;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.util.Assert;
+import java.io.BufferedInputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class DeadCodeGeneratedForEmptyTryTest {
+
+    public static void main(String[] args) throws Exception {
+        new DeadCodeGeneratedForEmptyTryTest().run();
+    }
+
+    void run() throws Exception {
+        checkClassFile(Paths.get(System.getProperty("test.classes"),
+                this.getClass().getName() + "$Test.class"));
+    }
+
+    int utf8Index;
+    int numberOfRefToStr = 0;
+    ConstantPool constantPool;
+
+    void checkClassFile(final Path path) throws Exception {
+        ClassFile classFile = ClassFile.read(
+                new BufferedInputStream(Files.newInputStream(path)));
+        constantPool = classFile.constant_pool;
+        utf8Index = constantPool.getUTF8Index("STR_TO_LOOK_FOR");
+        for (Method method: classFile.methods) {
+            if (method.getName(constantPool).equals("methodToLookFor")) {
+                Code_attribute codeAtt = (Code_attribute)method.attributes.get(Attribute.Code);
+                for (Instruction inst: codeAtt.getInstructions()) {
+                    inst.accept(codeVisitor, null);
+                }
+            }
+        }
+        Assert.check(numberOfRefToStr == 1,
+                "There should only be one reference to a CONSTANT_String_info structure in the generated code");
+    }
+
+    CodeVisitor codeVisitor = new CodeVisitor();
+
+    class CodeVisitor implements KindVisitor<Void, Void> {
+
+        void checkIndirectRefToString(int cp_index) {
+            try {
+                CPInfo cInfo = constantPool.get(cp_index);
+                if (cInfo instanceof CONSTANT_String_info) {
+                    CONSTANT_String_info strInfo = (CONSTANT_String_info)cInfo;
+                    if (strInfo.string_index == utf8Index) {
+                        numberOfRefToStr++;
+                    }
+                }
+            } catch (InvalidIndex ex) {
+                throw new AssertionError("invalid constant pool index at " + cp_index);
+            }
+        }
+
+        @Override
+        public Void visitNoOperands(Instruction instr, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitArrayType(Instruction instr, TypeKind kind, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitBranch(Instruction instr, int offset, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitConstantPoolRef(Instruction instr, int index, Void p) {
+            checkIndirectRefToString(index);
+            return null;
+        }
+
+        @Override
+        public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Void p) {
+            checkIndirectRefToString(index);
+            return null;
+        }
+
+        @Override
+        public Void visitLocal(Instruction instr, int index, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitLocalAndValue(Instruction instr, int index, int value, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitValue(Instruction instr, int value, Void p) {
+            return null;
+        }
+
+        @Override
+        public Void visitUnknown(Instruction instr, Void p) {
+            return null;
+        }
+
+    }
+
+    public class Test {
+        void methodToLookFor() {
+            try {
+            } finally {
+                System.out.println("STR_TO_LOOK_FOR");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/element/8009367/TestQualifiedNameUsed.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8009367
+ * @summary Test that the correct kind of names (binary) are used when comparing
+ *          Class and Symbol for repeatable Classes.
+ * @library /tools/javac/lib
+ * @build   JavacTestingAbstractProcessor TestQualifiedNameUsed p.Q p.QQ p.R p.RR
+ * @run compile -processor TestQualifiedNameUsed -proc:only TestQualifiedNameUsed.java
+ */
+
+import java.lang.annotation.Repeatable;
+import java.util.Set;
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+import static javax.lang.model.util.ElementFilter.*;
+
+import com.sun.tools.javac.util.Assert;
+
+import java.util.Arrays;
+
+public class TestQualifiedNameUsed extends JavacTestingAbstractProcessor {
+    @Q
+    @p.Q
+    @p.R.Q
+    public boolean process(Set<? extends TypeElement> annotations,
+                           RoundEnvironment roundEnv) {
+        if (!roundEnv.processingOver()) {
+            boolean hasRun = false;
+            for (Element element : roundEnv.getRootElements()) {
+                for (ExecutableElement e : methodsIn(element.getEnclosedElements())) {
+                    if (e.getSimpleName().contentEquals("value"))
+                        continue; // don't want to look Q.value() in this file
+
+                    hasRun = true;
+                    Q[] qs = e.getAnnotationsByType(Q.class);
+                    Assert.check(qs.length == 1);
+                    Assert.check(qs[0] instanceof Q);
+
+                    p.Q[] ps = e.getAnnotationsByType(p.Q.class);
+                    Assert.check(ps.length == 1);
+                    Assert.check(ps[0] instanceof p.Q);
+
+                    p.R.Q[] rs = e.getAnnotationsByType(p.R.Q.class);
+                    Assert.check(rs.length == 1);
+                    Assert.check(rs[0] instanceof p.R.Q);
+                }
+            }
+            if (!hasRun) throw new RuntimeException("No methods!");
+        }
+        return true;
+    }
+}
+
+@Repeatable(QQ.class)
+@interface Q {}
+
+@interface QQ {
+    Q[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/element/8009367/p/Q.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p;
+
+import java.lang.annotation.Repeatable;
+
+@Repeatable(QQ.class)
+public @interface Q {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/element/8009367/p/QQ.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p;
+
+public @interface QQ {
+    Q[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/element/8009367/p/R.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p;
+
+import java.lang.annotation.Repeatable;
+
+public class R {
+
+    @Repeatable(RR.class)
+    public @interface Q {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/element/8009367/p/RR.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p;
+
+public @interface RR {
+    R.Q[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/tree/NewArrayPretty.java	Tue Aug 13 18:34:12 2013 -0700
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014826
+ * @summary test Pretty print of NewArray
+ * @author ksrini
+ */
+import com.sun.source.tree.ClassTree;
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.tree.JCTree;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Arrays;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class NewArrayPretty {
+    private final JavaCompiler tool;
+    NewArrayPretty() {
+        tool = ToolProvider.getSystemJavaCompiler();
+    }
+    public static void main(String... args) throws Exception {
+        NewArrayPretty nap = new NewArrayPretty();
+        nap.run("Class[] cls = null");
+        nap.run("Class[] cls = new Class[]{Object.class}");
+    }
+    void run(String code) throws IOException {
+        String src = "public class Test {" + code + ";}";
+
+        JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, null,
+                null, Arrays.asList(new MyFileObject(src)));
+
+        for (CompilationUnitTree cut : ct.parse()) {
+            JCTree.JCVariableDecl var =
+                    (JCTree.JCVariableDecl) ((ClassTree) cut.getTypeDecls().get(0)).getMembers().get(0);
+
+            if (!code.equals(var.toString())) {
+                System.err.println("Expected: " + code);
+                System.err.println("Obtained: " + var.toString());
+                throw new RuntimeException("strings do not match!");
+            }
+        }
+    }
+}
+class MyFileObject extends SimpleJavaFileObject {
+
+    private String text;
+
+    public MyFileObject(String text) {
+        super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+        this.text = text;
+    }
+
+    @Override
+    public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+        return text;
+    }
+}
--- a/nashorn/.hgtags	Mon Aug 12 20:37:09 2013 +0530
+++ b/nashorn/.hgtags	Tue Aug 13 18:34:12 2013 -0700
@@ -211,3 +211,4 @@
 10a1ab9e20a42d278aa1a89698f2a4cf5883d00d jdk8-b99
 598321c438b52d9408a2671fb3fc2b2947d0f654 jdk8-b100
 a302b05d0ee460679501dc01004f70eb395fadf5 jdk8-b101
+e966ff0a3ffef8a687eaf5a14167bb595b623d02 jdk8-b102