changeset 13671:439c4e6b0756

Merge
author lana
date Thu, 04 Feb 2016 16:49:26 -0800
parents b5f8a1045cbe 44d28eb7dae9
children 2ba1aed4abb2
files src/java.base/share/classes/sun/misc/Cleaner.java src/java.desktop/share/classes/sun/awt/DefaultMouseInfoPeer.java test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java test/sun/misc/Cleaner/ExitOnThrow.java test/sun/misc/Cleaner/exitOnThrow.sh
diffstat 794 files changed, 30482 insertions(+), 21224 deletions(-) [+]
line wrap: on
line diff
--- a/make/lib/CoreLibraries.gmk	Thu Feb 04 11:28:26 2016 -0800
+++ b/make/lib/CoreLibraries.gmk	Thu Feb 04 16:49:26 2016 -0800
@@ -247,6 +247,13 @@
   LIBJIMAGE_TOOLCHAIN := TOOLCHAIN_LINK_CXX
 endif # OPENJDK_TARGET_OS aix
 
+JIMAGELIB_CPPFLAGS := \
+    -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
+    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
+    -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
+    -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
+    #
+
 $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \
     LIBRARY := jimage, \
     TOOLCHAIN := $(LIBJIMAGE_TOOLCHAIN), \
@@ -255,12 +262,8 @@
     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libjimage \
         $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \
     EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
-    CFLAGS := $(CFLAGS_JDKLIB) \
-        $(JIMAGELIB_CPPFLAGS) \
-        -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
-        -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-        -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
-        -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
+    CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
+    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
     CFLAGS_unix := -UDEBUG, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
--- a/make/mapfiles/libjava/mapfile-vers	Thu Feb 04 11:28:26 2016 -0800
+++ b/make/mapfiles/libjava/mapfile-vers	Thu Feb 04 16:49:26 2016 -0800
@@ -250,6 +250,7 @@
 		Java_sun_misc_Signal_raise0;
               Java_sun_reflect_ConstantPool_getClassAt0;
               Java_sun_reflect_ConstantPool_getClassAtIfLoaded0;
+              Java_sun_reflect_ConstantPool_getClassRefIndexAt0;
               Java_sun_reflect_ConstantPool_getDoubleAt0;
               Java_sun_reflect_ConstantPool_getFieldAt0;
               Java_sun_reflect_ConstantPool_getFieldAtIfLoaded0;
@@ -259,8 +260,11 @@
               Java_sun_reflect_ConstantPool_getMemberRefInfoAt0;
               Java_sun_reflect_ConstantPool_getMethodAt0;
               Java_sun_reflect_ConstantPool_getMethodAtIfLoaded0;
+              Java_sun_reflect_ConstantPool_getNameAndTypeRefIndexAt0;
+              Java_sun_reflect_ConstantPool_getNameAndTypeRefInfoAt0;
               Java_sun_reflect_ConstantPool_getSize0;
               Java_sun_reflect_ConstantPool_getStringAt0;
+              Java_sun_reflect_ConstantPool_getTagAt0;
               Java_sun_reflect_ConstantPool_getUTF8At0;
 		Java_java_io_Console_istty;
 		Java_java_io_Console_encoding;
--- a/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java	Thu Feb 04 16:49:26 2016 -0800
@@ -351,8 +351,8 @@
      */
     void encryptBlock(byte[] in, int inOffset,
                       byte[] out, int outOffset) {
-        cryptBlockCheck(in, inOffset);
-        cryptBlockCheck(out, outOffset);
+        Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length);
+        Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length);
         implEncryptBlock(in, inOffset, out, outOffset);
     }
 
@@ -430,8 +430,8 @@
      */
     void decryptBlock(byte[] in, int inOffset,
                       byte[] out, int outOffset) {
-        cryptBlockCheck(in, inOffset);
-        cryptBlockCheck(out, outOffset);
+        Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length);
+        Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length);
         implDecryptBlock(in, inOffset, out, outOffset);
     }
 
@@ -593,26 +593,6 @@
         out[outOffset  ] = (byte)(Si[(a0       ) & 0xFF] ^ (t1       ));
     }
 
-    // Used to perform all checks required by the Java semantics
-    // (i.e., null checks and bounds checks) on the input parameters
-    // to encryptBlock and to decryptBlock.
-    // Normally, the Java Runtime performs these checks, however, as
-    // encryptBlock and decryptBlock are possibly replaced with
-    // compiler intrinsics, the JDK performs the required checks instead.
-    // Does not check accesses to class-internal (private) arrays.
-    private static void cryptBlockCheck(byte[] array, int offset) {
-        Objects.requireNonNull(array);
-
-        if (offset < 0 || offset >= array.length) {
-            throw new ArrayIndexOutOfBoundsException(offset);
-        }
-
-        int largestIndex = offset + AES_BLOCK_SIZE - 1;
-        if (largestIndex < 0 || largestIndex >= array.length) {
-            throw new ArrayIndexOutOfBoundsException(largestIndex);
-        }
-    }
-
     /**
      * Expand a user-supplied key material into a session key.
      *
--- a/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java	Thu Feb 04 16:49:26 2016 -0800
@@ -173,9 +173,9 @@
      */
     private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
 
-        cryptBlockCheck(in, inOff, len);
-        cryptBlockCheck(out, outOff, len);
-        return implCrypt(in, inOff, len, out, outOff);
+      Objects.checkFromIndexSize(inOff, len, in.length);
+      Objects.checkFromIndexSize(outOff, len, out.length);
+      return implCrypt(in, inOff, len, out, outOff);
     }
 
     // Implementation of crpyt() method. Possibly replaced with a compiler intrinsic.
@@ -193,22 +193,4 @@
         return result;
     }
 
-    // Used to perform all checks required by the Java semantics
-    // (i.e., null checks and bounds checks) on the input parameters to crypt().
-    // Normally, the Java Runtime performs these checks, however, as crypt() is
-    // possibly replaced with compiler intrinsic, the JDK performs the
-    // required checks instead.
-    // Does not check accesses to class-internal (private) arrays.
-    private static void cryptBlockCheck(byte[] array, int offset, int len) {
-        Objects.requireNonNull(array);
-
-        if (offset < 0 || len < 0 || offset >= array.length) {
-            throw new ArrayIndexOutOfBoundsException(offset);
-        }
-
-        int largestIndex = offset + len - 1;
-        if (largestIndex < 0 || largestIndex >= array.length) {
-            throw new ArrayIndexOutOfBoundsException(largestIndex);
-        }
-    }
 }
--- a/src/java.base/share/classes/java/lang/Long.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/lang/Long.java	Thu Feb 04 16:49:26 2016 -0800
@@ -401,18 +401,6 @@
      * @param offset the offset in the destination buffer to start at
      * @param len the number of characters to write
      */
-     static void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) {
-        // assert shift > 0 && shift <=5 : "Illegal shift value";
-        // assert offset >= 0 && offset < buf.length : "illegal offset";
-        // assert len > 0 && (offset + len) <= buf.length : "illegal length";
-        int charPos = offset + len;
-        int radix = 1 << shift;
-        int mask = radix - 1;
-        do {
-            buf[--charPos] = Integer.digits[((int) val) & mask];
-            val >>>= shift;
-        } while (charPos > offset);
-    }
 
     /** byte[]/LATIN1 version    */
     static void formatUnsignedLong0(long val, int shift, byte[] buf, int offset, int len) {
@@ -436,6 +424,39 @@
         } while (charPos > offset);
     }
 
+    static String fastUUID(long lsb, long msb) {
+        if (COMPACT_STRINGS) {
+            byte[] buf = new byte[36];
+            formatUnsignedLong0(lsb,        4, buf, 24, 12);
+            formatUnsignedLong0(lsb >>> 48, 4, buf, 19, 4);
+            formatUnsignedLong0(msb,        4, buf, 14, 4);
+            formatUnsignedLong0(msb >>> 16, 4, buf, 9,  4);
+            formatUnsignedLong0(msb >>> 32, 4, buf, 0,  8);
+
+            buf[23] = '-';
+            buf[18] = '-';
+            buf[13] = '-';
+            buf[8]  = '-';
+
+            return new String(buf, LATIN1);
+        } else {
+            byte[] buf = new byte[72];
+
+            formatUnsignedLong0UTF16(lsb,        4, buf, 24, 12);
+            formatUnsignedLong0UTF16(lsb >>> 48, 4, buf, 19, 4);
+            formatUnsignedLong0UTF16(msb,        4, buf, 14, 4);
+            formatUnsignedLong0UTF16(msb >>> 16, 4, buf, 9,  4);
+            formatUnsignedLong0UTF16(msb >>> 32, 4, buf, 0,  8);
+
+            StringUTF16.putChar(buf, 23, '-');
+            StringUTF16.putChar(buf, 18, '-');
+            StringUTF16.putChar(buf, 13, '-');
+            StringUTF16.putChar(buf,  8, '-');
+
+            return new String(buf, UTF16);
+        }
+    }
+
     /**
      * Returns a {@code String} object representing the specified
      * {@code long}.  The argument is converted to signed decimal
--- a/src/java.base/share/classes/java/lang/StringConcatHelper.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/lang/StringConcatHelper.java	Thu Feb 04 16:49:26 2016 -0800
@@ -342,4 +342,12 @@
         return new String(buf, coder);
     }
 
+    /**
+     * Provides the initial coder for the String.
+     * @return initial coder
+     */
+    static byte initialCoder() {
+        return String.COMPACT_STRINGS ? String.LATIN1 : String.UTF16;
+    }
+
 }
--- a/src/java.base/share/classes/java/lang/System.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/lang/System.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1911,11 +1911,8 @@
             public void invokeFinalize(Object o) throws Throwable {
                 o.finalize();
             }
-            public void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) {
-                Long.formatUnsignedLong(val, shift, buf, offset, len);
-            }
-            public void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) {
-                Integer.formatUnsignedInt(val, shift, buf, offset, len);
+            public String fastUUID(long lsb, long msb) {
+                return Long.fastUUID(lsb, msb);
             }
         });
     }
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Thu Feb 04 16:49:26 2016 -0800
@@ -30,7 +30,7 @@
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import static java.lang.invoke.MethodHandleStatics.*;
 import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
 
 /**
  * The JVM interface for the method handles package is all here.
--- a/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Thu Feb 04 16:49:26 2016 -0800
@@ -30,7 +30,7 @@
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.org.objectweb.asm.Opcodes;
 import jdk.internal.vm.annotation.ForceInline;
-import sun.misc.Unsafe;
+import jdk.internal.misc.Unsafe;
 
 import java.lang.invoke.MethodHandles.Lookup;
 import java.security.AccessController;
@@ -957,6 +957,22 @@
                     storage trimming, which defeats the purpose of exact strategies.
                  */
 
+                /*
+                   The logic for this check is as follows:
+
+                     Stack before:     Op:
+                      (SB)              dup, dup
+                      (SB, SB, SB)      capacity()
+                      (int, SB, SB)     swap
+                      (SB, int, SB)     toString()
+                      (S, int, SB)      length()
+                      (int, int, SB)    if_icmpeq
+                      (SB)              <end>
+
+                   Note that it leaves the same StringBuilder on exit, like the one on enter.
+                 */
+
+                mv.visitInsn(DUP);
                 mv.visitInsn(DUP);
 
                 mv.visitMethodInsn(
@@ -967,7 +983,7 @@
                         false
                 );
 
-                mv.visitIntInsn(ISTORE, 0);
+                mv.visitInsn(SWAP);
 
                 mv.visitMethodInsn(
                         INVOKEVIRTUAL,
@@ -977,8 +993,6 @@
                         false
                 );
 
-                mv.visitInsn(DUP);
-
                 mv.visitMethodInsn(
                         INVOKEVIRTUAL,
                         "java/lang/String",
@@ -987,8 +1001,6 @@
                         false
                 );
 
-                mv.visitIntInsn(ILOAD, 0);
-
                 Label l0 = new Label();
                 mv.visitJumpInsn(IF_ICMPEQ, l0);
 
@@ -1003,16 +1015,16 @@
                 mv.visitInsn(ATHROW);
 
                 mv.visitLabel(l0);
-            } else {
-                mv.visitMethodInsn(
-                        INVOKEVIRTUAL,
-                        "java/lang/StringBuilder",
-                        "toString",
-                        "()Ljava/lang/String;",
-                        false
-                );
             }
 
+            mv.visitMethodInsn(
+                    INVOKEVIRTUAL,
+                    "java/lang/StringBuilder",
+                    "toString",
+                    "()Ljava/lang/String;",
+                    false
+            );
+
             mv.visitInsn(ARETURN);
 
             mv.visitMaxs(-1, -1);
@@ -1485,7 +1497,7 @@
             //
             // The method handle shape after all length and coder mixers is:
             //   (int, byte, <args>)String = ("index", "coder", <args>)
-            byte initialCoder = 0; // initial coder
+            byte initialCoder = INITIAL_CODER;
             int initialLen = 0;    // initial length, in characters
             for (RecipeElement el : recipe.getElements()) {
                 switch (el.getTag()) {
@@ -1618,11 +1630,14 @@
         private static final ConcurrentMap<Class<?>, MethodHandle> LENGTH_MIXERS;
         private static final ConcurrentMap<Class<?>, MethodHandle> CODER_MIXERS;
         private static final Class<?> STRING_HELPER;
+        private static final byte INITIAL_CODER;
 
         static {
             try {
                 STRING_HELPER = Class.forName("java.lang.StringConcatHelper");
-            } catch (ClassNotFoundException e) {
+                MethodHandle initCoder = lookupStatic(Lookup.IMPL_LOOKUP, STRING_HELPER, "initialCoder", byte.class);
+                INITIAL_CODER = (byte) initCoder.invoke();
+            } catch (Throwable e) {
                 throw new AssertionError(e);
             }
 
--- a/src/java.base/share/classes/java/lang/ref/Reference.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/lang/ref/Reference.java	Thu Feb 04 16:49:26 2016 -0800
@@ -26,10 +26,10 @@
 package java.lang.ref;
 
 import jdk.internal.vm.annotation.DontInline;
-import sun.misc.Cleaner;
 import jdk.internal.HotSpotIntrinsicCandidate;
 import jdk.internal.misc.JavaLangRefAccess;
 import jdk.internal.misc.SharedSecrets;
+import jdk.internal.ref.Cleaner;
 
 /**
  * Abstract base class for reference objects.  This class defines the
--- a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template	Thu Feb 04 16:49:26 2016 -0800
@@ -28,9 +28,9 @@
 package java.nio;
 
 import java.io.FileDescriptor;
-import sun.misc.Cleaner;
 import jdk.internal.misc.Unsafe;
 import jdk.internal.misc.VM;
+import jdk.internal.ref.Cleaner;
 import sun.nio.ch.DirectBuffer;
 
 
--- a/src/java.base/share/classes/java/nio/file/Path.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/nio/file/Path.java	Thu Feb 04 16:49:26 2016 -0800
@@ -150,7 +150,7 @@
      * #normalize normalize} method, to eliminate redundant names, for cases where
      * <em>shell-like</em> navigation is required.
      *
-     * <p> If this path has one or more elements, and no root component, then
+     * <p> If this path has more than one element, and no root component, then
      * this method is equivalent to evaluating the expression:
      * <blockquote><pre>
      * subpath(0,&nbsp;getNameCount()-1);
--- a/src/java.base/share/classes/java/time/LocalDate.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/time/LocalDate.java	Thu Feb 04 16:49:26 2016 -0800
@@ -100,6 +100,8 @@
 import java.time.zone.ZoneOffsetTransition;
 import java.time.zone.ZoneRules;
 import java.util.Objects;
+import java.util.stream.LongStream;
+import java.util.stream.Stream;
 
 /**
  * A date without a time-zone in the ISO-8601 calendar system,
@@ -1716,6 +1718,89 @@
     }
 
     /**
+     * Returns a sequential ordered stream of dates. The returned stream starts from this date
+     * (inclusive) and goes to {@code endExclusive} (exclusive) by an incremental step of 1 day.
+     * <p>
+     * This method is equivalent to {@code datesUntil(endExclusive, Period.ofDays(1))}.
+     *
+     * @param endExclusive  the end date, exclusive, not null
+     * @return a sequential {@code Stream} for the range of {@code LocalDate} values
+     * @throws IllegalArgumentException if end date is before this date
+     * @since 9
+     */
+    public Stream<LocalDate> datesUntil(LocalDate endExclusive) {
+        long end = endExclusive.toEpochDay();
+        long start = toEpochDay();
+        if (end < start) {
+            throw new IllegalArgumentException(endExclusive + " < " + this);
+        }
+        return LongStream.range(start, end).mapToObj(LocalDate::ofEpochDay);
+    }
+
+    /**
+     * Returns a sequential ordered stream of dates by given incremental step. The returned stream
+     * starts from this date (inclusive) and goes to {@code endExclusive} (exclusive).
+     * <p>
+     * The n-th date which appears in the stream is equal to {@code this.plus(step.multipliedBy(n))}
+     * (but the result of step multiplication never overflows). For example, if this date is
+     * {@code 2015-01-31}, the end date is {@code 2015-05-01} and the step is 1 month, then the
+     * stream contains {@code 2015-01-31}, {@code 2015-02-28}, {@code 2015-03-31}, and
+     * {@code 2015-04-30}.
+     *
+     * @param endExclusive  the end date, exclusive, not null
+     * @param step  the non-zero, non-negative {@code Period} which represents the step.
+     * @return a sequential {@code Stream} for the range of {@code LocalDate} values
+     * @throws IllegalArgumentException if step is zero, or {@code step.getDays()} and
+     *             {@code step.toTotalMonths()} have opposite sign, or end date is before this date
+     *             and step is positive, or end date is after this date and step is negative
+     * @since 9
+     */
+    public Stream<LocalDate> datesUntil(LocalDate endExclusive, Period step) {
+        if (step.isZero()) {
+            throw new IllegalArgumentException("step is zero");
+        }
+        long end = endExclusive.toEpochDay();
+        long start = toEpochDay();
+        long until = end - start;
+        long months = step.toTotalMonths();
+        long days = step.getDays();
+        if ((months < 0 && days > 0) || (months > 0 && days < 0)) {
+            throw new IllegalArgumentException("period months and days are of opposite sign");
+        }
+        if (until == 0) {
+            return Stream.empty();
+        }
+        int sign = months > 0 || days > 0 ? 1 : -1;
+        if (sign < 0 ^ until < 0) {
+            throw new IllegalArgumentException(endExclusive + (sign < 0 ? " > " : " < ") + this);
+        }
+        if (months == 0) {
+            long steps = (until - sign) / days; // non-negative
+            return LongStream.rangeClosed(0, steps).mapToObj(
+                    n -> LocalDate.ofEpochDay(start + n * days));
+        }
+        // 48699/1600 = 365.2425/12, no overflow, non-negative result
+        long steps = until * 1600 / (months * 48699 + days * 1600) + 1;
+        long addMonths = months * steps;
+        long addDays = days * steps;
+        long maxAddMonths = months > 0 ? MAX.getProlepticMonth() - getProlepticMonth()
+                : getProlepticMonth() - MIN.getProlepticMonth();
+        // adjust steps estimation
+        if (addMonths * sign > maxAddMonths
+                || (plusMonths(addMonths).toEpochDay() + addDays) * sign >= end * sign) {
+            steps--;
+            addMonths -= months;
+            addDays -= days;
+            if (addMonths * sign > maxAddMonths
+                    || (plusMonths(addMonths).toEpochDay() + addDays) * sign >= end * sign) {
+                steps--;
+            }
+        }
+        return LongStream.rangeClosed(0, steps).mapToObj(
+                n -> this.plusMonths(months * n).plusDays(days * n));
+    }
+
+    /**
      * Formats this date using the specified formatter.
      * <p>
      * This date will be passed to the formatter to produce a string.
--- a/src/java.base/share/classes/java/util/UUID.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/util/UUID.java	Thu Feb 04 16:49:26 2016 -0800
@@ -392,17 +392,7 @@
      * @return  A string representation of this {@code UUID}
      */
     public String toString() {
-        char[] chars = new char[36];
-        jla.formatUnsignedLong(mostSigBits >> 32, 4, chars, 0, 8);
-        chars[8] = '-';
-        jla.formatUnsignedLong(mostSigBits >> 16, 4, chars, 9, 4);
-        chars[13] = '-';
-        jla.formatUnsignedLong(mostSigBits, 4, chars, 14, 4);
-        chars[18] = '-';
-        jla.formatUnsignedLong(leastSigBits >> 48, 4, chars, 19, 4);
-        chars[23] = '-';
-        jla.formatUnsignedLong(leastSigBits, 4, chars, 24, 12);
-        return jla.newStringUnsafe(chars);
+        return jla.fastUUID(leastSigBits, mostSigBits);
     }
 
     /**
--- a/src/java.base/share/classes/java/util/concurrent/TimeUnit.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/java/util/concurrent/TimeUnit.java	Thu Feb 04 16:49:26 2016 -0800
@@ -35,6 +35,9 @@
 
 package java.util.concurrent;
 
+import java.time.temporal.ChronoUnit;
+import java.util.Objects;
+
 /**
  * A {@code TimeUnit} represents time durations at a given unit of
  * granularity and provides utility methods to convert across units,
@@ -390,4 +393,48 @@
         }
     }
 
+    /**
+     * Converts this {@code TimeUnit} to the equivalent {@code ChronoUnit}.
+     *
+     * @return the converted equivalent ChronoUnit
+     * @since 9
+     */
+    public ChronoUnit toChronoUnit() {
+        switch (this) {
+        case NANOSECONDS:  return ChronoUnit.NANOS;
+        case MICROSECONDS: return ChronoUnit.MICROS;
+        case MILLISECONDS: return ChronoUnit.MILLIS;
+        case SECONDS:      return ChronoUnit.SECONDS;
+        case MINUTES:      return ChronoUnit.MINUTES;
+        case HOURS:        return ChronoUnit.HOURS;
+        case DAYS:         return ChronoUnit.DAYS;
+        default: throw new AssertionError();
+        }
+    }
+
+    /**
+     * Converts a {@code ChronoUnit} to the equivalent {@code TimeUnit}.
+     *
+     * @param chronoUnit the ChronoUnit to convert
+     * @return the converted equivalent TimeUnit
+     * @throws IllegalArgumentException if {@code chronoUnit} has no
+     *         equivalent TimeUnit
+     * @throws NullPointerException if {@code chronoUnit} is null
+     * @since 9
+     */
+    public static TimeUnit of(ChronoUnit chronoUnit) {
+        switch (Objects.requireNonNull(chronoUnit, "chronoUnit")) {
+        case NANOS:   return TimeUnit.NANOSECONDS;
+        case MICROS:  return TimeUnit.MICROSECONDS;
+        case MILLIS:  return TimeUnit.MILLISECONDS;
+        case SECONDS: return TimeUnit.SECONDS;
+        case MINUTES: return TimeUnit.MINUTES;
+        case HOURS:   return TimeUnit.HOURS;
+        case DAYS:    return TimeUnit.DAYS;
+        default:
+            throw new IllegalArgumentException(
+                "No TimeUnit equivalent for " + chronoUnit);
+        }
+    }
+
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/Version.java	Thu Feb 04 16:49:26 2016 -0800
@@ -0,0 +1,609 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk;
+
+import java.math.BigInteger;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * A representation of the JDK version-string which contains a version
+ * number optionally followed by pre-release and build information.
+ *
+ * <h2><a name="verNum">Version numbers</a></h2>
+ *
+ * A <em>version number</em>, {@code $VNUM}, is a non-empty sequence of
+ * non-negative integer numerals, without leading or trailing zeroes,
+ * separated by period characters (U+002E); i.e., it matches the regular
+ * expression {@code ^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$}. The sequence may
+ * be of arbitrary length but the first three elements are assigned specific
+ * meanings, as follows:
+ *
+ * <blockquote><pre>
+ *     $MAJOR.$MINOR.$SECURITY
+ * </pre></blockquote>
+ *
+ * <ul>
+ *
+ * <li><p> <a name="major">{@code $MAJOR}</a> --- The major version number,
+ * incremented for a major release that contains significant new features as
+ * specified in a new edition of the Java&#160;SE Platform Specification,
+ * <em>e.g.</em>, <a href="https://jcp.org/en/jsr/detail?id=337">JSR 337</a>
+ * for Java&#160;SE&#160;8. Features may be removed in a major release, given
+ * advance notice at least one major release ahead of time, and incompatible
+ * changes may be made when justified. The {@code $MAJOR} version number of
+ * JDK&#160;8 was {@code 8}; the {@code $MAJOR} version number of JDK&#160;9
+ * is {@code 9}. </p></li>
+ *
+ * <li><p> <a name="minor">{@code $MINOR}</a> --- The minor version number,
+ * incremented for a minor update release that may contain compatible bug
+ * fixes, revisions to standard APIs mandated by a <a
+ * href="https://jcp.org/en/procedures/jcp2#5.3">Maintenance Release</a> of
+ * the relevant Platform Specification, and implementation features outside
+ * the scope of that Specification such as new JDK-specific APIs, additional
+ * service providers, new garbage collectors, and ports to new hardware
+ * architectures. {@code $MINOR} is reset to zero when {@code $MAJOR} is
+ * incremented. </p></li>
+ *
+ * <li><p> <a name="security">{@code $SECURITY}</a> --- The security level,
+ * incremented for a security-update release that contains critical fixes
+ * including those necessary to improve security. {@code $SECURITY} is reset
+ * to zero <strong>only</strong> when {@code $MAJOR} is incremented. A higher
+ * value of {@code $SECURITY} for a given {@code $MAJOR} value, therefore,
+ * always indicates a more secure release, regardless of the value of {@code
+ * $MINOR}. </p></li>
+ *
+ * </ul>
+ *
+ * <p> The fourth and later elements of a version number are free for use by
+ * downstream consumers of the JDK code base.  Such a consumer may,
+ * <em>e.g.</em>, use the fourth element to identify patch releases which
+ * contain a small number of critical non-security fixes in addition to the
+ * security fixes in the corresponding security release. </p>
+ *
+ * <p> The version number does not include trailing zero elements;
+ * <em>i.e.</em>, {@code $SECURITY} is omitted if it has the value zero, and
+ * {@code $MINOR} is omitted if both {@code $MINOR} and {@code $SECURITY} have
+ * the value zero. </p>
+ *
+ * <p> The sequence of numerals in a version number is compared to another
+ * such sequence in numerical, pointwise fashion; <em>e.g.</em>, {@code 9.9.1}
+ * is less than {@code 9.10.0}. If one sequence is shorter than another then
+ * the missing elements of the shorter sequence are considered to be zero;
+ * <em>e.g.</em>, {@code 9.1.2} is equal to {@code 9.1.2.0} but less than
+ * {@code 9.1.2.1}. </p>
+ *
+ * <h2><a name="verStr">Version strings</a></h2>
+ *
+ * <p> A <em>version string</em> {@code $VSTR} consists of a version number
+ * {@code $VNUM}, as described above, optionally followed by pre-release and
+ * build information, in the format </p>
+ *
+ * <blockquote><pre>
+ *     $VNUM(-$PRE)?(\+($BUILD)?(-$OPT)?)?
+ * </pre></blockquote>
+ *
+ * <p> where: </p>
+ *
+ * <ul>
+ *
+ * <li><p> <a name="pre">{@code $PRE}</a>, matching {@code ([a-zA-Z0-9]+)} ---
+ * A pre-release identifier.  Typically {@code ea}, for an early-access
+ * release that's under active development and potentially unstable, or {@code
+ * internal}, for an internal developer build.
+ *
+ * <li><p> <a name="build">{@code $BUILD}</a>, matching {@code
+ * (0|[1-9][0-9]*)} --- The build number, incremented for each promoted build.
+ * {@code $BUILD} is reset to {@code 1} when any portion of {@code $VNUM} is
+ * incremented. </p>
+ *
+ * <li><p> <a name="opt">{@code $OPT}</a>, matching {@code ([-a-zA-Z0-9\.]+)}
+ * --- Additional build information, if desired.  In the case of an {@code
+ * internal} build this will often contain the date and time of the
+ * build. </p>
+ *
+ * </ul>
+ *
+ * <p> When comparing two version strings the value of {@code $OPT}, if
+ * present, may or may not be significant depending on the chosen comparison
+ * method.  The comparison methods {@link #compareTo(Version) compareTo()} and
+ * {@link #compareToIgnoreOpt(Version) compareToIgnoreOpt{}} should be used
+ * consistently with the corresponding methods {@link #equals(Object) equals()}
+ * and {@link #equalsIgnoreOpt(Object) equalsIgnoreOpt()}.  </p>
+ *
+ * <p> A <em>short version string</em> ({@code $SVSTR}), often useful in less
+ * formal contexts, is simply {@code $VNUM} optionally ended with {@code
+ * -$PRE}. </p>
+ *
+ * @since  9
+ */
+public final class Version
+    implements Comparable<Version>
+{
+    private final List<Integer>     version;
+    private final Optional<String>  pre;
+    private final Optional<Integer> build;
+    private final Optional<String>  optional;
+
+    private static Version current;
+
+    // $VNUM(-$PRE)?(\+($BUILD)?(\-$OPT)?)?
+    // RE limits the format of version strings
+    // ([1-9][0-9]*(?:(?:\.0)*\.[1-9][0-9]*)*)(?:-([a-zA-Z0-9]+))?(?:(\+)(0|[1-9][0-9]*)?)?(?:-([-a-zA-Z0-9.]+))?
+
+    private static final String VNUM
+        = "(?<VNUM>[1-9][0-9]*(?:(?:\\.0)*\\.[1-9][0-9]*)*)";
+    private static final String VNUM_GROUP  = "VNUM";
+
+    private static final String PRE      = "(?:-(?<PRE>[a-zA-Z0-9]+))?";
+    private static final String PRE_GROUP   = "PRE";
+
+    private static final String BUILD
+        = "(?:(?<PLUS>\\+)(?<BUILD>0|[1-9][0-9]*)?)?";
+    private static final String PLUS_GROUP  = "PLUS";
+    private static final String BUILD_GROUP = "BUILD";
+
+    private static final String OPT      = "(?:-(?<OPT>[-a-zA-Z0-9.]+))?";
+    private static final String OPT_GROUP   = "OPT";
+
+    private static final String VSTR_FORMAT
+        = "^" + VNUM + PRE + BUILD + OPT + "$";
+    private static final Pattern VSTR_PATTERN = Pattern.compile(VSTR_FORMAT);
+
+    /**
+     * Constructs a valid JDK <a href="verStr">version string</a> containing a
+     * <a href="#verNum">version number</a> followed by pre-release and build
+     * information.
+     *
+     * @param  s
+     *         A string to be interpreted as a version
+     *
+     * @throws  IllegalArgumentException
+     *          If the given string cannot be interpreted a valid version
+     *
+     * @throws  NullPointerException
+     *          If {@code s} is {@code null}
+     *
+     * @throws  NumberFormatException
+     *          If an element of the version number or the build number cannot
+     *          be represented as an {@link Integer}
+     */
+    private Version(String s) {
+        if (s == null)
+            throw new NullPointerException();
+
+        Matcher m = VSTR_PATTERN.matcher(s);
+        if (!m.matches())
+            throw new IllegalArgumentException("Invalid version string: '"
+                                               + s + "'");
+
+        // $VNUM is a dot-separated list of integers of arbitrary length
+        version
+            = Collections.unmodifiableList(
+                  Arrays.stream(m.group(VNUM_GROUP).split("\\."))
+                  .map(Integer::parseInt)
+                  .collect(Collectors.toList()));
+
+        pre = Optional.ofNullable(m.group(PRE_GROUP));
+
+        String b = m.group(BUILD_GROUP);
+        // $BUILD is an integer
+        build = (b == null)
+             ? Optional.<Integer>empty()
+             : Optional.ofNullable(Integer.parseInt(b));
+
+        optional = Optional.ofNullable(m.group(OPT_GROUP));
+
+        // empty '+'
+        if ((m.group(PLUS_GROUP) != null) && !build.isPresent()) {
+            if (optional.isPresent()) {
+                if (pre.isPresent())
+                    throw new IllegalArgumentException("'+' found with"
+                        + " pre-release and optional components:'" + s + "'");
+            } else {
+                throw new IllegalArgumentException("'+' found with neither"
+                    + " build or optional components: '" + s + "'");
+            }
+        }
+    }
+
+    /**
+     * Parses the given string as a valid JDK <a
+     * href="#verStr">version string</a> containing a <a
+     * href="#verNum">version number</a> followed by pre-release and
+     * build information.
+     *
+     * @param  s
+     *         A string to interpret as a version
+     *
+     * @throws  IllegalArgumentException
+     *          If the given string cannot be interpreted a valid version
+     *
+     * @throws  NullPointerException
+     *          If the given string is {@code null}
+     *
+     * @throws  NumberFormatException
+     *          If an element of the version number or the build number cannot
+     *          be represented as an {@link Integer}
+     *
+     * @return  This version
+     */
+    public static Version parse(String s) {
+        return new Version(s);
+    }
+
+    /**
+     * Returns {@code System.getProperty("java.version")} as a Version.
+     *
+     * @throws  SecurityException
+     *          If a security manager exists and its {@link
+     *          SecurityManager#checkPropertyAccess(String)
+     *          checkPropertyAccess} method does not allow access to the
+     *          system property "java.version"
+     *
+     * @return  {@code System.getProperty("java.version")} as a Version
+     */
+    public static Version current() {
+        if (current == null) {
+            current = parse(AccessController.doPrivileged(
+                new PrivilegedAction<>() {
+                    public String run() {
+                        return System.getProperty("java.version");
+                    }
+                }));
+        }
+        return current;
+    }
+
+    /**
+     * Returns the <a href="#major">major</a> version number.
+     *
+     * @return  The major version number
+     */
+    public int major() {
+        return version.get(0);
+    }
+
+    /**
+     * Returns the <a href="#minor">minor</a> version number or zero if it was
+     * not set.
+     *
+     * @return  The minor version number or zero if it was not set
+     */
+    public int minor() {
+        return (version.size() > 1 ? version.get(1) : 0);
+    }
+
+    /**
+     * Returns the <a href="#security">security</a> version number or zero if
+     * it was not set.
+     *
+     * @return  The security version number or zero if it was not set
+     */
+    public int security() {
+        return (version.size() > 2 ? version.get(2) : 0);
+    }
+
+    /**
+     * Returns an unmodifiable {@link java.util.List List} of the
+     * integer numerals contained in the <a href="#verNum">version
+     * number</a>.  The {@code List} always contains at least one
+     * element corresponding to the <a href="#major">major version
+     * number</a>.
+     *
+     * @return  An unmodifiable list of the integer numerals
+     *          contained in the version number
+     */
+    public List<Integer> version() {
+        return version;
+    }
+
+    /**
+     * Returns the optional <a href="#pre">pre-release</a> information.
+     *
+     * @return  The optional pre-release information as a String
+     */
+    public Optional<String> pre() {
+        return pre;
+    }
+
+    /**
+     * Returns the <a href="#build">build number</a>.
+     *
+     * @return The optional build number.
+     */
+    public Optional<Integer> build() {
+        return build;
+    }
+
+    /**
+     * Returns <a href="#opt">optional</a> additional identifying build
+     * information.
+     *
+     * @return  Additional build information as a String
+     */
+    public Optional<String> optional() {
+        return optional;
+    }
+
+    /**
+     * Compares this version to another.
+     *
+     * <p> Each of the components in the <a href="#verStr">version</a> is
+     * compared in the follow order of precedence: version numbers,
+     * pre-release identifiers, build numbers, optional build information. </p>
+     *
+     * <p> Comparison begins by examining the sequence of version numbers.  If
+     * one sequence is shorter than another, then the missing elements of the
+     * shorter sequence are considered to be zero. </p>
+     *
+     * <p> A version with a pre-release identifier is always considered to be
+     * less than a version without one.  Pre-release identifiers are compared
+     * numerically when they consist only of digits, and lexicographically
+     * otherwise.  Numeric identifiers are considered to be less than
+     * non-numeric identifiers.  </p>
+     *
+     * <p> A version without a build number is always less than one with a
+     * build number; otherwise build numbers are compared numerically. </p>
+     *
+     * <p> The optional build information is compared lexicographically.
+     * During this comparison, a version with optional build information is
+     * considered to be greater than a version without one. </p>
+     *
+     * <p> A version is not comparable to any other type of object.
+     *
+     * @param  ob
+     *         The object to be compared
+     *
+     * @return  A negative integer, zero, or a positive integer if this
+     *          {@code Version} is less than, equal to, or greater than the
+     *          given {@code Version}
+     *
+     * @throws  NullPointerException
+     *          If the given object is {@code null}
+     */
+    @Override
+    public int compareTo(Version ob) {
+        return compare(ob, false);
+    }
+
+    /**
+     * Compares this version to another disregarding optional build
+     * information.
+     *
+     * <p> Two versions are compared by examining the version string as
+     * described in {@link #compareTo(Version)} with the exception that the
+     * optional build information is always ignored. </p>
+     *
+     * <p> A version is not comparable to any other type of object.
+     *
+     * @param  ob
+     *         The object to be compared
+     *
+     * @return  A negative integer, zero, or a positive integer if this
+     *          {@code Version} is less than, equal to, or greater than the
+     *          given {@code Version}
+     *
+     * @throws  NullPointerException
+     *          If the given object is {@code null}
+     */
+    public int compareToIgnoreOpt(Version ob) {
+        return compare(ob, true);
+    }
+
+    private int compare(Version ob, boolean ignoreOpt) {
+        if (ob == null)
+            throw new NullPointerException("Invalid argument");
+
+        int ret = compareVersion(ob);
+        if (ret != 0)
+            return ret;
+
+        ret = comparePre(ob);
+        if (ret != 0)
+            return ret;
+
+        ret = compareBuild(ob);
+        if (ret != 0)
+            return ret;
+
+        if (!ignoreOpt)
+            return compareOpt(ob);
+
+        return 0;
+    }
+
+    private int compareVersion(Version ob) {
+        int size = version.size();
+        int oSize = ob.version().size();
+        int min = Math.min(size, oSize);
+        for (int i = 0; i < min; i++) {
+            Integer val = version.get(i);
+            Integer oVal = ob.version().get(i);
+            if (val != oVal)
+                return val - oVal;
+        }
+        if (size != oSize)
+            return size - oSize;
+        return 0;
+    }
+
+    private int comparePre(Version ob) {
+        Optional<String> oPre = ob.pre();
+        if (!pre.isPresent()) {
+            if (oPre.isPresent())
+                return 1;
+        } else {
+            if (!oPre.isPresent())
+                return -1;
+            String val = pre.get();
+            String oVal = oPre.get();
+            if (val.matches("\\d+")) {
+                return (oVal.matches("\\d+")
+                        ? (new BigInteger(val)).compareTo(new BigInteger(oVal))
+                        : -1);
+            } else {
+                return (oVal.matches("\\d+")
+                        ? 1
+                        : val.compareTo(oVal));
+            }
+        }
+        return 0;
+    }
+
+    private int compareBuild(Version ob) {
+        Optional<Integer> oBuild = ob.build();
+        if (oBuild.isPresent()) {
+            return (build.isPresent()
+                   ? build.get().compareTo(oBuild.get())
+                   : 1);
+        } else if (build.isPresent()) {
+            return -1;
+        }
+        return 0;
+    }
+
+    private int compareOpt(Version ob) {
+        Optional<String> oOpt = ob.optional();
+        if (!optional.isPresent()) {
+            if (oOpt.isPresent())
+                return -1;
+        } else {
+            if (!oOpt.isPresent())
+                return 1;
+            return optional.get().compareTo(oOpt.get());
+        }
+        return 0;
+    }
+
+    /**
+     * Returns a string representation of this version.
+     *
+     * @return  The version string
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb
+            = new StringBuilder(version.stream()
+                                .map(Object::toString)
+                                .collect(Collectors.joining(".")));
+        pre.ifPresent(v -> sb.append("-").append(v));
+
+        if (build.isPresent()) {
+            sb.append("+").append(build.get());
+            if (optional.isPresent())
+                sb.append("-").append(optional.get());
+        } else {
+            if (optional.isPresent()) {
+                sb.append(pre.isPresent() ? "-" : "+-");
+                sb.append(optional.get());
+            }
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * Determines whether this {@code Version} is equal to another object.
+     *
+     * <p> Two {@code Version}s are equal if and only if they represent the
+     * same version string.
+     *
+     * <p> This method satisfies the general contract of the {@link
+     * Object#equals(Object) Object.equals} method. </p>
+     *
+     * @param  ob
+     *         The object to which this {@code Version} is to be compared
+     *
+     * @return  {@code true} if, and only if, the given object is a {@code
+     *          Version} that is identical to this {@code Version}
+     *
+     */
+    @Override
+    public boolean equals(Object ob) {
+        boolean ret = equalsIgnoreOpt(ob);
+        if (!ret)
+            return false;
+
+        Version that = (Version)ob;
+        return (this.optional().equals(that.optional()));
+    }
+
+    /**
+     * Determines whether this {@code Version} is equal to another
+     * disregarding optional build information.
+     *
+     * <p> Two {@code Version}s are equal if and only if they represent the
+     * same version string disregarding the optional build information.
+     *
+     * @param  ob
+     *         The object to which this {@code Version} is to be compared
+     *
+     * @return  {@code true} if, and only if, the given object is a {@code
+     *          Version} that is identical to this {@code Version}
+     *          ignoring the optinal build information
+     *
+     */
+    public boolean equalsIgnoreOpt(Object ob) {
+        if (this == ob)
+            return true;
+        if (!(ob instanceof Version))
+            return false;
+
+        Version that = (Version)ob;
+        return (this.version().equals(that.version())
+                && this.pre().equals(that.pre())
+                && this.build().equals(that.build()));
+    }
+
+    /**
+     * Returns the hash code of this version.
+     *
+     * <p> This method satisfies the general contract of the {@link
+     * Object#hashCode Object.hashCode} method.
+     *
+     * @return  The hashcode of this version
+     */
+    @Override
+    public int hashCode() {
+        int h = 1;
+        int p = 17;
+
+        h = p * h + version.hashCode();
+        h = p * h + pre.hashCode();
+        h = p * h + build.hashCode();
+        h = p * h + optional.hashCode();
+
+        return h;
+    }
+}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java	Thu Feb 04 16:49:26 2016 -0800
@@ -124,12 +124,7 @@
     void invokeFinalize(Object o) throws Throwable;
 
     /**
-     * Invokes Long.formatUnsignedLong(long val, int shift, char[] buf, int offset, int len)
+     * Invokes Long.fastUUID
      */
-    void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len);
-
-    /**
-     * Invokes Integer.formatUnsignedInt(long val, int shift, char[] buf, int offset, int len)
-     */
-    void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len);
+    String fastUUID(long lsb, long msb);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/ref/Cleaner.java	Thu Feb 04 16:49:26 2016 -0800
@@ -0,0 +1,164 @@
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.ref;
+
+import java.lang.ref.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+
+/**
+ * General-purpose phantom-reference-based cleaners.
+ *
+ * <p> Cleaners are a lightweight and more robust alternative to finalization.
+ * They are lightweight because they are not created by the VM and thus do not
+ * require a JNI upcall to be created, and because their cleanup code is
+ * invoked directly by the reference-handler thread rather than by the
+ * finalizer thread.  They are more robust because they use phantom references,
+ * the weakest type of reference object, thereby avoiding the nasty ordering
+ * problems inherent to finalization.
+ *
+ * <p> A cleaner tracks a referent object and encapsulates a thunk of arbitrary
+ * cleanup code.  Some time after the GC detects that a cleaner's referent has
+ * become phantom-reachable, the reference-handler thread will run the cleaner.
+ * Cleaners may also be invoked directly; they are thread safe and ensure that
+ * they run their thunks at most once.
+ *
+ * <p> Cleaners are not a replacement for finalization.  They should be used
+ * only when the cleanup code is extremely simple and straightforward.
+ * Nontrivial cleaners are inadvisable since they risk blocking the
+ * reference-handler thread and delaying further cleanup and finalization.
+ *
+ *
+ * @author Mark Reinhold
+ */
+
+public class Cleaner
+    extends PhantomReference<Object>
+    implements Runnable
+{
+
+    // Dummy reference queue, needed because the PhantomReference constructor
+    // insists that we pass a queue.  Nothing will ever be placed on this queue
+    // since the reference handler invokes cleaners explicitly.
+    //
+    private static final ReferenceQueue<Object> dummyQueue = new ReferenceQueue<>();
+
+    // Doubly-linked list of live cleaners, which prevents the cleaners
+    // themselves from being GC'd before their referents
+    //
+    private static Cleaner first = null;
+
+    private Cleaner
+        next = null,
+        prev = null;
+
+    private static synchronized Cleaner add(Cleaner cl) {
+        if (first != null) {
+            cl.next = first;
+            first.prev = cl;
+        }
+        first = cl;
+        return cl;
+    }
+
+    private static synchronized boolean remove(Cleaner cl) {
+
+        // If already removed, do nothing
+        if (cl.next == cl)
+            return false;
+
+        // Update list
+        if (first == cl) {
+            if (cl.next != null)
+                first = cl.next;
+            else
+                first = cl.prev;
+        }
+        if (cl.next != null)
+            cl.next.prev = cl.prev;
+        if (cl.prev != null)
+            cl.prev.next = cl.next;
+
+        // Indicate removal by pointing the cleaner to itself
+        cl.next = cl;
+        cl.prev = cl;
+        return true;
+
+    }
+
+    private final Runnable thunk;
+
+    private Cleaner(Object referent, Runnable thunk) {
+        super(referent, dummyQueue);
+        this.thunk = thunk;
+    }
+
+    /**
+     * Creates a new cleaner.
+     *
+     * @param  ob the referent object to be cleaned
+     * @param  thunk
+     *         The cleanup code to be run when the cleaner is invoked.  The
+     *         cleanup code is run directly from the reference-handler thread,
+     *         so it should be as simple and straightforward as possible.
+     *
+     * @return  The new cleaner
+     */
+    public static Cleaner create(Object ob, Runnable thunk) {
+        if (thunk == null)
+            return null;
+        return add(new Cleaner(ob, thunk));
+    }
+
+    /**
+     * Runs this cleaner, if it has not been run before.
+     */
+    public void clean() {
+        if (!remove(this))
+            return;
+        try {
+            thunk.run();
+        } catch (final Throwable x) {
+            AccessController.doPrivileged(new PrivilegedAction<>() {
+                    public Void run() {
+                        if (System.err != null)
+                            new Error("Cleaner terminated abnormally", x)
+                                .printStackTrace();
+                        System.exit(1);
+                        return null;
+                    }});
+        }
+    }
+
+    @Override public void run() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null)
+            security.checkPackageAccess("jdk.internal.ref");
+        this.clean();
+    }
+
+}
--- a/src/java.base/share/classes/sun/misc/Cleaner.java	Thu Feb 04 11:28:26 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import java.lang.ref.*;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-
-/**
- * General-purpose phantom-reference-based cleaners.
- *
- * <p> Cleaners are a lightweight and more robust alternative to finalization.
- * They are lightweight because they are not created by the VM and thus do not
- * require a JNI upcall to be created, and because their cleanup code is
- * invoked directly by the reference-handler thread rather than by the
- * finalizer thread.  They are more robust because they use phantom references,
- * the weakest type of reference object, thereby avoiding the nasty ordering
- * problems inherent to finalization.
- *
- * <p> A cleaner tracks a referent object and encapsulates a thunk of arbitrary
- * cleanup code.  Some time after the GC detects that a cleaner's referent has
- * become phantom-reachable, the reference-handler thread will run the cleaner.
- * Cleaners may also be invoked directly; they are thread safe and ensure that
- * they run their thunks at most once.
- *
- * <p> Cleaners are not a replacement for finalization.  They should be used
- * only when the cleanup code is extremely simple and straightforward.
- * Nontrivial cleaners are inadvisable since they risk blocking the
- * reference-handler thread and delaying further cleanup and finalization.
- *
- *
- * @author Mark Reinhold
- */
-
-public class Cleaner
-    extends PhantomReference<Object>
-{
-
-    // Dummy reference queue, needed because the PhantomReference constructor
-    // insists that we pass a queue.  Nothing will ever be placed on this queue
-    // since the reference handler invokes cleaners explicitly.
-    //
-    private static final ReferenceQueue<Object> dummyQueue = new ReferenceQueue<>();
-
-    // Doubly-linked list of live cleaners, which prevents the cleaners
-    // themselves from being GC'd before their referents
-    //
-    private static Cleaner first = null;
-
-    private Cleaner
-        next = null,
-        prev = null;
-
-    private static synchronized Cleaner add(Cleaner cl) {
-        if (first != null) {
-            cl.next = first;
-            first.prev = cl;
-        }
-        first = cl;
-        return cl;
-    }
-
-    private static synchronized boolean remove(Cleaner cl) {
-
-        // If already removed, do nothing
-        if (cl.next == cl)
-            return false;
-
-        // Update list
-        if (first == cl) {
-            if (cl.next != null)
-                first = cl.next;
-            else
-                first = cl.prev;
-        }
-        if (cl.next != null)
-            cl.next.prev = cl.prev;
-        if (cl.prev != null)
-            cl.prev.next = cl.next;
-
-        // Indicate removal by pointing the cleaner to itself
-        cl.next = cl;
-        cl.prev = cl;
-        return true;
-
-    }
-
-    private final Runnable thunk;
-
-    private Cleaner(Object referent, Runnable thunk) {
-        super(referent, dummyQueue);
-        this.thunk = thunk;
-    }
-
-    /**
-     * Creates a new cleaner.
-     *
-     * @param  ob the referent object to be cleaned
-     * @param  thunk
-     *         The cleanup code to be run when the cleaner is invoked.  The
-     *         cleanup code is run directly from the reference-handler thread,
-     *         so it should be as simple and straightforward as possible.
-     *
-     * @return  The new cleaner
-     */
-    public static Cleaner create(Object ob, Runnable thunk) {
-        if (thunk == null)
-            return null;
-        return add(new Cleaner(ob, thunk));
-    }
-
-    /**
-     * Runs this cleaner, if it has not been run before.
-     */
-    public void clean() {
-        if (!remove(this))
-            return;
-        try {
-            thunk.run();
-        } catch (final Throwable x) {
-            AccessController.doPrivileged(new PrivilegedAction<>() {
-                    public Void run() {
-                        if (System.err != null)
-                            new Error("Cleaner terminated abnormally", x)
-                                .printStackTrace();
-                        System.exit(1);
-                        return null;
-                    }});
-        }
-    }
-
-}
--- a/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java	Thu Feb 04 16:49:26 2016 -0800
@@ -25,7 +25,7 @@
 
 package sun.nio.ch;
 
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
 
 
 public interface DirectBuffer {
--- a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java	Thu Feb 04 16:49:26 2016 -0800
@@ -47,7 +47,7 @@
 import jdk.internal.misc.JavaIOFileDescriptorAccess;
 import jdk.internal.misc.JavaNioAccess;
 import jdk.internal.misc.SharedSecrets;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
 import sun.security.action.GetPropertyAction;
 
 public class FileChannelImpl
--- a/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java	Thu Feb 04 16:49:26 2016 -0800
@@ -26,7 +26,7 @@
 package sun.nio.ch;
 
 import java.nio.ByteBuffer;
-import sun.misc.*;
+import jdk.internal.ref.Cleaner;
 
 
 /**
--- a/src/java.base/share/classes/sun/nio/ch/Util.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/sun/nio/ch/Util.java	Thu Feb 04 16:49:26 2016 -0800
@@ -33,7 +33,7 @@
 import java.security.PrivilegedAction;
 import java.util.*;
 import jdk.internal.misc.Unsafe;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
 import sun.security.action.GetPropertyAction;
 
 
--- a/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java	Thu Feb 04 16:49:26 2016 -0800
@@ -26,7 +26,7 @@
 package sun.nio.fs;
 
 import jdk.internal.misc.Unsafe;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
 
 /**
  * A light-weight buffer in native memory.
--- a/src/java.base/share/classes/sun/reflect/ConstantPool.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/sun/reflect/ConstantPool.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,10 @@
   public int      getSize()                      { return getSize0            (constantPoolOop);        }
   public Class<?> getClassAt         (int index) { return getClassAt0         (constantPoolOop, index); }
   public Class<?> getClassAtIfLoaded (int index) { return getClassAtIfLoaded0 (constantPoolOop, index); }
+  // Returns a class reference index for a method or a field.
+  public int getClassRefIndexAt(int index) {
+      return getClassRefIndexAt0(constantPoolOop, index);
+  }
   // Returns either a Method or Constructor.
   // Static initializers are returned as Method objects.
   public Member   getMethodAt        (int index) { return getMethodAt0        (constantPoolOop, index); }
@@ -45,13 +49,56 @@
   // Fetches the class name, member (field, method or interface
   // method) name, and type descriptor as an array of three Strings
   public String[] getMemberRefInfoAt (int index) { return getMemberRefInfoAt0 (constantPoolOop, index); }
+  // Returns a name and type reference index for a method, a field or an invokedynamic.
+  public int getNameAndTypeRefIndexAt(int index) {
+      return getNameAndTypeRefIndexAt0(constantPoolOop, index);
+  }
+  // Fetches the name and type from name_and_type index as an array of two Strings
+  public String[] getNameAndTypeRefInfoAt(int index) {
+      return getNameAndTypeRefInfoAt0(constantPoolOop, index);
+  }
   public int      getIntAt           (int index) { return getIntAt0           (constantPoolOop, index); }
   public long     getLongAt          (int index) { return getLongAt0          (constantPoolOop, index); }
   public float    getFloatAt         (int index) { return getFloatAt0         (constantPoolOop, index); }
   public double   getDoubleAt        (int index) { return getDoubleAt0        (constantPoolOop, index); }
   public String   getStringAt        (int index) { return getStringAt0        (constantPoolOop, index); }
   public String   getUTF8At          (int index) { return getUTF8At0          (constantPoolOop, index); }
+  public Tag getTagAt(int index) {
+      return Tag.valueOf(getTagAt0(constantPoolOop, index));
+  }
 
+  public static enum Tag {
+      UTF8(1),
+      INTEGER(3),
+      FLOAT(4),
+      LONG(5),
+      DOUBLE(6),
+      CLASS(7),
+      STRING(8),
+      FIELDREF(9),
+      METHODREF(10),
+      INTERFACEMETHODREF(11),
+      NAMEANDTYPE(12),
+      METHODHANDLE(15),
+      METHODTYPE(16),
+      INVOKEDYNAMIC(18),
+      INVALID(0);
+
+      private final int tagCode;
+
+      private Tag(int tagCode) {
+          this.tagCode = tagCode;
+      }
+
+      private static Tag valueOf(byte v) {
+          for (Tag tag : Tag.values()) {
+              if (tag.tagCode == v) {
+                  return tag;
+              }
+          }
+          throw new IllegalArgumentException("Unknown constant pool tag code " + v);
+      }
+   }
   //---------------------------------------------------------------------------
   // Internals only below this point
   //
@@ -66,15 +113,19 @@
   private native int      getSize0            (Object constantPoolOop);
   private native Class<?> getClassAt0         (Object constantPoolOop, int index);
   private native Class<?> getClassAtIfLoaded0 (Object constantPoolOop, int index);
+  private native int      getClassRefIndexAt0 (Object constantPoolOop, int index);
   private native Member   getMethodAt0        (Object constantPoolOop, int index);
   private native Member   getMethodAtIfLoaded0(Object constantPoolOop, int index);
   private native Field    getFieldAt0         (Object constantPoolOop, int index);
   private native Field    getFieldAtIfLoaded0 (Object constantPoolOop, int index);
   private native String[] getMemberRefInfoAt0 (Object constantPoolOop, int index);
+  private native int      getNameAndTypeRefIndexAt0(Object constantPoolOop, int index);
+  private native String[] getNameAndTypeRefInfoAt0(Object constantPoolOop, int index);
   private native int      getIntAt0           (Object constantPoolOop, int index);
   private native long     getLongAt0          (Object constantPoolOop, int index);
   private native float    getFloatAt0         (Object constantPoolOop, int index);
   private native double   getDoubleAt0        (Object constantPoolOop, int index);
   private native String   getStringAt0        (Object constantPoolOop, int index);
   private native String   getUTF8At0          (Object constantPoolOop, int index);
+  private native byte     getTagAt0           (Object constantPoolOop, int index);
 }
--- a/src/java.base/share/classes/sun/security/jca/ProviderList.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/classes/sun/security/jca/ProviderList.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -653,6 +653,7 @@
         String type = null;
         String algorithm;
         String provider;
+        String alternateName = null;
 
         PreferredEntry(String t, String p) {
             int i = t.indexOf('.');
@@ -664,6 +665,11 @@
             }
 
             provider = p;
+            if (algorithm.compareToIgnoreCase("SHA1") == 0) {
+                alternateName = "SHA-1";
+            } else if (algorithm.compareToIgnoreCase("SHA-1") == 0) {
+                alternateName = "SHA1";
+            }
         }
 
         boolean match(String t, String a) {
@@ -685,6 +691,15 @@
                 return true;
             }
 
+            if (alternateName != null &&
+                    a.compareToIgnoreCase(alternateName) == 0) {
+                if (debug != null) {
+                    debug.println("Config entry found (alternateName):  " +
+                            toString());
+                }
+                return true;
+            }
+
             // No match
             return false;
         }
--- a/src/java.base/share/conf/security/java.security	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/conf/security/java.security	Thu Feb 04 16:49:26 2016 -0800
@@ -109,7 +109,8 @@
 #   jdk.security.provider.preferred=AES/GCM/NoPadding:SunJCE, \
 #         MessageDigest.SHA-256:SUN
 #ifdef solaris-sparc
-jdk.security.provider.preferred=AES:SunJCE, SHA-256:SUN, SHA-384:SUN, SHA-512:SUN
+jdk.security.provider.preferred=AES:SunJCE, SHA1:SUN, SHA-224:SUN, \
+      SHA-256:SUN, SHA-384:SUN, SHA-512:SUN
 #endif
 #ifdef solaris-x86
 jdk.security.provider.preferred=AES:SunJCE, RSA:SunRsaSign
--- a/src/java.base/share/native/include/jvm.h	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/native/include/jvm.h	Thu Feb 04 16:49:26 2016 -0800
@@ -63,7 +63,7 @@
  *    class.
  */
 
-#define JVM_INTERFACE_VERSION 4
+#define JVM_INTERFACE_VERSION 5
 
 JNIEXPORT jint JNICALL
 JVM_GetInterfaceVersion(void);
@@ -502,6 +502,9 @@
 JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded
 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 
+JNIEXPORT jint JNICALL JVM_ConstantPoolGetClassRefIndexAt
+(JNIEnv *env, jobject obj, jobject unused, jint index);
+
 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt
 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 
@@ -517,6 +520,12 @@
 JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt
 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 
+JNIEXPORT jint JNICALL JVM_ConstantPoolGetNameAndTypeRefIndexAt
+(JNIEnv *env, jobject obj, jobject unused, jint index);
+
+JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetNameAndTypeRefInfoAt
+(JNIEnv *env, jobject obj, jobject unused, jint index);
+
 JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt
 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 
@@ -535,6 +544,9 @@
 JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At
 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 
+JNIEXPORT jbyte JNICALL JVM_ConstantPoolGetTagAt
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);
+
 /*
  * Parameter reflection
  */
--- a/src/java.base/share/native/libjava/ConstantPool.c	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/native/libjava/ConstantPool.c	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,12 @@
   return JVM_ConstantPoolGetClassAtIfLoaded(env, unused, jcpool, index);
 }
 
+JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getClassRefIndexAt0
+(JNIEnv *env, jobject unused, jobject jcpool, jint index)
+{
+    return JVM_ConstantPoolGetClassRefIndexAt(env, unused, jcpool, index);
+}
+
 JNIEXPORT jobject JNICALL Java_sun_reflect_ConstantPool_getMethodAt0
 (JNIEnv *env, jobject unused, jobject jcpool, jint index)
 {
@@ -74,6 +80,18 @@
   return JVM_ConstantPoolGetMemberRefInfoAt(env, unused, jcpool, index);
 }
 
+JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getNameAndTypeRefIndexAt0
+(JNIEnv *env, jobject unused, jobject jcpool, jint index)
+{
+    return JVM_ConstantPoolGetNameAndTypeRefIndexAt(env, unused, jcpool, index);
+}
+
+JNIEXPORT jobjectArray JNICALL Java_sun_reflect_ConstantPool_getNameAndTypeRefInfoAt0
+(JNIEnv *env, jobject unused, jobject jcpool, jint index)
+{
+  return JVM_ConstantPoolGetNameAndTypeRefInfoAt(env, unused, jcpool, index);
+}
+
 JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getIntAt0
 (JNIEnv *env, jobject unused, jobject jcpool, jint index)
 {
@@ -109,3 +127,10 @@
 {
   return JVM_ConstantPoolGetUTF8At(env, unused, jcpool, index);
 }
+
+JNIEXPORT jbyte JNICALL Java_sun_reflect_ConstantPool_getTagAt0
+(JNIEnv *env, jobject unused, jobject jcpool, jint index)
+{
+  return JVM_ConstantPoolGetTagAt(env, unused, jcpool, index);
+}
+
--- a/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -210,7 +210,7 @@
     // Locate resource location data.
     ImageLocation location;
     bool found = reader->find_location(path, location);
-    delete path;
+    delete[] path;
     // Resource not found.
     if (!found) return NULL;
     // Expand stream into array.
--- a/src/java.base/share/native/libjimage/imageDecompressor.cpp	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.base/share/native/libjimage/imageDecompressor.cpp	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +86,7 @@
 }
 
 void ImageDecompressor::image_decompressor_close() {
-    delete _decompressors;
+    delete[] _decompressors;
 }
 
 /*
@@ -135,13 +135,13 @@
             decompressor->decompress_resource(compressed_resource, decompressed_resource,
                 &_header, strings);
             if (compressed_resource_base != compressed) {
-                delete compressed_resource_base;
+                delete[] compressed_resource_base;
             }
             compressed_resource = decompressed_resource;
         }
     } while (has_header);
     memcpy(uncompressed, decompressed_resource, uncompressed_size);
-    delete decompressed_resource;
+    delete[] decompressed_resource;
 }
 
 // Zip decompressor
@@ -190,8 +190,8 @@
             { // String in Strings table
                 *uncompressed_resource = 1;
                 uncompressed_resource += 1;
-                int i = decompress_int(data);
-                const char * string = strings->get(i);
+                int k = decompress_int(data);
+                const char * string = strings->get(k);
                 int str_length = (int) strlen(string);
                 Endian::set_java(uncompressed_resource, str_length);
                 uncompressed_resource += 2;
@@ -241,7 +241,7 @@
                                 *fullpkg = '/';
                                 memcpy(uncompressed_resource, pkg_base, len);
                                 uncompressed_resource += len;
-                                delete pkg_base;
+                                delete[] pkg_base;
                                 desc_length += len;
                             } else { // Empty package
                                 // Nothing to do.
--- a/src/java.desktop/macosx/classes/com/apple/eawt/Application.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/Application.java	Thu Feb 04 16:49:26 2016 -0800
@@ -39,7 +39,7 @@
 import sun.lwawt.macosx.CPlatformWindow;
 
 /**
- * The <code>Application</code> class allows you to integrate your Java application with the native Mac OS X environment.
+ * The {@code Application} class allows you to integrate your Java application with the native Mac OS X environment.
  * You can provide your Mac OS X users a greatly enhanced experience by implementing a few basic handlers for standard system events.
  *
  * For example:
@@ -142,7 +142,7 @@
     /**
      * Installs a handler to show a custom About window for your application.
      *
-     * Setting the {@link AboutHandler} to <code>null</code> reverts it to the default Cocoa About window.
+     * Setting the {@link AboutHandler} to {@code null} reverts it to the default Cocoa About window.
      *
      * @param aboutHandler the handler to respond to the {@link AboutHandler#handleAbout()} message
      * @since Java for Mac OS X 10.6 Update 3
@@ -155,7 +155,7 @@
     /**
      * Installs a handler to create the Preferences menu item in your application's app menu.
      *
-     * Setting the {@link PreferencesHandler} to <code>null</code> will remove the Preferences item from the app menu.
+     * Setting the {@link PreferencesHandler} to {@code null} will remove the Preferences item from the app menu.
      *
      * @param preferencesHandler
      * @since Java for Mac OS X 10.6 Update 3
@@ -167,8 +167,8 @@
 
     /**
      * Installs the handler which is notified when the application is asked to open a list of files.
-     * The {@link OpenFilesHandler#openFiles(AppEvent.OpenFilesEvent)} notifications are only sent if the Java app is a bundled application, with a <code>CFBundleDocumentTypes</code> array present in it's Info.plist.
-     * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a <code>CFBundleDocumentTypes</code> key to your app's Info.plist.
+     * The {@link OpenFilesHandler#openFiles(AppEvent.OpenFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist.
+     * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a {@code CFBundleDocumentTypes} key to your app's Info.plist.
      *
      * @param openFileHandler
      * @since Java for Mac OS X 10.6 Update 3
@@ -180,8 +180,8 @@
 
     /**
      * Installs the handler which is notified when the application is asked to print a list of files.
-     * The {@link PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)} notifications are only sent if the Java app is a bundled application, with a <code>CFBundleDocumentTypes</code> array present in it's Info.plist.
-     * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a <code>CFBundleDocumentTypes</code> key to your app's Info.plist.
+     * The {@link PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist.
+     * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a {@code CFBundleDocumentTypes} key to your app's Info.plist.
      *
      * @param printFileHandler
      * @since Java for Mac OS X 10.6 Update 3
@@ -193,10 +193,10 @@
 
     /**
      * Installs the handler which is notified when the application is asked to open a URL.
-     * The {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} notifications are only sent if the Java app is a bundled application, with a <code>CFBundleURLTypes</code> array present in it's Info.plist.
-     * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a <code>CFBundleURLTypes</code> key to your app's Info.plist.
+     * The {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleURLTypes} array present in it's Info.plist.
+     * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a {@code CFBundleURLTypes} key to your app's Info.plist.
      *
-     * Setting the handler to <code>null</code> causes all {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be enqueued until another handler is set.
+     * Setting the handler to {@code null} causes all {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be enqueued until another handler is set.
      *
      * @param openURIHandler
      * @since Java for Mac OS X 10.6 Update 3
@@ -209,7 +209,7 @@
     /**
      * Installs the handler which determines if the application should quit.
      * The handler is passed a one-shot {@link QuitResponse} which can cancel or proceed with the quit.
-     * Setting the handler to <code>null</code> causes all quit requests to directly perform the default {@link QuitStrategy}.
+     * Setting the handler to {@code null} causes all quit requests to directly perform the default {@link QuitStrategy}.
      *
      * @param quitHandler the handler that is called when the application is asked to quit
      * @since Java for Mac OS X 10.6 Update 3
@@ -432,11 +432,11 @@
 
     /**
      * Enables the Preferences item in the application menu. The ApplicationListener receives a callback for
-     * selection of the Preferences item in the application menu only if this is set to <code>true</code>.
+     * selection of the Preferences item in the application menu only if this is set to {@code true}.
      *
      * If a Preferences item isn't present, this method adds and enables it.
      *
-     * @param enable specifies whether the Preferences item in the application menu should be enabled (<code>true</code>) or not (<code>false</code>)
+     * @param enable specifies whether the Preferences item in the application menu should be enabled ({@code true}) or not ({@code false})
      *
      * @deprecated no replacement
      * @since 1.4
@@ -449,12 +449,12 @@
 
     /**
      * Enables the About item in the application menu. The ApplicationListener receives a callback for
-     * selection of the About item in the application menu only if this is set to <code>true</code>. Because AWT supplies
-     * a standard About window when an application may not, by default this is set to <code>true</code>.
+     * selection of the About item in the application menu only if this is set to {@code true}. Because AWT supplies
+     * a standard About window when an application may not, by default this is set to {@code true}.
      *
      * If the About item isn't present, this method adds and enables it.
      *
-     * @param enable specifies whether the About item in the application menu should be enabled (<code>true</code>) or not (<code>false</code>)
+     * @param enable specifies whether the About item in the application menu should be enabled ({@code true}) or not ({@code false})
      *
      * @deprecated no replacement
      * @since 1.4
@@ -553,7 +553,7 @@
     }
 
     /**
-     * @deprecated Use <code>java.awt.MouseInfo.getPointerInfo().getLocation()</code>.
+     * @deprecated Use {@code java.awt.MouseInfo.getPointerInfo().getLocation()}.
      *
      * @since 1.4
      */
--- a/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -26,7 +26,7 @@
 package com.apple.eawt;
 
 /**
- * An abstract adapter class for receiving <code>ApplicationEvents</code>.
+ * An abstract adapter class for receiving {@code ApplicationEvents}.
  *
  * ApplicationEvents are deprecated. Use individual app event listeners or handlers instead.
  *
--- a/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java	Thu Feb 04 16:49:26 2016 -0800
@@ -50,9 +50,9 @@
 
     /**
      * Determines whether an ApplicationListener has acted on a particular event.
-     * An event is marked as having been handled with <code>setHandled(true)</code>.
+     * An event is marked as having been handled with {@code setHandled(true)}.
      *
-     * @return <code>true</code> if the event has been handled, otherwise <code>false</code>
+     * @return {@code true} if the event has been handled, otherwise {@code false}
      *
      * @since 1.4
      * @deprecated
@@ -65,10 +65,10 @@
     /**
      * Marks the event as handled.
      * After this method handles an ApplicationEvent, it may be useful to specify that it has been handled.
-     * This is usually used in conjunction with <code>getHandled()</code>.
-     * Set to <code>true</code> to designate that this event has been handled. By default it is <code>false</code>.
+     * This is usually used in conjunction with {@code getHandled()}.
+     * Set to {@code true} to designate that this event has been handled. By default it is {@code false}.
      *
-     * @param state <code>true</code> if the event has been handled, otherwise <code>false</code>.
+     * @param state {@code true} if the event has been handled, otherwise {@code false}.
      *
      * @since 1.4
      * @deprecated
@@ -84,7 +84,7 @@
      * For example, the Print and Open events refer to specific files.
      * For these cases, this returns the appropriate file name.
      *
-     * @return the full path to the file associated with the event, if applicable, otherwise <code>null</code>
+     * @return the full path to the file associated with the event, if applicable, otherwise {@code null}
      *
      * @since 1.4
      * @deprecated use {@link OpenFilesHandler} or {@link PrintFilesHandler} instead
--- a/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java	Thu Feb 04 16:49:26 2016 -0800
@@ -53,9 +53,9 @@
 @Deprecated
 public interface ApplicationListener extends EventListener {
     /**
-     * Called when the user selects the About item in the application menu. If <code>event</code> is not handled by
-     * setting <code>isHandled(true)</code>, a default About window consisting of the application's name and icon is
-     * displayed. To display a custom About window, designate the <code>event</code> as being handled and display the
+     * Called when the user selects the About item in the application menu. If {@code event} is not handled by
+     * setting {@code isHandled(true)}, a default About window consisting of the application's name and icon is
+     * displayed. To display a custom About window, designate the {@code event} as being handled and display the
      * appropriate About window.
      *
      * @param event an ApplicationEvent initiated by the user choosing About in the application menu
@@ -99,7 +99,7 @@
      * Called when the Preference item in the application menu is selected. Native Mac OS X applications make their
      * Preferences window available through the application menu. Java applications are automatically given an application
      * menu in Mac OS X. By default, the Preferences item is disabled in that menu. If you are deploying an application
-     * on Mac OS X, you should enable the preferences item with <code>setEnabledPreferencesMenu(true)</code> in the
+     * on Mac OS X, you should enable the preferences item with {@code setEnabledPreferencesMenu(true)} in the
      * Application object and then display your Preferences window in this handler.
      *
      * @param event triggered when the user selects Preferences from the application menu
@@ -130,8 +130,8 @@
      * application menu, when the user types Command-Q, or when the user control clicks on your application icon in the
      * Dock and chooses Quit. You can either accept or reject the request to quit. You might want to reject the request
      * to quit if the user has unsaved work. Reject the request, move into your code to save changes, then quit your
-     * application. To accept the request to quit, and terminate the application, set <code>isHandled(true)</code> for the
-     * <code>event</code>. To reject the quit, set <code>isHandled(false)</code>.
+     * application. To accept the request to quit, and terminate the application, set {@code isHandled(true)} for the
+     * {@code event}. To reject the quit, set {@code isHandled(false)}.
      *
      * @param event a Quit Application event
      * @deprecated use {@link QuitHandler} and {@link QuitResponse}
--- a/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java	Thu Feb 04 16:49:26 2016 -0800
@@ -29,8 +29,8 @@
 
 /**
  * An implementor is notified when the application is asked to open a URI.
- * The application only sends {@link com.apple.eawt.EAWTEvent.OpenURIEvent}s when it has been launched as a bundled Mac application, and it's Info.plist claims URL schemes in it's <code>CFBundleURLTypes</code> entry.
- * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a <code>CFBundleURLTypes</code> key to your app's Info.plist.
+ * The application only sends {@link com.apple.eawt.EAWTEvent.OpenURIEvent}s when it has been launched as a bundled Mac application, and it's Info.plist claims URL schemes in it's {@code CFBundleURLTypes} entry.
+ * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a {@code CFBundleURLTypes} key to your app's Info.plist.
  *
  * @see Application#setOpenURIHandler(OpenURIHandler)
  *
--- a/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java	Thu Feb 04 16:49:26 2016 -0800
@@ -38,7 +38,7 @@
  */
 public enum QuitStrategy {
     /**
-     * Shuts down the application by calling <code>System.exit(0)</code>. This is the default strategy.
+     * Shuts down the application by calling {@code System.exit(0)}. This is the default strategy.
      */
     SYSTEM_EXIT_0,
 
--- a/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java	Thu Feb 04 16:49:26 2016 -0800
@@ -32,19 +32,19 @@
  * attributes. These attributes in turn are dependent on HFS and HFS+ file systems. As such, it is important to recognize
  * their limitation when writing code that must function well across multiple platforms.<p>
  *
- * In addition to file name suffixes, Mac OS X can use Finder attributes like file <code>type</code> and <code>creator</code> codes to
- * identify and handle files. These codes are unique 4-byte identifiers. The file <code>type</code> is a string that describes the
- * contents of a file. For example, the file type <code>APPL</code> identifies the file as an application and therefore
- * executable. A file type of <code>TEXT</code>  means that the file contains raw text. Any application that can read raw
- * text can open a file of type <code>TEXT</code>. Applications that use proprietary file types might assign their files a proprietary
- * file <code>type</code> code.
+ * In addition to file name suffixes, Mac OS X can use Finder attributes like file {@code type} and {@code creator} codes to
+ * identify and handle files. These codes are unique 4-byte identifiers. The file {@code type} is a string that describes the
+ * contents of a file. For example, the file type {@code APPL} identifies the file as an application and therefore
+ * executable. A file type of {@code TEXT}  means that the file contains raw text. Any application that can read raw
+ * text can open a file of type {@code TEXT}. Applications that use proprietary file types might assign their files a proprietary
+ * file {@code type} code.
  * <p>
- * To identify the application that can handle a document, the Finder can look at the <code>creator</code>. For example, if a user
- * double-clicks on a document with the <code>ttxt</code> <code>creator</code>, it opens up in Text Edit, the application registered
- * with the <code>ttxt</code> <code>creator</code> code. Note that the <code>creator</code>
+ * To identify the application that can handle a document, the Finder can look at the {@code creator}. For example, if a user
+ * double-clicks on a document with the {@code ttxt creator}, it opens up in Text Edit, the application registered
+ * with the {@code ttxt creator} code. Note that the {@code creator}
  * code can be set to any application, not necessarily the application that created it. For example, if you
- * use an editor to create an HTML document, you might want to assign a browser's <code>creator</code> code for the file rather than
- * the HTML editor's <code>creator</code> code. Double-clicking on the document then opens the appropriate browser rather than the
+ * use an editor to create an HTML document, you might want to assign a browser's {@code creator} code for the file rather than
+ * the HTML editor's {@code creator} code. Double-clicking on the document then opens the appropriate browser rather than the
  *HTML editor.
  *<p>
  * If you plan to publicly distribute your application, you must register its creator and any proprietary file types with the Apple
@@ -126,7 +126,7 @@
     }
 
     /**
-         * Sets the file <code>type</code> and <code>creator</code> codes for a file or folder.
+         * Sets the file {@code type} and {@code creator} codes for a file or folder.
          *
          * @since 1.4
          */
@@ -140,7 +140,7 @@
         private static native void _setFileTypeAndCreator(String filename, int type, int creator) throws IOException;
 
     /**
-         * Sets the file <code>type</code> code for a file or folder.
+         * Sets the file {@code type} code for a file or folder.
          *
          * @since 1.4
          */
@@ -154,7 +154,7 @@
     private static native void _setFileType(String filename, int type) throws IOException;
 
     /**
-         * Sets the file <code>creator</code> code for a file or folder.
+         * Sets the file {@code creator} code for a file or folder.
          *
          * @since 1.4
          */
@@ -168,7 +168,7 @@
     private static native void _setFileCreator(String filename, int creator) throws IOException;
 
     /**
-         * Obtains the file <code>type</code> code for a file or folder.
+         * Obtains the file {@code type} code for a file or folder.
          *
          * @since 1.4
          */
@@ -182,7 +182,7 @@
     private static native int _getFileType(String filename) throws IOException;
 
     /**
-         * Obtains the file <code>creator</code> code for a file or folder.
+         * Obtains the file {@code creator} code for a file or folder.
          *
          * @since 1.4
          */
@@ -200,11 +200,11 @@
          * Locates a folder of a particular type. Mac OS X recognizes certain specific folders that have distinct purposes.
          * For example, the user's desktop or temporary folder. These folders have corresponding codes. Given one of these codes,
          * this method returns the path to that particular folder. Certain folders of a given type may appear in more than
-         * one domain. For example, although there is only one <code>root</code> folder, there are multiple <code>pref</code>
-         * folders. If this method is called to find the <code>pref</code> folder, it will return the first one it finds,
-         * the user's preferences folder in <code>~/Library/Preferences</code>. To explicitly locate a folder in a certain
-         * domain use <code>findFolder(short domain, int folderType)</code> or <code>findFolder(short domain, int folderType,
-         * boolean createIfNeeded)</code>.
+         * one domain. For example, although there is only one {@code root} folder, there are multiple {@code pref}
+         * folders. If this method is called to find the {@code pref} folder, it will return the first one it finds,
+         * the user's preferences folder in {@code ~/Library/Preferences}. To explicitly locate a folder in a certain
+         * domain use {@code findFolder(short domain, int folderType)} or
+         * {@code findFolder(short domain, int folderType, boolean createIfNeeded)}.
          *
          * @return the path to the folder searched for
          *
@@ -215,8 +215,8 @@
         }
 
     /**
-         * Locates a folder of a particular type, within a given domain. Similar to <code>findFolder(int folderType)</code>
-         * except that the domain to look in can be specified. Valid values for <code>domain</code>include:
+         * Locates a folder of a particular type, within a given domain. Similar to {@code findFolder(int folderType)}
+         * except that the domain to look in can be specified. Valid values for {@code domain} include:
          * <dl>
          * <dt>user</dt>
          * <dd>The User domain contains resources specific to the user who is currently logged in</dd>
@@ -239,12 +239,12 @@
 
     /**
          * Locates a folder of a particular type within a given domain and optionally creating the folder if it does
-         * not exist. The behavior is similar to <code>findFolder(int folderType)</code> and
-         * <code>findFolder(short domain, int folderType)</code> except that it can create the folder if it does not already exist.
+         * not exist. The behavior is similar to {@code findFolder(int folderType)} and
+         * {@code findFolder(short domain, int folderType)} except that it can create the folder if it does not already exist.
          *
          * @param createIfNeeded
-         *            set to <code>true</code>, by setting to <code>false</code> the behavior will be the
-         *            same as <code>findFolder(short domain, int folderType, boolean createIfNeeded)</code>
+         *            set to {@code true}, by setting to {@code false} the behavior will be the
+         *            same as {@code findFolder(short domain, int folderType, boolean createIfNeeded)}
          * @return the path to the folder searched for
          *
          * @since 1.4
@@ -263,9 +263,9 @@
 
 
     /**
-         * Opens the path specified by a URL in the appropriate application for that URL. HTTP URL's (<code>http://</code>)
-         * open in the default browser as set in the Internet pane of System Preferences. File (<code>file://</code>) and
-         * FTP URL's (<code>ftp://</code>) open in the Finder. Note that opening an FTP URL will prompt the user for where
+         * Opens the path specified by a URL in the appropriate application for that URL. HTTP URL's ({@code http://})
+         * open in the default browser as set in the Internet pane of System Preferences. File ({@code file://}) and
+         * FTP URL's ({@code ftp://}) open in the Finder. Note that opening an FTP URL will prompt the user for where
          * they want to save the downloaded file(s).
          *
          * @param url
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java	Thu Feb 04 16:49:26 2016 -0800
@@ -26,6 +26,7 @@
 package com.apple.laf;
 
 
+import java.awt.ComponentOrientation;
 import java.beans.*;
 import java.io.File;
 import java.util.*;
@@ -85,6 +86,15 @@
         } else if (prop == JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY) {
             invalidateFileCache();
             validateFileCache();
+        } else if (prop.equals("componentOrientation")) {
+            ComponentOrientation o = (ComponentOrientation) e.getNewValue();
+            JFileChooser cc = (JFileChooser) e.getSource();
+            if (o != e.getOldValue()) {
+                cc.applyComponentOrientation(o);
+            }
+            fFileList.setComponentOrientation(o);
+            fFileList.getParent().getParent().setComponentOrientation(o);
+
         }
         if (prop == SORT_BY_CHANGED) {// $ Ought to just resort
             fSortNames = (((Integer)e.getNewValue()).intValue() == 0);
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java	Thu Feb 04 16:49:26 2016 -0800
@@ -105,7 +105,9 @@
         // Position depends on *current* position of frame, unlike super which reuses the first position
         final Rectangle r = getBoundsForIconOf(f);
         desktopIcon.setBounds(r.x, r.y, r.width, r.height);
-
+        if (!wasIcon(f)) {
+            setWasIcon(f, Boolean.TRUE);
+        }
         c = f.getParent();
         if (c == null) return;
 
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Thu Feb 04 16:49:26 2016 -0800
@@ -295,9 +295,9 @@
     }
 
     /**
-     * Installs necessary mouse handlers on <code>newPane</code>
+     * Installs necessary mouse handlers on {@code newPane}
      * and adds it to the frame.
-     * Reverse process for the <code>currentPane</code>.
+     * Reverse process for the {@code currentPane}.
      */
     @Override
     protected void replacePane(final JComponent currentPane, final JComponent newPane) {
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Thu Feb 04 16:49:26 2016 -0800
@@ -82,9 +82,9 @@
     }
 
     /**
-     * Returns true if the <code>LookAndFeel</code> returned
-     * <code>RootPaneUI</code> instances support providing Window decorations
-     * in a <code>JRootPane</code>.
+     * Returns true if the {@code LookAndFeel} returned
+     * {@code RootPaneUI} instances support providing Window decorations
+     * in a {@code JRootPane}.
      * <p>
      * The default implementation returns false, subclasses that support
      * Window decorations should override this and return true.
@@ -174,20 +174,20 @@
     }
 
     /**
-     * Returns an <code>ActionMap</code>.
+     * Returns an {@code ActionMap}.
      * <P>
-     * This <code>ActionMap</code> contains <code>Actions</code> that
+     * This {@code ActionMap} contains {@code Actions} that
      * embody the ability to render an auditory cue. These auditory
      * cues map onto user and system activities that may be useful
      * for an end user to know about (such as a dialog box appearing).
      * <P>
-     * At the appropriate time in a <code>JComponent</code> UI's lifecycle,
+     * At the appropriate time in a {@code JComponent} UI's lifecycle,
      * the ComponentUI is responsible for getting the appropriate
-     * <code>Action</code> out of the <code>ActionMap</code> and passing
-     * it on to <code>playSound</code>.
+     * {@code Action} out of the {@code ActionMap} and passing
+     * it on to {@code playSound}.
      * <P>
-     * The <code>Actions</code> in this <code>ActionMap</code> are
-     * created by the <code>createAudioAction</code> method.
+     * The {@code Actions} in this {@code ActionMap} are
+     * created by the {@code createAudioAction} method.
      *
      * @return      an ActionMap containing Actions
      *              responsible for rendering auditory cues
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java	Thu Feb 04 16:49:26 2016 -0800
@@ -47,7 +47,7 @@
 
     /**
      * Creates and returns a Container containin the buttons. The buttons
-     * are created by calling <code>getButtons</code>.
+     * are created by calling {@code getButtons}.
      */
     protected Container createButtonArea() {
         final Container bottom = super.createButtonArea();
@@ -141,5 +141,27 @@
                 xLocation += xOffset;
             }
         }
+
+        @Override
+        public Dimension minimumLayoutSize(Container c) {
+            if (c != null) {
+                Component[] children = c.getComponents();
+                if (children != null && children.length > 0) {
+                    int numChildren = children.length;
+                    Insets cInsets = c.getInsets();
+                    int extraHeight = cInsets.top + cInsets.bottom;
+                    int extraWidth = cInsets.left + cInsets.right;
+                    int okCancelButtonWidth = extraWidth
+                            + (kOKCancelButtonWidth * numChildren)
+                            + (numChildren - 1) * padding;
+                    int okbuttonHeight = extraHeight + kButtonHeight;
+                    Dimension minSize = super.minimumLayoutSize(c);
+                    return new Dimension(Math.max(minSize.width,
+                            okCancelButtonWidth),
+                            Math.max(minSize.height, okbuttonHeight));
+                }
+            }
+            return new Dimension(0, 0);
+        }
     }
 }
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java	Thu Feb 04 16:49:26 2016 -0800
@@ -180,10 +180,19 @@
         final int width = progressBar.getWidth() - (i.right + i.left);
         final int height = progressBar.getHeight() - (i.bottom + i.top);
 
+        Graphics2D g2 = (Graphics2D) g;
+        final AffineTransform savedAT = g2.getTransform();
+        if (!progressBar.getComponentOrientation().isLeftToRight()) {
+            //Scale operation: Flips component about pivot
+            //Translate operation: Moves component back into original position
+            g2.scale(-1, 1);
+            g2.translate(-progressBar.getWidth(), 0);
+        }
         painter.paint(g, progressBar, i.left, i.top, width, height);
 
+        g2.setTransform(savedAT);
         if (progressBar.isStringPainted() && !progressBar.isIndeterminate()) {
-            paintString(g, i.left, i.top, width, height);
+                paintString(g, i.left, i.top, width, height);
         }
     }
 
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java	Thu Feb 04 16:49:26 2016 -0800
@@ -164,7 +164,7 @@
 
     /**
      * Invoked when a property changes on the root pane. If the event
-     * indicates the <code>defaultButton</code> has changed, this will
+     * indicates the {@code defaultButton} has changed, this will
      * update the animation.
      * If the enabled state changed, it will start or stop the animation
      */
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java	Thu Feb 04 16:49:26 2016 -0800
@@ -22,7 +22,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
 package com.apple.laf;
 
 import java.awt.*;
@@ -45,33 +44,37 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 /**
- * This is originally derived from BasicSpinnerUI, but they made everything private
- * so we can't subclass!
+ * This is originally derived from BasicSpinnerUI, but they made everything
+ * private so we can't subclass!
  */
 public class AquaSpinnerUI extends SpinnerUI {
+
     private static final RecyclableSingleton<? extends PropertyChangeListener> propertyChangeListener
             = new RecyclableSingletonFromDefaultConstructor<>(PropertyChangeHandler.class);
+
     static PropertyChangeListener getPropertyChangeListener() {
         return propertyChangeListener.get();
     }
 
     private static final RecyclableSingleton<ArrowButtonHandler> nextButtonHandler
             = new RecyclableSingleton<ArrowButtonHandler>() {
-        @Override
-        protected ArrowButtonHandler getInstance() {
-            return new ArrowButtonHandler("increment", true);
-        }
-    };
+                @Override
+                protected ArrowButtonHandler getInstance() {
+                    return new ArrowButtonHandler("increment", true);
+                }
+            };
+
     static ArrowButtonHandler getNextButtonHandler() {
         return nextButtonHandler.get();
     }
     private static final RecyclableSingleton<ArrowButtonHandler> previousButtonHandler
             = new RecyclableSingleton<ArrowButtonHandler>() {
-        @Override
-        protected ArrowButtonHandler getInstance() {
-            return new ArrowButtonHandler("decrement", false);
-        }
-    };
+                @Override
+                protected ArrowButtonHandler getInstance() {
+                    return new ArrowButtonHandler("decrement", false);
+                }
+            };
+
     static ArrowButtonHandler getPreviousButtonHandler() {
         return previousButtonHandler.get();
     }
@@ -92,9 +95,10 @@
     }
 
     boolean wasOpaque;
+
     @Override
     public void installUI(final JComponent c) {
-        this.spinner = (JSpinner)c;
+        this.spinner = (JSpinner) c;
         installDefaults();
         installListeners();
         next = createNextButton();
@@ -110,8 +114,7 @@
         installKeyboardActions();
 
         // this doesn't work because JSpinner calls setOpaque(true) directly in it's constructor
-    //    LookAndFeel.installProperty(spinner, "opaque", Boolean.FALSE);
-
+        //    LookAndFeel.installProperty(spinner, "opaque", Boolean.FALSE);
         // ...so we have to handle the is/was opaque ourselves
         wasOpaque = spinner.isOpaque();
         spinner.setOpaque(false);
@@ -208,6 +211,7 @@
 
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     class TransparentButton extends JButton implements SwingConstants {
+
         boolean interceptRepaints = false;
 
         public TransparentButton() {
@@ -219,14 +223,17 @@
         }
 
         @Override
-        public void paint(final Graphics g) {}
+        public void paint(final Graphics g) {
+        }
 
         @Override
         public void repaint() {
             // only intercept repaints if we are after this has been initialized
             // otherwise we can't talk to our containing class
             if (interceptRepaints) {
-                if (spinPainter == null) return;
+                if (spinPainter == null) {
+                    return;
+                }
                 spinPainter.repaint();
             }
             super.repaint();
@@ -246,7 +253,9 @@
     }
 
     protected void fixupEditor(final JComponent editor) {
-        if (!(editor instanceof DefaultEditor)) return;
+        if (!(editor instanceof DefaultEditor)) {
+            return;
+        }
 
         editor.setOpaque(false);
         editor.setInheritsPopupMenu(true);
@@ -255,7 +264,7 @@
             editor.setFont(new FontUIResource(spinner.getFont()));
         }
 
-        final JFormattedTextField editorTextField = ((DefaultEditor)editor).getTextField();
+        final JFormattedTextField editorTextField = ((DefaultEditor) editor).getTextField();
         if (editorTextField.getFont() instanceof UIResource) {
             editorTextField.setFont(new FontUIResource(spinner.getFont()));
         }
@@ -277,7 +286,7 @@
 
             child.setEnabled(enabled);
             if (child instanceof Container) {
-                updateEnabledState((Container)child, enabled);
+                updateEnabledState((Container) child, enabled);
             }
         }
     }
@@ -290,13 +299,13 @@
 
     private InputMap getInputMap(final int condition) {
         if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) {
-            return (InputMap)UIManager.get("Spinner.ancestorInputMap");
+            return (InputMap) UIManager.get("Spinner.ancestorInputMap");
         }
         return null;
     }
 
     private ActionMap getActionMap() {
-        ActionMap map = (ActionMap)UIManager.get("Spinner.actionMap");
+        ActionMap map = (ActionMap) UIManager.get("Spinner.actionMap");
 
         if (map == null) {
             map = createActionMap();
@@ -316,6 +325,7 @@
 
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     private static class ArrowButtonHandler extends AbstractAction implements MouseListener {
+
         final javax.swing.Timer autoRepeatTimer;
         final boolean isNext;
         JSpinner spinner = null;
@@ -330,9 +340,9 @@
         private JSpinner eventToSpinner(final AWTEvent e) {
             Object src = e.getSource();
             while ((src instanceof Component) && !(src instanceof JSpinner)) {
-                src = ((Component)src).getParent();
+                src = ((Component) src).getParent();
             }
-            return (src instanceof JSpinner) ? (JSpinner)src : null;
+            return (src instanceof JSpinner) ? (JSpinner) src : null;
         }
 
         @Override
@@ -342,13 +352,15 @@
                 spinner = eventToSpinner(e);
             }
 
-            if (spinner == null) return;
+            if (spinner == null) {
+                return;
+            }
 
             try {
                 final int calendarField = getCalendarField(spinner);
                 spinner.commitEdit();
                 if (calendarField != -1) {
-                    ((SpinnerDateModel)spinner.getModel()).setCalendarField(calendarField);
+                    ((SpinnerDateModel) spinner.getModel()).setCalendarField(calendarField);
                 }
                 final Object value = (isNext) ? spinner.getNextValue() : spinner.getPreviousValue();
                 if (value != null) {
@@ -368,37 +380,46 @@
          */
         private void select(final JSpinner spinnerComponent) {
             final JComponent editor = spinnerComponent.getEditor();
-            if (!(editor instanceof JSpinner.DateEditor)) return;
+            if (!(editor instanceof JSpinner.DateEditor)) {
+                return;
+            }
 
-            final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor;
+            final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor) editor;
             final JFormattedTextField ftf = dateEditor.getTextField();
             final Format format = dateEditor.getFormat();
             Object value;
-            if (format == null || (value = spinnerComponent.getValue()) == null) return;
+            if (format == null || (value = spinnerComponent.getValue()) == null) {
+                return;
+            }
 
             final SpinnerDateModel model = dateEditor.getModel();
             final DateFormat.Field field = DateFormat.Field.ofCalendarField(model.getCalendarField());
-            if (field == null) return;
+            if (field == null) {
+                return;
+            }
 
             try {
                 final AttributedCharacterIterator iterator = format.formatToCharacterIterator(value);
                 if (!select(ftf, iterator, field) && field == DateFormat.Field.HOUR0) {
                     select(ftf, iterator, DateFormat.Field.HOUR1);
                 }
-            } catch (final IllegalArgumentException iae) {}
+            } catch (final IllegalArgumentException iae) {
+            }
         }
 
         /**
-         * Selects the passed in field, returning true if it is found,
-         * false otherwise.
+         * Selects the passed in field, returning true if it is found, false
+         * otherwise.
          */
         private boolean select(final JFormattedTextField ftf, final AttributedCharacterIterator iterator, final DateFormat.Field field) {
             final int max = ftf.getDocument().getLength();
 
             iterator.first();
             do {
-                final Map<Attribute,Object> attrs = iterator.getAttributes();
-                if (attrs == null || !attrs.containsKey(field)) continue;
+                final Map<Attribute, Object> attrs = iterator.getAttributes();
+                if (attrs == null || !attrs.containsKey(field)) {
+                    continue;
+                }
 
                 final int start = iterator.getRunStart(field);
                 final int end = iterator.getRunLimit(field);
@@ -412,29 +433,35 @@
         }
 
         /**
-         * Returns the calendarField under the start of the selection, or
-         * -1 if there is no valid calendar field under the selection (or
-         * the spinner isn't editing dates.
+         * Returns the calendarField under the start of the selection, or -1 if
+         * there is no valid calendar field under the selection (or the spinner
+         * isn't editing dates.
          */
         private int getCalendarField(final JSpinner spinnerComponent) {
             final JComponent editor = spinnerComponent.getEditor();
-            if (!(editor instanceof JSpinner.DateEditor)) return -1;
+            if (!(editor instanceof JSpinner.DateEditor)) {
+                return -1;
+            }
 
-            final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor;
+            final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor) editor;
             final JFormattedTextField ftf = dateEditor.getTextField();
             final int start = ftf.getSelectionStart();
             final JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter();
-            if (!(formatter instanceof InternationalFormatter)) return -1;
+            if (!(formatter instanceof InternationalFormatter)) {
+                return -1;
+            }
 
-            final Format.Field[] fields = ((InternationalFormatter)formatter).getFields(start);
+            final Format.Field[] fields = ((InternationalFormatter) formatter).getFields(start);
             for (final Field element : fields) {
-                if (!(element instanceof DateFormat.Field)) continue;
+                if (!(element instanceof DateFormat.Field)) {
+                    continue;
+                }
                 int calendarField;
 
                 if (element == DateFormat.Field.HOUR1) {
                     calendarField = Calendar.HOUR;
                 } else {
-                    calendarField = ((DateFormat.Field)element).getCalendarField();
+                    calendarField = ((DateFormat.Field) element).getCalendarField();
                 }
 
                 if (calendarField != -1) {
@@ -446,7 +473,9 @@
 
         @Override
         public void mousePressed(final MouseEvent e) {
-            if (!SwingUtilities.isLeftMouseButton(e) || !e.getComponent().isEnabled()) return;
+            if (!SwingUtilities.isLeftMouseButton(e) || !e.getComponent().isEnabled()) {
+                return;
+            }
             spinner = eventToSpinner(e);
             autoRepeatTimer.start();
 
@@ -460,26 +489,35 @@
         }
 
         @Override
-        public void mouseClicked(final MouseEvent e) {}
+        public void mouseClicked(final MouseEvent e) {
+        }
+
         @Override
-        public void mouseEntered(final MouseEvent e) {}
+        public void mouseEntered(final MouseEvent e) {
+        }
+
         @Override
-        public void mouseExited(final MouseEvent e) {}
+        public void mouseExited(final MouseEvent e) {
+        }
 
         /**
-         * Requests focus on a child of the spinner if the spinner doesn't
-         * have focus.
+         * Requests focus on a child of the spinner if the spinner doesn't have
+         * focus.
          */
         private void focusSpinnerIfNecessary() {
             final Component fo = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
-            if (!spinner.isRequestFocusEnabled() || (fo != null && (SwingUtilities.isDescendingFrom(fo, spinner)))) return;
+            if (!spinner.isRequestFocusEnabled() || (fo != null && (SwingUtilities.isDescendingFrom(fo, spinner)))) {
+                return;
+            }
             Container root = spinner;
 
             if (!root.isFocusCycleRoot()) {
                 root = root.getFocusCycleRootAncestor();
             }
 
-            if (root == null) return;
+            if (root == null) {
+                return;
+            }
             final FocusTraversalPolicy ftp = root.getFocusTraversalPolicy();
             final Component child = ftp.getComponentAfter(root, spinner);
 
@@ -491,6 +529,7 @@
 
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     class SpinPainter extends JComponent {
+
         final AquaPainter<JRSUIState> painter = AquaPainter.create(JRSUIStateFactory.getSpinnerArrows());
 
         ButtonModel fTopModel;
@@ -551,11 +590,12 @@
     }
 
     /**
-     * A simple layout manager for the editor and the next/previous buttons.
-     * See the AquaSpinnerUI javadoc for more information about exactly
-     * how the components are arranged.
+     * A simple layout manager for the editor and the next/previous buttons. See
+     * the AquaSpinnerUI javadoc for more information about exactly how the
+     * components are arranged.
      */
     static class SpinnerLayout implements LayoutManager {
+
         private Component nextButton = null;
         private Component previousButton = null;
         private Component editor = null;
@@ -656,26 +696,38 @@
     }
 
     /**
-     * Detect JSpinner property changes we're interested in and delegate.  Subclasses
-     * shouldn't need to replace the default propertyChangeListener (although they
-     * can by overriding createPropertyChangeListener) since all of the interesting
-     * property changes are delegated to protected methods.
+     * Detect JSpinner property changes we're interested in and delegate.
+     * Subclasses shouldn't need to replace the default propertyChangeListener
+     * (although they can by overriding createPropertyChangeListener) since all
+     * of the interesting property changes are delegated to protected methods.
      */
     static class PropertyChangeHandler implements PropertyChangeListener {
+
         @Override
         public void propertyChange(final PropertyChangeEvent e) {
             final String propertyName = e.getPropertyName();
-            final JSpinner spinner = (JSpinner)(e.getSource());
+            final JSpinner spinner = (JSpinner) (e.getSource());
             final SpinnerUI spinnerUI = spinner.getUI();
 
             if (spinnerUI instanceof AquaSpinnerUI) {
-                final AquaSpinnerUI ui = (AquaSpinnerUI)spinnerUI;
+                final AquaSpinnerUI ui = (AquaSpinnerUI) spinnerUI;
 
                 if ("editor".equals(propertyName)) {
-                    final JComponent oldEditor = (JComponent)e.getOldValue();
-                    final JComponent newEditor = (JComponent)e.getNewValue();
+                    final JComponent oldEditor = (JComponent) e.getOldValue();
+                    final JComponent newEditor = (JComponent) e.getNewValue();
                     ui.replaceEditor(oldEditor, newEditor);
                     ui.updateEnabledState();
+                } else if ("componentOrientation".equals(propertyName)) {
+                    ComponentOrientation o
+                            = (ComponentOrientation) e.getNewValue();
+                    if (o != e.getOldValue()) {
+                        JComponent editor = spinner.getEditor();
+                        if (editor != null) {
+                            editor.applyComponentOrientation(o);
+                        }
+                        spinner.revalidate();
+                        spinner.repaint();
+                    }
                 } else if ("enabled".equals(propertyName)) {
                     ui.updateEnabledState();
                 } else if (JComponent.TOOL_TIP_TEXT_KEY.equals(propertyName)) {
@@ -683,8 +735,8 @@
                 } else if ("font".equals(propertyName)) {
                     JComponent editor = spinner.getEditor();
                     if (editor instanceof JSpinner.DefaultEditor) {
-                        JTextField tf =
-                                ((JSpinner.DefaultEditor) editor).getTextField();
+                        JTextField tf
+                                = ((JSpinner.DefaultEditor) editor).getTextField();
                         if (tf != null) {
                             if (tf.getFont() instanceof UIResource) {
                                 tf.setFont(new FontUIResource(spinner.getFont()));
@@ -703,12 +755,12 @@
         final Component[] children = spinnerComponent.getComponents();
         for (final Component element : children) {
             if (element instanceof JSpinner.DefaultEditor) {
-                final JTextField tf = ((JSpinner.DefaultEditor)element).getTextField();
+                final JTextField tf = ((JSpinner.DefaultEditor) element).getTextField();
                 if (tf != null) {
                     tf.setToolTipText(toolTipText);
                 }
             } else if (element instanceof JComponent) {
-                ((JComponent)element).setToolTipText(toolTipText);
+                ((JComponent) element).setToolTipText(toolTipText);
             }
         }
     }
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Thu Feb 04 16:49:26 2016 -0800
@@ -235,9 +235,9 @@
     }
 
     /**
-     * Invoked by <code>installUI</code> to create
+     * Invoked by {@code installUI} to create
      * a layout manager object to manage
-     * the <code>JTabbedPane</code>.
+     * the {@code JTabbedPane}.
      *
      * @return a layout manager object
      *
@@ -536,7 +536,7 @@
 
     /**
      * Sets the tab the mouse is over by location. This is a cover method
-     * for <code>setRolloverTab(tabForCoordinate(x, y, false))</code>.
+     * for {@code setRolloverTab(tabForCoordinate(x, y, false))}.
      */
     private void setRolloverTab(final int x, final int y) {
         // NOTE:
@@ -547,8 +547,8 @@
     }
 
     /**
-     * Sets the tab the mouse is currently over to <code>index</code>.
-     * <code>index</code> will be -1 if the mouse is no longer over any
+     * Sets the tab the mouse is currently over to {@code index}.
+     * {@code index} will be -1 if the mouse is no longer over any
      * tab. No checking is done to ensure the passed in index identifies a
      * valid tab.
      *
@@ -676,7 +676,7 @@
 
     /**
      * Returns the amount the baseline is offset by.  This is typically
-     * the same as <code>getTabLabelShiftY</code>.
+     * the same as {@code getTabLabelShiftY}.
      *
      * @return amount to offset the baseline by
      * @since 1.6
@@ -765,10 +765,10 @@
     /**
      * Paints the tabs in the tab area.
      * Invoked by paint().
-     * The graphics parameter must be a valid <code>Graphics</code>
+     * The graphics parameter must be a valid {@code Graphics}
      * object.  Tab placement may be either:
-     * <code>JTabbedPane.TOP</code>, <code>JTabbedPane.BOTTOM</code>,
-     * <code>JTabbedPane.LEFT</code>, or <code>JTabbedPane.RIGHT</code>.
+     * {@code JTabbedPane.TOP}, {@code JTabbedPane.BOTTOM},
+     * {@code JTabbedPane.LEFT}, or {@code JTabbedPane.RIGHT}.
      * The selected index must be a valid tabbed pane tab index (0 to
      * tab count - 1, inclusive) or -1 if no tab is currently selected.
      * The handling of invalid parameters is unspecified.
@@ -1406,7 +1406,7 @@
      * designated Rectangle object (rather than instantiating and returning
      * a new Rectangle each time). The tab index parameter must be a valid
      * tabbed pane tab index (0 to tab count - 1, inclusive).  The destination
-     * rectangle parameter must be a valid <code>Rectangle</code> instance.
+     * rectangle parameter must be a valid {@code Rectangle} instance.
      * The handling of invalid parameters is unspecified.
      *
      * @param tabIndex the index of the tab
@@ -3717,7 +3717,7 @@
 
     /**
      * An ActionMap that populates its contents as necessary. The
-     * contents are populated by invoking the <code>loadActionMap</code>
+     * contents are populated by invoking the {@code loadActionMap}
      * method on the passed in Object.
      *
      * @version 1.6, 11/17/05
@@ -3726,14 +3726,14 @@
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     static class LazyActionMap extends ActionMapUIResource {
         /**
-         * Object to invoke <code>loadActionMap</code> on. This may be
+         * Object to invoke {@code loadActionMap} on. This may be
          * a Class object.
          */
         private transient Object _loader;
 
         /**
          * Installs an ActionMap that will be populated by invoking the
-         * <code>loadActionMap</code> method on the specified Class
+         * {@code loadActionMap} method on the specified Class
          * when necessary.
          * <p>
          * This should be used if the ActionMap can be shared.
@@ -3755,7 +3755,7 @@
 
         /**
          * Returns an ActionMap that will be populated by invoking the
-         * <code>loadActionMap</code> method on the specified Class
+         * {@code loadActionMap} method on the specified Class
          * when necessary.
          * <p>
          * This should be used if the ActionMap can be shared.
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java	Thu Feb 04 16:49:26 2016 -0800
@@ -179,8 +179,8 @@
     }
 
     /**
-     * Paints the expand (toggle) part of a row. The receiver should NOT modify <code>clipBounds</code>, or
-     * <code>insets</code>.
+     * Paints the expand (toggle) part of a row. The receiver should NOT modify {@code clipBounds}, or
+     * {@code insets}.
      */
     protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) {
         final Object value = path.getLastPathComponent();
--- a/src/java.desktop/macosx/classes/sun/font/NativeFont.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/font/NativeFont.java	Thu Feb 04 16:49:26 2016 -0800
@@ -41,7 +41,7 @@
 
     /**
      * Verifies native font is accessible.
-     * @throws FontFormatException - if the font can't be located.
+     * @throws FontFormatException if the font can't be located.
      */
     public NativeFont(String platName, boolean isBitmapDelegate)
         throws FontFormatException {
--- a/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java	Thu Feb 04 16:49:26 2016 -0800
@@ -37,10 +37,10 @@
     IntBuffer bankdata[];
 
     /**
-     * Constructs an integer-based <CODE>DataBuffer</CODE> with a single bank
+     * Constructs an integer-based {@code DataBuffer} with a single bank
      * and the specified size.
      *
-     * @param size The size of the <CODE>DataBuffer</CODE>.
+     * @param size The size of the {@code DataBuffer}.
      */
     public DataBufferNIOInt(int size) {
         super(TYPE_INT,size);
@@ -51,7 +51,7 @@
     }
 
     /**
-     * Returns the default (first) IntBuffer in <CODE>DataBuffer</CODE>.
+     * Returns the default (first) IntBuffer in {@code DataBuffer}.
      *
      * @return The first IntBuffer.
      */
@@ -70,7 +70,7 @@
     }
 
     /**
-     * Returns the default (first) int data array in <CODE>DataBuffer</CODE>.
+     * Returns the default (first) int data array in {@code DataBuffer}.
      *
      * @return The first integer data array.
      */
@@ -137,7 +137,7 @@
 
     /**
      * Sets the requested data array element in the specified bank
-     * to the integer value <CODE>i</CODE>.
+     * to the integer value {@code i}.
      * @param bank The bank in which you want to set the data array element.
      * @param i The data array element you want to set.
      * @param val The integer value to which you want to set the specified data array element.
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java	Thu Feb 04 16:49:26 2016 -0800
@@ -33,7 +33,7 @@
 
 
 /**
- * Concrete implementation of the interface <code>DesktopPeer</code> for MacOS X
+ * Concrete implementation of the interface {@code DesktopPeer} for MacOS X
  *
  * @see DesktopPeer
  */
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Thu Feb 04 16:49:26 2016 -0800
@@ -101,7 +101,7 @@
      * method.
      *
      * @param context the input method context for this input method
-     * @exception NullPointerException if <code>context</code> is null
+     * @exception NullPointerException if {@code context} is null
      */
     public void setInputMethodContext(InputMethodContext context) {
         fIMContext = context;
@@ -124,7 +124,7 @@
      *
      * @param lang locale to input
      * @return whether the specified locale is supported
-     * @exception NullPointerException if <code>locale</code> is null
+     * @exception NullPointerException if {@code locale} is null
      */
     public boolean setLocale(Locale lang) {
         return setLocale(lang, false);
@@ -205,7 +205,7 @@
      * are dispatched to the current input method for this component before
      * they are dispatched to the component's methods or event listeners.
      * The input method decides whether it needs to handle the event. If it
-     * does, it also calls the event's <code>consume</code> method; this
+     * does, it also calls the event's {@code consume} method; this
      * causes the event to not get dispatched to the component's event
      * processing methods or event listeners.
      * <p>
@@ -216,7 +216,7 @@
      * This method is called by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}.
      *
      * @param event the event being dispatched to the input method
-     * @exception NullPointerException if <code>event</code> is null
+     * @exception NullPointerException if {@code event} is null
      */
     public void dispatchEvent(final AWTEvent event) {
         // No-op for Mac OS X.
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Thu Feb 04 16:49:26 2016 -0800
@@ -75,8 +75,7 @@
             jclickCount = clickCount;
         }
 
-        int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber,
-                                                        modifierFlags);
+        int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags);
         boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers);
 
         eventNotifier.notifyMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber,
@@ -90,9 +89,7 @@
     void handleScrollEvent(final int x, final int y, final int absX,
                            final int absY, final int modifierFlags,
                            final double deltaX, final double deltaY) {
-        final int buttonNumber = CocoaConstants.kCGMouseButtonCenter;
-        int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber,
-                                                        modifierFlags);
+        int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags);
         final boolean isShift = (jmodifiers & InputEvent.SHIFT_DOWN_MASK) != 0;
 
         // Vertical scroll.
@@ -187,8 +184,7 @@
             postsTyped = false;
         }
 
-
-        int jmodifiers = NSEvent.nsToJavaKeyModifiers(modifierFlags);
+        int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags);
         long when = System.currentTimeMillis();
 
         if (jeventType == KeyEvent.KEY_PRESSED) {
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java	Thu Feb 04 16:49:26 2016 -0800
@@ -35,8 +35,8 @@
     }
 
     /**
-     * Returns the type of this <code>GraphicsDevice</code>.
-     * @return the type of this <code>GraphicsDevice</code>, which can
+     * Returns the type of this {@code GraphicsDevice}.
+     * @return the type of this {@code GraphicsDevice}, which can
      * either be TYPE_RASTER_SCREEN, TYPE_PRINTER or TYPE_IMAGE_BUFFER.
      * @see #TYPE_RASTER_SCREEN
      * @see #TYPE_PRINTER
@@ -48,30 +48,30 @@
 
     /**
      * Returns the identification string associated with this
-     * <code>GraphicsDevice</code>.
-     * @return a <code>String</code> that is the identification
-     * of this <code>GraphicsDevice</code>.
+     * {@code GraphicsDevice}.
+     * @return a {@code String} that is the identification
+     * of this {@code GraphicsDevice}.
      */
     public String getIDstring() {
         return ("Printer");
     }
 
     /**
-     * Returns all of the <code>GraphicsConfiguration</code>
-     * objects associated with this <code>GraphicsDevice</code>.
-     * @return an array of <code>GraphicsConfiguration</code>
+     * Returns all of the {@code GraphicsConfiguration}
+     * objects associated with this {@code GraphicsDevice}.
+     * @return an array of {@code GraphicsConfiguration}
      * objects that are associated with this
-     * <code>GraphicsDevice</code>.
+     * {@code GraphicsDevice}.
      */
     public GraphicsConfiguration[] getConfigurations() {
         return new GraphicsConfiguration[] { gc };
     }
 
     /**
-     * Returns the default <code>GraphicsConfiguration</code>
-     * associated with this <code>GraphicsDevice</code>.
-     * @return the default <code>GraphicsConfiguration</code>
-     * of this <code>GraphicsDevice</code>.
+     * Returns the default {@code GraphicsConfiguration}
+     * associated with this {@code GraphicsDevice}.
+     * @return the default {@code GraphicsConfiguration}
+     * of this {@code GraphicsDevice}.
      */
     public GraphicsConfiguration getDefaultConfiguration() {
         return gc;
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java	Thu Feb 04 16:49:26 2016 -0800
@@ -49,9 +49,9 @@
 
     /**
      * Returns the {@link GraphicsDevice} associated with this
-     * <code>GraphicsConfiguration</code>.
-     * @return a <code>GraphicsDevice</code> object that is
-     * associated with this <code>GraphicsConfiguration</code>.
+     * {@code GraphicsConfiguration}.
+     * @return a {@code GraphicsDevice} object that is
+     * associated with this {@code GraphicsConfiguration}.
      */
     public GraphicsDevice getDevice() {
         return gd;
@@ -59,16 +59,16 @@
 
     /**
      * Returns a {@link BufferedImage} with a data layout and color model
-     * compatible with this <code>GraphicsConfiguration</code>.  This
+     * compatible with this {@code GraphicsConfiguration}.  This
      * method has nothing to do with memory-mapping
-     * a device.  The returned <code>BufferedImage</code> has
+     * a device.  The returned {@code BufferedImage} has
      * a layout and color model that is closest to this native device
      * configuration and can therefore be optimally blitted to this
      * device.
-     * @param width the width of the returned <code>BufferedImage</code>
-     * @param height the height of the returned <code>BufferedImage</code>
-     * @return a <code>BufferedImage</code> whose data layout and color
-     * model is compatible with this <code>GraphicsConfiguration</code>.
+     * @param width the width of the returned {@code BufferedImage}
+     * @param height the height of the returned {@code BufferedImage}
+     * @return a {@code BufferedImage} whose data layout and color
+     * model is compatible with this {@code GraphicsConfiguration}.
      */
     public BufferedImage createCompatibleImage(int width, int height) {
         return createCompatibleImage(width, height, Transparency.OPAQUE);
@@ -76,15 +76,15 @@
 
     /**
      * Returns a {@link VolatileImage} with a data layout and color model
-     * compatible with this <code>GraphicsConfiguration</code>.
-     * The returned <code>VolatileImage</code>
+     * compatible with this {@code GraphicsConfiguration}.
+     * The returned {@code VolatileImage}
      * may have data that is stored optimally for the underlying graphics
      * device and may therefore benefit from platform-specific rendering
      * acceleration.
-     * @param width the width of the returned <code>VolatileImage</code>
-     * @param height the height of the returned <code>VolatileImage</code>
-     * @return a <code>VolatileImage</code> whose data layout and color
-     * model is compatible with this <code>GraphicsConfiguration</code>.
+     * @param width the width of the returned {@code VolatileImage}
+     * @param height the height of the returned {@code VolatileImage}
+     * @return a {@code VolatileImage} whose data layout and color
+     * model is compatible with this {@code GraphicsConfiguration}.
      * @see Component#createVolatileImage(int, int)
      */
     public VolatileImage createCompatibleVolatileImage(int width, int height) {
@@ -97,18 +97,18 @@
     }
 
     /**
-     * Returns a <code>BufferedImage</code> that supports the specified
+     * Returns a {@code BufferedImage} that supports the specified
      * transparency and has a data layout and color model
-     * compatible with this <code>GraphicsConfiguration</code>.  This
+     * compatible with this {@code GraphicsConfiguration}.  This
      * method has nothing to do with memory-mapping
-     * a device. The returned <code>BufferedImage</code> has a layout and
+     * a device. The returned {@code BufferedImage} has a layout and
      * color model that can be optimally blitted to a device
-     * with this <code>GraphicsConfiguration</code>.
-     * @param width the width of the returned <code>BufferedImage</code>
-     * @param height the height of the returned <code>BufferedImage</code>
+     * with this {@code GraphicsConfiguration}.
+     * @param width the width of the returned {@code BufferedImage}
+     * @param height the height of the returned {@code BufferedImage}
      * @param transparency the specified transparency mode
-     * @return a <code>BufferedImage</code> whose data layout and color
-     * model is compatible with this <code>GraphicsConfiguration</code>
+     * @return a {@code BufferedImage} whose data layout and color
+     * model is compatible with this {@code GraphicsConfiguration}
      * and also supports the specified transparency.
      * @see Transparency#OPAQUE
      * @see Transparency#BITMASK
@@ -121,21 +121,21 @@
 
     /**
      * Returns the {@link ColorModel} associated with this
-     * <code>GraphicsConfiguration</code>.
-     * @return a <code>ColorModel</code> object that is associated with
-     * this <code>GraphicsConfiguration</code>.
+     * {@code GraphicsConfiguration}.
+     * @return a {@code ColorModel} object that is associated with
+     * this {@code GraphicsConfiguration}.
      */
     public ColorModel getColorModel() {
         return getColorModel(Transparency.OPAQUE);
     }
 
     /**
-     * Returns the <code>ColorModel</code> associated with this
-     * <code>GraphicsConfiguration</code> that supports the specified
+     * Returns the {@code ColorModel} associated with this
+     * {@code GraphicsConfiguration} that supports the specified
      * transparency.
      * @param transparency the specified transparency mode
-     * @return a <code>ColorModel</code> object that is associated with
-     * this <code>GraphicsConfiguration</code> and supports the
+     * @return a {@code ColorModel} object that is associated with
+     * this {@code GraphicsConfiguration} and supports the
      * specified transparency.
      */
     public ColorModel getColorModel(int transparency) {
@@ -144,22 +144,22 @@
 
     /**
      * Returns the default {@link AffineTransform} for this
-     * <code>GraphicsConfiguration</code>. This
-     * <code>AffineTransform</code> is typically the Identity transform
-     * for most normal screens.  The default <code>AffineTransform</code>
+     * {@code GraphicsConfiguration}. This
+     * {@code AffineTransform} is typically the Identity transform
+     * for most normal screens.  The default {@code AffineTransform}
      * maps coordinates onto the device such that 72 user space
      * coordinate units measure approximately 1 inch in device
      * space.  The normalizing transform can be used to make
      * this mapping more exact.  Coordinates in the coordinate space
-     * defined by the default <code>AffineTransform</code> for screen and
+     * defined by the default {@code AffineTransform} for screen and
      * printer devices have the origin in the upper left-hand corner of
      * the target region of the device, with X coordinates
      * increasing to the right and Y coordinates increasing downwards.
      * For image buffers not associated with a device, such as those not
-     * created by <code>createCompatibleImage</code>,
-     * this <code>AffineTransform</code> is the Identity transform.
-     * @return the default <code>AffineTransform</code> for this
-     * <code>GraphicsConfiguration</code>.
+     * created by {@code createCompatibleImage},
+     * this {@code AffineTransform} is the Identity transform.
+     * @return the default {@code AffineTransform} for this
+     * {@code GraphicsConfiguration}.
      */
     public AffineTransform getDefaultTransform() {
         return new AffineTransform();
@@ -167,9 +167,9 @@
 
     /**
      *
-     * Returns a <code>AffineTransform</code> that can be concatenated
-     * with the default <code>AffineTransform</code>
-     * of a <code>GraphicsConfiguration</code> so that 72 units in user
+     * Returns a {@code AffineTransform} that can be concatenated
+     * with the default {@code AffineTransform}
+     * of a {@code GraphicsConfiguration} so that 72 units in user
      * space equals 1 inch in device space.
      * <p>
      * For a particular {@link Graphics2D}, g, one
@@ -181,16 +181,16 @@
      *      g.setTransform(gc.getDefaultTransform());
      *      g.transform(gc.getNormalizingTransform());
      * </pre>
-     * Note that sometimes this <code>AffineTransform</code> is identity,
+     * Note that sometimes this {@code AffineTransform} is identity,
      * such as for printers or metafile output, and that this
-     * <code>AffineTransform</code> is only as accurate as the information
+     * {@code AffineTransform} is only as accurate as the information
      * supplied by the underlying system.  For image buffers not
      * associated with a device, such as those not created by
-     * <code>createCompatibleImage</code>, this
-     * <code>AffineTransform</code> is the Identity transform
+     * {@code createCompatibleImage}, this
+     * {@code AffineTransform} is the Identity transform
      * since there is no valid distance measurement.
-     * @return an <code>AffineTransform</code> to concatenate to the
-     * default <code>AffineTransform</code> so that 72 units in user
+     * @return an {@code AffineTransform} to concatenate to the
+     * default {@code AffineTransform} so that 72 units in user
      * space is mapped to 1 inch in device space.
      */
     public AffineTransform getNormalizingTransform() {
@@ -198,12 +198,12 @@
     }
 
     /**
-     * Returns the bounds of the <code>GraphicsConfiguration</code>
+     * Returns the bounds of the {@code GraphicsConfiguration}
      * in the device coordinates. In a multi-screen environment
      * with a virtual device, the bounds can have negative X
      * or Y origins.
      * @return the bounds of the area covered by this
-     * <code>GraphicsConfiguration</code>.
+     * {@code GraphicsConfiguration}.
      * @since 1.3
      */
     public Rectangle getBounds() {
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Thu Feb 04 16:49:26 2016 -0800
@@ -83,13 +83,13 @@
      * to these native print services.
      * To present the cross platform print dialog for all services,
      * including native ones instead use
-     * <code>printDialog(PrintRequestAttributeSet)</code>.
+     * {@code printDialog(PrintRequestAttributeSet)}.
      * <p>
      * PrinterJob implementations which can use PrintService's will update
      * the PrintService for this PrinterJob to reflect the new service
      * selected by the user.
-     * @return <code>true</code> if the user does not cancel the dialog;
-     * <code>false</code> otherwise.
+     * @return {@code true} if the user does not cancel the dialog;
+     * {@code false} otherwise.
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
@@ -117,19 +117,19 @@
 
     /**
      * Displays a dialog that allows modification of a
-     * <code>PageFormat</code> instance.
-     * The <code>page</code> argument is used to initialize controls
+     * {@code PageFormat} instance.
+     * The {@code page} argument is used to initialize controls
      * in the page setup dialog.
      * If the user cancels the dialog then this method returns the
-     * original <code>page</code> object unmodified.
+     * original {@code page} object unmodified.
      * If the user okays the dialog then this method returns a new
-     * <code>PageFormat</code> object with the indicated changes.
-     * In either case, the original <code>page</code> object is
+     * {@code PageFormat} object with the indicated changes.
+     * In either case, the original {@code page} object is
      * not modified.
-     * @param page the default <code>PageFormat</code> presented to the
+     * @param page the default {@code PageFormat} presented to the
      *            user for modification
-     * @return    the original <code>page</code> object if the dialog
-     *            is cancelled; a new <code>PageFormat</code> object
+     * @return    the original {@code page} object if the dialog
+     *            is cancelled; a new {@code PageFormat} object
      *          containing the format indicated by the user if the
      *          dialog is acknowledged.
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
@@ -157,11 +157,11 @@
     }
 
     /**
-     * Clones the <code>PageFormat</code> argument and alters the
+     * Clones the {@code PageFormat} argument and alters the
      * clone to describe a default page size and orientation.
-     * @param page the <code>PageFormat</code> to be cloned and altered
-     * @return clone of <code>page</code>, altered to describe a default
-     *                      <code>PageFormat</code>.
+     * @param page the {@code PageFormat} to be cloned and altered
+     * @return clone of {@code page}, altered to describe a default
+     *                      {@code PageFormat}.
      */
     @Override
     public PageFormat defaultPage(PageFormat page) {
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java	Thu Feb 04 16:49:26 2016 -0800
@@ -73,7 +73,7 @@
      * Presses one or more mouse buttons.
      *
      * @param buttons the button mask (combination of
-     * <code>InputEvent.BUTTON1/2/3_MASK</code>)
+     * {@code InputEvent.BUTTON1/2/3_MASK})
      */
     @Override
     public void mousePress(int buttons) {
@@ -87,7 +87,7 @@
      * Releases one or more mouse buttons.
      *
      * @param buttons the button mask (combination of
-     * <code>InputEvent.BUTTON1/2/3_MASK</code>)
+     * {@code InputEvent.BUTTON1/2/3_MASK})
      */
     @Override
     public void mouseRelease(int buttons) {
@@ -133,14 +133,14 @@
      * Presses a given key.
      * <p>
      * Key codes that have more than one physical key associated with them
-     * (e.g. <code>KeyEvent.VK_SHIFT</code> could mean either the
+     * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the
      * left or right shift key) will map to the left key.
      * <p>
      * Assumes that the
      * peer implementations will throw an exception for other bogus
      * values e.g. -1, 999999
      *
-     * @param keycode the key to press (e.g. <code>KeyEvent.VK_A</code>)
+     * @param keycode the key to press (e.g. {@code KeyEvent.VK_A})
      */
     @Override
     public void keyPress(final int keycode) {
@@ -151,14 +151,14 @@
      * Releases a given key.
      * <p>
      * Key codes that have more than one physical key associated with them
-     * (e.g. <code>KeyEvent.VK_SHIFT</code> could mean either the
+     * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the
      * left or right shift key) will map to the left key.
      * <p>
      * Assumes that the
      * peer implementations will throw an exception for other bogus
      * values e.g. -1, 999999
      *
-     * @param keycode the key to release (e.g. <code>KeyEvent.VK_A</code>)
+     * @param keycode the key to release (e.g. {@code KeyEvent.VK_A})
      */
     @Override
     public void keyRelease(final int keycode) {
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java	Thu Feb 04 16:49:26 2016 -0800
@@ -214,7 +214,7 @@
             jclickCount = nsEvent.getClickCount();
         }
 
-        int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber,
+        int jmodifiers = NSEvent.nsToJavaModifiers(
                 nsEvent.getModifierFlags());
         boolean isPopupTrigger = NSEvent.isPopupTrigger(jmodifiers);
 
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Thu Feb 04 16:49:26 2016 -0800
@@ -515,13 +515,13 @@
      * key for menu shortcuts.
      * <p>
      * Menu shortcuts, which are embodied in the
-     * <code>MenuShortcut</code> class, are handled by the
-     * <code>MenuBar</code> class.
+     * {@code MenuShortcut} class, are handled by the
+     * {@code MenuBar} class.
      * <p>
-     * By default, this method returns <code>Event.CTRL_MASK</code>.
+     * By default, this method returns {@code Event.CTRL_MASK}.
      * Toolkit implementations should override this method if the
      * <b>Control</b> key isn't the correct key for accelerators.
-     * @return    the modifier mask on the <code>Event</code> class
+     * @return    the modifier mask on the {@code Event} class
      *                 that is used for menu shortcuts on this toolkit.
      * @see       java.awt.MenuBar
      * @see       java.awt.MenuShortcut
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -231,16 +231,14 @@
         return jeventType;
     }
 
-    /*
-     * Converts NSEvent mouse modifiers to AWT mouse modifiers.
+    /**
+     * Converts NSEvent key modifiers to AWT key modifiers. Note that this
+     * method adds the current mouse state as a mouse modifiers.
+     *
+     * @param  modifierFlags the NSEvent key modifiers
+     * @return the java key and mouse modifiers
      */
-    static native int nsToJavaMouseModifiers(int buttonNumber,
-                                                    int modifierFlags);
-
-    /*
-     * Converts NSEvent key modifiers to AWT key modifiers.
-     */
-    static native int nsToJavaKeyModifiers(int modifierFlags);
+    static native int nsToJavaModifiers(int modifierFlags);
 
     /*
      * Converts NSEvent key info to AWT key info.
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -579,7 +579,7 @@
 }
 
 
-jint GetJavaMouseModifiers(NSInteger button, NSUInteger modifierFlags)
+jint GetJavaMouseModifiers(NSUInteger modifierFlags)
 {
     // Mousing needs the key modifiers
     jint modifiers = NsKeyModifiersToJavaModifiers(modifierFlags, YES);
@@ -632,38 +632,18 @@
 
 /*
  * Class:     sun_lwawt_macosx_NSEvent
- * Method:    nsToJavaMouseModifiers
+ * Method:    nsToJavaModifiers
  * Signature: (II)I
  */
 JNIEXPORT jint JNICALL
-Java_sun_lwawt_macosx_NSEvent_nsToJavaMouseModifiers
-(JNIEnv *env, jclass cls, jint buttonNumber, jint modifierFlags)
-{
-    jint jmodifiers = 0;
-
-JNF_COCOA_ENTER(env);
-
-    jmodifiers = GetJavaMouseModifiers(buttonNumber, modifierFlags);
-
-JNF_COCOA_EXIT(env);
-
-    return jmodifiers;
-}
-
-/*
- * Class:     sun_lwawt_macosx_NSEvent
- * Method:    nsToJavaKeyModifiers
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_sun_lwawt_macosx_NSEvent_nsToJavaKeyModifiers
+Java_sun_lwawt_macosx_NSEvent_nsToJavaModifiers
 (JNIEnv *env, jclass cls, jint modifierFlags)
 {
     jint jmodifiers = 0;
 
 JNF_COCOA_ENTER(env);
 
-    jmodifiers = NsKeyModifiersToJavaModifiers(modifierFlags, YES);
+    jmodifiers = GetJavaMouseModifiers(modifierFlags);
 
 JNF_COCOA_EXIT(env);
 
--- a/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m	Thu Feb 04 16:49:26 2016 -0800
@@ -562,6 +562,17 @@
     (CGGI_GlyphCanvas *canvas, const CGGlyph glyph,
      GlyphInfo *info, const CGGI_RenderingMode *mode)
 {
+    if (isnan(info->topLeftX) || isnan(info->topLeftY)) {
+        // Explicitly set glyphInfo width/height to be 0 to ensure
+        // zero length glyph image is copied into GlyphInfo from canvas
+        info->width = 0;
+        info->height = 0;
+
+        // copy the "empty" glyph from the canvas into the info
+        (*mode->glyphDescriptor->copyFxnPtr)(canvas, info);
+        return;
+    }
+
     // clean the canvas
     CGGI_ClearCanvas(canvas, info);
 
@@ -570,7 +581,6 @@
                                -info->topLeftX,
                                canvas->image->height + info->topLeftY,
                                &glyph, 1);
-
     // copy the glyph from the canvas into the info
     (*mode->glyphDescriptor->copyFxnPtr)(canvas, info);
 }
--- a/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m	Thu Feb 04 16:49:26 2016 -0800
@@ -259,6 +259,10 @@
 
     OSStatus status = noErr;
 
+    if ( isnan(tx->a) || isnan(tx->b) || isnan(tx->c) ||
+         isnan(tx->d) || isnan(tx->tx) || isnan(tx->ty)) {
+        return status;
+    }
     glyphs = glyphs + inStartIndex;
 //    advanceArray = advanceArray + inStartIndex; // TODO(cpc): use advance
 
--- a/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader	Thu Feb 04 16:49:26 2016 -0800
@@ -3,4 +3,5 @@
 com.sun.media.sound.AiffFileReader
 com.sun.media.sound.WaveFileReader
 com.sun.media.sound.WaveFloatFileReader
+com.sun.media.sound.WaveExtensibleFileReader
 com.sun.media.sound.SoftMidiAudioFileReader
--- a/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter	Thu Feb 04 16:49:26 2016 -0800
@@ -2,3 +2,4 @@
 com.sun.media.sound.AuFileWriter
 com.sun.media.sound.AiffFileWriter
 com.sun.media.sound.WaveFileWriter
+com.sun.media.sound.WaveFloatFileWriter
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -74,7 +74,7 @@
 /** This class is the Java Image IO plugin reader for BMP images.
  *  It may subsample the image, clip the image, select sub-bands,
  *  and shift the decoded image origin if the proper decoding parameter
- *  are set in the provided <code>ImageReadParam</code>.
+ *  are set in the provided {@code ImageReadParam}.
  *
  *  This class supports Microsoft Windows Bitmap Version 3-5,
  *  as well as OS/2 Bitmap Version 2.x (for single-image BMP file).
@@ -159,8 +159,8 @@
     /** source and destination bands. */
     private int[] sourceBands, destBands;
 
-    /** Constructs <code>BMPImageReader</code> from the provided
-     *  <code>ImageReaderSpi</code>.
+    /** Constructs {@code BMPImageReader} from the provided
+     *  {@code ImageReaderSpi}.
      */
     public BMPImageReader(ImageReaderSpi originator) {
         super(originator);
@@ -1681,8 +1681,8 @@
     /** Decodes the jpeg/png image embedded in the bitmap using any jpeg
      *  ImageIO-style plugin.
      *
-     * @param bi The destination <code>BufferedImage</code>.
-     * @param bmpParam The <code>ImageReadParam</code> for decoding this
+     * @param bi The destination {@code BufferedImage}.
+     * @param bmpParam The {@code ImageReadParam} for decoding this
      *          BMP image.  The parameters for subregion, band selection and
      *          subsampling are used in decoding the jpeg image.
      */
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -69,7 +69,7 @@
  * a BMP format.
  *
  * The encoding process may clip, subsample using the parameters
- * specified in the <code>ImageWriteParam</code>.
+ * specified in the {@code ImageWriteParam}.
  *
  * @see javax.imageio.plugins.bmp.BMPImageWriteParam
  */
@@ -88,8 +88,8 @@
     private short[] spixels;
     private int[] ipixels;
 
-    /** Constructs <code>BMPImageWriter</code> based on the provided
-     *  <code>ImageWriterSpi</code>.
+    /** Constructs {@code BMPImageWriter} based on the provided
+     *  {@code ImageWriterSpi}.
      */
     public BMPImageWriter(ImageWriterSpi originator) {
         super(originator);
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java	Thu Feb 04 16:49:26 2016 -0800
@@ -28,7 +28,7 @@
 import java.awt.color.ColorSpace;
 
 /**
- * A dummy <code>ColorSpace</code> to enable <code>ColorModel</code>
+ * A dummy {@code ColorSpace} to enable {@code ColorModel}
  * for image data which do not have an innate color representation.
  */
 @SuppressWarnings("serial") // JDK-implementation class
@@ -37,8 +37,8 @@
      * Return the type given the number of components.
      *
      * @param numComponents The number of components in the
-     * <code>ColorSpace</code>.
-     * @exception IllegalArgumentException if <code>numComponents</code>
+     * {@code ColorSpace}.
+     * @exception IllegalArgumentException if {@code numComponents}
      * is less than 1.
      */
     private static int getType(int numComponents) {
@@ -62,11 +62,11 @@
     }
 
     /**
-     * Constructs a bogus <code>ColorSpace</code>.
+     * Constructs a bogus {@code ColorSpace}.
      *
      * @param numComponents The number of components in the
-     * <code>ColorSpace</code>.
-     * @exception IllegalArgumentException if <code>numComponents</code>
+     * {@code ColorSpace}.
+     * @exception IllegalArgumentException if {@code numComponents}
      * is less than 1.
      */
     public BogusColorSpace(int numComponents) {
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java	Thu Feb 04 16:49:26 2016 -0800
@@ -37,9 +37,9 @@
  * the file from the jar as the package name is included automatically.
  *
  * <p>Extenders need only provide a static method
- * <code>getString(String)</code> which calls the static method in this
+ * {@code getString(String)} which calls the static method in this
  * class with the name of the invoking class and returns a
- * <code>String</code>.
+ * {@code String}.
  */
 public class I18NImpl {
     /**
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java	Thu Feb 04 16:49:26 2016 -0800
@@ -58,35 +58,35 @@
 
 public class ImageUtil {
     /**
-     * Creates a <code>ColorModel</code> that may be used with the
-     * specified <code>SampleModel</code>.  If a suitable
-     * <code>ColorModel</code> cannot be found, this method returns
-     * <code>null</code>.
+     * Creates a {@code ColorModel} that may be used with the
+     * specified {@code SampleModel}.  If a suitable
+     * {@code ColorModel} cannot be found, this method returns
+     * {@code null}.
      *
-     * <p> Suitable <code>ColorModel</code>s are guaranteed to exist
-     * for all instances of <code>ComponentSampleModel</code>.
-     * For 1- and 3- banded <code>SampleModel</code>s, the returned
-     * <code>ColorModel</code> will be opaque.  For 2- and 4-banded
-     * <code>SampleModel</code>s, the output will use alpha transparency
+     * <p> Suitable {@code ColorModel}s are guaranteed to exist
+     * for all instances of {@code ComponentSampleModel}.
+     * For 1- and 3- banded {@code SampleModel}s, the returned
+     * {@code ColorModel} will be opaque.  For 2- and 4-banded
+     * {@code SampleModel}s, the output will use alpha transparency
      * which is not premultiplied.  1- and 2-banded data will use a
-     * grayscale <code>ColorSpace</code>, and 3- and 4-banded data a sRGB
-     * <code>ColorSpace</code>. Data with 5 or more bands will have a
-     * <code>BogusColorSpace</code>.</p>
+     * grayscale {@code ColorSpace}, and 3- and 4-banded data a sRGB
+     * {@code ColorSpace}. Data with 5 or more bands will have a
+     * {@code BogusColorSpace}.</p>
      *
-     * <p>An instance of <code>DirectColorModel</code> will be created for
-     * instances of <code>SinglePixelPackedSampleModel</code> with no more
+     * <p>An instance of {@code DirectColorModel} will be created for
+     * instances of {@code SinglePixelPackedSampleModel} with no more
      * than 4 bands.</p>
      *
-     * <p>An instance of <code>IndexColorModel</code> will be created for
-     * instances of <code>MultiPixelPackedSampleModel</code>. The colormap
-     * will be a grayscale ramp with <code>1&nbsp;<<&nbsp;numberOfBits</code>
+     * <p>An instance of {@code IndexColorModel} will be created for
+     * instances of {@code MultiPixelPackedSampleModel}. The colormap
+     * will be a grayscale ramp with <code>1&nbsp;&lt;&lt;&nbsp;numberOfBits</code>
      * entries ranging from zero to at most 255.</p>
      *
-     * @return An instance of <code>ColorModel</code> that is suitable for
-     *         the supplied <code>SampleModel</code>, or <code>null</code>.
+     * @return An instance of {@code ColorModel} that is suitable for
+     *         the supplied {@code SampleModel}, or {@code null}.
      *
-     * @throws IllegalArgumentException  If <code>sampleModel</code> is
-     *         <code>null</code>.
+     * @throws IllegalArgumentException  If {@code sampleModel} is
+     *         {@code null}.
      */
     public static final ColorModel createColorModel(SampleModel sampleModel) {
         // Check the parameter.
@@ -194,19 +194,19 @@
     }
 
     /**
-     * For the case of binary data (<code>isBinary()</code> returns
-     * <code>true</code>), return the binary data as a packed byte array.
+     * For the case of binary data ({@code isBinary()} returns
+     * {@code true}), return the binary data as a packed byte array.
      * The data will be packed as eight bits per byte with no bit offset,
      * i.e., the first bit in each image line will be the left-most of the
      * first byte of the line.  The line stride in bytes will be
-     * <code>(int)((getWidth()+7)/8)</code>.  The length of the returned
-     * array will be the line stride multiplied by <code>getHeight()</code>
+     * {@code (int)((getWidth()+7)/8)}.  The length of the returned
+     * array will be the line stride multiplied by {@code getHeight()}
      *
      * @return the binary data as a packed array of bytes with zero offset
-     * of <code>null</code> if the data are not binary.
-     * @throws IllegalArgumentException if <code>isBinary()</code> returns
-     * <code>false</code> with the <code>SampleModel</code> of the
-     * supplied <code>Raster</code> as argument.
+     * of {@code null} if the data are not binary.
+     * @throws IllegalArgumentException if {@code isBinary()} returns
+     * {@code false} with the {@code SampleModel} of the
+     * supplied {@code Raster} as argument.
      */
     public static byte[] getPackedBinaryData(Raster raster,
                                              Rectangle rect) {
@@ -387,11 +387,11 @@
 
     /**
      * Returns the binary data unpacked into an array of bytes.
-     * The line stride will be the width of the <code>Raster</code>.
+     * The line stride will be the width of the {@code Raster}.
      *
-     * @throws IllegalArgumentException if <code>isBinary()</code> returns
-     * <code>false</code> with the <code>SampleModel</code> of the
-     * supplied <code>Raster</code> as argument.
+     * @throws IllegalArgumentException if {@code isBinary()} returns
+     * {@code false} with the {@code SampleModel} of the
+     * supplied {@code Raster} as argument.
      */
     public static byte[] getUnpackedBinaryData(Raster raster,
                                                Rectangle rect) {
@@ -467,13 +467,13 @@
     }
 
     /**
-     * Sets the supplied <code>Raster</code>'s data from an array
+     * Sets the supplied {@code Raster}'s data from an array
      * of packed binary data of the form returned by
-     * <code>getPackedBinaryData()</code>.
+     * {@code getPackedBinaryData()}.
      *
-     * @throws IllegalArgumentException if <code>isBinary()</code> returns
-     * <code>false</code> with the <code>SampleModel</code> of the
-     * supplied <code>Raster</code> as argument.
+     * @throws IllegalArgumentException if {@code isBinary()} returns
+     * {@code false} with the {@code SampleModel} of the
+     * supplied {@code Raster} as argument.
      */
     public static void setPackedBinaryData(byte[] binaryDataArray,
                                            WritableRaster raster,
@@ -713,16 +713,16 @@
     }
 
     /**
-     * Copies data into the packed array of the <code>Raster</code>
+     * Copies data into the packed array of the {@code Raster}
      * from an array of unpacked data of the form returned by
-     * <code>getUnpackedBinaryData()</code>.
+     * {@code getUnpackedBinaryData()}.
      *
      * <p> If the data are binary, then the target bit will be set if
      * and only if the corresponding byte is non-zero.
      *
-     * @throws IllegalArgumentException if <code>isBinary()</code> returns
-     * <code>false</code> with the <code>SampleModel</code> of the
-     * supplied <code>Raster</code> as argument.
+     * @throws IllegalArgumentException if {@code isBinary()} returns
+     * {@code false} with the {@code SampleModel} of the
+     * supplied {@code Raster} as argument.
      */
     public static void setUnpackedBinaryData(byte[] bdata,
                                              WritableRaster raster,
@@ -983,7 +983,7 @@
      * @param g The green channel color indices.
      * @param b The blue channel color indices.
      * @return If all the indices have 256 entries, and are identical mappings,
-     *         return <code>true</code>; otherwise, return <code>false</code>.
+     *         return {@code true}; otherwise, return {@code false}.
      */
     public static boolean isIndicesForGrayscale(byte[] r, byte[] g, byte[] b) {
         if (r.length != g.length || r.length != b.length)
@@ -1004,7 +1004,7 @@
         return true;
     }
 
-    /** Converts the provided object to <code>String</code> */
+    /** Converts the provided object to {@code String} */
     public static String convertObjectToString(Object obj) {
         if (obj == null)
             return "";
@@ -1035,10 +1035,10 @@
 
     }
 
-    /** Checks that the provided <code>ImageWriter</code> can encode
-     * the provided <code>ImageTypeSpecifier</code> or not.  If not, an
-     * <code>IIOException</code> will be thrown.
-     * @param writer The provided <code>ImageWriter</code>.
+    /** Checks that the provided {@code ImageWriter} can encode
+     * the provided {@code ImageTypeSpecifier} or not.  If not, an
+     * {@code IIOException} will be thrown.
+     * @param writer The provided {@code ImageWriter}.
      * @param type The image to be tested.
      * @throws IIOException If the writer cannot encoded the provided image.
      */
@@ -1053,12 +1053,12 @@
         }
     }
 
-    /** Checks that the provided <code>ImageWriter</code> can encode
-     * the provided <code>ColorModel</code> and <code>SampleModel</code>.
-     * If not, an <code>IIOException</code> will be thrown.
-     * @param writer The provided <code>ImageWriter</code>.
-     * @param colorModel The provided <code>ColorModel</code>.
-     * @param sampleModel The provided <code>SampleModel</code>.
+    /** Checks that the provided {@code ImageWriter} can encode
+     * the provided {@code ColorModel} and {@code SampleModel}.
+     * If not, an {@code IIOException} will be thrown.
+     * @param writer The provided {@code ImageWriter}.
+     * @param colorModel The provided {@code ColorModel}.
+     * @param sampleModel The provided {@code SampleModel}.
      * @throws IIOException If the writer cannot encoded the provided image.
      */
     public static final void canEncodeImage(ImageWriter writer,
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java	Thu Feb 04 16:49:26 2016 -0800
@@ -31,9 +31,9 @@
  * General purpose LZW String Table.
  * Extracted from GIFEncoder by Adam Doppelt
  * Comments added by Robin Luiten
- * <code>expandCode</code> added by Robin Luiten
+ * {@code expandCode} added by Robin Luiten
  * The strLen table to give quick access to the lenght of an expanded
- * code for use by the <code>expandCode</code> method added by Robin.
+ * code for use by the {@code expandCode} method added by Robin.
  **/
 public class LZWStringTable {
     /** codesize + Reserved Codes */
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java	Thu Feb 04 16:49:26 2016 -0800
@@ -70,19 +70,19 @@
 
     /**
      * Creates an image representing given image
-     * <code>src</code> using <code>IndexColorModel</code>.
+     * {@code src} using {@code IndexColorModel}.
      *
      * Lossless conversion is not always possible (e.g. if number
      * of colors in the  given image exceeds maximum palette size).
      * Result image then is an approximation constructed by octree
      * quantization method.
      *
-     * @exception IllegalArgumentException if <code>src</code> is
-     * <code>null</code>.
+     * @exception IllegalArgumentException if {@code src} is
+     * {@code null}.
      *
      * @exception UnsupportedOperationException if implemented method
-     * is unable to create approximation of <code>src</code>
-     * and <code>canCreatePalette</code> returns <code>false</code>.
+     * is unable to create approximation of {@code src}
+     * and {@code canCreatePalette} returns {@code false}.
      *
      * @see createIndexColorModel
      *
@@ -97,15 +97,15 @@
 
     /**
      * Creates an palette representing colors from given image
-     * <code>img</code>. If number of colors in the given image exceeds
+     * {@code img}. If number of colors in the given image exceeds
      * maximum palette size closest colors would be merged.
      *
-     * @exception IllegalArgumentException if <code>img</code> is
-     * <code>null</code>.
+     * @exception IllegalArgumentException if {@code img} is
+     * {@code null}.
      *
      * @exception UnsupportedOperationException if implemented method
-     * is unable to create approximation of <code>img</code>
-     * and <code>canCreatePalette</code> returns <code>false</code>.
+     * is unable to create approximation of {@code img}
+     * and {@code canCreatePalette} returns {@code false}.
      *
      * @see createIndexedImage
      *
@@ -119,17 +119,17 @@
     }
 
     /**
-     * Returns <code>true</code> if PaletteBuilder is able to create
+     * Returns {@code true} if PaletteBuilder is able to create
      * palette for given image type.
      *
-     * @param type an instance of <code>ImageTypeSpecifier</code> to be
+     * @param type an instance of {@code ImageTypeSpecifier} to be
      * indexed.
      *
-     * @return <code>true</code> if the <code>PaletteBuilder</code>
+     * @return {@code true} if the {@code PaletteBuilder}
      * is likely to be able to create palette for this image type.
      *
-     * @exception IllegalArgumentException if <code>type</code>
-     * is <code>null</code>.
+     * @exception IllegalArgumentException if {@code type}
+     * is {@code null}.
      */
     public static boolean canCreatePalette(ImageTypeSpecifier type) {
         if (type == null) {
@@ -139,17 +139,17 @@
     }
 
     /**
-     * Returns <code>true</code> if PaletteBuilder is able to create
+     * Returns {@code true} if PaletteBuilder is able to create
      * palette for given rendered image.
      *
-     * @param image an instance of <code>RenderedImage</code> to be
+     * @param image an instance of {@code RenderedImage} to be
      * indexed.
      *
-     * @return <code>true</code> if the <code>PaletteBuilder</code>
+     * @return {@code true} if the {@code PaletteBuilder}
      * is likely to be able to create palette for this image type.
      *
-     * @exception IllegalArgumentException if <code>image</code>
-     * is <code>null</code>.
+     * @exception IllegalArgumentException if {@code image}
+     * is {@code null}.
      */
     public static boolean canCreatePalette(RenderedImage image) {
         if (image == null) {
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java	Thu Feb 04 16:49:26 2016 -0800
@@ -134,25 +134,25 @@
      * pixels that will be written during a particular decoding pass.
      * The intent is to simplify the work done by readers in combining
      * the source region, source subsampling, and destination offset
-     * information obtained from the <code>ImageReadParam</code> with
+     * information obtained from the {@code ImageReadParam} with
      * the offsets and periods of a progressive or interlaced decoding
      * pass.
      *
-     * @param sourceRegion a <code>Rectangle</code> containing the
+     * @param sourceRegion a {@code Rectangle} containing the
      * source region being read, offset by the source subsampling
      * offsets, and clipped against the source bounds, as returned by
-     * the <code>getSourceRegion</code> method.
-     * @param destinationOffset a <code>Point</code> containing the
+     * the {@code getSourceRegion} method.
+     * @param destinationOffset a {@code Point} containing the
      * coordinates of the upper-left pixel to be written in the
      * destination.
      * @param dstMinX the smallest X coordinate (inclusive) of the
-     * destination <code>Raster</code>.
+     * destination {@code Raster}.
      * @param dstMinY the smallest Y coordinate (inclusive) of the
-     * destination <code>Raster</code>.
+     * destination {@code Raster}.
      * @param dstMaxX the largest X coordinate (inclusive) of the destination
-     * <code>Raster</code>.
+     * {@code Raster}.
      * @param dstMaxY the largest Y coordinate (inclusive) of the destination
-     * <code>Raster</code>.
+     * {@code Raster}.
      * @param sourceXSubsampling the X subsampling factor.
      * @param sourceYSubsampling the Y subsampling factor.
      * @param passXStart the smallest source X coordinate (inclusive)
@@ -168,7 +168,7 @@
      * @param passPeriodY the Y period (vertical spacing between
      * pixels) of the current progressive pass.
      *
-     * @return an array of 6 <code>int</code>s containing the
+     * @return an array of 6 {@code int}s containing the
      * destination min X, min Y, width, height, X period and Y period
      * of the region that will be updated.
      */
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1017,7 +1017,7 @@
 
     /**
      * Remove all settings including global settings such as
-     * <code>Locale</code>s and listeners, as well as stream settings.
+     * {@code Locale}s and listeners, as well as stream settings.
      */
     public void reset() {
         super.reset();
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -70,7 +70,7 @@
     GIFWritableImageMetadata.NATIVE_FORMAT_NAME;
 
     /**
-     * The <code>output</code> case to an <code>ImageOutputStream</code>.
+     * The {@code output} case to an {@code ImageOutputStream}.
      */
     private ImageOutputStream stream = null;
 
@@ -272,7 +272,7 @@
     }
 
     /**
-     * Merges <code>inData</code> into <code>outData</code>. The supplied
+     * Merges {@code inData} into {@code outData}. The supplied
      * metadata format name is attempted first and failing that the standard
      * metadata format name is attempted.
      */
@@ -554,8 +554,8 @@
      *
      * @param writeHeader Whether to write the header.
      * @param writeTrailer Whether to write the trailer.
-     * @param sm The stream metadata or <code>null</code> if
-     * <code>writeHeader</code> is <code>false</code>.
+     * @param sm The stream metadata or {@code null} if
+     * {@code writeHeader} is {@code false}.
      * @param iioimage The image and image metadata.
      * @param p The write parameters.
      *
@@ -564,10 +564,10 @@
      * greater than 8.
      * @throws IllegalArgumentException if the color component size is
      * greater than 8.
-     * @throws IllegalArgumentException if <code>writeHeader</code> is
-     * <code>true</code> and <code>sm</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>writeHeader</code> is
-     * <code>false</code> and a sequence is not being written.
+     * @throws IllegalArgumentException if {@code writeHeader} is
+     * {@code true} and {@code sm} is {@code null}.
+     * @throws IllegalArgumentException if {@code writeHeader} is
+     * {@code false} and a sequence is not being written.
      */
     private void write(boolean writeHeader,
                        boolean writeTrailer,
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java	Thu Feb 04 16:49:26 2016 -0800
@@ -32,7 +32,7 @@
 
 /**
  * Class which adds utility DOM element attribute access methods to
- * <code>IIOMetadata</code> for subclass use.
+ * {@code IIOMetadata} for subclass use.
  */
 abstract class GIFMetadata extends IIOMetadata {
 
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java	Thu Feb 04 16:49:26 2016 -0800
@@ -39,7 +39,7 @@
  * comment data as it is read from the stream.  If the marker segment is
  * constructed from a String, then local default encoding is assumed
  * when creating the byte array.  If the marker segment is created from
- * an <code>IIOMetadataNode</code>, the user object, if present is
+ * an {@code IIOMetadataNode}, the user object, if present is
  * assumed to be a byte array containing the comment data.  If there is
  * no user object then the comment attribute is used to create the
  * byte array, again assuming the default local encoding.
@@ -49,7 +49,7 @@
 
     /**
      * Constructs a marker segment from the given buffer, which contains
-     * data from an <code>ImageInputStream</code>.  This is used when
+     * data from an {@code ImageInputStream}.  This is used when
      * reading metadata from a stream.
      */
     COMMarkerSegment(JPEGBuffer buffer) throws IOException {
@@ -69,7 +69,7 @@
 
     /**
      * Constructs a marker segment from a native tree node.  If the node
-     * is an <code>IIOMetadataNode</code> and contains a user object,
+     * is an {@code IIOMetadataNode} and contains a user object,
      * that object is used rather than the string attribute.  If the
      * string attribute is used, the default encoding is used.
      */
@@ -103,7 +103,7 @@
     }
 
     /**
-     * Returns an <code>IIOMetadataNode</code> containing the data array
+     * Returns an {@code IIOMetadataNode} containing the data array
      * as a user object and a string encoded using ISO-8895-1, as an
      * attribute.
      */
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java	Thu Feb 04 16:49:26 2016 -0800
@@ -90,7 +90,7 @@
     private final boolean debug = false;
 
     /**
-     * Set to <code>true</code> when reading the chunks of an
+     * Set to {@code true} when reading the chunks of an
      * ICC profile.  All chunks are consolidated to create a single
      * "segment" containing all the chunks.  This flag is a state
      * variable identifying whether to construct a new segment or
@@ -594,10 +594,10 @@
 
     /**
      * Writes out a default JFIF marker segment to the given
-     * output stream.  If <code>thumbnails</code> is not <code>null</code>,
+     * output stream.  If {@code thumbnails} is not {@code null},
      * writes out the set of thumbnail images as JFXX marker segments, or
      * incorporated into the JFIF segment if appropriate.
-     * If <code>iccProfile</code> is not <code>null</code>,
+     * If {@code iccProfile} is not {@code null},
      * writes out the profile after the JFIF segment using as many APP2
      * marker segments as necessary.
      */
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java	Thu Feb 04 16:49:26 2016 -0800
@@ -36,7 +36,7 @@
 /**
  * A class containing JPEG-related constants, definitions, and
  * static methods.  This class and its constants must be public so that
- * <code>JPEGImageWriteParam</code> can see it.
+ * {@code JPEGImageWriteParam} can see it.
  */
 public class JPEG {
 
@@ -234,10 +234,10 @@
     public static final float DEFAULT_QUALITY = 0.75F;
 
     /**
-     * Returns <code>true</code> if the given <code>ColorSpace</code>
+     * Returns {@code true} if the given {@code ColorSpace}
      * object is an instance of ICC_ColorSpace but is not one of the
-     * standard <code>ColorSpaces</code> returned by
-     * <code>ColorSpace.getInstance()</code>.
+     * standard {@code ColorSpaces} returned by
+     * {@code ColorSpace.getInstance()}.
      */
     static boolean isNonStandardICC(ColorSpace cs) {
         boolean retval = false;
@@ -255,8 +255,8 @@
 
 
     /**
-     * Returns <code>true</code> if the given imageType can be used
-     * in a JFIF file.  If <code>input</code> is true, then the
+     * Returns {@code true} if the given imageType can be used
+     * in a JFIF file.  If {@code input} is true, then the
      * image type is considered before colorspace conversion.
      */
     static boolean isJFIFcompliant(ImageTypeSpecifier imageType,
@@ -295,7 +295,7 @@
     /**
      * Given an image type, return the Adobe transform corresponding to
      * that type, or ADOBE_IMPOSSIBLE if the image type is incompatible
-     * with an Adobe marker segment.  If <code>input</code> is true, then
+     * with an Adobe marker segment.  If {@code input} is true, then
      * the image type is considered before colorspace conversion.
      */
     static int transformForType(ImageTypeSpecifier imageType, boolean input) {
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java	Thu Feb 04 16:49:26 2016 -0800
@@ -75,12 +75,12 @@
     }
 
     /**
-     * Ensures that there are at least <code>count</code> bytes available
+     * Ensures that there are at least {@code count} bytes available
      * in the buffer, loading more data and moving any remaining
      * bytes to the front.  A count of 0 means to just fill the buffer.
      * If the count is larger than the buffer size, just fills the buffer.
      * If the end of the stream is encountered before a non-0 count can
-     * be satisfied, an <code>IIOException</code> is thrown with the
+     * be satisfied, an {@code IIOException} is thrown with the
      * message "Image Format Error".
      */
     void loadBuf(int count) throws IOException {
@@ -122,7 +122,7 @@
      * the buffer and then reading directly from the stream
      * if necessary.  The buffer is left in an appropriate
      * state.  If the end of the stream is encountered, an
-     * <code>IIOException</code> is thrown with the
+     * {@code IIOException} is thrown with the
      * message "Image Format Error".
      */
     void readData(byte [] data) throws IOException {
@@ -149,9 +149,9 @@
     }
 
     /**
-     * Skips <code>count</code> bytes, leaving the buffer
+     * Skips {@code count} bytes, leaving the buffer
      * in an appropriate state.  If the end of the stream is
-     * encountered, an <code>IIOException</code> is thrown with the
+     * encountered, an {@code IIOException} is thrown with the
      * message "Image Format Error".
      */
     void skipData(int count) throws IOException {
@@ -195,8 +195,8 @@
      * the buffer as necessary.  The buffer position is left
      * pointing to the first non-0xff byte after a run of
      * 0xff bytes.  If the end of the stream is encountered,
-     * an EOI marker is inserted into the buffer and <code>true</code>
-     * is returned.  Otherwise returns <code>false</code>.
+     * an EOI marker is inserted into the buffer and {@code true}
+     * is returned.  Otherwise returns {@code false}.
      */
     boolean scanForFF(JPEGImageReader reader) throws IOException {
         boolean retval = false;
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -544,7 +544,7 @@
     }
 
     /**
-     * Returns <code>true</code> if there is an image beyond
+     * Returns {@code true} if there is an image beyond
      * the current stream position.  Does not disturb the
      * stream position.
      */
@@ -614,13 +614,13 @@
 
     /**
      * Read in the header information starting from the current
-     * stream position, returning <code>true</code> if the
+     * stream position, returning {@code true} if the
      * header was a tables-only image.  After this call, the
      * native IJG decompression struct will contain the image
      * information required by most query calls below
      * (e.g. getWidth, getHeight, etc.), if the header was not
      * a tables-only image.
-     * If reset is <code>true</code>, the state of the IJG
+     * If reset is {@code true}, the state of the IJG
      * object is reset so that it can read a header again.
      * This happens automatically if the header was a tables-only
      * image.
@@ -867,7 +867,7 @@
      * Checks the implied color conversion between the stream and
      * the target image, altering the IJG output color space if necessary.
      * If a java color conversion is required, then this sets up
-     * <code>convert</code>.
+     * {@code convert}.
      * If bands are being rearranged at all (either source or destination
      * bands are specified in the param), then the default color
      * conversions are assumed to be correct.
@@ -1394,7 +1394,7 @@
     }
 
     /**
-     * Returns <code>true</code> if the read was aborted.
+     * Returns {@code true} if the read was aborted.
      */
     private native boolean readImage(long structPointer,
                                      byte [] buffer,
@@ -1788,6 +1788,8 @@
             case JPEG.JCS_GRAYSCALE:
                 return ImageTypeSpecifier.createFromBufferedImageType
                         (BufferedImage.TYPE_BYTE_GRAY);
+            case JPEG.JCS_YCbCr:
+            //there is no YCbCr raw type so by default we assume it as RGB
             case JPEG.JCS_RGB:
                 return ImageTypeSpecifier.createInterleaved(JPEG.JCS.sRGB,
                         JPEG.bOffsRGB,
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1130,10 +1130,10 @@
         /*
          * from jpeg_metadata.html:
          * If no stream metadata is supplied to
-         * <code>ImageWriter.prepareWriteSequence</code>, then no
+         * {@code ImageWriter.prepareWriteSequence}, then no
          * tables-only image is written.  If stream metadata containing
          * no tables is supplied to
-         * <code>ImageWriter.prepareWriteSequence</code>, then a tables-only
+         * {@code ImageWriter.prepareWriteSequence}, then a tables-only
          * image containing default visually lossless tables is written.
          */
         if (streamMetadata != null) {
@@ -1699,7 +1699,7 @@
     private native void setDest(long structPointer);
 
     /**
-     * Returns <code>true</code> if the write was aborted.
+     * Returns {@code true} if the write was aborted.
      */
     private native boolean writeImage(long structPointer,
                                       byte [] data,
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java	Thu Feb 04 16:49:26 2016 -0800
@@ -66,17 +66,17 @@
     private static final boolean debug = false;
 
     /**
-     * A copy of <code>markerSequence</code>, created the first time the
-     * <code>markerSequence</code> is modified.  This is used by reset
+     * A copy of {@code markerSequence}, created the first time the
+     * {@code markerSequence} is modified.  This is used by reset
      * to restore the original state.
      */
     private List<MarkerSegment> resetSequence = null;
 
     /**
-     * Set to <code>true</code> when reading a thumbnail stored as
+     * Set to {@code true} when reading a thumbnail stored as
      * JPEG.  This is used to enforce the prohibition of JFIF thumbnails
      * containing any JFIF marker segments, and to ensure generation of
-     * a correct native subtree during <code>getAsTree</code>.
+     * a correct native subtree during {@code getAsTree}.
      */
     private boolean inThumb = false;
 
@@ -93,7 +93,7 @@
     /////// Package-access variables
 
     /**
-     * All data is a list of <code>MarkerSegment</code> objects.
+     * All data is a list of {@code MarkerSegment} objects.
      * When accessing the list, use the tag to identify the particular
      * subclass.  Any JFIF marker segment must be the first element
      * of the list if it is present, and any JFXX or APP2ICC marker
@@ -132,17 +132,17 @@
     }
 
     /*
-     * Constructs a <code>JPEGMetadata</code> object by reading the
-     * contents of an <code>ImageInputStream</code>.  Has package-only
+     * Constructs a {@code JPEGMetadata} object by reading the
+     * contents of an {@code ImageInputStream}.  Has package-only
      * access.
      *
      * @param isStream A boolean indicating whether this object will be
      * stream or image metadata.
      * @param isThumb A boolean indicating whether this metadata object
      * is for an image or for a thumbnail stored as JPEG.
-     * @param iis An <code>ImageInputStream</code> from which to read
+     * @param iis An {@code ImageInputStream} from which to read
      * the metadata.
-     * @param reader The <code>JPEGImageReader</code> calling this
+     * @param reader The {@code JPEGImageReader} calling this
      * constructor, to which warnings should be sent.
      */
     JPEGMetadata(boolean isStream,
@@ -365,7 +365,7 @@
     }
 
     /**
-     * Constructs a default stream <code>JPEGMetadata</code> object appropriate
+     * Constructs a default stream {@code JPEGMetadata} object appropriate
      * for the given write parameters.
      */
     JPEGMetadata(ImageWriteParam param, JPEGImageWriter writer) {
@@ -398,7 +398,7 @@
     }
 
     /**
-     * Constructs a default image <code>JPEGMetadata</code> object appropriate
+     * Constructs a default image {@code JPEGMetadata} object appropriate
      * for the given image type and write parameters.
      */
     JPEGMetadata(ImageTypeSpecifier imageType,
@@ -2248,7 +2248,7 @@
 
     /**
      * Check that this metadata object is in a consistent state and
-     * return <code>true</code> if it is or <code>false</code>
+     * return {@code true} if it is or {@code false}
      * otherwise.  All the constructors and modifiers should call
      * this method at the end to guarantee that the data is always
      * consistent, as the writer relies on this.
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java	Thu Feb 04 16:49:26 2016 -0800
@@ -133,12 +133,12 @@
     }
 
     /**
-     * Returns <code>true</code> if the named element occurs in the
+     * Returns {@code true} if the named element occurs in the
      * subtree of the format starting with the node named by
-     * <code>subtreeName</code>, including the node
-     * itself.  <code>subtreeName</code> may be any node in
+     * {@code subtreeName}, including the node
+     * itself.  {@code subtreeName} may be any node in
      * the format.  If it is not, an
-     * <code>IllegalArgumentException</code> is thrown.
+     * {@code IllegalArgumentException} is thrown.
      */
     protected boolean isInSubtree(String elementName,
                                   String subtreeName) {
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java	Thu Feb 04 16:49:26 2016 -0800
@@ -51,8 +51,8 @@
     boolean unknown = false; // Set to true if the tag is not recognized
 
     /**
-     * Constructor for creating <code>MarkerSegment</code>s by reading
-     * from an <code>ImageInputStream</code>.
+     * Constructor for creating {@code MarkerSegment}s by reading
+     * from an {@code ImageInputStream}.
      */
     MarkerSegment(JPEGBuffer buffer) throws IOException {
 
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -26,16 +26,13 @@
 package com.sun.imageio.plugins.png;
 
 import java.awt.Rectangle;
-import java.awt.image.ColorModel;
 import java.awt.image.IndexColorModel;
 import java.awt.image.Raster;
 import java.awt.image.WritableRaster;
 import java.awt.image.RenderedImage;
 import java.awt.image.SampleModel;
 import java.io.ByteArrayOutputStream;
-import java.io.DataOutput;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.util.Iterator;
 import java.util.Locale;
 import java.util.zip.Deflater;
@@ -46,14 +43,13 @@
 import javax.imageio.ImageWriteParam;
 import javax.imageio.ImageWriter;
 import javax.imageio.metadata.IIOMetadata;
-import javax.imageio.metadata.IIOMetadata;
 import javax.imageio.spi.ImageWriterSpi;
 import javax.imageio.stream.ImageOutputStream;
 import javax.imageio.stream.ImageOutputStreamImpl;
 
-class CRC {
+final class CRC {
 
-    private static int[] crcTable = new int[256];
+    private static final int[] crcTable = new int[256];
     private int crc = 0xffffffff;
 
     static {
@@ -72,23 +68,25 @@
         }
     }
 
-    public CRC() {}
+    CRC() {}
 
-    public void reset() {
+    void reset() {
         crc = 0xffffffff;
     }
 
-    public void update(byte[] data, int off, int len) {
+    void update(byte[] data, int off, int len) {
+        int c = crc;
         for (int n = 0; n < len; n++) {
-            crc = crcTable[(crc ^ data[off + n]) & 0xff] ^ (crc >>> 8);
+            c = crcTable[(c ^ data[off + n]) & 0xff] ^ (c >>> 8);
         }
+        crc = c;
     }
 
-    public void update(int data) {
+    void update(int data) {
         crc = crcTable[(crc ^ data) & 0xff] ^ (crc >>> 8);
     }
 
-    public int getValue() {
+    int getValue() {
         return crc ^ 0xffffffff;
     }
 }
@@ -96,11 +94,11 @@
 
 final class ChunkStream extends ImageOutputStreamImpl {
 
-    private ImageOutputStream stream;
-    private long startPos;
-    private CRC crc = new CRC();
+    private final ImageOutputStream stream;
+    private final long startPos;
+    private final CRC crc = new CRC();
 
-    public ChunkStream(int type, ImageOutputStream stream) throws IOException {
+    ChunkStream(int type, ImageOutputStream stream) throws IOException {
         this.stream = stream;
         this.startPos = stream.getStreamPosition();
 
@@ -108,25 +106,29 @@
         writeInt(type);
     }
 
+    @Override
     public int read() throws IOException {
         throw new RuntimeException("Method not available");
     }
 
+    @Override
     public int read(byte[] b, int off, int len) throws IOException {
         throw new RuntimeException("Method not available");
     }
 
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         crc.update(b, off, len);
         stream.write(b, off, len);
     }
 
+    @Override
     public void write(int b) throws IOException {
         crc.update(b);
         stream.write(b);
     }
 
-    public void finish() throws IOException {
+    void finish() throws IOException {
         // Write CRC
         stream.writeInt(crc.getValue());
 
@@ -140,6 +142,7 @@
         stream.flushBefore(pos);
     }
 
+    @Override
     protected void finalize() throws Throwable {
         // Empty finalizer (for improved performance; no need to call
         // super.finalize() in this case)
@@ -150,24 +153,29 @@
 // fixed length.
 final class IDATOutputStream extends ImageOutputStreamImpl {
 
-    private static byte[] chunkType = {
+    private static final byte[] chunkType = {
         (byte)'I', (byte)'D', (byte)'A', (byte)'T'
     };
 
-    private ImageOutputStream stream;
-    private int chunkLength;
+    private final ImageOutputStream stream;
+    private final int chunkLength;
     private long startPos;
-    private CRC crc = new CRC();
+    private final CRC crc = new CRC();
 
-    Deflater def = new Deflater(Deflater.BEST_COMPRESSION);
-    byte[] buf = new byte[512];
+    private final Deflater def;
+    private final byte[] buf = new byte[512];
+    // reused 1 byte[] array:
+    private final byte[] wbuf1 = new byte[1];
 
     private int bytesRemaining;
 
-    public IDATOutputStream(ImageOutputStream stream, int chunkLength)
-        throws IOException {
+    IDATOutputStream(ImageOutputStream stream, int chunkLength,
+                            int deflaterLevel) throws IOException
+    {
         this.stream = stream;
         this.chunkLength = chunkLength;
+        this.def = new Deflater(deflaterLevel);
+
         startChunk();
     }
 
@@ -206,14 +214,17 @@
         }
     }
 
+    @Override
     public int read() throws IOException {
         throw new RuntimeException("Method not available");
     }
 
+    @Override
     public int read(byte[] b, int off, int len) throws IOException {
         throw new RuntimeException("Method not available");
     }
 
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         if (len == 0) {
             return;
@@ -227,7 +238,7 @@
         }
     }
 
-    public void deflate() throws IOException {
+    void deflate() throws IOException {
         int len = def.deflate(buf, 0, buf.length);
         int off = 0;
 
@@ -247,13 +258,13 @@
         }
     }
 
+    @Override
     public void write(int b) throws IOException {
-        byte[] wbuf = new byte[1];
-        wbuf[0] = (byte)b;
-        write(wbuf, 0, 1);
+        wbuf1[0] = (byte)b;
+        write(wbuf1, 0, 1);
     }
 
-    public void finish() throws IOException {
+    void finish() throws IOException {
         try {
             if (!def.finished()) {
                 def.finish();
@@ -267,6 +278,7 @@
         }
     }
 
+    @Override
     protected void finalize() throws Throwable {
         // Empty finalizer (for improved performance; no need to call
         // super.finalize() in this case)
@@ -274,18 +286,76 @@
 }
 
 
-class PNGImageWriteParam extends ImageWriteParam {
+final class PNGImageWriteParam extends ImageWriteParam {
 
-    public PNGImageWriteParam(Locale locale) {
+    /** Default quality level = 0.5 ie medium compression */
+    private static final float DEFAULT_QUALITY = 0.5f;
+
+    private static final String[] compressionNames = {"Deflate"};
+    private static final float[] qualityVals = { 0.00F, 0.30F, 0.75F, 1.00F };
+    private static final String[] qualityDescs = {
+        "High compression",   // 0.00 -> 0.30
+        "Medium compression", // 0.30 -> 0.75
+        "Low compression"     // 0.75 -> 1.00
+    };
+
+    PNGImageWriteParam(Locale locale) {
         super();
         this.canWriteProgressive = true;
         this.locale = locale;
+        this.canWriteCompressed = true;
+        this.compressionTypes = compressionNames;
+        this.compressionType = compressionTypes[0];
+        this.compressionMode = MODE_DEFAULT;
+        this.compressionQuality = DEFAULT_QUALITY;
+    }
+
+    /**
+     * Removes any previous compression quality setting.
+     *
+     * <p> The default implementation resets the compression quality
+     * to <code>0.5F</code>.
+     *
+     * @exception IllegalStateException if the compression mode is not
+     * <code>MODE_EXPLICIT</code>.
+     */
+    @Override
+    public void unsetCompression() {
+        super.unsetCompression();
+        this.compressionType = compressionTypes[0];
+        this.compressionQuality = DEFAULT_QUALITY;
+    }
+
+    /**
+     * Returns <code>true</code> since the PNG plug-in only supports
+     * lossless compression.
+     *
+     * @return <code>true</code>.
+     */
+    @Override
+    public boolean isCompressionLossless() {
+        return true;
+    }
+
+    @Override
+    public String[] getCompressionQualityDescriptions() {
+        super.getCompressionQualityDescriptions();
+        return qualityDescs.clone();
+    }
+
+    @Override
+    public float[] getCompressionQualityValues() {
+        super.getCompressionQualityValues();
+        return qualityVals.clone();
     }
 }
 
 /**
  */
-public class PNGImageWriter extends ImageWriter {
+public final class PNGImageWriter extends ImageWriter {
+
+    /** Default compression level = 4 ie medium compression */
+    private static final int DEFAULT_COMPRESSION_LEVEL = 4;
 
     ImageOutputStream stream = null;
 
@@ -334,6 +404,7 @@
         super(originatingProvider);
     }
 
+    @Override
     public void setOutput(Object output) {
         super.setOutput(output);
         if (output != null) {
@@ -346,16 +417,17 @@
         }
     }
 
-    private static int[] allowedProgressivePasses = { 1, 7 };
-
+    @Override
     public ImageWriteParam getDefaultWriteParam() {
         return new PNGImageWriteParam(getLocale());
     }
 
+    @Override
     public IIOMetadata getDefaultStreamMetadata(ImageWriteParam param) {
         return null;
     }
 
+    @Override
     public IIOMetadata getDefaultImageMetadata(ImageTypeSpecifier imageType,
                                                ImageWriteParam param) {
         PNGMetadata m = new PNGMetadata();
@@ -363,11 +435,13 @@
         return m;
     }
 
+    @Override
     public IIOMetadata convertStreamMetadata(IIOMetadata inData,
                                              ImageWriteParam param) {
         return null;
     }
 
+    @Override
     public IIOMetadata convertImageMetadata(IIOMetadata inData,
                                             ImageTypeSpecifier imageType,
                                             ImageWriteParam param) {
@@ -934,8 +1008,11 @@
     }
 
     // Use sourceXOffset, etc.
-    private void write_IDAT(RenderedImage image) throws IOException {
-        IDATOutputStream ios = new IDATOutputStream(stream, 32768);
+    private void write_IDAT(RenderedImage image, int deflaterLevel)
+        throws IOException
+    {
+        IDATOutputStream ios = new IDATOutputStream(stream, 32768,
+                                                    deflaterLevel);
         try {
             if (metadata.IHDR_interlaceMethod == 1) {
                 for (int i = 0; i < 7; i++) {
@@ -1028,6 +1105,7 @@
         }
     }
 
+    @Override
     public void write(IIOMetadata streamMetadata,
                       IIOImage image,
                       ImageWriteParam param) throws IIOException {
@@ -1110,7 +1188,23 @@
             metadata = new PNGMetadata();
         }
 
+        // reset compression level to default:
+        int deflaterLevel = DEFAULT_COMPRESSION_LEVEL;
+
         if (param != null) {
+            switch(param.getCompressionMode()) {
+            case ImageWriteParam.MODE_DISABLED:
+                deflaterLevel = Deflater.NO_COMPRESSION;
+                break;
+            case ImageWriteParam.MODE_EXPLICIT:
+                float quality = param.getCompressionQuality();
+                if (quality >= 0f && quality <= 1f) {
+                    deflaterLevel = 9 - Math.round(9f * quality);
+                }
+                break;
+            default:
+            }
+
             // Use Adam7 interlacing if set in write param
             switch (param.getProgressiveMode()) {
             case ImageWriteParam.MODE_DEFAULT:
@@ -1119,8 +1213,9 @@
             case ImageWriteParam.MODE_DISABLED:
                 metadata.IHDR_interlaceMethod = 0;
                 break;
-                // MODE_COPY_FROM_METADATA should alreay be taken care of
+                // MODE_COPY_FROM_METADATA should already be taken care of
                 // MODE_EXPLICIT is not allowed
+            default:
             }
         }
 
@@ -1165,7 +1260,7 @@
 
             writeUnknownChunks();
 
-            write_IDAT(im);
+            write_IDAT(im, deflaterLevel);
 
             if (abortRequested()) {
                 processWriteAborted();
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Thu Feb 04 16:49:26 2016 -0800
@@ -254,7 +254,7 @@
 
     /**
      * Sets the IHDR_bitDepth and IHDR_colorType variables.
-     * The <code>numBands</code> parameter is necessary since
+     * The {@code numBands} parameter is necessary since
      * we may only be writing a subset of the image bands.
      */
     public void initialize(ImageTypeSpecifier imageType, int numBands) {
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java	Thu Feb 04 16:49:26 2016 -0800
@@ -362,9 +362,9 @@
             offsets.add(f);
         }
 
+        List<TIFFField> byteCounts = new ArrayList<>();
         if (offsets.size() > 0) {
             // StripByteCounts
-            List<TIFFField> byteCounts = new ArrayList<>();
             f = getTIFFField(BaselineTIFFTagSet.TAG_STRIP_BYTE_COUNTS);
             if (f != null) {
                 if (f.getCount() != count) {
@@ -415,6 +415,12 @@
             }
         }
 
+        // Ensure there is at least a data pointer for JPEG interchange format or
+        // both data offsets and byte counts for other compression types.
+        if (jpegOffset == null && (offsets.size() == 0 || byteCounts.size() == 0)) {
+            throw new IIOException("Insufficient data offsets or byte counts");
+        }
+
         // JPEGQTables - one 64-byte table for each offset.
         f = getTIFFField(BaselineTIFFTagSet.TAG_JPEG_Q_TABLES);
         if (f != null) {
@@ -480,14 +486,16 @@
                 stream.skipBytes(4);
                 continue;
             }
-            int count = (int)stream.readUnsignedInt();
+            long longCount = stream.readUnsignedInt();
 
             // Get the associated TIFFTag.
             TIFFTag tag = getTag(tagNumber, tagSetList);
 
-            // Ignore unknown fields.
+            // Ignore unknown fields, fields with unknown type, and fields
+            // with count out of int range.
             if((tag == null && ignoreUnknownFields)
-                || (tag != null && !tag.isDataTypeOK(type))) {
+                || (tag != null && !tag.isDataTypeOK(type))
+                || longCount > Integer.MAX_VALUE) {
                 // Skip the value/offset so as to leave the stream
                 // position at the start of the next IFD entry.
                 stream.skipBytes(4);
@@ -496,6 +504,8 @@
                 continue;
             }
 
+            int count = (int)longCount;
+
             if (tag == null) {
                 tag = new TIFFTag(TIFFTag.UNKNOWN_TAG_NAME, tagNumber,
                     1 << type, count);
@@ -518,7 +528,14 @@
                 }
             }
 
-            int size = count*sizeOfType;
+            long longSize = longCount*sizeOfType;
+            if (longSize > Integer.MAX_VALUE) {
+                // Continue with the next IFD entry.
+                stream.skipBytes(4);
+                continue;
+            }
+            int size = (int)longSize;
+
             if (size > 4 || tag.isIFDPointer()) {
                 // The IFD entry value is a pointer to the actual field value.
                 long offset = stream.readUnsignedInt();
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -266,6 +266,8 @@
         super.setOutput(output);
 
         if (output != null) {
+            reset();
+
             if (!(output instanceof ImageOutputStream)) {
                 throw new IllegalArgumentException
                     ("output not an ImageOutputStream!");
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -50,7 +50,7 @@
 /** This class is the Java Image IO plugin reader for WBMP images.
  *  It may subsample the image, clip the image,
  *  and shift the decoded image origin if the proper decoding parameter
- *  are set in the provided <code>WBMPImageReadParam</code>.
+ *  are set in the provided {@code WBMPImageReadParam}.
  */
 public class WBMPImageReader extends ImageReader {
     /** The input stream where reads from */
@@ -69,8 +69,8 @@
 
     private WBMPMetadata metadata;
 
-    /** Constructs <code>WBMPImageReader</code> from the provided
-     *  <code>ImageReaderSpi</code>.
+    /** Constructs {@code WBMPImageReader} from the provided
+     *  {@code ImageReaderSpi}.
      */
     public WBMPImageReader(ImageReaderSpi originator) {
         super(originator);
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -57,7 +57,7 @@
  * a WBMP format.
  *
  * The encoding process may clip, subsample using the parameters
- * specified in the <code>ImageWriteParam</code>.
+ * specified in the {@code ImageWriteParam}.
  *
  * @see com.sun.media.imageio.plugins.WBMPImageWriteParam
  */
@@ -92,8 +92,8 @@
         return multiBytes;
     }
 
-    /** Constructs <code>WBMPImageWriter</code> based on the provided
-     *  <code>ImageWriterSpi</code>.
+    /** Constructs {@code WBMPImageWriter} based on the provided
+     *  {@code ImageWriterSpi}.
      */
     public WBMPImageWriter(ImageWriterSpi originator) {
         super(originator);
--- a/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,22 @@
 
 package com.sun.media.sound;
 
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
 import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.IOException;
-
-import java.io.BufferedOutputStream;
-import java.io.DataOutputStream;
-import java.io.FileOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.RandomAccessFile;
 import java.io.SequenceInputStream;
 import java.util.Objects;
 
 import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioSystem;
 
 //$$fb this class is buggy. Should be replaced in future.
@@ -63,6 +62,7 @@
 
     // METHODS TO IMPLEMENT AudioFileWriter
 
+    @Override
     public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) {
 
         AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length];
@@ -84,6 +84,7 @@
     }
 
 
+    @Override
     public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException {
         Objects.requireNonNull(stream);
         Objects.requireNonNull(fileType);
@@ -106,6 +107,7 @@
     }
 
 
+    @Override
     public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException {
         Objects.requireNonNull(stream);
         Objects.requireNonNull(fileType);
@@ -160,6 +162,9 @@
      * Throws IllegalArgumentException if not supported.
      */
     private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) {
+        if (!isFileTypeSupported(type, stream)) {
+            throw new IllegalArgumentException("File type " + type + " not supported.");
+        }
 
         AudioFormat format = null;
         AiffFileFormat fileFormat = null;
@@ -177,10 +182,6 @@
         int fileSize;
         boolean convert8to16 = false;
 
-        if( !types[0].equals(type) ) {
-            throw new IllegalArgumentException("File type " + type + " not supported.");
-        }
-
         if( (AudioFormat.Encoding.ALAW.equals(streamEncoding)) ||
             (AudioFormat.Encoding.ULAW.equals(streamEncoding)) ) {
 
--- a/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java	Thu Feb 04 16:49:26 2016 -0800
@@ -135,45 +135,48 @@
         AudioFormat sourceFormat = sourceStream.getFormat();
         AudioFormat.Encoding sourceEncoding = sourceFormat.getEncoding();
 
+        if( !isConversionSupported(targetEncoding,sourceStream.getFormat()) ) {
+            throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString());
+        }
         if( sourceEncoding.equals( targetEncoding ) ) {
             return sourceStream;
+        }
+        AudioFormat targetFormat = null;
+        if( sourceEncoding.equals( AudioFormat.Encoding.ALAW ) &&
+            targetEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) ) {
+
+            targetFormat = new AudioFormat( targetEncoding,
+                                            sourceFormat.getSampleRate(),
+                                            16,
+                                            sourceFormat.getChannels(),
+                                            2*sourceFormat.getChannels(),
+                                            sourceFormat.getSampleRate(),
+                                            sourceFormat.isBigEndian());
+
+        } else if( sourceEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) &&
+                   targetEncoding.equals( AudioFormat.Encoding.ALAW ) ) {
+
+            targetFormat = new AudioFormat( targetEncoding,
+                                            sourceFormat.getSampleRate(),
+                                            8,
+                                            sourceFormat.getChannels(),
+                                            sourceFormat.getChannels(),
+                                            sourceFormat.getSampleRate(),
+                                            false);
         } else {
-            AudioFormat targetFormat = null;
-            if( !isConversionSupported(targetEncoding,sourceStream.getFormat()) ) {
-                throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString());
-            }
-            if( sourceEncoding.equals( AudioFormat.Encoding.ALAW ) &&
-                targetEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) ) {
-
-                targetFormat = new AudioFormat( targetEncoding,
-                                                sourceFormat.getSampleRate(),
-                                                16,
-                                                sourceFormat.getChannels(),
-                                                2*sourceFormat.getChannels(),
-                                                sourceFormat.getSampleRate(),
-                                                sourceFormat.isBigEndian());
-
-            } else if( sourceEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) &&
-                       targetEncoding.equals( AudioFormat.Encoding.ALAW ) ) {
-
-                targetFormat = new AudioFormat( targetEncoding,
-                                                sourceFormat.getSampleRate(),
-                                                8,
-                                                sourceFormat.getChannels(),
-                                                sourceFormat.getChannels(),
-                                                sourceFormat.getSampleRate(),
-                                                false);
-            } else {
-                throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString());
-            }
-            return getAudioInputStream( targetFormat, sourceStream );
+            throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString());
         }
+        return getConvertedStream(targetFormat, sourceStream);
     }
 
     /**
      * use old code...
      */
     public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){
+        if (!isConversionSupported(targetFormat, sourceStream.getFormat()))
+            throw new IllegalArgumentException("Unsupported conversion: "
+                                               + sourceStream.getFormat().toString() + " to "
+                                               + targetFormat.toString());
         return getConvertedStream( targetFormat, sourceStream );
     }
 
@@ -218,33 +221,28 @@
         Vector<AudioFormat> formats = new Vector<>();
         AudioFormat format;
 
-        if ( AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) {
+        if (inputFormat.getSampleSizeInBits() == 16
+                && AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) {
             format = new AudioFormat(AudioFormat.Encoding.ALAW,
-                                     inputFormat.getSampleRate(),
-                                     8,
+                                     inputFormat.getSampleRate(), 8,
                                      inputFormat.getChannels(),
                                      inputFormat.getChannels(),
-                                     inputFormat.getSampleRate(),
-                                     false );
+                                     inputFormat.getSampleRate(), false);
             formats.addElement(format);
         }
-
-        if (AudioFormat.Encoding.ALAW.equals(inputFormat.getEncoding())) {
+        if (inputFormat.getSampleSizeInBits() == 8
+                && AudioFormat.Encoding.ALAW.equals(inputFormat.getEncoding())) {
             format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
-                                     inputFormat.getSampleRate(),
-                                     16,
+                                     inputFormat.getSampleRate(), 16,
                                      inputFormat.getChannels(),
-                                     inputFormat.getChannels()*2,
-                                     inputFormat.getSampleRate(),
-                                     false );
+                                     inputFormat.getChannels() * 2,
+                                     inputFormat.getSampleRate(), false);
             formats.addElement(format);
             format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
-                                     inputFormat.getSampleRate(),
-                                     16,
+                                     inputFormat.getSampleRate(), 16,
                                      inputFormat.getChannels(),
-                                     inputFormat.getChannels()*2,
-                                     inputFormat.getSampleRate(),
-                                     true );
+                                     inputFormat.getChannels() * 2,
+                                     inputFormat.getSampleRate(), true);
             formats.addElement(format);
         }
 
@@ -256,7 +254,7 @@
     }
 
 
-    final class AlawCodecStream extends AudioInputStream {
+    private final class AlawCodecStream extends AudioInputStream {
 
         // tempBuffer required only for encoding (when encode is true)
         private static final int tempBufferSize = 64;
@@ -446,5 +444,12 @@
                 return (i - off);
             }
         }
+
+        @Override
+        public long skip(final long n) throws IOException {
+            // Implementation of this method assumes that we support
+            // encoding/decoding from/to 8/16 bits only
+            return encode ? super.skip(n * 2) / 2 : super.skip(n / 2) * 2;
+        }
     } // end class AlawCodecStream
 } // end class ALAW
--- a/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,24 +25,18 @@
 
 package com.sun.media.sound;
 
-
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioFormat;
 
-
 /**
  * AU file format.
  *
  * @author Jan Borgersen
  */
-
 final class AuFileFormat extends AudioFileFormat {
 
     // magic numbers
-    static final int AU_SUN_MAGIC =     0x2e736e64;
-    static final int AU_SUN_INV_MAGIC = 0x646e732e;
-    static final int AU_DEC_MAGIC =         0x2e736400;
-    static final int AU_DEC_INV_MAGIC = 0x0064732e;
+    static final int AU_SUN_MAGIC = 0x2e736e64; // ".snd"
 
     // encodings
     static final int AU_ULAW_8       = 1;  /* 8-bit ISDN u-law */
@@ -62,11 +56,6 @@
 
     private int auType;
 
-    AuFileFormat( AudioFileFormat aff ) {
-
-        this( aff.getType(), aff.getByteLength(), aff.getFormat(), aff.getFrameLength() );
-    }
-
     AuFileFormat(AudioFileFormat.Type type, int lengthInBytes, AudioFormat format, int lengthInFrames) {
 
         super(type,lengthInBytes,format,lengthInFrames);
@@ -94,12 +83,9 @@
                 auType = AU_LINEAR_32;
             }
         }
-
     }
 
     public int getAuType() {
-
         return auType;
     }
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -46,45 +46,25 @@
     @Override
     public AudioFileFormat getAudioFileFormatImpl(final InputStream stream)
             throws UnsupportedAudioFileException, IOException {
-        boolean bigendian  = false;
-        int headerSize     = -1;
-        int dataSize       = -1;
-        int encoding_local = -1;
-        int sampleRate     = -1;
-        int frameRate      = -1;
-        int frameSize      = -1;
-        int channels       = -1;
-        final int sampleSizeInBits;
-        int length = 0;
-        int nread = 0;
-        AudioFormat.Encoding encoding = null;
+        final DataInputStream dis = new DataInputStream(stream);
+        final int magic = dis.readInt();
 
-        DataInputStream dis = new DataInputStream( stream );
-
-        final int magic = dis.readInt(); nread += 4;
-
-        if (! (magic == AuFileFormat.AU_SUN_MAGIC) || (magic == AuFileFormat.AU_DEC_MAGIC) ||
-            (magic == AuFileFormat.AU_SUN_INV_MAGIC) || (magic == AuFileFormat.AU_DEC_INV_MAGIC) ) {
-
+        if (magic != AuFileFormat.AU_SUN_MAGIC) {
             // not AU, throw exception
             throw new UnsupportedAudioFileException("not an AU file");
         }
 
-        if ((magic == AuFileFormat.AU_SUN_MAGIC) || (magic == AuFileFormat.AU_DEC_MAGIC)) {
-            bigendian = true;        // otherwise little-endian
-        }
-
-        headerSize     = (bigendian==true ? dis.readInt() : rllong(dis) );  nread += 4;
-        dataSize       = (bigendian==true ? dis.readInt() : rllong(dis) );  nread += 4;
-        encoding_local = (bigendian==true ? dis.readInt() : rllong(dis) );  nread += 4;
-        sampleRate     = (bigendian==true ? dis.readInt() : rllong(dis) );  nread += 4;
-        channels       = (bigendian==true ? dis.readInt() : rllong(dis) );  nread += 4;
+        final int headerSize = dis.readInt();
+        final int dataSize = dis.readInt();
+        final int encoding_local = dis.readInt();
+        final int sampleRate = dis.readInt();
+        final int channels = dis.readInt();
         if (channels <= 0) {
             throw new UnsupportedAudioFileException("Invalid number of channels");
         }
 
-        frameRate = sampleRate;
-
+        final int sampleSizeInBits;
+        final AudioFormat.Encoding encoding;
         switch (encoding_local) {
         case AuFileFormat.AU_ULAW_8:
             encoding = AudioFormat.Encoding.ULAW;
@@ -138,24 +118,24 @@
                         break;
             */
         default:
-                // unsupported filetype, throw exception
-                throw new UnsupportedAudioFileException("not a valid AU file");
+            // unsupported filetype, throw exception
+            throw new UnsupportedAudioFileException("not a valid AU file");
         }
 
-        frameSize = calculatePCMFrameSize(sampleSizeInBits, channels);
+        final int frameSize = calculatePCMFrameSize(sampleSizeInBits, channels);
         //$$fb 2002-11-02: fix for 4629669: AU file reader: problems with empty files
-        if( dataSize < 0 ) {
+        final int length;
+        if (dataSize < 0) {
             length = AudioSystem.NOT_SPECIFIED;
         } else {
             //$$fb 2003-10-20: fix for 4940459: AudioInputStream.getFrameLength() returns 0 instead of NOT_SPECIFIED
             length = dataSize / frameSize;
         }
         // now seek past the header
-        dis.skipBytes(headerSize - nread);
-        AudioFormat format = new AudioFormat(encoding, sampleRate,
-                                             sampleSizeInBits, channels,
-                                             frameSize, (float) frameRate,
-                                             bigendian);
+        dis.skipBytes(headerSize - AuFileFormat.AU_HEADERSIZE);
+        final AudioFormat format = new AudioFormat(encoding, sampleRate,
+                                                   sampleSizeInBits, channels,
+                                                   frameSize, sampleRate, true);
         return new AuFileFormat(AudioFileFormat.Type.AU, dataSize + headerSize,
                                 format, length);
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,24 @@
 
 package com.sun.media.sound;
 
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
 import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.IOException;
-
-import java.io.BufferedOutputStream;
-import java.io.DataOutputStream;
-import java.io.FileOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.RandomAccessFile;
 import java.io.SequenceInputStream;
 import java.util.Objects;
 
 import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioSystem;
 
-
 /**
  * AU file writer.
  *
@@ -52,8 +50,10 @@
  */
 public final class AuFileWriter extends SunFileWriter {
 
-    //$$fb value for length field if length is not known
-    public static final int UNKNOWN_SIZE=-1;
+    /**
+     * Value for length field if length is not known.
+     */
+    private static final int UNKNOWN_SIZE = -1;
 
     /**
      * Constructs a new AuFileWriter object.
@@ -62,6 +62,7 @@
         super(new AudioFileFormat.Type[]{AudioFileFormat.Type.AU});
     }
 
+    @Override
     public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) {
 
         AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length];
@@ -82,7 +83,7 @@
         return new AudioFileFormat.Type[0];
     }
 
-
+    @Override
     public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException {
         Objects.requireNonNull(stream);
         Objects.requireNonNull(fileType);
@@ -96,13 +97,10 @@
 
         // throws IllegalArgumentException if not supported
         AuFileFormat auFileFormat = (AuFileFormat)getAudioFileFormat(fileType, stream);
-
-        int bytesWritten = writeAuFile(stream, auFileFormat, out);
-        return bytesWritten;
+        return writeAuFile(stream, auFileFormat, out);
     }
 
-
-
+    @Override
     public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException {
         Objects.requireNonNull(stream);
         Objects.requireNonNull(fileType);
@@ -137,7 +135,6 @@
         return bytesWritten;
     }
 
-
     // -------------------------------------------------------------
 
     /**
@@ -145,6 +142,9 @@
      * Throws IllegalArgumentException if not supported.
      */
     private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) {
+        if (!isFileTypeSupported(type, stream)) {
+            throw new IllegalArgumentException("File type " + type + " not supported.");
+        }
 
         AudioFormat format = null;
         AuFileFormat fileFormat = null;
@@ -154,17 +154,9 @@
         AudioFormat.Encoding streamEncoding = streamFormat.getEncoding();
 
 
-        float sampleRate;
         int sampleSizeInBits;
-        int channels;
-        int frameSize;
-        float frameRate;
         int fileSize;
 
-        if( !types[0].equals(type) ) {
-            throw new IllegalArgumentException("File type " + type + " not supported.");
-        }
-
         if( (AudioFormat.Encoding.ALAW.equals(streamEncoding)) ||
             (AudioFormat.Encoding.ULAW.equals(streamEncoding)) ) {
 
@@ -206,14 +198,12 @@
         return fileFormat;
     }
 
-
-    private InputStream getFileStream(AuFileFormat auFileFormat, InputStream audioStream) throws IOException {
+    private InputStream getFileStream(AuFileFormat auFileFormat, AudioInputStream audioStream) throws IOException {
 
         // private method ... assumes auFileFormat is a supported file type
 
         AudioFormat format            = auFileFormat.getFormat();
 
-        int magic          = AuFileFormat.AU_SUN_MAGIC;
         int headerSize     = AuFileFormat.AU_HEADERSIZE;
         long dataSize       = auFileFormat.getFrameLength();
         //$$fb fix for Bug 4351296
@@ -225,9 +215,6 @@
         int encoding_local = auFileFormat.getAuType();
         int sampleRate     = (int)format.getSampleRate();
         int channels       = format.getChannels();
-        //$$fb below is the fix for 4297100.
-        //boolean bigendian      = format.isBigEndian();
-        boolean bigendian      = true;                  // force bigendian
 
         byte header[] = null;
         ByteArrayInputStream headerStream = null;
@@ -243,54 +230,37 @@
 
         codedAudioStream = audioStream;
 
-        if( audioStream instanceof AudioInputStream ) {
+        audioStreamFormat = audioStream.getFormat();
+        encoding = audioStreamFormat.getEncoding();
 
+        //$$ fb 2001-07-13: Bug 4391108
+        if( (AudioFormat.Encoding.PCM_UNSIGNED.equals(encoding)) ||
+            (AudioFormat.Encoding.PCM_SIGNED.equals(encoding)
+             && !audioStreamFormat.isBigEndian()) ) {
+            // We always write big endian au files, this is by far the standard
+            codedAudioStream = AudioSystem.getAudioInputStream( new AudioFormat (
+                                                                                 AudioFormat.Encoding.PCM_SIGNED,
+                                                                                 audioStreamFormat.getSampleRate(),
+                                                                                 audioStreamFormat.getSampleSizeInBits(),
+                                                                                 audioStreamFormat.getChannels(),
+                                                                                 audioStreamFormat.getFrameSize(),
+                                                                                 audioStreamFormat.getFrameRate(),
+                                                                                 true),
+                                                                                 audioStream );
 
-            audioStreamFormat = ((AudioInputStream)audioStream).getFormat();
-            encoding = audioStreamFormat.getEncoding();
 
-            //$$ fb 2001-07-13: Bug 4391108
-            if( (AudioFormat.Encoding.PCM_UNSIGNED.equals(encoding)) ||
-                (AudioFormat.Encoding.PCM_SIGNED.equals(encoding)
-                 && bigendian != audioStreamFormat.isBigEndian()) ) {
-
-                                // plug in the transcoder to convert to PCM_SIGNED, bigendian
-                                // NOTE: little endian AU is not common, so we're always converting
-                                //       to big endian unless the passed in audioFileFormat is little.
-                                // $$fb this NOTE is superseded. We always write big endian au files, this is by far the standard.
-                codedAudioStream = AudioSystem.getAudioInputStream( new AudioFormat (
-                                                                                     AudioFormat.Encoding.PCM_SIGNED,
-                                                                                     audioStreamFormat.getSampleRate(),
-                                                                                     audioStreamFormat.getSampleSizeInBits(),
-                                                                                     audioStreamFormat.getChannels(),
-                                                                                     audioStreamFormat.getFrameSize(),
-                                                                                     audioStreamFormat.getFrameRate(),
-                                                                                     bigendian),
-                                                                    (AudioInputStream)audioStream );
-
-
-            }
         }
 
         baos = new ByteArrayOutputStream();
         dos = new DataOutputStream(baos);
 
 
-        if (bigendian) {
-            dos.writeInt(AuFileFormat.AU_SUN_MAGIC);
-            dos.writeInt(headerSize);
-            dos.writeInt((int)dataSizeInBytes);
-            dos.writeInt(encoding_local);
-            dos.writeInt(sampleRate);
-            dos.writeInt(channels);
-        } else {
-            dos.writeInt(AuFileFormat.AU_SUN_INV_MAGIC);
-            dos.writeInt(big2little(headerSize));
-            dos.writeInt(big2little((int)dataSizeInBytes));
-            dos.writeInt(big2little(encoding_local));
-            dos.writeInt(big2little(sampleRate));
-            dos.writeInt(big2little(channels));
-        }
+        dos.writeInt(AuFileFormat.AU_SUN_MAGIC);
+        dos.writeInt(headerSize);
+        dos.writeInt((int)dataSizeInBytes);
+        dos.writeInt(encoding_local);
+        dos.writeInt(sampleRate);
+        dos.writeInt(channels);
 
         // Now create a new InputStream from headerStream and the InputStream
         // in audioStream
@@ -304,7 +274,7 @@
         return auStream;
     }
 
-    private int writeAuFile(InputStream in, AuFileFormat auFileFormat, OutputStream out) throws IOException {
+    private int writeAuFile(AudioInputStream in, AuFileFormat auFileFormat, OutputStream out) throws IOException {
 
         int bytesRead = 0;
         int bytesWritten = 0;
@@ -332,6 +302,4 @@
 
         return bytesWritten;
     }
-
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.io.IOException;
@@ -475,6 +476,11 @@
 
     public AudioInputStream getAudioInputStream(Encoding targetEncoding,
             AudioInputStream sourceStream) {
+        if (!isConversionSupported(targetEncoding, sourceStream.getFormat())) {
+            throw new IllegalArgumentException(
+                    "Unsupported conversion: " + sourceStream.getFormat()
+                            .toString() + " to " + targetEncoding.toString());
+        }
         if (sourceStream.getFormat().getEncoding().equals(targetEncoding))
             return sourceStream;
         AudioFormat format = sourceStream.getFormat();
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java	Thu Feb 04 16:49:26 2016 -0800
@@ -32,9 +32,9 @@
 import javax.sound.sampled.SourceDataLine;
 
 /**
- * <code>AudioSynthesizer</code> is a <code>Synthesizer</code>
- * which renders it's output audio into <code>SourceDataLine</code>
- * or <code>AudioInputStream</code>.
+ * {@code AudioSynthesizer} is a {@code Synthesizer}
+ * which renders it's output audio into {@code SourceDataLine}
+ * or {@code AudioInputStream}.
  *
  * @see MidiSystem#getSynthesizer
  * @see Synthesizer
@@ -59,7 +59,7 @@
      * Gets information about the possible properties for the synthesizer.
      *
      * @param info a proposed list of tag/value pairs that will be sent on open.
-     * @return an array of <code>AudioSynthesizerPropertyInfo</code> objects
+     * @return an array of {@code AudioSynthesizerPropertyInfo} objects
      * describing possible properties. This array may be an empty array if
      * no properties are required.
      */
@@ -68,7 +68,7 @@
 
     /**
      * Opens the synthesizer and starts rendering audio into
-     * <code>SourceDataLine</code>.
+     * {@code SourceDataLine}.
      *
      * <p>An application opening a synthesizer explicitly with this call
      * has to close the synthesizer by calling {@link #close}. This is
@@ -77,13 +77,13 @@
      *
      * <p>Note that some synthesizers, once closed, cannot be reopened.
      * Attempts to reopen such a synthesizer will always result in
-     * a <code>MidiUnavailableException</code>.
+     * a {@code MidiUnavailableException}.
      *
-     * @param line which <code>AudioSynthesizer</code> writes output audio into.
-     * If <code>line</code> is null, then line from system default mixer is used.
-     * @param info a <code>Map<String,Object></code> object containing
+     * @param line which {@code AudioSynthesizer} writes output audio into.
+     * If {@code line} is null, then line from system default mixer is used.
+     * @param info a {@code Map<String,Object>} object containing
      * properties for additional configuration supported by synthesizer.
-     * If <code>info</code> is null then default settings are used.
+     * If {@code info} is null then default settings are used.
      *
      * @throws MidiUnavailableException thrown if the synthesizer cannot be
      * opened due to resource restrictions.
@@ -98,7 +98,7 @@
 
     /**
      * Opens the synthesizer and renders audio into returned
-     * <code>AudioInputStream</code>.
+     * {@code AudioInputStream}.
      *
      * <p>An application opening a synthesizer explicitly with this call
      * has to close the synthesizer by calling {@link #close}. This is
@@ -107,13 +107,13 @@
      *
      * <p>Note that some synthesizers, once closed, cannot be reopened.
      * Attempts to reopen such a synthesizer will always result in
-     * a <code>MidiUnavailableException<code>.
+     * a {@code MidiUnavailableException}.
      *
-     * @param targetFormat specifies the <code>AudioFormat</code>
-     * used in returned <code>AudioInputStream</code>.
-     * @param info a <code>Map<String,Object></code> object containing
+     * @param targetFormat specifies the {@code AudioFormat}
+     * used in returned {@code AudioInputStream}.
+     * @param info a {@code Map<String,Object>} object containing
      * properties for additional configuration supported by synthesizer.
-     * If <code>info</code> is null then default settings are used.
+     * If {@code info} is null then default settings are used.
      *
      * @throws MidiUnavailableException thrown if the synthesizer cannot be
      * opened due to resource restrictions.
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java	Thu Feb 04 16:49:26 2016 -0800
@@ -25,16 +25,16 @@
 package com.sun.media.sound;
 
 /**
- * Information about property used in  opening <code>AudioSynthesizer</code>.
+ * Information about property used in  opening {@code AudioSynthesizer}.
  *
  * @author Karl Helgason
  */
 public final class AudioSynthesizerPropertyInfo {
 
     /**
-     * Constructs a <code>AudioSynthesizerPropertyInfo</code> object with a given
-     * name and value. The <code>description</code> and <code>choices</code>
-     * are initialized by <code>null</code> values.
+     * Constructs a {@code AudioSynthesizerPropertyInfo} object with a given
+     * name and value. The {@code description} and {@code choices}
+     * are initialized by {@code null} values.
      *
      * @param name the name of the property
      * @param value the current value or class used for values.
@@ -60,18 +60,18 @@
      */
     public String description = null;
     /**
-     * The <code>value</code> field specifies the current value of
+     * The {@code value} field specifies the current value of
      * the property.
      */
     public Object value = null;
     /**
-     * The <code>valueClass</code> field specifies class
-     * used in <code>value</code> field.
+     * The {@code valueClass} field specifies class
+     * used in {@code value} field.
      */
     public Class<?> valueClass = null;
     /**
      * An array of possible values if the value for the field
-     * <code>AudioSynthesizerPropertyInfo.value</code> may be selected
+     * {@code AudioSynthesizerPropertyInfo.value} may be selected
      * from a particular set of values; otherwise null.
      */
     public Object[] choices = null;
--- a/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java	Thu Feb 04 16:49:26 2016 -0800
@@ -250,7 +250,7 @@
     /**
      * Binary search for the event indexes of the track
      *
-     * @param tick - tick number of index to be found in array
+     * @param tick  tick number of index to be found in array
      * @return index in track which is on or after "tick".
      *   if no entries are found that follow after tick, track.size() is returned
      */
--- a/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java	Thu Feb 04 16:49:26 2016 -0800
@@ -33,7 +33,6 @@
 import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
 
-
 /**
  * Converts among signed/unsigned and little/big endianness of sampled.
  *
@@ -52,11 +51,6 @@
         AudioFormat.Encoding.PCM_UNSIGNED,
     };
 
-
-
-    private static final int tempBufferSize = 64;
-    private byte tempBuffer [] = null;
-
     /**
      * Constructs a new PCMtoPCM codec object.
      */
@@ -67,21 +61,31 @@
 
     // NEW CODE
 
+    public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) {
 
-    /**
-     */
-    public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat){
-
-        if( sourceFormat.getEncoding().equals( AudioFormat.Encoding.PCM_SIGNED ) ||
-            sourceFormat.getEncoding().equals( AudioFormat.Encoding.PCM_UNSIGNED ) ) {
-
-                AudioFormat.Encoding encs[] = new AudioFormat.Encoding[2];
-                encs[0] = AudioFormat.Encoding.PCM_SIGNED;
-                encs[1] = AudioFormat.Encoding.PCM_UNSIGNED;
-                return encs;
-            } else {
-                return new AudioFormat.Encoding[0];
+        final int sampleSize = sourceFormat.getSampleSizeInBits();
+        AudioFormat.Encoding encoding = sourceFormat.getEncoding();
+        if (sampleSize == 8) {
+            if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED)) {
+                return new AudioFormat.Encoding[]{
+                        AudioFormat.Encoding.PCM_UNSIGNED
+                };
             }
+            if (encoding.equals(AudioFormat.Encoding.PCM_UNSIGNED)) {
+                return new AudioFormat.Encoding[]{
+                        AudioFormat.Encoding.PCM_SIGNED
+                };
+            }
+        } else if (sampleSize == 16) {
+            if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED)
+                    || encoding.equals(AudioFormat.Encoding.PCM_UNSIGNED)) {
+                return new AudioFormat.Encoding[]{
+                        AudioFormat.Encoding.PCM_UNSIGNED,
+                        AudioFormat.Encoding.PCM_SIGNED
+                };
+            }
+        }
+        return new AudioFormat.Encoding[0];
     }
 
 
@@ -125,7 +129,7 @@
                                                         sourceFormat.getFrameRate(),
                                                         sourceFormat.isBigEndian() );
 
-            return getAudioInputStream( targetFormat, sourceStream );
+            return getConvertedStream(targetFormat, sourceStream);
 
         } else {
             throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString() );
@@ -136,7 +140,10 @@
      * use old code
      */
     public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){
-
+        if (!isConversionSupported(targetFormat, sourceStream.getFormat()))
+            throw new IllegalArgumentException("Unsupported conversion: "
+                                               + sourceStream.getFormat().toString() + " to "
+                                               + targetFormat.toString());
         return getConvertedStream( targetFormat, sourceStream );
     }
 
@@ -166,7 +173,6 @@
         } else {
 
             cs = (AudioInputStream) (new PCMtoPCMCodecStream(stream, outputFormat));
-            tempBuffer = new byte[tempBufferSize];
         }
         return cs;
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java	Thu Feb 04 16:49:26 2016 -0800
@@ -25,7 +25,7 @@
 package com.sun.media.sound;
 
 /**
- * <code>SoftControl</code> are the basic controls
+ * {@code SoftControl} are the basic controls
  * used for control-rate processing.
  *
  * @author Karl Helgason
--- a/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -25,6 +25,7 @@
 
 package com.sun.media.sound;
 
+import java.io.EOFException;
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -131,7 +132,8 @@
         stream.mark(200);
         try {
             return getAudioInputStream(MidiSystem.getSequence(stream));
-        } catch (final InvalidMidiDataException ignored) {
+        } catch (InvalidMidiDataException | EOFException ignored) {
+            // stream is unsupported or the header is less than was expected
             stream.reset();
             throw new UnsupportedAudioFileException();
         }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,11 +26,8 @@
 package com.sun.media.sound;
 
 import javax.sound.sampled.AudioFormat;
-import javax.sound.sampled.AudioInputStream;
-
 import javax.sound.sampled.spi.FormatConversionProvider;
 
-
 /**
  * A codec can encode and/or decode audio data.  It provides an
  * AudioInputStream from which processed data may be read.
@@ -73,23 +70,4 @@
         System.arraycopy(outputEncodings, 0, encodings, 0, outputEncodings.length);
         return encodings;
     }
-
-    /**
-     */
-    public abstract AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat);
-
-
-    /**
-     */
-    public abstract AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat);
-
-
-    /**
-     */
-    public abstract AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream);
-    /**
-     */
-    public abstract AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream);
-
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -27,6 +27,7 @@
 
 import java.io.BufferedInputStream;
 import java.io.DataInputStream;
+import java.io.EOFException;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -51,6 +52,9 @@
         stream.mark(200); // The biggest value which was historically used
         try {
             return getAudioFileFormatImpl(stream);
+        } catch (final EOFException ignored) {
+            // the header is less than was expected
+            throw new UnsupportedAudioFileException();
         } finally {
             stream.reset();
         }
@@ -61,6 +65,9 @@
             throws UnsupportedAudioFileException, IOException {
         try (InputStream is = url.openStream()) {
             return getAudioFileFormatImpl(new BufferedInputStream(is));
+        } catch (final EOFException ignored) {
+            // the header is less than was expected
+            throw new UnsupportedAudioFileException();
         }
     }
 
@@ -69,6 +76,9 @@
             throws UnsupportedAudioFileException, IOException {
         try (InputStream is = new FileInputStream(file)) {
             return getAudioFileFormatImpl(new BufferedInputStream(is));
+        } catch (final EOFException ignored) {
+            // the header is less than was expected
+            throw new UnsupportedAudioFileException();
         }
     }
 
@@ -82,9 +92,10 @@
             // beginning of the audio data, so return an AudioInputStream
             return new AudioInputStream(stream, fileFormat.getFormat(),
                                         fileFormat.getFrameLength());
-        } catch (final UnsupportedAudioFileException e) {
+        } catch (UnsupportedAudioFileException | EOFException ignored) {
+            // stream is unsupported or the header is less than was expected
             stream.reset();
-            throw e;
+            throw new UnsupportedAudioFileException();
         }
     }
 
@@ -125,6 +136,9 @@
      * @throws UnsupportedAudioFileException if the stream does not point to
      *         valid audio file data recognized by the system
      * @throws IOException if an I/O exception occurs
+     * @throws EOFException is used incorrectly by our readers instead of
+     *         UnsupportedAudioFileException if the header is less than was
+     *         expected
      */
     abstract AudioFileFormat getAudioFileFormatImpl(InputStream stream)
             throws UnsupportedAudioFileException, IOException;
--- a/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,13 @@
 
 package com.sun.media.sound;
 
-import java.io.File;
+import java.io.DataInputStream;
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.IOException;
-import java.io.DataInputStream;
 
 import javax.sound.sampled.AudioFileFormat;
-import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.spi.AudioFileWriter;
 
-
-
-
 /**
  * Abstract File Writer class.
  *
@@ -75,14 +69,6 @@
         return localArray;
     }
 
-
-    public abstract AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream);
-
-    public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException;
-
-    public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException;
-
-
     // HELPER METHODS
 
 
--- a/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java	Thu Feb 04 16:49:26 2016 -0800
@@ -26,13 +26,12 @@
 package com.sun.media.sound;
 
 import java.io.IOException;
-
 import java.util.Objects;
 import java.util.Vector;
 
 import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
-import javax.sound.sampled.AudioInputStream;
 
 
 /**
@@ -126,43 +125,46 @@
         AudioFormat sourceFormat = sourceStream.getFormat();
         AudioFormat.Encoding sourceEncoding = sourceFormat.getEncoding();
 
+        if (!isConversionSupported(targetEncoding,sourceStream.getFormat())) {
+            throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString());
+        }
         if (sourceEncoding.equals(targetEncoding)) {
             return sourceStream;
+        }
+        AudioFormat targetFormat = null;
+        if (AudioFormat.Encoding.ULAW.equals(sourceEncoding) &&
+            AudioFormat.Encoding.PCM_SIGNED.equals(targetEncoding) ) {
+            targetFormat = new AudioFormat( targetEncoding,
+                                            sourceFormat.getSampleRate(),
+                                            16,
+                                            sourceFormat.getChannels(),
+                                            2*sourceFormat.getChannels(),
+                                            sourceFormat.getSampleRate(),
+                                            sourceFormat.isBigEndian());
+        } else if (AudioFormat.Encoding.PCM_SIGNED.equals(sourceEncoding) &&
+                   AudioFormat.Encoding.ULAW.equals(targetEncoding)) {
+            targetFormat = new AudioFormat( targetEncoding,
+                                            sourceFormat.getSampleRate(),
+                                            8,
+                                            sourceFormat.getChannels(),
+                                            sourceFormat.getChannels(),
+                                            sourceFormat.getSampleRate(),
+                                            false);
         } else {
-            AudioFormat targetFormat = null;
-            if (!isConversionSupported(targetEncoding,sourceStream.getFormat())) {
-                throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString());
-            }
-            if (AudioFormat.Encoding.ULAW.equals(sourceEncoding) &&
-                AudioFormat.Encoding.PCM_SIGNED.equals(targetEncoding) ) {
-                targetFormat = new AudioFormat( targetEncoding,
-                                                sourceFormat.getSampleRate(),
-                                                16,
-                                                sourceFormat.getChannels(),
-                                                2*sourceFormat.getChannels(),
-                                                sourceFormat.getSampleRate(),
-                                                sourceFormat.isBigEndian());
-            } else if (AudioFormat.Encoding.PCM_SIGNED.equals(sourceEncoding) &&
-                       AudioFormat.Encoding.ULAW.equals(targetEncoding)) {
-                targetFormat = new AudioFormat( targetEncoding,
-                                                sourceFormat.getSampleRate(),
-                                                8,
-                                                sourceFormat.getChannels(),
-                                                sourceFormat.getChannels(),
-                                                sourceFormat.getSampleRate(),
-                                                false);
-            } else {
-                throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString());
-            }
+            throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString());
+        }
 
-            return getAudioInputStream( targetFormat, sourceStream );
-        }
+        return getConvertedStream(targetFormat, sourceStream);
     }
 
     /**
      * use old code...
      */
     public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){
+        if (!isConversionSupported(targetFormat, sourceStream.getFormat()))
+            throw new IllegalArgumentException("Unsupported conversion: "
+                                               + sourceStream.getFormat().toString() + " to "
+                                               + targetFormat.toString());
         return getConvertedStream(targetFormat, sourceStream);
     }
 
@@ -215,24 +217,20 @@
                                      false );
             formats.addElement(format);
         }
-
-        if (AudioFormat.Encoding.ULAW.equals(inputFormat.getEncoding())) {
+        if (inputFormat.getSampleSizeInBits() == 8
+                && AudioFormat.Encoding.ULAW.equals(inputFormat.getEncoding())) {
             format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
-                                     inputFormat.getSampleRate(),
-                                     16,
+                                     inputFormat.getSampleRate(), 16,
                                      inputFormat.getChannels(),
-                                     inputFormat.getChannels()*2,
-                                     inputFormat.getSampleRate(),
-                                     false );
+                                     inputFormat.getChannels() * 2,
+                                     inputFormat.getSampleRate(), false);
             formats.addElement(format);
 
             format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
-                                     inputFormat.getSampleRate(),
-                                     16,
+                                     inputFormat.getSampleRate(), 16,
                                      inputFormat.getChannels(),
-                                     inputFormat.getChannels()*2,
-                                     inputFormat.getSampleRate(),
-                                     true );
+                                     inputFormat.getChannels() * 2,
+                                     inputFormat.getSampleRate(), true);
             formats.addElement(format);
         }
 
@@ -244,7 +242,7 @@
     }
 
 
-    class UlawCodecStream extends AudioInputStream {
+    private final class UlawCodecStream extends AudioInputStream {
 
         private static final int tempBufferSize = 64;
         private byte tempBuffer [] = null;
@@ -416,6 +414,12 @@
                 return (i - off);
             }
         }
+
+        @Override
+        public long skip(final long n) throws IOException {
+            // Implementation of this method assumes that we support
+            // encoding/decoding from/to 8/16 bits only
+            return encode ? super.skip(n * 2) / 2 : super.skip(n / 2) * 2;
+        }
     } // end class UlawCodecStream
-
 } // end class ULAW
--- a/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,6 @@
                 return false;
             return true;
         }
-
     }
 
     private static final String[] channelnames = { "FL", "FR", "FC", "LF",
@@ -196,9 +195,9 @@
                 fmt_found = true;
 
                 int format = chunk.readUnsignedShort();
-                if (format != 0xFFFE)
-                    throw new UnsupportedAudioFileException(); // WAVE_FORMAT_EXTENSIBLE
-                // only
+                if (format != WaveFileFormat.WAVE_FORMAT_EXTENSIBLE) {
+                    throw new UnsupportedAudioFileException();
+                }
                 channels = chunk.readUnsignedShort();
                 samplerate = chunk.readUnsignedInt();
                 /* framerate = */chunk.readUnsignedInt();
--- a/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,13 +28,11 @@
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioFormat;
 
-
 /**
  * WAVE file format class.
  *
  * @author Jan Borgersen
  */
-
 final class WaveFileFormat extends AudioFileFormat {
 
     /**
@@ -53,15 +51,16 @@
     private static final int STANDARD_FMT_CHUNK_SIZE = 16;
 
     // magic numbers
-    static  final int RIFF_MAGIC         = 1380533830;
-    static  final int WAVE_MAGIC         = 1463899717;
-    static  final int FMT_MAGIC                  = 0x666d7420; // "fmt "
-    static  final int DATA_MAGIC                 = 0x64617461; // "data"
+    static final int RIFF_MAGIC = 1380533830;
+    static final int WAVE_MAGIC = 1463899717;
+    static final int FMT_MAGIC  = 0x666d7420; // "fmt "
+    static final int DATA_MAGIC = 0x64617461; // "data"
 
     // encodings
     static final int WAVE_FORMAT_UNKNOWN   = 0x0000;
     static final int WAVE_FORMAT_PCM       = 0x0001;
     static final int WAVE_FORMAT_ADPCM     = 0x0002;
+    static final int WAVE_FORMAT_IEEE_FLOAT= 0x0003;
     static final int WAVE_FORMAT_ALAW      = 0x0006;
     static final int WAVE_FORMAT_MULAW     = 0x0007;
     static final int WAVE_FORMAT_OKI_ADPCM = 0x0010;
@@ -72,12 +71,7 @@
     static final int WAVE_IBM_FORMAT_ADPCM = 0x0103;
     static final int WAVE_FORMAT_DVI_ADPCM = 0x0011;
     static final int WAVE_FORMAT_SX7383    = 0x1C07;
-
-
-    WaveFileFormat( AudioFileFormat aff ) {
-
-        this( aff.getType(), aff.getByteLength(), aff.getFormat(), aff.getFrameLength() );
-    }
+    static final int WAVE_FORMAT_EXTENSIBLE= 0xFFFE;
 
     WaveFileFormat(AudioFileFormat.Type type, int lengthInBytes, AudioFormat format, int lengthInFrames) {
 
@@ -98,7 +92,6 @@
     }
 
     int getWaveType() {
-
         return waveType;
     }
 
--- a/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,22 @@
 
 package com.sun.media.sound;
 
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
 import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.IOException;
-
-import java.io.BufferedOutputStream;
-import java.io.DataOutputStream;
-import java.io.FileOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.RandomAccessFile;
 import java.io.SequenceInputStream;
 import java.util.Objects;
 
 import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioSystem;
 
 //$$fb this class is buggy. Should be replaced in future.
@@ -53,27 +52,6 @@
  */
 public final class WaveFileWriter extends SunFileWriter {
 
-    // magic numbers
-    static  final int RIFF_MAGIC = 1380533830;
-    static  final int WAVE_MAGIC = 1463899717;
-    static  final int FMT_MAGIC  = 0x666d7420; // "fmt "
-    static  final int DATA_MAGIC = 0x64617461; // "data"
-
-    // encodings
-    static final int WAVE_FORMAT_UNKNOWN   = 0x0000;
-    static final int WAVE_FORMAT_PCM       = 0x0001;
-    static final int WAVE_FORMAT_ADPCM     = 0x0002;
-    static final int WAVE_FORMAT_ALAW      = 0x0006;
-    static final int WAVE_FORMAT_MULAW     = 0x0007;
-    static final int WAVE_FORMAT_OKI_ADPCM = 0x0010;
-    static final int WAVE_FORMAT_DIGISTD   = 0x0015;
-    static final int WAVE_FORMAT_DIGIFIX   = 0x0016;
-    static final int WAVE_IBM_FORMAT_MULAW = 0x0101;
-    static final int WAVE_IBM_FORMAT_ALAW  = 0x0102;
-    static final int WAVE_IBM_FORMAT_ADPCM = 0x0103;
-    static final int WAVE_FORMAT_DVI_ADPCM = 0x0011;
-    static final int WAVE_FORMAT_SX7383    = 0x1C07;
-
     /**
      * Constructs a new WaveFileWriter object.
      */
@@ -81,10 +59,7 @@
         super(new AudioFileFormat.Type[]{AudioFileFormat.Type.WAVE});
     }
 
-
-    // METHODS TO IMPLEMENT AudioFileWriter
-
-
+    @Override
     public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) {
 
         AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length];
@@ -106,6 +81,7 @@
     }
 
 
+    @Override
     public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException {
         Objects.requireNonNull(stream);
         Objects.requireNonNull(fileType);
@@ -125,11 +101,11 @@
             throw new IOException("stream length not specified");
         }
 
-        int bytesWritten = writeWaveFile(stream, waveFileFormat, out);
-        return bytesWritten;
+        return writeWaveFile(stream, waveFileFormat, out);
     }
 
 
+    @Override
     public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException {
         Objects.requireNonNull(stream);
         Objects.requireNonNull(fileType);
@@ -173,6 +149,9 @@
      * Throws IllegalArgumentException if not supported.
      */
     private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) {
+        if (!isFileTypeSupported(type, stream)) {
+            throw new IllegalArgumentException("File type " + type + " not supported.");
+        }
         AudioFormat format = null;
         WaveFileFormat fileFormat = null;
         AudioFormat.Encoding encoding = AudioFormat.Encoding.PCM_SIGNED;
@@ -187,9 +166,6 @@
         float frameRate;
         int fileSize;
 
-        if (!types[0].equals(type)) {
-            throw new IllegalArgumentException("File type " + type + " not supported.");
-        }
         int waveType = WaveFileFormat.WAVE_FORMAT_PCM;
 
         if( AudioFormat.Encoding.ALAW.equals(streamEncoding) ||
@@ -198,9 +174,9 @@
             encoding = streamEncoding;
             sampleSizeInBits = streamFormat.getSampleSizeInBits();
             if (streamEncoding.equals(AudioFormat.Encoding.ALAW)) {
-                waveType = WAVE_FORMAT_ALAW;
+                waveType = WaveFileFormat.WAVE_FORMAT_ALAW;
             } else {
-                waveType = WAVE_FORMAT_MULAW;
+                waveType = WaveFileFormat.WAVE_FORMAT_MULAW;
             }
         } else if ( streamFormat.getSampleSizeInBits()==8 ) {
             encoding = AudioFormat.Encoding.PCM_UNSIGNED;
--- a/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +67,9 @@
                 fmt_found = true;
 
                 int format = chunk.readUnsignedShort();
-                if (format != 3) // WAVE_FORMAT_IEEE_FLOAT only
+                if (format != WaveFileFormat.WAVE_FORMAT_IEEE_FLOAT) {
                     throw new UnsupportedAudioFileException();
+                }
                 channels = chunk.readUnsignedShort();
                 samplerate = chunk.readUnsignedInt();
                 /* framerate = */chunk.readUnsignedInt();
--- a/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java	Thu Feb 04 16:49:26 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,18 +22,20 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.util.Objects;
 
 import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFileFormat.Type;
 import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioFormat.Encoding;
 import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
-import javax.sound.sampled.AudioFileFormat.Type;
 import javax.sound.sampled.spi.AudioFileWriter;
 
 /**
@@ -43,10 +45,12 @@
  */
 public final class WaveFloatFileWriter extends AudioFileWriter {
 
+    @Override
     public Type[] getAudioFileTypes() {
-        return new Type[] { Type.WAVE };
+        return new Type[]{Type.WAVE};
     }
 
+    @Override
     public Type[] getAudioFileTypes(AudioInputStream stream) {
 
         if (!stream.getFormat().getEncoding().equals(Encoding.PCM_FLOAT))
@@ -92,18 +96,22 @@
             this.out = out;
         }
 
+        @Override
         public void write(int b) throws IOException {
             out.write(b);
         }
 
+        @Override
         public void flush() throws IOException {
             out.flush();
         }
 
+        @Override
         public void write(byte[] b, int off, int len) throws IOException {
             out.write(b, off, len);
         }
 
+        @Override
         public void write(byte[] b) throws IOException {
             out.write(b);
         }
@@ -118,8 +126,12 @@
         return AudioSystem.getAudioInputStream(targetFormat, ais);
     }
 
+    @Override
     public int write(AudioInputStream stream, Type fileType, OutputStream out)
             throws IOException {
+        Objects.requireNonNull(stream);
+        Objects.requireNonNull(fileType);
+        Objects.requireNonNull(out);
 
         checkFormat(fileType, stream);
         if (stream.getFormat().isBigEndian())
@@ -131,8 +143,13 @@
         return fpointer;
     }
 
+    @Override
     public int write(AudioInputStream stream, Type fileType, File out)
             throws IOException {
+        Objects.requireNonNull(stream);
+        Objects.requireNonNull(fileType);
+        Objects.requireNonNull(out);
+
         checkFormat(fileType, stream);
         if (stream.getFormat().isBigEndian())
             stream = toLittleEndian(stream);
@@ -142,5 +159,4 @@
         writer.close();
         return fpointer;
     }
-
 }
--- a/src/java.desktop/share/classes/java/applet/Applet.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/java/applet/Applet.java	Thu Feb 04 16:49:26 2016 -0800
@@ -38,9 +38,9 @@
  * An applet is a small program that is intended not to be run on
  * its own, but rather to be embedded inside another application.
  * <p>
- * The <code>Applet</code> class must be the superclass of any
+ * The {@code Applet} class must be the superclass of any
  * applet that is to be embedded in a Web page or viewed by the Java
- * Applet Viewer. The <code>Applet</code> class provides a standard
+ * Applet Viewer. The {@code Applet} class provides a standard
  * interface between applets and their environment.
  *
  * @author      Arthur van Hoff
@@ -52,10 +52,10 @@
     /**
      * Constructs a new Applet.
      * <p>
-     * Note: Many methods in <code>java.applet.Applet</code>
+     * Note: Many methods in {@code java.applet.Applet}
      * may be invoked by the applet only after the applet is
      * fully constructed; applet should avoid calling methods
-     * in <code>java.applet.Applet</code> in the constructor.
+     * in {@code java.applet.Applet} in the constructor.
      *
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
@@ -88,8 +88,8 @@
      * Read an applet from an object input stream.
      * @param  s  an object input stream.
      * @exception HeadlessException if
-     * <code>GraphicsEnvironment.isHeadless()</code> returns
-     * <code>true</code>
+     * {@code GraphicsEnvironment.isHeadless()} returns
+     * {@code true}
      * @serial
      * @see java.awt.GraphicsEnvironment#isHeadless
      * @since 1.4
@@ -104,9 +104,9 @@
 
     /**
      * Sets this applet's stub. This is done automatically by the system.
-     * <p>If there is a security manager, its <code> checkPermission </code>
+     * <p>If there is a security manager, its {@code checkPermission}
      * method is called with the
-     * <code>AWTPermission("setAppletStub")</code>
+     * {@code AWTPermission("setAppletStub")}
      * permission if a stub has already been set.
      * @param   stub   the new stub.
      * @exception SecurityException if the caller cannot set the stub
@@ -123,11 +123,11 @@
 
     /**
      * Determines if this applet is active. An applet is marked active
-     * just before its <code>start</code> method is called. It becomes
-     * inactive just before its <code>stop</code> method is called.
+     * just before its {@code start} method is called. It becomes
+     * inactive just before its {@code stop} method is called.
      *
-     * @return  <code>true</code> if the applet is active;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the applet is active;
+     *          {@code false} otherwise.
      * @see     java.applet.Applet#start()
      * @see     java.applet.Applet#stop()
      */
@@ -179,14 +179,14 @@
      * &lt;/applet&gt;
      * </pre></blockquote>
      * <p>
-     * then a call to <code>getParameter("Color")</code> returns the
-     * value <code>"blue"</code>.
+     * then a call to {@code getParameter("Color")} returns the
+     * value {@code "blue"}.
      * <p>
-     * The <code>name</code> argument is case insensitive.
+     * The {@code name} argument is case insensitive.
      *
      * @param   name   a parameter name.
      * @return  the value of the named parameter,
-     *          or <code>null</code> if not set.
+     *          or {@code null} if not set.
      */
      public String getParameter(String name) {
          return stub.getParameter(name);
@@ -260,8 +260,8 @@
     }
 
     /**
-     * Returns an <code>Image</code> object that can then be painted on
-     * the screen. The <code>url</code> that is passed as an argument
+     * Returns an {@code Image} object that can then be painted on
+     * the screen. The {@code url} that is passed as an argument
      * must specify an absolute URL.
      * <p>
      * This method always returns immediately, whether or not the image
@@ -278,10 +278,10 @@
     }
 
     /**
-     * Returns an <code>Image</code> object that can then be painted on
-     * the screen. The <code>url</code> argument must specify an absolute
-     * URL. The <code>name</code> argument is a specifier that is
-     * relative to the <code>url</code> argument.
+     * Returns an {@code Image} object that can then be painted on
+     * the screen. The {@code url} argument must specify an absolute
+     * URL. The {@code name} argument is a specifier that is
+     * relative to the {@code url} argument.
      * <p>
      * This method always returns immediately, whether or not the image
      * exists. When this applet attempts to draw the image on the screen,
@@ -290,7 +290,7 @@
      *
      * @param   url    an absolute URL giving the base location of the image.
      * @param   name   the location of the image, relative to the
-     *                 <code>url</code> argument.
+     *                 {@code url} argument.
      * @return  the image at the specified URL.
      * @see     java.awt.Image
      */
@@ -315,8 +315,8 @@
     }
 
     /**
-     * Returns the <code>AudioClip</code> object specified by the
-     * <code>URL</code> argument.
+     * Returns the {@code AudioClip} object specified by the
+     * {@code URL} argument.
      * <p>
      * This method always returns immediately, whether or not the audio
      * clip exists. When this applet attempts to play the audio clip, the
@@ -331,8 +331,8 @@
     }
 
     /**
-     * Returns the <code>AudioClip</code> object specified by the
-     * <code>URL</code> and <code>name</code> arguments.
+     * Returns the {@code AudioClip} object specified by the
+     * {@code URL} and {@code name} arguments.
      * <p>
      * This method always returns immediately, whether or not the audio
      * clip exists. When this applet attempts to play the audio clip, the
@@ -341,7 +341,7 @@
      * @param   url    an absolute URL giving the base location of the
      *                 audio clip.
      * @param   name   the location of the audio clip, relative to the
-     *                 <code>url</code> argument.
+     *                 {@code url} argument.
      * @return  the audio clip at the specified URL.
      * @see     java.applet.AudioClip
      */
@@ -355,11 +355,11 @@
 
     /**
      * Returns information about this applet. An applet should override
-     * this method to return a <code>String</code> containing information
+     * this method to return a {@code String} containing information
      * about the author, version, and copyright of the applet.
      * <p>
      * The implementation of this method provided by the
-     * <code>Applet</code> class returns <code>null</code>.
+     * {@code Applet} class returns {@code null}.
      *
      * @return  a string containing information about the author, version, and
      *          copyright of the applet.
@@ -388,10 +388,10 @@
     /**
      * Returns information about the parameters that are understood by
      * this applet. An applet should override this method to return an
-     * array of <code>Strings</code> describing these parameters.
+     * array of {@code Strings} describing these parameters.
      * <p>
      * Each element of the array should be a set of three
-     * <code>Strings</code> containing the name, the type, and a
+     * {@code Strings} containing the name, the type, and a
      * description. For example:
      * <blockquote><pre>
      * String pinfo[][] = {
@@ -402,7 +402,7 @@
      * </pre></blockquote>
      * <p>
      * The implementation of this method provided by the
-     * <code>Applet</code> class returns <code>null</code>.
+     * {@code Applet} class returns {@code null}.
      *
      * @return  an array describing the parameters this applet looks for.
      */
@@ -430,7 +430,7 @@
      * @param   url    an absolute URL giving the base location of the
      *                 audio clip.
      * @param   name   the location of the audio clip, relative to the
-     *                 <code>url</code> argument.
+     *                 {@code url} argument.
      */
     public void play(URL url, String name) {
         AudioClip clip = getAudioClip(url, name);
@@ -442,16 +442,16 @@
     /**
      * Called by the browser or applet viewer to inform
      * this applet that it has been loaded into the system. It is always
-     * called before the first time that the <code>start</code> method is
+     * called before the first time that the {@code start} method is
      * called.
      * <p>
-     * A subclass of <code>Applet</code> should override this method if
+     * A subclass of {@code Applet} should override this method if
      * it has initialization to perform. For example, an applet with
-     * threads would use the <code>init</code> method to create the
-     * threads and the <code>destroy</code> method to kill them.
+     * threads would use the {@code init} method to create the
+     * threads and the {@code destroy} method to kill them.
      * <p>
      * The implementation of this method provided by the
-     * <code>Applet</code> class does nothing.
+     * {@code Applet} class does nothing.
      *
      * @see     java.applet.Applet#destroy()
      * @see     java.applet.Applet#start()
@@ -463,25 +463,25 @@
     /**
      * Called by the browser or applet viewer to inform
      * this applet that it should start its execution. It is called after
-     * the <code>init</code> method and each time the applet is revisited
+     * the {@code init} method and each time the applet is revisited
      * in a Web page.
      * <p>
-     * A subclass of <code>Applet</code> should override this method if
+     * A subclass of {@code Applet} should override this method if
      * it has any operation that it wants to perform each time the Web
      * page containing it is visited. For example, an applet with
-     * animation might want to use the <code>start</code> method to
-     * resume animation, and the <code>stop</code> method to suspend the
+     * animation might want to use the {@code start} method to
+     * resume animation, and the {@code stop} method to suspend the
      * animation.
      * <p>
-     * Note: some methods, such as <code>getLocationOnScreen</code>, can only
+     * Note: some methods, such as {@code getLocationOnScreen}, can only
      * provide meaningful results if the applet is showing.  Because
-     * <code>isShowing</code> returns <code>false</code> when the applet's
-     * <code>start</code> is first called, methods requiring
-     * <code>isShowing</code> to return <code>true</code> should be called from
-     * a <code>ComponentListener</code>.
+     * {@code isShowing} returns {@code false} when the applet's
+     * {@code start} is first called, methods requiring
+     * {@code isShowing} to return {@code true} should be called from
+     * a {@code ComponentListener}.
      * <p>
      * The implementation of this method provided by the
-     * <code>Applet</code> class does nothing.
+     * {@code Applet} class does nothing.
      *
      * @see     java.applet.Applet#destroy()
      * @see     java.applet.Applet#init()
@@ -498,15 +498,15 @@
      * the Web page that contains this applet has been replaced by
      * another page, and also just before the applet is to be destroyed.
      * <p>
-     * A subclass of <code>Applet</code> should override this method if
+     * A subclass of {@code Applet} should override this method if
      * it has any operation that it wants to perform each time the Web
      * page containing it is no longer visible. For example, an applet
-     * with animation might want to use the <code>start</code> method to
-     * resume animation, and the <code>stop</code> method to suspend the
+     * with animation might want to use the {@code start} method to
+     * resume animation, and the {@code stop} method to suspend the
      * animation.
      * <p>
      * The implementation of this method provided by the
-     * <code>Applet</code> class does nothing.
+     * {@code Applet} class does nothing.
      *
      * @see     java.applet.Applet#destroy()
      * @see     java.applet.Applet#init()
@@ -517,17 +517,17 @@
     /**
      * Called by the browser or applet viewer to inform
      * this applet that it is being reclaimed and that it should destroy
-     * any resources that it has allocated. The <code>stop</code> method
-     * will always be called before <code>destroy</code>.
+     * any resources that it has allocated. The {@code stop} method
+     * will always be called before {@code destroy}.
      * <p>
-     * A subclass of <code>Applet</code> should override this method if
+     * A subclass of {@code Applet} should override this method if
      * it has any operation that it wants to perform before it is
      * destroyed. For example, an applet with threads would use the
-     * <code>init</code> method to create the threads and the
-     * <code>destroy</code> method to kill them.
+     * {@code init} method to create the threads and the
+     * {@code destroy} method to kill them.
      * <p>
      * The implementation of this method provided by the
-     * <code>Applet</code> class does nothing.
+     * {@code Applet} class does nothing.
      *
      * @see     java.applet.Applet#init()
      * @see     java.applet.Applet#start()
@@ -561,7 +561,7 @@
 
     /**
      * This class implements accessibility support for the
-     * <code>Applet</code> class.  It provides an implementation of the
+     * {@code Applet} class.  It provides an implementation of the
      * Java Accessibility API appropriate to applet user-interface elements.
      * @since 1.3
      */
--- a/src/java.desktop/share/classes/java/applet/AudioClip.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/java/applet/AudioClip.java	Thu Feb 04 16:49:26 2016 -0800
@@ -26,8 +26,8 @@
 package java.applet;
 
 /**
- * The <code>AudioClip</code> interface is a simple abstraction for
- * playing a sound clip. Multiple <code>AudioClip</code> items can be
+ * The {@code AudioClip} interface is a simple abstraction for
+ * playing a sound clip. Multiple {@code AudioClip} items can be
  * playing at the same time, and the resulting sound is mixed
  * together to produce a composite.
  *
--- a/src/java.desktop/share/classes/java/awt/AWTError.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/java/awt/AWTError.java	Thu Feb 04 16:49:26 2016 -0800
@@ -38,7 +38,7 @@
      private static final long serialVersionUID = -1819846354050686206L;
 
     /**
-     * Constructs an instance of <code>AWTError</code> with the specified
+     * Constructs an instance of {@code AWTError} with the specified
      * detail message.
      * @param   msg   the detail message.
      * @since   1.0
--- a/src/java.desktop/share/classes/java/awt/AWTEvent.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/java/awt/AWTEvent.java	Thu Feb 04 16:49:26 2016 -0800
@@ -410,11 +410,11 @@
     }
 
     /**
-     * Returns a string representing the state of this <code>Event</code>.
+     * Returns a string representing the state of this {@code Event}.
      * This method is intended to be used only for debugging purposes, and the
      * content and format of the returned string may vary between
      * implementations. The returned string may be empty but may not be
-     * <code>null</code>.
+     * {@code null}.
      *
      * @return  a string representation of this event
      */
--- a/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java	Thu Feb 04 16:49:26 2016 -0800
@@ -122,9 +122,9 @@
 
     /**
      * Creates an event multicaster instance which chains listener-a
-     * with listener-b. Input parameters <code>a</code> and <code>b</code>
-     * should not be <code>null</code>, though implementations may vary in
-     * choosing whether or not to throw <code>NullPointerException</code>
+     * with listener-b. Input parameters {@code a} and {@code b}
+     * should not be {@code null}, though implementations may vary in
+     * choosing whether or not to throw {@code NullPointerException}
      * in that case.
      * @param a listener-a
      * @param b listener-b
@@ -1078,30 +1078,30 @@
     /**
      * Returns an array of all the objects chained as
      * <code><em>Foo</em>Listener</code>s by the specified
-     * <code>java.util.EventListener</code>.
+     * {@code java.util.EventListener}.
      * <code><em>Foo</em>Listener</code>s are chained by the
-     * <code>AWTEventMulticaster</code> using the
+     * {@code AWTEventMulticaster} using the
      * <code>add<em>Foo</em>Listener</code> method.
-     * If a <code>null</code> listener is specified, this method returns an
+     * If a {@code null} listener is specified, this method returns an
      * empty array. If the specified listener is not an instance of
-     * <code>AWTEventMulticaster</code>, this method returns an array which
+     * {@code AWTEventMulticaster}, this method returns an array which
      * contains only the specified listener. If no such listeners are chained,
      * this method returns an empty array.
      *
      * @param <T> the listener type
-     * @param l the specified <code>java.util.EventListener</code>
+     * @param l the specified {@code java.util.EventListener}
      * @param listenerType the type of listeners requested; this parameter
      *          should specify an interface that descends from
-     *          <code>java.util.EventListener</code>
+     *          {@code java.util.EventListener}
      * @return an array of all objects chained as
      *          <code><em>Foo</em>Listener</code>s by the specified multicast
      *          listener, or an empty array if no such listeners have been
      *          chained by the specified multicast listener
      * @exception NullPointerException if the specified
      *             {@code listenertype} parameter is {@code null}
-     * @exception ClassCastException if <code>listenerType</code>
+     * @exception ClassCastException if {@code listenerType}
      *          doesn't specify a class or interface that implements
-     *          <code>java.util.EventListener</code>
+     *          {@code java.util.EventListener}
      *
      * @since 1.4
      */
--- a/src/java.desktop/share/classes/java/awt/AWTException.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/java/awt/AWTException.java	Thu Feb 04 16:49:26 2016 -0800
@@ -38,9 +38,9 @@
      private static final long serialVersionUID = -1900414231151323879L;
 
     /**
-     * Constructs an instance of <code>AWTException</code> with the
+     * Constructs an instance of {@code AWTException} with the
      * specified detail message. A detail message is an
-     * instance of <code>String</code> that describes this particular
+     * instance of {@code String} that describes this particular
      * exception.
      * @param   msg     the detail message
      * @since   1.0
--- a/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java	Thu Feb 04 11:28:26 2016 -0800
+++ b/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java	Thu Feb 04 16:49:26 2016 -0800
@@ -37,22 +37,22 @@
 import sun.swing.SwingAccessor;
 
 /**
- * An <code>AWTKeyStroke</code> represents a key action on the
- * keyboard, or equivalent input device. <code>AWTKeyStroke</code>s
+ * An {@code AWTKeyStroke} represents a key action on the
+ * keyboard, or equivalent input device. {@code AWTKeyStroke}s
  * can correspond to only a press or release of a
- * particular key, just as <code>KEY_PRESSED</code> and
- * <code>KEY_RELEASED</code> <code>KeyEvent</code>s do;
+ * particular key, just as {@code KEY_PRESSED} and
+ * {@code KEY_RELEASED KeyEvent}s do;
  * alternately, they can correspond to typing a specific Java character, just
- * as <code>KEY_TYPED</code> <code>KeyEvent</code>s do.
- * In all cases, <code>AWTKeyStroke</code>s can specify modifiers
+ * as {@code KEY_TYPED KeyEvent}s do.
+ * In all cases, {@code AWTKeyStroke}s can specify modifiers
  * (alt, shift, control, meta, altGraph, or a combination thereof) which must be present
  * during the action for an exact match.
  * <p>
- * <code>AWTKeyStrokes</code> are immutable, and are intended
+ * {@code AWTKeyStrokes} are immutable, and are intended
  * to be unique. Client code should never create an
- * <code>AWTKeyStroke</code> on its own, but should instead use
- * a variant of <code>getAWTKeyStroke</code>. Client use of these factory
- * methods allows the <code>AWTKeyStroke</code> implementation
+ * {@code AWTKeyStroke} on its own, but should instead use
+ * a variant of {@code getAWTKeyStroke}. Client use of these factory
+ * methods allows the {@code AWTKeyStroke} implementation
  * to cache and share instances efficiently.
  *
  * @see #getAWTKeyStroke