changeset 15435:3cdae27c90b5 jdk-9+133

Merge
author amurillo
date Mon, 22 Aug 2016 08:27:10 -0700
parents 45cef6862663 71716def08ac
children 8e5362b5a18d ca7fb78b94b6
files src/java.base/share/classes/java/lang/reflect/AbstractClassLoaderValue.java src/java.base/share/classes/java/lang/reflect/ClassLoaderValue.java src/java.desktop/share/classes/sun/java2d/marlin/ArrayCache.java test/java/lang/reflect/ClassLoaderValue/Driver.java test/java/lang/reflect/ClassLoaderValue/java.base/java/lang/reflect/ClassLoaderValueTest.java
diffstat 426 files changed, 14827 insertions(+), 9913 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/macosx/classes/apple/security/AppleProvider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/macosx/classes/apple/security/AppleProvider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -26,6 +26,7 @@
 package apple.security;
 
 import java.security.*;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
 
 /**
  * The Apple Security Provider.
@@ -74,7 +75,7 @@
 
     public AppleProvider() {
         /* We are the Apple provider */
-        super("Apple", 9.0d, info);
+        super("Apple", PROVIDER_VER, info);
 
         final Provider p = this;
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java	Mon Aug 22 08:27:10 2016 -0700
@@ -108,6 +108,11 @@
         }
         try {
             this.prf = Mac.getInstance(prfAlgo);
+            // SunPKCS11 requires a non-empty PBE password
+            if (passwdBytes.length == 0 &&
+                this.prf.getProvider().getName().startsWith("SunPKCS11")) {
+                this.prf = Mac.getInstance(prfAlgo, SunJCE.getInstance());
+            }
         } catch (NoSuchAlgorithmException nsae) {
             // not gonna happen; re-throw just in case
             InvalidKeySpecException ike = new InvalidKeySpecException();
--- a/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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,6 +28,7 @@
 import java.security.AccessController;
 import java.security.Provider;
 import java.security.SecureRandom;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
 
 
 /**
@@ -104,7 +105,7 @@
 
     public SunJCE() {
         /* We are the "SunJCE" provider */
-        super("SunJCE", 9.0d, info);
+        super("SunJCE", PROVIDER_VER, info);
 
         final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" +
             "|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" +
--- a/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java	Mon Aug 22 08:27:10 2016 -0700
@@ -38,6 +38,32 @@
  */
 class GenerateJLIClassesHelper {
 
+    static byte[] generateBasicFormsClassBytes(String className) {
+        ArrayList<LambdaForm> forms = new ArrayList<>();
+        ArrayList<String> names = new ArrayList<>();
+        HashSet<String> dedupSet = new HashSet<>();
+        for (LambdaForm.BasicType type : LambdaForm.BasicType.values()) {
+            LambdaForm zero = LambdaForm.zeroForm(type);
+            String name = zero.kind.defaultLambdaName
+                   + "_" + zero.returnType().basicTypeChar();
+            if (dedupSet.add(name)) {
+                names.add(name);
+                forms.add(zero);
+            }
+
+            LambdaForm identity = LambdaForm.identityForm(type);
+            name = identity.kind.defaultLambdaName
+                   + "_" + identity.returnType().basicTypeChar();
+            if (dedupSet.add(name)) {
+                names.add(name);
+                forms.add(identity);
+            }
+        }
+        return generateCodeBytesForLFs(className,
+                names.toArray(new String[0]),
+                forms.toArray(new LambdaForm[0]));
+    }
+
     static byte[] generateDirectMethodHandleHolderClassBytes(String className,
             MethodType[] methodTypes, int[] types) {
         LambdaForm[] forms = new LambdaForm[methodTypes.length];
--- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Mon Aug 22 08:27:10 2016 -0700
@@ -624,6 +624,11 @@
                 return resolveFrom(name, invokerType, DelegatingMethodHandle.Holder.class);
             }
             case DELEGATE:                  return resolveFrom(name, invokerType, DelegatingMethodHandle.Holder.class);
+            case ZERO:                      // fall-through
+            case IDENTITY: {
+                name = name + "_" + form.returnType().basicTypeChar();
+                return resolveFrom(name, invokerType, LambdaForm.Holder.class);
+            }
             case DIRECT_INVOKE_INTERFACE:   // fall-through
             case DIRECT_INVOKE_SPECIAL:     // fall-through
             case DIRECT_INVOKE_STATIC:      // fall-through
--- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Mon Aug 22 08:27:10 2016 -0700
@@ -270,6 +270,8 @@
 
     enum Kind {
         GENERIC(""),
+        ZERO("zero"),
+        IDENTITY("identity"),
         BOUND_REINVOKER("BMH.reinvoke"),
         REINVOKER("MH.reinvoke"),
         DELEGATE("MH.delegate"),
@@ -1848,7 +1850,7 @@
         // bootstrap dependency on this method in case we're interpreting LFs
         if (isVoid) {
             Name[] idNames = new Name[] { argument(0, L_TYPE) };
-            idForm = new LambdaForm(idMem.getName(), 1, idNames, VOID_RESULT);
+            idForm = new LambdaForm(idMem.getName(), 1, idNames, VOID_RESULT, Kind.IDENTITY);
             idForm.compileToBytecode();
             idFun = new NamedFunction(idMem, SimpleMethodHandle.make(idMem.getInvocationType(), idForm));
 
@@ -1856,15 +1858,17 @@
             zeFun = idFun;
         } else {
             Name[] idNames = new Name[] { argument(0, L_TYPE), argument(1, type) };
-            idForm = new LambdaForm(idMem.getName(), 2, idNames, 1);
+            idForm = new LambdaForm(idMem.getName(), 2, idNames, 1, Kind.IDENTITY);
             idForm.compileToBytecode();
-            idFun = new NamedFunction(idMem, SimpleMethodHandle.make(idMem.getInvocationType(), idForm));
+            idFun = new NamedFunction(idMem, MethodHandleImpl.makeIntrinsic(
+                    idMem.getInvocationType(), idForm, MethodHandleImpl.Intrinsic.IDENTITY));
 
             Object zeValue = Wrapper.forBasicType(btChar).zero();
             Name[] zeNames = new Name[] { argument(0, L_TYPE), new Name(idFun, zeValue) };
-            zeForm = new LambdaForm(zeMem.getName(), 1, zeNames, 1);
+            zeForm = new LambdaForm(zeMem.getName(), 1, zeNames, 1, Kind.ZERO);
             zeForm.compileToBytecode();
-            zeFun = new NamedFunction(zeMem, SimpleMethodHandle.make(zeMem.getInvocationType(), zeForm));
+            zeFun = new NamedFunction(zeMem, MethodHandleImpl.makeIntrinsic(
+                    zeMem.getInvocationType(), zeForm, MethodHandleImpl.Intrinsic.ZERO));
         }
 
         LF_zero[ord] = zeForm;
@@ -1921,8 +1925,17 @@
         if (USE_PREDEFINED_INTERPRET_METHODS)
             computeInitialPreparedForms();
         NamedFunction.initializeInvokers();
+
+        // The Holder class will contain pre-generated forms resolved
+        // using MemberName.getFactory(). However, that doesn't initialize the
+        // class, which subtly breaks inlining etc. By forcing
+        // initialization of the Holder class we avoid these issues.
+        UNSAFE.ensureClassInitialized(Holder.class);
     }
 
+    /* Placeholder class for zero and identity forms generated ahead of time */
+    final class Holder {}
+
     // The following hack is necessary in order to suppress TRACE_INTERPRETER
     // during execution of the static initializes of this class.
     // Turning on TRACE_INTERPRETER too early will cause
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1739,6 +1739,12 @@
                 return GenerateJLIClassesHelper
                         .generateConcreteBMHClassBytes(types);
             }
+
+            @Override
+            public byte[] generateBasicFormsClassBytes(final String className) {
+                return GenerateJLIClassesHelper
+                        .generateBasicFormsClassBytes(className);
+            }
         });
     }
 
@@ -1934,7 +1940,7 @@
      * @return whether the counter has reached the limit.
      */
     static boolean countedLoopPredicate(int counter, int limit) {
-        return counter <= limit;
+        return counter < limit;
     }
 
     /**
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Mon Aug 22 08:27:10 2016 -0700
@@ -4583,7 +4583,8 @@
      *     // assume MH_decrement is a handle to x-1 of type int
      *     MethodHandle[]
      *         indexVar = {start, MH_increment}, // i = start; i = i+1
-     *         loopLimit = {end, null, MH_lessThan, returnVar }, // i<end
+     *         loopLimit = {end, null,
+     *                       filterArgument(MH_lessThan, 0, MH_decrement), returnVar}, // i-1<end
      *         bodyClause = {init,
      *                       filterArgument(dropArguments(body, 1, int.class), 0, MH_decrement}; // v = body(i-1, v)
      *     return loop(indexVar, loopLimit, bodyClause);
@@ -4619,12 +4620,12 @@
         MethodHandle actualBody = body == null ? dropArguments(defaultResultHandle, 0, int.class) : body;
         MethodHandle returnVar = dropArguments(defaultResultHandle, 0, int.class, int.class);
         MethodHandle actualEnd = end == null ? constant(int.class, 0) : end;
+        MethodHandle decr = MethodHandleImpl.getConstantHandle(MethodHandleImpl.MH_decrementCounter);
         MethodHandle[] indexVar = {start, MethodHandleImpl.getConstantHandle(MethodHandleImpl.MH_countedLoopStep)};
         MethodHandle[] loopLimit = {actualEnd, null,
-                MethodHandleImpl.getConstantHandle(MethodHandleImpl.MH_countedLoopPred), returnVar};
-        MethodHandle[] bodyClause = {actualInit,
-                filterArgument(dropArguments(actualBody, 1, int.class), 0,
-                        MethodHandleImpl.getConstantHandle(MethodHandleImpl.MH_decrementCounter))};
+                filterArgument(MethodHandleImpl.getConstantHandle(MethodHandleImpl.MH_countedLoopPred), 0, decr),
+                returnVar};
+        MethodHandle[] bodyClause = {actualInit, filterArgument(dropArguments(actualBody, 1, int.class), 0, decr)};
         return loop(indexVar, loopLimit, bodyClause);
     }
 
--- a/src/java.base/share/classes/java/lang/reflect/AbstractClassLoaderValue.java	Fri Aug 19 11:22:17 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,431 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.lang.reflect;
-
-import jdk.internal.loader.BootLoader;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
-
-import java.util.Iterator;
-import java.util.Objects;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.BiFunction;
-import java.util.function.Supplier;
-
-/**
- * AbstractClassLoaderValue is a superclass of root-{@link ClassLoaderValue}
- * and {@link Sub sub}-ClassLoaderValue.
- *
- * @param <CLV> the type of concrete ClassLoaderValue (this type)
- * @param <V>   the type of values associated with ClassLoaderValue
- */
-abstract class AbstractClassLoaderValue<CLV extends AbstractClassLoaderValue<CLV, V>, V> {
-
-    /**
-     * Sole constructor.
-     */
-    AbstractClassLoaderValue() {}
-
-    /**
-     * Returns the key component of this ClassLoaderValue. The key component of
-     * the root-{@link ClassLoaderValue} is the ClassLoaderValue itself,
-     * while the key component of a {@link #sub(Object) sub}-ClassLoaderValue
-     * is what was given to construct it.
-     *
-     * @return the key component of this ClassLoaderValue.
-     */
-    public abstract Object key();
-
-    /**
-     * Constructs new sub-ClassLoaderValue of this ClassLoaderValue with given
-     * key component.
-     *
-     * @param key the key component of the sub-ClassLoaderValue.
-     * @param <K> the type of the key component.
-     * @return a sub-ClassLoaderValue of this ClassLoaderValue for given key
-     */
-    public <K> Sub<K> sub(K key) {
-        return new Sub<>(key);
-    }
-
-    /**
-     * Returns {@code true} if this ClassLoaderValue is equal to given {@code clv}
-     * or if this ClassLoaderValue was derived from given {@code clv} by a chain
-     * of {@link #sub(Object)} invocations.
-     *
-     * @param clv the ClassLoaderValue to test this against
-     * @return if this ClassLoaderValue is equal to given {@code clv} or
-     * its descendant
-     */
-    public abstract boolean isEqualOrDescendantOf(AbstractClassLoaderValue<?, V> clv);
-
-    /**
-     * Returns the value associated with this ClassLoaderValue and given ClassLoader
-     * or {@code null} if there is none.
-     *
-     * @param cl the ClassLoader for the associated value
-     * @return the value associated with this ClassLoaderValue and given ClassLoader
-     * or {@code null} if there is none.
-     */
-    public V get(ClassLoader cl) {
-        Object val = AbstractClassLoaderValue.<CLV>map(cl).get(this);
-        try {
-            return extractValue(val);
-        } catch (Memoizer.RecursiveInvocationException e) {
-            // propagate recursive get() for the same key that is just
-            // being calculated in computeIfAbsent()
-            throw e;
-        } catch (Throwable t) {
-            // don't propagate exceptions thrown from Memoizer - pretend
-            // that there was no entry
-            // (computeIfAbsent invocation will try to remove it anyway)
-            return null;
-        }
-    }
-
-    /**
-     * Associates given value {@code v} with this ClassLoaderValue and given
-     * ClassLoader and returns {@code null} if there was no previously associated
-     * value or does nothing and returns previously associated value if there
-     * was one.
-     *
-     * @param cl the ClassLoader for the associated value
-     * @param v  the value to associate
-     * @return previously associated value or null if there was none
-     */
-    public V putIfAbsent(ClassLoader cl, V v) {
-        ConcurrentHashMap<CLV, Object> map = map(cl);
-        @SuppressWarnings("unchecked")
-        CLV clv = (CLV) this;
-        while (true) {
-            try {
-                Object val = map.putIfAbsent(clv, v);
-                return extractValue(val);
-            } catch (Memoizer.RecursiveInvocationException e) {
-                // propagate RecursiveInvocationException for the same key that
-                // is just being calculated in computeIfAbsent
-                throw e;
-            } catch (Throwable t) {
-                // don't propagate exceptions thrown from foreign Memoizer -
-                // pretend that there was no entry and retry
-                // (foreign computeIfAbsent invocation will try to remove it anyway)
-            }
-            // TODO:
-            // Thread.onSpinLoop(); // when available
-        }
-    }
-
-    /**
-     * Removes the value associated with this ClassLoaderValue and given
-     * ClassLoader if the associated value is equal to given value {@code v} and
-     * returns {@code true} or does nothing and returns {@code false} if there is
-     * no currently associated value or it is not equal to given value {@code v}.
-     *
-     * @param cl the ClassLoader for the associated value
-     * @param v  the value to compare with currently associated value
-     * @return {@code true} if the association was removed or {@code false} if not
-     */
-    public boolean remove(ClassLoader cl, Object v) {
-        return AbstractClassLoaderValue.<CLV>map(cl).remove(this, v);
-    }
-
-    /**
-     * Returns the value associated with this ClassLoaderValue and given
-     * ClassLoader if there is one or computes the value by invoking given
-     * {@code mappingFunction}, associates it and returns it.
-     * <p>
-     * Computation and association of the computed value is performed atomically
-     * by the 1st thread that requests a particular association while holding a
-     * lock associated with this ClassLoaderValue and given ClassLoader.
-     * Nested calls from the {@code mappingFunction} to {@link #get},
-     * {@link #putIfAbsent} or {@link #computeIfAbsent} for the same association
-     * are not allowed and throw {@link IllegalStateException}. Nested call to
-     * {@link #remove} for the same association is allowed but will always return
-     * {@code false} regardless of passed-in comparison value. Nested calls for
-     * other association(s) are allowed, but care should be taken to avoid
-     * deadlocks. When two threads perform nested computations of the overlapping
-     * set of associations they should always request them in the same order.
-     *
-     * @param cl              the ClassLoader for the associated value
-     * @param mappingFunction the function to compute the value
-     * @return the value associated with this ClassLoaderValue and given
-     * ClassLoader.
-     * @throws IllegalStateException if a direct or indirect invocation from
-     *                               within given {@code mappingFunction} that
-     *                               computes the value of a particular association
-     *                               to {@link #get}, {@link #putIfAbsent} or
-     *                               {@link #computeIfAbsent}
-     *                               for the same association is attempted.
-     */
-    public V computeIfAbsent(ClassLoader cl,
-                             BiFunction<
-                                 ? super ClassLoader,
-                                 ? super CLV,
-                                 ? extends V
-                                 > mappingFunction) throws IllegalStateException {
-        ConcurrentHashMap<CLV, Object> map = map(cl);
-        @SuppressWarnings("unchecked")
-        CLV clv = (CLV) this;
-        Memoizer<CLV, V> mv = null;
-        while (true) {
-            Object val = (mv == null) ? map.get(clv) : map.putIfAbsent(clv, mv);
-            if (val == null) {
-                if (mv == null) {
-                    // create Memoizer lazily when 1st needed and restart loop
-                    mv = new Memoizer<>(cl, clv, mappingFunction);
-                    continue;
-                }
-                // mv != null, therefore sv == null was a result of successful
-                // putIfAbsent
-                try {
-                    // trigger Memoizer to compute the value
-                    V v = mv.get();
-                    // attempt to replace our Memoizer with the value
-                    map.replace(clv, mv, v);
-                    // return computed value
-                    return v;
-                } catch (Throwable t) {
-                    // our Memoizer has thrown, attempt to remove it
-                    map.remove(clv, mv);
-                    // propagate exception because it's from our Memoizer
-                    throw t;
-                }
-            } else {
-                try {
-                    return extractValue(val);
-                } catch (Memoizer.RecursiveInvocationException e) {
-                    // propagate recursive attempts to calculate the same
-                    // value as being calculated at the moment
-                    throw e;
-                } catch (Throwable t) {
-                    // don't propagate exceptions thrown from foreign Memoizer -
-                    // pretend that there was no entry and retry
-                    // (foreign computeIfAbsent invocation will try to remove it anyway)
-                }
-            }
-            // TODO:
-            // Thread.onSpinLoop(); // when available
-        }
-    }
-
-    /**
-     * Removes all values associated with given ClassLoader {@code cl} and
-     * {@link #isEqualOrDescendantOf(AbstractClassLoaderValue) this or descendants}
-     * of this ClassLoaderValue.
-     * This is not an atomic operation. Other threads may see some associations
-     * be already removed and others still present while this method is executing.
-     * <p>
-     * The sole intention of this method is to cleanup after a unit test that
-     * tests ClassLoaderValue directly. It is not intended for use in
-     * actual algorithms.
-     *
-     * @param cl the associated ClassLoader of the values to be removed
-     */
-    public void removeAll(ClassLoader cl) {
-        ConcurrentHashMap<CLV, Object> map = map(cl);
-        for (Iterator<CLV> i = map.keySet().iterator(); i.hasNext(); ) {
-            if (i.next().isEqualOrDescendantOf(this)) {
-                i.remove();
-            }
-        }
-    }
-
-    private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
-
-    /**
-     * @return a ConcurrentHashMap for given ClassLoader
-     */
-    @SuppressWarnings("unchecked")
-    private static <CLV extends AbstractClassLoaderValue<CLV, ?>>
-    ConcurrentHashMap<CLV, Object> map(ClassLoader cl) {
-        return (ConcurrentHashMap<CLV, Object>)
-            (cl == null ? BootLoader.getClassLoaderValueMap()
-                        : JLA.createOrGetClassLoaderValueMap(cl));
-    }
-
-    /**
-     * @return value extracted from the {@link Memoizer} if given
-     * {@code memoizerOrValue} parameter is a {@code Memoizer} or
-     * just return given parameter.
-     */
-    @SuppressWarnings("unchecked")
-    private V extractValue(Object memoizerOrValue) {
-        if (memoizerOrValue instanceof Memoizer) {
-            return ((Memoizer<?, V>) memoizerOrValue).get();
-        } else {
-            return (V) memoizerOrValue;
-        }
-    }
-
-    /**
-     * A memoized supplier that invokes given {@code mappingFunction} just once
-     * and remembers the result or thrown exception for subsequent calls.
-     * If given mappingFunction returns null, it is converted to NullPointerException,
-     * thrown from the Memoizer's {@link #get()} method and remembered.
-     * If the Memoizer is invoked recursively from the given {@code mappingFunction},
-     * {@link RecursiveInvocationException} is thrown, but it is not remembered.
-     * The in-flight call to the {@link #get()} can still complete successfully if
-     * such exception is handled by the mappingFunction.
-     */
-    private static final class Memoizer<CLV extends AbstractClassLoaderValue<CLV, V>, V>
-        implements Supplier<V> {
-
-        private final ClassLoader cl;
-        private final CLV clv;
-        private final BiFunction<? super ClassLoader, ? super CLV, ? extends V>
-            mappingFunction;
-
-        private volatile V v;
-        private volatile Throwable t;
-        private boolean inCall;
-
-        Memoizer(ClassLoader cl,
-                 CLV clv,
-                 BiFunction<? super ClassLoader, ? super CLV, ? extends V>
-                     mappingFunction
-        ) {
-            this.cl = cl;
-            this.clv = clv;
-            this.mappingFunction = mappingFunction;
-        }
-
-        @Override
-        public V get() throws RecursiveInvocationException {
-            V v = this.v;
-            if (v != null) return v;
-            Throwable t = this.t;
-            if (t == null) {
-                synchronized (this) {
-                    if ((v = this.v) == null && (t = this.t) == null) {
-                        if (inCall) {
-                            throw new RecursiveInvocationException();
-                        }
-                        inCall = true;
-                        try {
-                            this.v = v = Objects.requireNonNull(
-                                mappingFunction.apply(cl, clv));
-                        } catch (Throwable x) {
-                            this.t = t = x;
-                        } finally {
-                            inCall = false;
-                        }
-                    }
-                }
-            }
-            if (v != null) return v;
-            if (t instanceof Error) {
-                throw (Error) t;
-            } else if (t instanceof RuntimeException) {
-                throw (RuntimeException) t;
-            } else {
-                throw new UndeclaredThrowableException(t);
-            }
-        }
-
-        static class RecursiveInvocationException extends IllegalStateException {
-            private static final long serialVersionUID = 1L;
-
-            RecursiveInvocationException() {
-                super("Recursive call");
-            }
-        }
-    }
-
-    /**
-     * sub-ClassLoaderValue is an inner class of {@link AbstractClassLoaderValue}
-     * and also a subclass of it. It can therefore be instantiated as an inner
-     * class of either an instance of root-{@link ClassLoaderValue} or another
-     * instance of itself. This enables composing type-safe compound keys of
-     * arbitrary length:
-     * <pre>{@code
-     * ClassLoaderValue<V> clv = new ClassLoaderValue<>();
-     * ClassLoaderValue<V>.Sub<K1>.Sub<K2>.Sub<K3> clv_k123 =
-     *     clv.sub(k1).sub(k2).sub(k3);
-     * }</pre>
-     * From which individual components are accessible in a type-safe way:
-     * <pre>{@code
-     * K1 k1 = clv_k123.parent().parent().key();
-     * K2 k2 = clv_k123.parent().key();
-     * K3 k3 = clv_k123.key();
-     * }</pre>
-     * This allows specifying non-capturing lambdas for the mapping function of
-     * {@link #computeIfAbsent(ClassLoader, BiFunction)} operation that can
-     * access individual key components from passed-in
-     * sub-[sub-...]ClassLoaderValue instance in a type-safe way.
-     *
-     * @param <K> the type of {@link #key()} component contained in the
-     *            sub-ClassLoaderValue.
-     */
-    final class Sub<K> extends AbstractClassLoaderValue<Sub<K>, V> {
-
-        private final K key;
-
-        Sub(K key) {
-            this.key = key;
-        }
-
-        /**
-         * @return the parent ClassLoaderValue this sub-ClassLoaderValue
-         * has been {@link #sub(Object) derived} from.
-         */
-        public AbstractClassLoaderValue<CLV, V> parent() {
-            return AbstractClassLoaderValue.this;
-        }
-
-        /**
-         * @return the key component of this sub-ClassLoaderValue.
-         */
-        @Override
-        public K key() {
-            return key;
-        }
-
-        /**
-         * sub-ClassLoaderValue is a descendant of given {@code clv} if it is
-         * either equal to it or if its {@link #parent() parent} is a
-         * descendant of given {@code clv}.
-         */
-        @Override
-        public boolean isEqualOrDescendantOf(AbstractClassLoaderValue<?, V> clv) {
-            return equals(Objects.requireNonNull(clv)) ||
-                   parent().isEqualOrDescendantOf(clv);
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (this == o) return true;
-            if (!(o instanceof Sub)) return false;
-            @SuppressWarnings("unchecked")
-            Sub<?> that = (Sub<?>) o;
-            return this.parent().equals(that.parent()) &&
-                   Objects.equals(this.key, that.key);
-        }
-
-        @Override
-        public int hashCode() {
-            return 31 * parent().hashCode() +
-                   Objects.hashCode(key);
-        }
-    }
-}
--- a/src/java.base/share/classes/java/lang/reflect/ClassLoaderValue.java	Fri Aug 19 11:22:17 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.lang.reflect;
-
-import java.util.Objects;
-import java.util.function.BiFunction;
-
-/**
- * root-ClassLoaderValue. Each instance defines a separate namespace for
- * associated values.
- * <p>
- * ClassLoaderValue allows associating a
- * {@link #computeIfAbsent(ClassLoader, BiFunction) computed} non-null value with
- * a {@code (ClassLoader, keys...)} tuple. The associated value, as well as the
- * keys are strongly reachable from the associated ClassLoader so care should be
- * taken to use such keys and values that only reference types resolvable from
- * the associated ClassLoader. Failing that, ClassLoader leaks are inevitable.
- * <p>
- * Example usage:
- * <pre>{@code
- * // create a root instance which represents a namespace and declares the type of
- * // associated values (Class instances in this example)
- * static final ClassLoaderValue<Class<?>> proxyClasses = new ClassLoaderValue<>();
- *
- * // create a compound key composed of a Module and a list of interfaces
- * Module module = ...;
- * List<Class<?>> interfaces = ...;
- * ClassLoaderValue<Class<?>>.Sub<Module>.Sub<List<Class<?>>> key =
- *     proxyClasses.sub(module).sub(interfaces);
- *
- * // use the compound key together with ClassLoader to lazily associate
- * // the value with tuple (loader, module, interfaces) and return it
- * ClassLoader loader = ...;
- * Class<?> proxyClass = key.computeIfAbsent(loader, (ld, ky) -> {
- *     List<Class<?>> intfcs = ky.key();
- *     Module m = ky.parent().key();
- *     Class<?> clazz = defineProxyClass(ld, m, intfcs);
- *     return clazz;
- * });
- * }</pre>
- * <p>
- * {@code classLoaderValue.<operation>(classLoader, ...)} represents an operation
- * to {@link #get}, {@link #putIfAbsent}, {@link #computeIfAbsent} or {@link #remove}
- * a value associated with a (classLoader, classLoaderValue) tuple. ClassLoader
- * instances and root-{@link ClassLoaderValue} instances are compared using
- * identity equality while {@link Sub sub}-ClassLoaderValue instances define
- * {@link #equals(Object) equality} in terms of equality of its
- * {@link Sub#parent() parent} ClassLoaderValue and its
- * {@link #key() key} component.
- *
- * @param <V> the type of value(s) associated with the root-ClassLoaderValue and
- *            all its {@link #sub(Object) descendants}.
- * @author Peter Levart
- * @since 9
- */
-final class ClassLoaderValue<V>
-    extends AbstractClassLoaderValue<ClassLoaderValue<V>, V> {
-
-    /**
-     * Constructs new root-ClassLoaderValue representing its own namespace.
-     */
-    public ClassLoaderValue() {}
-
-    /**
-     * @return the key component of this root-ClassLoaderValue (itself).
-     */
-    @Override
-    public ClassLoaderValue<V> key() {
-        return this;
-    }
-
-    /**
-     * root-ClassLoaderValue can only be equal to itself and has no predecessors.
-     */
-    @Override
-    public boolean isEqualOrDescendantOf(AbstractClassLoaderValue<?, V> clv) {
-        return equals(Objects.requireNonNull(clv));
-    }
-}
--- a/src/java.base/share/classes/java/lang/reflect/Proxy.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/lang/reflect/Proxy.java	Mon Aug 22 08:27:10 2016 -0700
@@ -29,11 +29,9 @@
 import java.security.PrivilegedAction;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.Deque;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.IdentityHashMap;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -49,6 +47,7 @@
 import jdk.internal.misc.VM;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
+import jdk.internal.loader.ClassLoaderValue;
 import sun.reflect.misc.ReflectUtil;
 import sun.security.action.GetPropertyAction;
 import sun.security.util.SecurityConstants;
--- a/src/java.base/share/classes/java/security/AuthProvider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/security/AuthProvider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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
@@ -50,9 +50,24 @@
      * @param name the provider name.
      * @param version the provider version number.
      * @param info a description of the provider and its services.
+     * @deprecated use {@link #AuthProvider(String, String, String)} instead.
      */
+    @Deprecated(since="9")
     protected AuthProvider(String name, double version, String info) {
-        super(name, version, info);
+        super(name, Double.toString(version), info);
+    }
+
+    /**
+     * Constructs a provider with the specified name, version string,
+     * and information.
+     *
+     * @param name the provider name.
+     * @param versionStr the provider version string.
+     * @param info a description of the provider and its services.
+     * @since 9
+     */
+    protected AuthProvider(String name, String versionStr, String info) {
+        super(name, versionStr, info);
     }
 
     /**
--- a/src/java.base/share/classes/java/security/Provider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/security/Provider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -67,14 +67,14 @@
  * <tr><td>{@code Provider.id name}</td>
   *    <td>{@code String.valueOf(provider.getName())}</td>
  * <tr><td>{@code Provider.id version}</td>
- *     <td>{@code String.valueOf(provider.getVersion())}</td>
+ *     <td>{@code String.valueOf(provider.getVersionStr())}</td>
  * <tr><td>{@code Provider.id info}</td>
        <td>{@code String.valueOf(provider.getInfo())}</td>
  * <tr><td>{@code Provider.id className}</td>
  *     <td>{@code provider.getClass().getName()}</td>
  * </table>
  *
- * <p>Each provider has a name and a version number. A provider normally
+ * <p>Each provider has a name and a version string. A provider normally
  * identifies itself with a file named {@code java.security.Provider}
  * in the resource directory {@code META-INF/services}.
  * Security providers are looked up via the {@link ServiceLoader} mechanism
@@ -102,11 +102,10 @@
 public abstract class Provider extends Properties {
 
     // Declare serialVersionUID to be compatible with JDK1.1
-    static final long serialVersionUID = -4298000515446427739L;
+    private static final long serialVersionUID = -4298000515446427739L;
 
     private static final sun.security.util.Debug debug =
-        sun.security.util.Debug.getInstance
-        ("provider", "Provider");
+        sun.security.util.Debug.getInstance("provider", "Provider");
 
     /**
      * The provider name.
@@ -129,6 +128,12 @@
      */
     private double version;
 
+    /**
+     * The provider version string.
+     *
+     * @serial
+     */
+    private String versionStr;
 
     private transient Set<Map.Entry<Object,Object>> entrySet = null;
     private transient int entrySetCallCount = 0;
@@ -174,19 +179,83 @@
         }
     }
 
+    private static double parseVersionStr(String s) {
+        try {
+            int firstDotIdx = s.indexOf('.');
+            int nextDotIdx = s.indexOf('.', firstDotIdx + 1);
+            if (nextDotIdx != -1) {
+                s = s.substring(0, nextDotIdx);
+            }
+            int endIdx = s.indexOf('-');
+            if (endIdx > 0) {
+                s = s.substring(0, endIdx);
+            }
+            endIdx = s.indexOf('+');
+            if (endIdx > 0) {
+                s = s.substring(0, endIdx);
+            }
+            return Double.parseDouble(s);
+        } catch (NullPointerException | NumberFormatException e) {
+            return 0d;
+        }
+    }
+
     /**
      * Constructs a provider with the specified name, version number,
-     * and information.
+     * and information. Calling this constructor is equivalent to call the
+     * {@link #Provider(String, String, String)} with {@code name}
+     * name, {@code Double.toString(version)}, and {@code info}.
      *
      * @param name the provider name.
      *
      * @param version the provider version number.
      *
      * @param info a description of the provider and its services.
+     *
+     * @deprecated use {@link #Provider(String, String, String)} instead.
      */
+    @Deprecated(since="9")
     protected Provider(String name, double version, String info) {
         this.name = name;
         this.version = version;
+        this.versionStr = Double.toString(version);
+        this.info = info;
+        putId();
+        initialized = true;
+    }
+
+    /**
+     * Constructs a provider with the specified name, version string,
+     * and information.
+     *
+     * <p>The version string contains a version number optionally followed
+     * by other information separated by one of the characters of '+', '-'.
+     *
+     * The format for the version number is:
+     *
+     * <blockquote><pre>
+     *     ^[0-9]+(\.[0-9]+)*
+     * </pre></blockquote>
+     *
+     * <p>In order to return the version number in a double, when there are
+     * more than two components (separated by '.' as defined above), only
+     * the first two components are retained. The resulting string is then
+     * passed to {@link Double#valueOf(String)} to generate version number,
+     * i.e. {@link #getVersion}.
+     * <p>If the conversion failed, value 0 will be used.
+     *
+     * @param name the provider name.
+     *
+     * @param versionStr the provider version string.
+     *
+     * @param info a description of the provider and its services.
+     *
+     * @since 9
+     */
+    protected Provider(String name, String versionStr, String info) {
+        this.name = name;
+        this.versionStr = versionStr;
+        this.version = parseVersionStr(versionStr);
         this.info = info;
         putId();
         initialized = true;
@@ -250,12 +319,26 @@
      * Returns the version number for this provider.
      *
      * @return the version number for this provider.
+     *
+     * @deprecated use {@link #getVersionStr} instead.
      */
+    @Deprecated(since="9")
     public double getVersion() {
         return version;
     }
 
     /**
+     * Returns the version string for this provider.
+     *
+     * @return the version string for this provider.
+     *
+     * @since 9
+     */
+    public String getVersionStr() {
+        return versionStr;
+    }
+
+    /**
      * Returns a human-readable description of the provider and its
      * services.  This may return an HTML page, with relevant links.
      *
@@ -266,14 +349,14 @@
     }
 
     /**
-     * Returns a string with the name and the version number
+     * Returns a string with the name and the version string
      * of this provider.
      *
-     * @return the string with the name and the version number
+     * @return the string with the name and the version string
      * for this provider.
      */
     public String toString() {
-        return name + " version " + version;
+        return name + " version " + versionStr;
     }
 
     /*
@@ -787,11 +870,21 @@
     private void putId() {
         // note: name and info may be null
         super.put("Provider.id name", String.valueOf(name));
-        super.put("Provider.id version", String.valueOf(version));
+        super.put("Provider.id version", String.valueOf(versionStr));
         super.put("Provider.id info", String.valueOf(info));
         super.put("Provider.id className", this.getClass().getName());
     }
 
+   /**
+    * Reads the {@code ObjectInputStream} for the default serializable fields.
+    * If the serialized field {@code versionStr} is found in the STREAM FIELDS,
+    * its String value will be used to populate both the version string and
+    * version number. If {@code versionStr} is not found, but {@code version}
+    * is, then its double value will be used to populate both fields.
+    *
+    * @param in the {@code ObjectInputStream} to read
+    * @serial
+    */
     private void readObject(ObjectInputStream in)
                 throws IOException, ClassNotFoundException {
         Map<Object,Object> copy = new HashMap<>();
@@ -800,6 +893,13 @@
         }
         defaults = null;
         in.defaultReadObject();
+        if (this.versionStr == null) {
+            // set versionStr based on version when not found in serialized bytes
+            this.versionStr = Double.toString(this.version);
+        } else {
+            // otherwise, set version based on versionStr
+            this.version = parseVersionStr(this.versionStr);
+        }
         implClear();
         initialized = true;
         putAll(copy);
@@ -1913,7 +2013,5 @@
             return provider.getName() + ": " + type + "." + algorithm
                 + " -> " + className + aString + attrs + "\r\n";
         }
-
     }
-
 }
--- a/src/java.base/share/classes/java/util/Date.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/util/Date.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -952,6 +952,9 @@
      * without affecting its internal state.
      */
     static final long getMillisOf(Date date) {
+        if (date.getClass() != Date.class) {
+            return date.getTime();
+        }
         if (date.cdate == null || date.cdate.isNormalized()) {
             return date.fastTime;
         }
--- a/src/java.base/share/classes/java/util/stream/Collectors.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/java/util/stream/Collectors.java	Mon Aug 22 08:27:10 2016 -0700
@@ -295,7 +295,13 @@
     public static <T>
     Collector<T, ?, Set<T>> toSet() {
         return new CollectorImpl<>((Supplier<Set<T>>) HashSet::new, Set::add,
-                                   (left, right) -> { left.addAll(right); return left; },
+                                   (left, right) -> {
+                                       if (left.size() < right.size()) {
+                                           right.addAll(left); return right;
+                                       } else {
+                                           left.addAll(right); return left;
+                                       }
+                                   },
                                    CH_UNORDERED_ID);
     }
 
--- a/src/java.base/share/classes/jdk/internal/jrtfs/jrtfsviewer.js	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/jrtfsviewer.js	Mon Aug 22 08:27:10 2016 -0700
@@ -53,6 +53,7 @@
 var Files = Java.type("java.nio.file.Files");
 var System = Java.type("java.lang.System");
 var URI = Java.type("java.net.URI");
+var Collections = Java.type("java.util.Collections");
 
 // JavaFX classes used
 var StackPane = Java.type("javafx.scene.layout.StackPane");
@@ -100,7 +101,7 @@
             print("did you miss specifying jrt-fs.jar with -cp option?");
             usage();
         }
-        return FileSystems.newFileSystem(uri, null, cls.classLoader);
+        return FileSystems.newFileSystem(uri, Collections.emptyMap(), cls.classLoader);
     }
 }
 
--- a/src/java.base/share/classes/jdk/internal/jrtfs/jrtls.js	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/jrtls.js	Mon Aug 22 08:27:10 2016 -0700
@@ -34,7 +34,6 @@
  * but also compiled and delivered as part of the jrtfs.jar to support access
  * to the jimage file provided by the shipped JDK by tools running on JDK 8.
  */
- */
 
 // classes used
 var Files = Java.type("java.nio.file.Files");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/loader/AbstractClassLoaderValue.java	Mon Aug 22 08:27:10 2016 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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.loader;
+
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Iterator;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.BiFunction;
+import java.util.function.Supplier;
+
+/**
+ * AbstractClassLoaderValue is a superclass of root-{@link ClassLoaderValue}
+ * and {@link Sub sub}-ClassLoaderValue.
+ *
+ * @param <CLV> the type of concrete ClassLoaderValue (this type)
+ * @param <V>   the type of values associated with ClassLoaderValue
+ */
+public abstract class AbstractClassLoaderValue<CLV extends AbstractClassLoaderValue<CLV, V>, V> {
+
+    /**
+     * Sole constructor.
+     */
+    AbstractClassLoaderValue() {}
+
+    /**
+     * Returns the key component of this ClassLoaderValue. The key component of
+     * the root-{@link ClassLoaderValue} is the ClassLoaderValue itself,
+     * while the key component of a {@link #sub(Object) sub}-ClassLoaderValue
+     * is what was given to construct it.
+     *
+     * @return the key component of this ClassLoaderValue.
+     */
+    public abstract Object key();
+
+    /**
+     * Constructs new sub-ClassLoaderValue of this ClassLoaderValue with given
+     * key component.
+     *
+     * @param key the key component of the sub-ClassLoaderValue.
+     * @param <K> the type of the key component.
+     * @return a sub-ClassLoaderValue of this ClassLoaderValue for given key
+     */
+    public <K> Sub<K> sub(K key) {
+        return new Sub<>(key);
+    }
+
+    /**
+     * Returns {@code true} if this ClassLoaderValue is equal to given {@code clv}
+     * or if this ClassLoaderValue was derived from given {@code clv} by a chain
+     * of {@link #sub(Object)} invocations.
+     *
+     * @param clv the ClassLoaderValue to test this against
+     * @return if this ClassLoaderValue is equal to given {@code clv} or
+     * its descendant
+     */
+    public abstract boolean isEqualOrDescendantOf(AbstractClassLoaderValue<?, V> clv);
+
+    /**
+     * Returns the value associated with this ClassLoaderValue and given ClassLoader
+     * or {@code null} if there is none.
+     *
+     * @param cl the ClassLoader for the associated value
+     * @return the value associated with this ClassLoaderValue and given ClassLoader
+     * or {@code null} if there is none.
+     */
+    public V get(ClassLoader cl) {
+        Object val = AbstractClassLoaderValue.<CLV>map(cl).get(this);
+        try {
+            return extractValue(val);
+        } catch (Memoizer.RecursiveInvocationException e) {
+            // propagate recursive get() for the same key that is just
+            // being calculated in computeIfAbsent()
+            throw e;
+        } catch (Throwable t) {
+            // don't propagate exceptions thrown from Memoizer - pretend
+            // that there was no entry
+            // (computeIfAbsent invocation will try to remove it anyway)
+            return null;
+        }
+    }
+
+    /**
+     * Associates given value {@code v} with this ClassLoaderValue and given
+     * ClassLoader and returns {@code null} if there was no previously associated
+     * value or does nothing and returns previously associated value if there
+     * was one.
+     *
+     * @param cl the ClassLoader for the associated value
+     * @param v  the value to associate
+     * @return previously associated value or null if there was none
+     */
+    public V putIfAbsent(ClassLoader cl, V v) {
+        ConcurrentHashMap<CLV, Object> map = map(cl);
+        @SuppressWarnings("unchecked")
+        CLV clv = (CLV) this;
+        while (true) {
+            try {
+                Object val = map.putIfAbsent(clv, v);
+                return extractValue(val);
+            } catch (Memoizer.RecursiveInvocationException e) {
+                // propagate RecursiveInvocationException for the same key that
+                // is just being calculated in computeIfAbsent
+                throw e;
+            } catch (Throwable t) {
+                // don't propagate exceptions thrown from foreign Memoizer -
+                // pretend that there was no entry and retry
+                // (foreign computeIfAbsent invocation will try to remove it anyway)
+            }
+            // TODO:
+            // Thread.onSpinLoop(); // when available
+        }
+    }
+
+    /**
+     * Removes the value associated with this ClassLoaderValue and given
+     * ClassLoader if the associated value is equal to given value {@code v} and
+     * returns {@code true} or does nothing and returns {@code false} if there is
+     * no currently associated value or it is not equal to given value {@code v}.
+     *
+     * @param cl the ClassLoader for the associated value
+     * @param v  the value to compare with currently associated value
+     * @return {@code true} if the association was removed or {@code false} if not
+     */
+    public boolean remove(ClassLoader cl, Object v) {
+        return AbstractClassLoaderValue.<CLV>map(cl).remove(this, v);
+    }
+
+    /**
+     * Returns the value associated with this ClassLoaderValue and given
+     * ClassLoader if there is one or computes the value by invoking given
+     * {@code mappingFunction}, associates it and returns it.
+     * <p>
+     * Computation and association of the computed value is performed atomically
+     * by the 1st thread that requests a particular association while holding a
+     * lock associated with this ClassLoaderValue and given ClassLoader.
+     * Nested calls from the {@code mappingFunction} to {@link #get},
+     * {@link #putIfAbsent} or {@link #computeIfAbsent} for the same association
+     * are not allowed and throw {@link IllegalStateException}. Nested call to
+     * {@link #remove} for the same association is allowed but will always return
+     * {@code false} regardless of passed-in comparison value. Nested calls for
+     * other association(s) are allowed, but care should be taken to avoid
+     * deadlocks. When two threads perform nested computations of the overlapping
+     * set of associations they should always request them in the same order.
+     *
+     * @param cl              the ClassLoader for the associated value
+     * @param mappingFunction the function to compute the value
+     * @return the value associated with this ClassLoaderValue and given
+     * ClassLoader.
+     * @throws IllegalStateException if a direct or indirect invocation from
+     *                               within given {@code mappingFunction} that
+     *                               computes the value of a particular association
+     *                               to {@link #get}, {@link #putIfAbsent} or
+     *                               {@link #computeIfAbsent}
+     *                               for the same association is attempted.
+     */
+    public V computeIfAbsent(ClassLoader cl,
+                             BiFunction<
+                                 ? super ClassLoader,
+                                 ? super CLV,
+                                 ? extends V
+                                 > mappingFunction) throws IllegalStateException {
+        ConcurrentHashMap<CLV, Object> map = map(cl);
+        @SuppressWarnings("unchecked")
+        CLV clv = (CLV) this;
+        Memoizer<CLV, V> mv = null;
+        while (true) {
+            Object val = (mv == null) ? map.get(clv) : map.putIfAbsent(clv, mv);
+            if (val == null) {
+                if (mv == null) {
+                    // create Memoizer lazily when 1st needed and restart loop
+                    mv = new Memoizer<>(cl, clv, mappingFunction);
+                    continue;
+                }
+                // mv != null, therefore sv == null was a result of successful
+                // putIfAbsent
+                try {
+                    // trigger Memoizer to compute the value
+                    V v = mv.get();
+                    // attempt to replace our Memoizer with the value
+                    map.replace(clv, mv, v);
+                    // return computed value
+                    return v;
+                } catch (Throwable t) {
+                    // our Memoizer has thrown, attempt to remove it
+                    map.remove(clv, mv);
+                    // propagate exception because it's from our Memoizer
+                    throw t;
+                }
+            } else {
+                try {
+                    return extractValue(val);
+                } catch (Memoizer.RecursiveInvocationException e) {
+                    // propagate recursive attempts to calculate the same
+                    // value as being calculated at the moment
+                    throw e;
+                } catch (Throwable t) {
+                    // don't propagate exceptions thrown from foreign Memoizer -
+                    // pretend that there was no entry and retry
+                    // (foreign computeIfAbsent invocation will try to remove it anyway)
+                }
+            }
+            // TODO:
+            // Thread.onSpinLoop(); // when available
+        }
+    }
+
+    /**
+     * Removes all values associated with given ClassLoader {@code cl} and
+     * {@link #isEqualOrDescendantOf(AbstractClassLoaderValue) this or descendants}
+     * of this ClassLoaderValue.
+     * This is not an atomic operation. Other threads may see some associations
+     * be already removed and others still present while this method is executing.
+     * <p>
+     * The sole intention of this method is to cleanup after a unit test that
+     * tests ClassLoaderValue directly. It is not intended for use in
+     * actual algorithms.
+     *
+     * @param cl the associated ClassLoader of the values to be removed
+     */
+    public void removeAll(ClassLoader cl) {
+        ConcurrentHashMap<CLV, Object> map = map(cl);
+        for (Iterator<CLV> i = map.keySet().iterator(); i.hasNext(); ) {
+            if (i.next().isEqualOrDescendantOf(this)) {
+                i.remove();
+            }
+        }
+    }
+
+    private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
+
+    /**
+     * @return a ConcurrentHashMap for given ClassLoader
+     */
+    @SuppressWarnings("unchecked")
+    private static <CLV extends AbstractClassLoaderValue<CLV, ?>>
+    ConcurrentHashMap<CLV, Object> map(ClassLoader cl) {
+        return (ConcurrentHashMap<CLV, Object>)
+            (cl == null ? BootLoader.getClassLoaderValueMap()
+                        : JLA.createOrGetClassLoaderValueMap(cl));
+    }
+
+    /**
+     * @return value extracted from the {@link Memoizer} if given
+     * {@code memoizerOrValue} parameter is a {@code Memoizer} or
+     * just return given parameter.
+     */
+    @SuppressWarnings("unchecked")
+    private V extractValue(Object memoizerOrValue) {
+        if (memoizerOrValue instanceof Memoizer) {
+            return ((Memoizer<?, V>) memoizerOrValue).get();
+        } else {
+            return (V) memoizerOrValue;
+        }
+    }
+
+    /**
+     * A memoized supplier that invokes given {@code mappingFunction} just once
+     * and remembers the result or thrown exception for subsequent calls.
+     * If given mappingFunction returns null, it is converted to NullPointerException,
+     * thrown from the Memoizer's {@link #get()} method and remembered.
+     * If the Memoizer is invoked recursively from the given {@code mappingFunction},
+     * {@link RecursiveInvocationException} is thrown, but it is not remembered.
+     * The in-flight call to the {@link #get()} can still complete successfully if
+     * such exception is handled by the mappingFunction.
+     */
+    private static final class Memoizer<CLV extends AbstractClassLoaderValue<CLV, V>, V>
+        implements Supplier<V> {
+
+        private final ClassLoader cl;
+        private final CLV clv;
+        private final BiFunction<? super ClassLoader, ? super CLV, ? extends V>
+            mappingFunction;
+
+        private volatile V v;
+        private volatile Throwable t;
+        private boolean inCall;
+
+        Memoizer(ClassLoader cl,
+                 CLV clv,
+                 BiFunction<? super ClassLoader, ? super CLV, ? extends V>
+                     mappingFunction
+        ) {
+            this.cl = cl;
+            this.clv = clv;
+            this.mappingFunction = mappingFunction;
+        }
+
+        @Override
+        public V get() throws RecursiveInvocationException {
+            V v = this.v;
+            if (v != null) return v;
+            Throwable t = this.t;
+            if (t == null) {
+                synchronized (this) {
+                    if ((v = this.v) == null && (t = this.t) == null) {
+                        if (inCall) {
+                            throw new RecursiveInvocationException();
+                        }
+                        inCall = true;
+                        try {
+                            this.v = v = Objects.requireNonNull(
+                                mappingFunction.apply(cl, clv));
+                        } catch (Throwable x) {
+                            this.t = t = x;
+                        } finally {
+                            inCall = false;
+                        }
+                    }
+                }
+            }
+            if (v != null) return v;
+            if (t instanceof Error) {
+                throw (Error) t;
+            } else if (t instanceof RuntimeException) {
+                throw (RuntimeException) t;
+            } else {
+                throw new UndeclaredThrowableException(t);
+            }
+        }
+
+        static class RecursiveInvocationException extends IllegalStateException {
+            private static final long serialVersionUID = 1L;
+
+            RecursiveInvocationException() {
+                super("Recursive call");
+            }
+        }
+    }
+
+    /**
+     * sub-ClassLoaderValue is an inner class of {@link AbstractClassLoaderValue}
+     * and also a subclass of it. It can therefore be instantiated as an inner
+     * class of either an instance of root-{@link ClassLoaderValue} or another
+     * instance of itself. This enables composing type-safe compound keys of
+     * arbitrary length:
+     * <pre>{@code
+     * ClassLoaderValue<V> clv = new ClassLoaderValue<>();
+     * ClassLoaderValue<V>.Sub<K1>.Sub<K2>.Sub<K3> clv_k123 =
+     *     clv.sub(k1).sub(k2).sub(k3);
+     * }</pre>
+     * From which individual components are accessible in a type-safe way:
+     * <pre>{@code
+     * K1 k1 = clv_k123.parent().parent().key();
+     * K2 k2 = clv_k123.parent().key();
+     * K3 k3 = clv_k123.key();
+     * }</pre>
+     * This allows specifying non-capturing lambdas for the mapping function of
+     * {@link #computeIfAbsent(ClassLoader, BiFunction)} operation that can
+     * access individual key components from passed-in
+     * sub-[sub-...]ClassLoaderValue instance in a type-safe way.
+     *
+     * @param <K> the type of {@link #key()} component contained in the
+     *            sub-ClassLoaderValue.
+     */
+    public final class Sub<K> extends AbstractClassLoaderValue<Sub<K>, V> {
+
+        private final K key;
+
+        Sub(K key) {
+            this.key = key;
+        }
+
+        /**
+         * @return the parent ClassLoaderValue this sub-ClassLoaderValue
+         * has been {@link #sub(Object) derived} from.
+         */
+        public AbstractClassLoaderValue<CLV, V> parent() {
+            return AbstractClassLoaderValue.this;
+        }
+
+        /**
+         * @return the key component of this sub-ClassLoaderValue.
+         */
+        @Override
+        public K key() {
+            return key;
+        }
+
+        /**
+         * sub-ClassLoaderValue is a descendant of given {@code clv} if it is
+         * either equal to it or if its {@link #parent() parent} is a
+         * descendant of given {@code clv}.
+         */
+        @Override
+        public boolean isEqualOrDescendantOf(AbstractClassLoaderValue<?, V> clv) {
+            return equals(Objects.requireNonNull(clv)) ||
+                   parent().isEqualOrDescendantOf(clv);
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (!(o instanceof Sub)) return false;
+            @SuppressWarnings("unchecked")
+            Sub<?> that = (Sub<?>) o;
+            return this.parent().equals(that.parent()) &&
+                   Objects.equals(this.key, that.key);
+        }
+
+        @Override
+        public int hashCode() {
+            return 31 * parent().hashCode() +
+                   Objects.hashCode(key);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/loader/ClassLoaderValue.java	Mon Aug 22 08:27:10 2016 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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.loader;
+
+import java.util.Objects;
+import java.util.function.BiFunction;
+
+/**
+ * root-ClassLoaderValue. Each instance defines a separate namespace for
+ * associated values.
+ * <p>
+ * ClassLoaderValue allows associating a
+ * {@link #computeIfAbsent(ClassLoader, BiFunction) computed} non-null value with
+ * a {@code (ClassLoader, keys...)} tuple. The associated value, as well as the
+ * keys are strongly reachable from the associated ClassLoader so care should be
+ * taken to use such keys and values that only reference types resolvable from
+ * the associated ClassLoader. Failing that, ClassLoader leaks are inevitable.
+ * <p>
+ * Example usage:
+ * <pre>{@code
+ * // create a root instance which represents a namespace and declares the type of
+ * // associated values (Class instances in this example)
+ * static final ClassLoaderValue<Class<?>> proxyClasses = new ClassLoaderValue<>();
+ *
+ * // create a compound key composed of a Module and a list of interfaces
+ * Module module = ...;
+ * List<Class<?>> interfaces = ...;
+ * ClassLoaderValue<Class<?>>.Sub<Module>.Sub<List<Class<?>>> key =
+ *     proxyClasses.sub(module).sub(interfaces);
+ *
+ * // use the compound key together with ClassLoader to lazily associate
+ * // the value with tuple (loader, module, interfaces) and return it
+ * ClassLoader loader = ...;
+ * Class<?> proxyClass = key.computeIfAbsent(loader, (ld, ky) -> {
+ *     List<Class<?>> intfcs = ky.key();
+ *     Module m = ky.parent().key();
+ *     Class<?> clazz = defineProxyClass(ld, m, intfcs);
+ *     return clazz;
+ * });
+ * }</pre>
+ * <p>
+ * {@code classLoaderValue.<operation>(classLoader, ...)} represents an operation
+ * to {@link #get}, {@link #putIfAbsent}, {@link #computeIfAbsent} or {@link #remove}
+ * a value associated with a (classLoader, classLoaderValue) tuple. ClassLoader
+ * instances and root-{@link ClassLoaderValue} instances are compared using
+ * identity equality while {@link Sub sub}-ClassLoaderValue instances define
+ * {@link #equals(Object) equality} in terms of equality of its
+ * {@link Sub#parent() parent} ClassLoaderValue and its
+ * {@link #key() key} component.
+ *
+ * @param <V> the type of value(s) associated with the root-ClassLoaderValue and
+ *            all its {@link #sub(Object) descendants}.
+ * @author Peter Levart
+ * @since 9
+ */
+public final class ClassLoaderValue<V>
+    extends AbstractClassLoaderValue<ClassLoaderValue<V>, V> {
+
+    /**
+     * Constructs new root-ClassLoaderValue representing its own namespace.
+     */
+    public ClassLoaderValue() {}
+
+    /**
+     * @return the key component of this root-ClassLoaderValue (itself).
+     */
+    @Override
+    public ClassLoaderValue<V> key() {
+        return this;
+    }
+
+    /**
+     * root-ClassLoaderValue can only be equal to itself and has no predecessors.
+     */
+    @Override
+    public boolean isEqualOrDescendantOf(AbstractClassLoaderValue<?, V> clv) {
+        return equals(Objects.requireNonNull(clv));
+    }
+}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java	Mon Aug 22 08:27:10 2016 -0700
@@ -72,4 +72,10 @@
      */
     Map.Entry<String, byte[]> generateConcreteBMHClassBytes(
             final String types);
+
+    /**
+     * Returns a {@code byte[]} containing the bytecode for a class implementing
+     * the zero and identity forms of all {@code LambdaForm.BasicType}s.
+     */
+    byte[] generateBasicFormsClassBytes(final String className);
 }
--- a/src/java.base/share/classes/sun/security/jca/ProviderList.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/security/jca/ProviderList.java	Mon Aug 22 08:27:10 2016 -0700
@@ -76,7 +76,7 @@
     // dummy provider object to use during initialization
     // used to avoid explicit null checks in various places
     private static final Provider EMPTY_PROVIDER =
-        new Provider("##Empty##", 1.0d, "initialization in progress") {
+        new Provider("##Empty##", "1.0", "initialization in progress") {
             private static final long serialVersionUID = 1151354171352296389L;
             // override getService() to return null slightly faster
             public Service getService(String type, String algorithm) {
--- a/src/java.base/share/classes/sun/security/provider/MD4.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/security/provider/MD4.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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,6 +28,7 @@
 import java.security.*;
 
 import static sun.security.provider.ByteArrayAccess.*;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
 
 /**
  * The MD4 class is used to compute an MD4 message digest over a given
@@ -65,7 +66,8 @@
     private static final Provider md4Provider;
 
     static {
-        md4Provider = new Provider("MD4Provider", 9.0d, "MD4 MessageDigest") {
+        md4Provider = new Provider("MD4Provider", PROVIDER_VER,
+            "MD4 MessageDigest") {
             private static final long serialVersionUID = -8850464997518327965L;
         };
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/src/java.base/share/classes/sun/security/provider/Sun.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/security/provider/Sun.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -29,6 +29,8 @@
 import java.security.*;
 
 import sun.security.action.PutAllAction;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
+
 
 /**
  * The SUN Security Provider.
@@ -47,7 +49,7 @@
 
     public Sun() {
         /* We are the SUN provider */
-        super("SUN", 9.0d, INFO);
+        super("SUN", PROVIDER_VER, INFO);
 
         // if there is no security manager installed, put directly into
         // the provider. Otherwise, create a temporary map and use a
--- a/src/java.base/share/classes/sun/security/provider/VerificationProvider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/security/provider/VerificationProvider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -31,6 +31,8 @@
 import sun.security.action.PutAllAction;
 
 import sun.security.rsa.SunRsaSignEntries;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
+
 
 /**
  * Provider used for verification of signed JAR files *if* the Sun and
@@ -61,7 +63,7 @@
     }
 
     public VerificationProvider() {
-        super("SunJarVerification", 9.0d, "Jar Verification Provider");
+        super("SunJarVerification", PROVIDER_VER, "Jar Verification Provider");
         // register all algorithms normally registered by the Sun and SunRsaSign
         // providers, but only if they are missing
         if (ACTIVE == false) {
--- a/src/java.base/share/classes/sun/security/rsa/SunRsaSign.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/security/rsa/SunRsaSign.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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
@@ -30,6 +30,7 @@
 import java.security.*;
 
 import sun.security.action.PutAllAction;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
 
 /**
  * Provider class for the RSA signature provider. Supports RSA keyfactory,
@@ -43,7 +44,7 @@
     private static final long serialVersionUID = 866040293550393045L;
 
     public SunRsaSign() {
-        super("SunRsaSign", 9.0d, "Sun RSA signature provider");
+        super("SunRsaSign", PROVIDER_VER, "Sun RSA signature provider");
 
         // if there is no security manager installed, put directly into
         // the provider. Otherwise, create a temporary map and use a
--- a/src/java.base/share/classes/sun/security/ssl/JsseJce.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/JsseJce.java	Mon Aug 22 08:27:10 2016 -0700
@@ -44,6 +44,7 @@
 import sun.security.util.ECUtil;
 
 import static sun.security.ssl.SunJSSE.cryptoProvider;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
 
 /**
  * This class contains a few static methods for interaction with the JCA/JCE
@@ -90,7 +91,7 @@
         private static final long serialVersionUID = -3284138292032213752L;
 
         SunCertificates(final Provider p) {
-            super("SunCertificates", 9.0d, "SunJSSE internal");
+            super("SunCertificates", PROVIDER_VER, "SunJSSE internal");
             AccessController.doPrivileged(new PrivilegedAction<Object>() {
                 @Override
                 public Object run() {
--- a/src/java.base/share/classes/sun/security/ssl/SunJSSE.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/SunJSSE.java	Mon Aug 22 08:27:10 2016 -0700
@@ -27,6 +27,7 @@
 package sun.security.ssl;
 
 import java.security.*;
+import static sun.security.util.SecurityConstants.PROVIDER_VER;
 
 /**
  * The JSSE provider.
@@ -104,7 +105,7 @@
 
     // standard constructor
     protected SunJSSE() {
-        super("SunJSSE", 9.0d, info);
+        super("SunJSSE", PROVIDER_VER, info);
         subclassCheck();
         if (Boolean.TRUE.equals(fips)) {
             throw new ProviderException
@@ -132,7 +133,7 @@
 
     private SunJSSE(java.security.Provider cryptoProvider,
             String providerName) {
-        super("SunJSSE", 9.0d, fipsInfo + providerName + ")");
+        super("SunJSSE", PROVIDER_VER, fipsInfo + providerName + ")");
         subclassCheck();
         if (cryptoProvider == null) {
             // Calling Security.getProvider() will cause other providers to be
--- a/src/java.base/share/classes/sun/security/util/SecurityConstants.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/security/util/SecurityConstants.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, 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
@@ -33,6 +33,7 @@
 import java.security.BasicPermission;
 import java.security.SecurityPermission;
 import java.security.AllPermission;
+import sun.security.action.GetPropertyAction;
 
 /**
  * Permission constants and string constants used to create permissions
@@ -145,4 +146,7 @@
     // java.lang.SecurityManager
     public static final SocketPermission LOCAL_LISTEN_PERMISSION =
         new SocketPermission("localhost:0", SOCKET_LISTEN_ACTION);
+
+    public static final String PROVIDER_VER =
+        GetPropertyAction.privilegedGetProperty("java.specification.version");
 }
--- a/src/java.base/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.base/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -143,8 +143,8 @@
         defaultLocaleProviderAdapter = Type.CLDR;
         if (!typeList.isEmpty()) {
             // bona fide preference exists
-            if (!typeList.contains(Type.CLDR)) {
-                // Append FALLBACK as the last resort.
+            if (!(typeList.contains(Type.CLDR) || (typeList.contains(Type.JRE)))) {
+                // Append FALLBACK as the last resort when no ResourceBundleBasedAdapter is available.
                 typeList.add(Type.FALLBACK);
                 defaultLocaleProviderAdapter = Type.FALLBACK;
             }
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java	Mon Aug 22 08:27:10 2016 -0700
@@ -124,7 +124,9 @@
             if (!progressBar.isIndeterminate()) return;
             stopAnimationTimer();
             // start the animation thread
-            startAnimationTimer();
+            if (progressBar.isDisplayable()) {
+              startAnimationTimer();
+            }
         }
 
         if ("JProgressBar.style".equals(prop)) {
@@ -141,7 +143,9 @@
 
     public void ancestorAdded(final AncestorEvent e) {
         if (!progressBar.isIndeterminate()) return;
-        startAnimationTimer();
+        if (progressBar.isDisplayable()) {
+          startAnimationTimer();
+        }
     }
 
     public void ancestorMoved(final AncestorEvent e) { }
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m	Mon Aug 22 08:27:10 2016 -0700
@@ -807,6 +807,18 @@
 
 - (void)sendEvent:(NSEvent *)event {
         if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown) {
+            // Move parent windows to front and make sure that a child window is displayed
+            // in front of its nearest parent.
+            if (self.ownerWindow != nil) {
+                JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
+                jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
+                if (platformWindow != NULL) {
+                    static JNF_MEMBER_CACHE(jm_orderAboveSiblings, jc_CPlatformWindow, "orderAboveSiblings", "()V");
+                    JNFCallVoidMethod(env,platformWindow, jm_orderAboveSiblings);
+                    (*env)->DeleteLocalRef(env, platformWindow);
+                }
+            }
+            [self orderChildWindows:YES];
 
             NSPoint p = [NSEvent mouseLocation];
             NSRect frame = [self.nsWindow frame];
@@ -1159,6 +1171,16 @@
     NSWindow *nsWindow = OBJC(windowPtr);
     [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow orderBack:nil];
+        // Order parent windows
+        AWTWindow *awtWindow = (AWTWindow*)[nsWindow delegate];
+        while (awtWindow.ownerWindow != nil) {
+            awtWindow = awtWindow.ownerWindow;
+            if ([AWTWindow isJavaPlatformWindowVisible:awtWindow.nsWindow]) {
+                [awtWindow.nsWindow orderBack:nil];
+            }
+        }
+        // Order child windows
+        [(AWTWindow*)[nsWindow delegate] orderChildWindows:NO];
     }];
 
 JNF_COCOA_EXIT(env);
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFColorConverter.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFColorConverter.java	Mon Aug 22 08:27:10 2016 -0700
@@ -47,7 +47,7 @@
      * @throws NullPointerException if {@code result} is
      * {@code null}.
      * @throws ArrayIndexOutOfBoundsException if
-     * {@code result.length&nbsp;&lt;&nbsp;3}.
+     * {@code result.length < 3}.
      */
     public abstract void fromRGB(float r, float g, float b, float[] result);
 
@@ -63,7 +63,7 @@
      * @throws NullPointerException if {@code rgb} is
      * {@code null}.
      * @throws ArrayIndexOutOfBoundsException if
-     * {@code rgb.length&nbsp;&lt;&nbsp;3}.
+     * {@code rgb.length < 3}.
      */
     public abstract void toRGB(float x0, float x1, float x2, float[] rgb);
 }
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java	Mon Aug 22 08:27:10 2016 -0700
@@ -353,7 +353,7 @@
      * <p> The pixels in the source region to be copied are
      * those with X coordinates of the form {@code activeSrcMinX +
      * k*subsampleX}, where {@code k} is an integer such
-     * that {@code 0 &le; k &lt; dstWidth}.
+     * that {@code 0 <= k < dstWidth}.
      */
     protected int activeSrcMinX;
 
@@ -365,7 +365,7 @@
      * <p> The pixels in the source region to be copied are
      * those with Y coordinates of the form {@code activeSrcMinY +
      * k*subsampleY}, where {@code k} is an integer such
-     * that {@code 0 &le; k &lt; dstHeight}.
+     * that {@code 0 <= k < dstHeight}.
      */
     protected int activeSrcMinY;
 
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java	Mon Aug 22 08:27:10 2016 -0700
@@ -49,6 +49,45 @@
     private long stripOrTileOffsetsPosition = -1;
     private long lastPosition = -1;
 
+
+    /**
+     * Converts a {@code TIFFDirectory} to a {@code TIFFIFD}.
+     */
+    public static TIFFIFD getDirectoryAsIFD(TIFFDirectory dir) {
+        if(dir instanceof TIFFIFD) {
+            return (TIFFIFD)dir;
+        }
+
+        TIFFIFD ifd = new TIFFIFD(Arrays.asList(dir.getTagSets()),
+                                  dir.getParentTag());
+        TIFFField[] fields = dir.getTIFFFields();
+        int numFields = fields.length;
+        for(int i = 0; i < numFields; i++) {
+            TIFFField f = fields[i];
+            TIFFTag tag = f.getTag();
+            if(tag.isIFDPointer()) {
+                TIFFDirectory subDir = null;
+                if (f.hasDirectory()) {
+                    subDir = f.getDirectory();
+                } else if (f.getData() instanceof TIFFDirectory) {
+                    subDir = (TIFFDirectory)f.getData();
+                }
+                if (subDir != null) {
+                    TIFFDirectory subIFD = getDirectoryAsIFD(subDir);
+                    f = new TIFFField(tag, f.getType(), (long)f.getCount(),
+                                      subIFD);
+                } else {
+                    f = null;
+                }
+            }
+            if (f != null) {
+                ifd.addTIFFField(f);
+            }
+        }
+
+        return ifd;
+    }
+
     public static TIFFTag getTag(int tagNumber, List<TIFFTagSet> tagSets) {
         Iterator<TIFFTagSet> iter = tagSets.iterator();
         while (iter.hasNext()) {
@@ -704,7 +743,7 @@
                 pos = nextSpace;
 
                 if (tag.isIFDPointer() && f.hasDirectory()) {
-                    TIFFIFD subIFD = (TIFFIFD)f.getDirectory();
+                    TIFFIFD subIFD = getDirectoryAsIFD(f.getDirectory());
                     subIFD.writeToStream(stream);
                     nextSpace = subIFD.lastPosition;
                 } else {
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java	Mon Aug 22 08:27:10 2016 -0700
@@ -132,7 +132,7 @@
             if (tag == null) {
                 node = f.getAsNativeNode();
             } else if (tag.isIFDPointer() && f.hasDirectory()) {
-                TIFFIFD subIFD = (TIFFIFD)f.getDirectory();
+                TIFFIFD subIFD = TIFFIFD.getDirectoryAsIFD(f.getDirectory());
 
                 // Recurse
                 node = getIFDAsTree(subIFD, tag.getName(), tag.getNumber());
@@ -1465,8 +1465,14 @@
                 String className = st.nextToken();
 
                 Object o = null;
+                Class<?> setClass = null;
                 try {
-                    Class<?> setClass = Class.forName(className);
+                    ClassLoader cl = TIFFImageMetadata.class.getClassLoader();
+                    setClass = Class.forName(className, false, cl);
+                    if (!TIFFTagSet.class.isAssignableFrom(setClass)) {
+                        fatal(node, "TagSets in IFD must be subset of"
+                                + " TIFFTagSet class");
+                    }
                     Method getInstanceMethod =
                         setClass.getMethod("getInstance", (Class[])null);
                     o = getInstanceMethod.invoke(null, (Object[])null);
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageReader.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageReader.java	Mon Aug 22 08:27:10 2016 -0700
@@ -35,6 +35,7 @@
 import java.awt.image.Raster;
 import java.awt.image.RenderedImage;
 import java.awt.image.SampleModel;
+import java.io.EOFException;
 import java.io.IOException;
 import java.nio.ByteOrder;
 import java.util.ArrayList;
@@ -189,8 +190,8 @@
 
             // Seek to start of first IFD
             long offset = stream.readUnsignedInt();
+            stream.seek(offset);
             imageStartPosition.add(Long.valueOf(offset));
-            stream.seek(offset);
         } catch (IOException e) {
             throw new IIOException("I/O error reading header!", e);
         }
@@ -201,10 +202,10 @@
     private int locateImage(int imageIndex) throws IIOException {
         readHeader();
 
+        // Find closest known index
+        int index = Math.min(imageIndex, imageStartPosition.size() - 1);
+
         try {
-            // Find closest known index
-            int index = Math.min(imageIndex, imageStartPosition.size() - 1);
-
             // Seek to that position
             Long l = imageStartPosition.get(index);
             stream.seek(l.longValue());
@@ -212,6 +213,11 @@
             // Skip IFDs until at desired index or last image found
             while (index < imageIndex) {
                 int count = stream.readUnsignedShort();
+                // If zero-entry IFD, decrement the index and exit the loop
+                if (count == 0) {
+                    imageIndex = index > 0 ? index - 1 : 0;
+                    break;
+                }
                 stream.skipBytes(12 * count);
 
                 long offset = stream.readUnsignedInt();
@@ -219,12 +225,17 @@
                     return index;
                 }
 
+                stream.seek(offset);
                 imageStartPosition.add(Long.valueOf(offset));
-                stream.seek(offset);
                 ++index;
             }
-        } catch (IOException e) {
-            throw new IIOException("Couldn't seek!", e);
+        } catch (EOFException eofe) {
+            forwardWarningMessage("Ignored " + eofe);
+
+            // Ran off the end of stream: decrement index
+            imageIndex = index > 0 ? index - 1 : 0;
+        } catch (IOException ioe) {
+            throw new IIOException("Couldn't seek!", ioe);
         }
 
         if (currIndex != imageIndex) {
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Mon Aug 22 08:27:10 2016 -0700
@@ -1478,7 +1478,7 @@
                 (ExifParentTIFFTagSet.TAG_EXIF_IFD_POINTER);
             if(f != null && f.hasDirectory()) {
                 // Retrieve the Exif IFD.
-                exifIFD = (TIFFIFD)f.getDirectory();
+                exifIFD = TIFFIFD.getDirectoryAsIFD(f.getDirectory());
             } else if(isPrimaryIFD) {
                 // Create the Exif IFD.
                 List<TIFFTagSet> exifTagSets = new ArrayList<TIFFTagSet>(1);
@@ -3622,6 +3622,8 @@
         streamMetadata = null;
         imageMetadata = null;
 
+        isRescaling = false;
+
         isWritingSequence = false;
         isWritingEmpty = false;
         isInsertingEmpty = false;
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFMetadataFormat.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFMetadataFormat.java	Mon Aug 22 08:27:10 2016 -0700
@@ -49,7 +49,8 @@
         }
         try {
             ResourceBundle bundle =
-                ResourceBundle.getBundle(resourceBaseName, locale);
+                ResourceBundle.getBundle(resourceBaseName, locale,
+                                         this.getClass().getModule());
             return bundle.getString(key);
         } catch (MissingResourceException e) {
             return null;
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java	Mon Aug 22 08:27:10 2016 -0700
@@ -657,7 +657,6 @@
 
         protected void paintToImage(Component c, Image image, Graphics g,
                                     int w, int h, Object[] args) {
-            boolean accEnabled = false;
             Skin skin = (Skin)args[0];
             Part part = skin.part;
             State state = (State)args[1];
@@ -668,6 +667,8 @@
                 c = skin.component;
             }
             BufferedImage bi = (BufferedImage)image;
+            w = bi.getWidth();
+            h = bi.getHeight();
 
             WritableRaster raster = bi.getRaster();
             DataBufferInt dbi = (DataBufferInt)raster.getDataBuffer();
--- a/src/java.desktop/share/classes/com/sun/media/sound/AbstractDataLine.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AbstractDataLine.java	Mon Aug 22 08:27:10 2016 -0700
@@ -32,7 +32,6 @@
 import javax.sound.sampled.LineEvent;
 import javax.sound.sampled.LineUnavailableException;
 
-
 /**
  * AbstractDataLine
  *
@@ -147,36 +146,35 @@
         }
     }
 
-
     public final void open(AudioFormat format) throws LineUnavailableException {
         open(format, AudioSystem.NOT_SPECIFIED);
     }
 
-
     /**
      * This implementation always returns 0.
      */
+    @Override
     public int available() {
         return 0;
     }
 
+    /**
+     * This implementation does nothing.
+     */
+    @Override
+    public void drain() {
+        if (Printer.trace) Printer.trace("AbstractDataLine: drain");
+    }
 
     /**
      * This implementation does nothing.
      */
-    public void drain() {
-        if (Printer.trace) Printer.trace("AbstractDataLine: drain");
-    }
-
-
-    /**
-     * This implementation does nothing.
-     */
+    @Override
     public void flush() {
         if (Printer.trace) Printer.trace("AbstractDataLine: flush");
     }
 
-
+    @Override
     public final void start() {
         //$$fb 2001-10-09: Bug #4517739: avoiding deadlock by synchronizing to mixer !
         synchronized(mixer) {
@@ -200,7 +198,7 @@
         if (Printer.trace) Printer.trace("< "+getClass().getName()+".start() - AbstractDataLine");
     }
 
-
+    @Override
     public final void stop() {
 
         //$$fb 2001-10-09: Bug #4517739: avoiding deadlock by synchronizing to mixer !
@@ -245,15 +243,17 @@
     // in MixerSourceLine and MixerClip, and I want to touch as little
     // code as possible to change isStarted() back to isRunning().
 
+    @Override
     public final boolean isRunning() {
         return started;
     }
 
+    @Override
     public final boolean isActive() {
         return active;
     }
 
-
+    @Override
     public final long getMicrosecondPosition() {
 
         long microseconds = getLongFramePosition();
@@ -263,12 +263,12 @@
         return microseconds;
     }
 
-
+    @Override
     public final AudioFormat getFormat() {
         return format;
     }
 
-
+    @Override
     public final int getBufferSize() {
         return bufferSize;
     }
@@ -283,11 +283,11 @@
     /**
      * This implementation returns AudioSystem.NOT_SPECIFIED.
      */
+    @Override
     public final float getLevel() {
         return (float)AudioSystem.NOT_SPECIFIED;
     }
 
-
     // HELPER METHODS
 
     /**
@@ -317,19 +317,12 @@
 
         synchronized (this) {
 
-            //if (Printer.debug) Printer.debug("    AbstractDataLine: setActive: this.active: " + this.active);
-            //if (Printer.debug) Printer.debug("                                 active: " + active);
-
             if (this.active != active) {
                 this.active = active;
                 //sendEvents = true;
             }
         }
 
-        //if (Printer.debug) Printer.debug("                                 this.active: " + this.active);
-        //if (Printer.debug) Printer.debug("                                 sendEvents: " + sendEvents);
-
-
         // $$kk: 11.19.99: take ACTIVE / INACTIVE / EOM events out;
         // putting them in is technically an API change.
         // do not generate ACTIVE / INACTIVE events for now
@@ -356,18 +349,12 @@
 
         synchronized (this) {
 
-            //if (Printer.debug) Printer.debug("    AbstractDataLine: setStarted: this.started: " + this.started);
-            //if (Printer.debug) Printer.debug("                                  started: " + started);
-
             if (this.started != started) {
                 this.started = started;
                 sendEvents = true;
             }
         }
 
-        //if (Printer.debug) Printer.debug("                                  this.started: " + this.started);
-        //if (Printer.debug) Printer.debug("                                  sendEvents: " + sendEvents);
-
         if (sendEvents) {
 
             if (started) {
@@ -379,7 +366,6 @@
         if (Printer.trace) Printer.trace("< AbstractDataLine: setStarted completed");
     }
 
-
     /**
      * This method generates a STOP event and sets the started state to false.
      * It is here for historic reasons when an EOM event existed.
@@ -393,9 +379,6 @@
         if (Printer.trace) Printer.trace("< AbstractDataLine: setEOM() completed");
     }
 
-
-
-
     // OVERRIDES OF ABSTRACT LINE METHODS
 
     /**
@@ -404,6 +387,7 @@
      * line is open, this should return quietly because the values
      * requested will match the current ones.
      */
+    @Override
     public final void open() throws LineUnavailableException {
 
         if (Printer.trace) Printer.trace("> "+getClass().getName()+".open() - AbstractDataLine");
@@ -413,11 +397,11 @@
         if (Printer.trace) Printer.trace("< "+getClass().getName()+".open() - AbstractDataLine");
     }
 
-
     /**
      * This should also stop the line.  The closed line should not be running or active.
      * After we close the line, we reset the format and buffer size to the defaults.
      */
+    @Override
     public final void close() {
         //$$fb 2001-10-09: Bug #4517739: avoiding deadlock by synchronizing to mixer !
         synchronized (mixer) {
@@ -445,12 +429,6 @@
         if (Printer.trace) Printer.trace("< "+getClass().getName()+".close() - in AbstractDataLine");
     }
 
-
-    // IMPLEMENTATIONS OF ABSTRACT LINE ABSTRACE METHODS
-
-
-    // ABSTRACT METHODS
-
     abstract void implOpen(AudioFormat format, int bufferSize) throws LineUnavailableException;
     abstract void implClose();
 
--- a/src/java.desktop/share/classes/com/sun/media/sound/AbstractLine.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AbstractLine.java	Mon Aug 22 08:27:10 2016 -0700
@@ -36,7 +36,6 @@
 import javax.sound.sampled.LineListener;
 import javax.sound.sampled.LineUnavailableException;
 
-
 /**
  * AbstractLine
  *
@@ -72,19 +71,19 @@
         this.controls = controls;
     }
 
-
     // LINE METHODS
 
+    @Override
     public final Line.Info getLineInfo() {
         return info;
     }
 
-
+    @Override
     public final boolean isOpen() {
         return open;
     }
 
-
+    @Override
     public final void addLineListener(LineListener listener) {
         synchronized(listeners) {
             if ( ! (listeners.contains(listener)) ) {
@@ -93,22 +92,22 @@
         }
     }
 
-
     /**
      * Removes an audio listener.
      * @param listener listener to remove
      */
+    @Override
     public final void removeLineListener(LineListener listener) {
         listeners.removeElement(listener);
     }
 
-
     /**
      * Obtains the set of controls supported by the
      * line.  If no controls are supported, returns an
      * array of length 0.
      * @return control set
      */
+    @Override
     public final Control[] getControls() {
         Control[] returnedArray = new Control[controls.length];
 
@@ -119,7 +118,7 @@
         return returnedArray;
     }
 
-
+    @Override
     public final boolean isControlSupported(Control.Type controlType) {
         // protect against a NullPointerException
         if (controlType == null) {
@@ -135,7 +134,7 @@
         return false;
     }
 
-
+    @Override
     public final Control getControl(Control.Type controlType) {
         // protect against a NullPointerException
         if (controlType != null) {
@@ -150,10 +149,8 @@
         throw new IllegalArgumentException("Unsupported control type: " + controlType);
     }
 
-
     // HELPER METHODS
 
-
     /**
      * This method sets the open state and generates
      * events if it changes.
@@ -182,7 +179,6 @@
         if (Printer.trace) Printer.trace("< "+getClass().getName()+" (AbstractLine): setOpen(" + open + ")  this.open: " + this.open);
     }
 
-
     /**
      * Send line events.
      */
@@ -190,7 +186,6 @@
         getEventDispatcher().sendAudioEvents(event, listeners);
     }
 
-
     /**
      * This is an error in the API: getFramePosition
      * should return a long value. At CD quality,
@@ -200,7 +195,6 @@
         return (int) getLongFramePosition();
     }
 
-
     /**
      * Return the frame position in a long value
      * This implementation returns AudioSystem.NOT_SPECIFIED.
@@ -209,7 +203,6 @@
         return AudioSystem.NOT_SPECIFIED;
     }
 
-
     // $$kk: 06.03.99: returns the mixer used in construction.
     // this is a hold-over from when there was a public method like
     // this on line and should be fixed!!
@@ -232,8 +225,8 @@
         }
     }
 
-    // ABSTRACT METHODS
-
+    @Override
     public abstract void open() throws LineUnavailableException;
+    @Override
     public abstract void close();
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java	Mon Aug 22 08:27:10 2016 -0700
@@ -26,10 +26,17 @@
 package com.sun.media.sound;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
-import java.util.Collections;
 
-import javax.sound.midi.*;
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiDeviceReceiver;
+import javax.sound.midi.MidiDeviceTransmitter;
+import javax.sound.midi.MidiMessage;
+import javax.sound.midi.MidiUnavailableException;
+import javax.sound.midi.Receiver;
+import javax.sound.midi.Transmitter;
 
 
 /**
@@ -43,11 +50,8 @@
  */
 abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice {
 
-    // STATIC VARIABLES
     private static final boolean TRACE_TRANSMITTER = false;
 
-    // INSTANCE VARIABLES
-
     private ArrayList<Receiver> receiverList;
 
     private TransmitterList transmitterList;
@@ -62,7 +66,6 @@
 
     private final MidiDevice.Info info;
 
-
     // DEVICE STATE
 
     private volatile boolean open;
@@ -73,15 +76,10 @@
     private List<Object> openKeepingObjects;
 
     /**
-     * This is the device handle returned from native code
+     * This is the device handle returned from native code.
      */
     protected volatile long id;
 
-
-
-    // CONSTRUCTOR
-
-
     /**
      * Constructs an AbstractMidiDevice with the specified info object.
      * @param info the description of the device
@@ -99,9 +97,9 @@
         if(Printer.trace) Printer.trace("<< AbstractMidiDevice CONSTRUCTOR completed");
     }
 
-
     // MIDI DEVICE METHODS
 
+    @Override
     public final MidiDevice.Info getDeviceInfo() {
         return info;
     }
@@ -111,6 +109,7 @@
      * opened the device implicitly from closing it. The only way to close the device after
      * this call is a call to close().
      */
+    @Override
     public final void open() throws MidiUnavailableException {
         if (Printer.trace) Printer.trace("> AbstractMidiDevice: open()");
         synchronized(this) {
@@ -120,8 +119,6 @@
         if (Printer.trace) Printer.trace("< AbstractMidiDevice: open() completed");
     }
 
-
-
     /** Open the device implicitly.
      * This method is intended to be used by AbstractReceiver
      * and BasicTransmitter. Actually, it is called by getReceiverReferenceCounting() and
@@ -146,7 +143,6 @@
         if (Printer.trace) Printer.trace("< AbstractMidiDevice: openInternal() completed");
     }
 
-
     private void doOpen() throws MidiUnavailableException {
         if (Printer.trace) Printer.trace("> AbstractMidiDevice: doOpen()");
         synchronized(this) {
@@ -158,7 +154,7 @@
         if (Printer.trace) Printer.trace("< AbstractMidiDevice: doOpen() completed");
     }
 
-
+    @Override
     public final void close() {
         if (Printer.trace) Printer.trace("> AbstractMidiDevice: close()");
         synchronized (this) {
@@ -168,7 +164,6 @@
         if (Printer.trace) Printer.trace("< AbstractMidiDevice: close() completed");
     }
 
-
     /** Close the device for an object that implicitely opened it.
      * This method is intended to be used by Transmitter.close() and Receiver.close().
      * Those methods should pass this for the object parameter. Since Transmitters or Receivers
@@ -196,7 +191,6 @@
         if (Printer.trace) Printer.trace("< AbstractMidiDevice: closeInternal() completed");
     }
 
-
     public final void doClose() {
         if (Printer.trace) Printer.trace("> AbstractMidiDevice: doClose()");
         synchronized(this) {
@@ -208,12 +202,11 @@
         if (Printer.trace) Printer.trace("< AbstractMidiDevice: doClose() completed");
     }
 
-
+    @Override
     public final boolean isOpen() {
         return open;
     }
 
-
     protected void implClose() {
         synchronized (traRecLock) {
             if (receiverList != null) {
@@ -230,21 +223,21 @@
         }
     }
 
-
     /**
      * This implementation always returns -1.
      * Devices that actually provide this should over-ride
      * this method.
      */
+    @Override
     public long getMicrosecondPosition() {
         return -1;
     }
 
-
     /** Return the maximum number of Receivers supported by this device.
         Depending on the return value of hasReceivers(), this method returns either 0 or -1.
         Subclasses should rather override hasReceivers() than override this method.
      */
+    @Override
     public final int getMaxReceivers() {
         if (hasReceivers()) {
             return -1;
@@ -253,11 +246,11 @@
         }
     }
 
-
     /** Return the maximum number of Transmitters supported by this device.
         Depending on the return value of hasTransmitters(), this method returns either 0 or -1.
         Subclasses should override hasTransmitters().
      */
+    @Override
     public final int getMaxTransmitters() {
         if (hasTransmitters()) {
             return -1;
@@ -266,7 +259,6 @@
         }
     }
 
-
     /** Retrieve a Receiver for this device.
         This method returns the value returned by createReceiver(), if it doesn't throw
         an exception. Subclasses should rather override createReceiver() than override
@@ -274,6 +266,7 @@
         If createReceiver returns a Receiver, it is added to the internal list
         of Receivers (see getReceiversList)
      */
+    @Override
     public final Receiver getReceiver() throws MidiUnavailableException {
         Receiver receiver;
         synchronized (traRecLock) {
@@ -283,7 +276,7 @@
         return receiver;
     }
 
-
+    @Override
     @SuppressWarnings("unchecked") // Cast of result of clone
     public final List<Receiver> getReceivers() {
         List<Receiver> recs;
@@ -298,12 +291,12 @@
         return recs;
     }
 
-
     /**
      * This implementation uses createTransmitter, which may throw an exception.
      * If a transmitter is returned in createTransmitter, it is added to the internal
      * TransmitterList
      */
+    @Override
     public final Transmitter getTransmitter() throws MidiUnavailableException {
         Transmitter transmitter;
         synchronized (traRecLock) {
@@ -313,7 +306,7 @@
         return transmitter;
     }
 
-
+    @Override
     @SuppressWarnings("unchecked") // Cast of result of clone
     public final List<Transmitter> getTransmitters() {
         List<Transmitter> tras;
@@ -328,19 +321,16 @@
         return tras;
     }
 
-
-    // HELPER METHODS
-
     final long getId() {
         return id;
     }
 
-
     // REFERENCE COUNTING
 
     /** Retrieve a Receiver and open the device implicitly.
         This method is called by MidiSystem.getReceiver().
      */
+    @Override
     public final Receiver getReceiverReferenceCounting()
             throws MidiUnavailableException {
         /* Keep this order of commands! If getReceiver() throws an exception,
@@ -354,10 +344,10 @@
         return receiver;
     }
 
-
     /** Retrieve a Transmitter and open the device implicitly.
         This method is called by MidiSystem.getTransmitter().
      */
+    @Override
     public final Transmitter getTransmitterReferenceCounting()
             throws MidiUnavailableException {
         /* Keep this order of commands! If getTransmitter() throws an exception,
@@ -371,7 +361,6 @@
         return transmitter;
     }
 
-
     /** Return the list of objects that have opened the device implicitely.
      */
     private synchronized List<Object> getOpenKeepingObjects() {
@@ -381,23 +370,19 @@
         return openKeepingObjects;
     }
 
-
-
     // RECEIVER HANDLING METHODS
 
-
     /** Return the internal list of Receivers, possibly creating it first.
      */
     private List<Receiver> getReceiverList() {
         synchronized (traRecLock) {
             if (receiverList == null) {
-                receiverList = new ArrayList<Receiver>();
+                receiverList = new ArrayList<>();
             }
         }
         return receiverList;
     }
 
-
     /** Returns if this device supports Receivers.
         Subclasses that use Receivers should override this method to
         return true. They also should override createReceiver().
@@ -408,7 +393,6 @@
         return false;
     }
 
-
     /** Create a Receiver object.
         throwing an exception here means that Receivers aren't enabled.
         Subclasses that use Receivers should override this method with
@@ -420,8 +404,6 @@
         throw new MidiUnavailableException("MIDI IN receiver not available");
     }
 
-
-
     // TRANSMITTER HANDLING
 
     /** Return the internal list of Transmitters, possibly creating it first.
@@ -435,7 +417,6 @@
         return transmitterList;
     }
 
-
     /** Returns if this device supports Transmitters.
         Subclasses that use Transmitters should override this method to
         return true. They also should override createTransmitter().
@@ -446,7 +427,6 @@
         return false;
     }
 
-
     /** Create a Transmitter object.
         throwing an exception here means that Transmitters aren't enabled.
         Subclasses that use Transmitters should override this method with
@@ -458,20 +438,16 @@
         throw new MidiUnavailableException("MIDI OUT transmitter not available");
     }
 
-    // ABSTRACT METHODS
-
     protected abstract void implOpen() throws MidiUnavailableException;
 
-
     /**
-     * close this device if discarded by the garbage collector
+     * close this device if discarded by the garbage collector.
      */
+    @Override
     protected final void finalize() {
         close();
     }
 
-    // INNER CLASSES
-
     /** Base class for Receivers.
         Subclasses that use Receivers must use this base class, since it
         contains magic necessary to manage implicit closing the device.
@@ -550,6 +526,7 @@
             this.tlist = tlist;
         }
 
+        @Override
         public final void setReceiver(Receiver receiver) {
             if (tlist != null && this.receiver != receiver) {
                 if (Printer.debug) Printer.debug("Transmitter "+toString()+": set receiver "+receiver);
@@ -558,16 +535,17 @@
             }
         }
 
+        @Override
         public final Receiver getReceiver() {
             return receiver;
         }
 
-
         /** Close the Transmitter.
          * Here, the call to the magic method closeInternal() takes place.
          * Therefore, subclasses that override this method must call
          * 'super.close()'.
          */
+        @Override
         public final void close() {
             AbstractMidiDevice.this.closeInternal(this);
             if (tlist != null) {
@@ -577,19 +555,19 @@
             }
         }
 
+        @Override
         public final MidiDevice getMidiDevice() {
             return AbstractMidiDevice.this;
         }
 
     } // class BasicTransmitter
 
-
     /**
-     * a class to manage a list of transmitters
+     * a class to manage a list of transmitters.
      */
     final class TransmitterList {
 
-        private final ArrayList<Transmitter> transmitters = new ArrayList<Transmitter>();
+        private final ArrayList<Transmitter> transmitters = new ArrayList<>();
         private MidiOutDevice.MidiOutReceiver midiOutReceiver;
 
         // how many transmitters must be present for optimized
@@ -712,9 +690,8 @@
             }
         }
 
-
         /**
-        * Send this message to all transmitters
+        * Send this message to all transmitters.
         */
         void sendMessage(MidiMessage message, long timeStamp) {
             if (message instanceof FastShortMessage) {
@@ -746,8 +723,5 @@
                 }
             }
         }
-
-
     } // TransmitterList
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDeviceProvider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDeviceProvider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -52,7 +52,6 @@
         // also for memory's sake, do not initialize the arrays here
     }
 
-
     final synchronized void readDeviceInfos() {
         Info[] infos = getInfoCache();
         MidiDevice[] devices = getDeviceCache();
@@ -148,10 +147,6 @@
         throw MidiUtils.unsupportedDevice(info);
     }
 
-
-    // INNER CLASSES
-
-
     /**
      * Info class for MidiDevices.  Adds an index value for
      * making native references to a particular device.
@@ -182,9 +177,6 @@
 
     } // class Info
 
-
-    // ABSTRACT METHODS
-
     abstract int getNumDevices();
     abstract MidiDevice[] getDeviceCache();
     abstract void setDeviceCache(MidiDevice[] devices);
--- a/src/java.desktop/share/classes/com/sun/media/sound/AbstractMixer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AbstractMixer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -28,9 +28,9 @@
 import java.util.Vector;
 
 import javax.sound.sampled.Control;
-import javax.sound.sampled.Mixer;
 import javax.sound.sampled.Line;
 import javax.sound.sampled.LineUnavailableException;
+import javax.sound.sampled.Mixer;
 
 /**
  * Abstract Mixer.  Implements Mixer (with abstract methods) and specifies
@@ -76,29 +76,18 @@
      */
     private boolean manuallyOpened = false;
 
+    // STATE VARIABLES
 
     /**
-     * Supported formats for the mixer.
-     */
-    //$$fb DELETE
-    //protected Vector formats = new Vector();
-
-
-    // STATE VARIABLES
-
-
-    /**
-     * Source lines (ports) currently open
+     * Source lines (ports) currently open.
      */
     private final Vector<Line> sourceLines = new Vector<>();
 
-
     /**
      * Target lines currently open.
      */
     private final Vector<Line> targetLines = new Vector<>();
 
-
     /**
      * Constructs a new AbstractMixer.
      * @param mixer the mixer with which this line is associated
@@ -124,30 +113,28 @@
         this.targetLineInfo = targetLineInfo;
     }
 
-
     // MIXER METHODS
 
-
+    @Override
     public final Mixer.Info getMixerInfo() {
         return mixerInfo;
     }
 
-
+    @Override
     public final Line.Info[] getSourceLineInfo() {
         Line.Info[] localArray = new Line.Info[sourceLineInfo.length];
         System.arraycopy(sourceLineInfo, 0, localArray, 0, sourceLineInfo.length);
         return localArray;
     }
 
-
+    @Override
     public final Line.Info[] getTargetLineInfo() {
-
         Line.Info[] localArray = new Line.Info[targetLineInfo.length];
         System.arraycopy(targetLineInfo, 0, localArray, 0, targetLineInfo.length);
         return localArray;
     }
 
-
+    @Override
     public final Line.Info[] getSourceLineInfo(Line.Info info) {
 
         int i;
@@ -168,7 +155,7 @@
         return returnedArray;
     }
 
-
+    @Override
     public final Line.Info[] getTargetLineInfo(Line.Info info) {
 
         int i;
@@ -189,7 +176,7 @@
         return returnedArray;
     }
 
-
+    @Override
     public final boolean isLineSupported(Line.Info info) {
 
         int i;
@@ -211,9 +198,10 @@
         return false;
     }
 
-
+    @Override
     public abstract Line getLine(Line.Info info) throws LineUnavailableException;
 
+    @Override
     public abstract int getMaxLines(Line.Info info);
 
     protected abstract void implOpen() throws LineUnavailableException;
@@ -221,7 +209,7 @@
     protected abstract void implStop();
     protected abstract void implClose();
 
-
+    @Override
     public final Line[] getSourceLines() {
 
         Line[] localLines;
@@ -238,7 +226,7 @@
         return localLines;
     }
 
-
+    @Override
     public final Line[] getTargetLines() {
 
         Line[] localLines;
@@ -255,37 +243,37 @@
         return localLines;
     }
 
+    /**
+     * Default implementation always throws an exception.
+     */
+    @Override
+    public final void synchronize(Line[] lines, boolean maintainSync) {
+        throw new IllegalArgumentException("Synchronization not supported by this mixer.");
+    }
 
     /**
      * Default implementation always throws an exception.
      */
-    public final void synchronize(Line[] lines, boolean maintainSync) {
-        throw new IllegalArgumentException("Synchronization not supported by this mixer.");
-    }
-
-
-    /**
-     * Default implementation always throws an exception.
-     */
+    @Override
     public final void unsynchronize(Line[] lines) {
         throw new IllegalArgumentException("Synchronization not supported by this mixer.");
     }
 
-
     /**
      * Default implementation always returns false.
      */
+    @Override
     public final boolean isSynchronizationSupported(Line[] lines,
                                                     boolean maintainSync) {
         return false;
     }
 
-
     // OVERRIDES OF ABSTRACT DATA LINE METHODS
 
     /**
      * This implementation tries to open the mixer with its current format and buffer size settings.
      */
+    @Override
     public final synchronized void open() throws LineUnavailableException {
         open(true);
     }
@@ -307,10 +295,8 @@
         if (Printer.trace) Printer.trace("<< AbstractMixer: open() succeeded");
     }
 
-
     // METHOD FOR INTERNAL IMPLEMENTATION USE
 
-
     /**
      * The default implementation of this method just determines whether
      * this line is a source or target line, calls open(no-arg) on the
@@ -357,7 +343,6 @@
         if (Printer.trace) Printer.trace("<< AbstractMixer: open(" + line + ") completed");
     }
 
-
     /**
      * Removes this line from the list of open source lines and
      * open target lines, if it exists in either.
@@ -388,10 +373,10 @@
         if (Printer.trace) Printer.trace("<< AbstractMixer: close(" + line + ") succeeded");
     }
 
-
     /**
      * Close all lines and then close this mixer.
      */
+    @Override
     public final synchronized void close() {
         if (Printer.trace) Printer.trace(">> AbstractMixer: close()");
         if (isOpen()) {
@@ -439,7 +424,6 @@
         if (Printer.trace) Printer.trace("<< AbstractMixer: start(" + line + ") succeeded");
     }
 
-
     /**
      * Stops the mixer if this was the last running line.
      */
@@ -492,8 +476,6 @@
         if (Printer.trace) Printer.trace("<< AbstractMixer: stop(" + line + ") succeeded");
     }
 
-
-
     /**
      * Determines whether this is a source line for this mixer.
      * Right now this just checks whether it's supported, but should
@@ -510,7 +492,6 @@
         return false;
     }
 
-
     /**
      * Determines whether this is a target line for this mixer.
      * Right now this just checks whether it's supported, but should
@@ -527,7 +508,6 @@
         return false;
     }
 
-
     /**
      * Returns the first complete Line.Info object it finds that
      * matches the one specified, or null if no matching Line.Info
@@ -551,8 +531,6 @@
                 return targetLineInfo[i];
             }
         }
-
         return null;
     }
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AiffFileFormat.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AiffFileFormat.java	Mon Aug 22 08:27:10 2016 -0700
@@ -87,5 +87,4 @@
     int getSsndChunkOffset() {
         return getHeaderSize()-16;
     }
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java	Mon Aug 22 08:27:10 2016 -0700
@@ -29,7 +29,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioFileFormat.Type;
 import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioSystem;
--- a/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java	Mon Aug 22 08:27:10 2016 -0700
@@ -33,7 +33,6 @@
 import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
 
-
 /**
  * A-law encodes linear data, and decodes a-law data to linear data.
  *
@@ -52,7 +51,7 @@
                                              0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF};
 
     /**
-     * Initializes the decode tables
+     * Initializes the decode tables.
      */
     static {
         for (int i=0;i<256;i++) {
@@ -83,10 +82,7 @@
         super(alawEncodings, alawEncodings);
     }
 
-    // NEW CODE
-
-    /**
-     */
+    @Override
     public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat){
 
         if( sourceFormat.getEncoding().equals( AudioFormat.Encoding.PCM_SIGNED )) {
@@ -117,8 +113,7 @@
         }
     }
 
-    /**
-     */
+    @Override
     public AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat){
         Objects.requireNonNull(sourceFormat);
         if( (targetEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) && sourceFormat.getEncoding().equals( AudioFormat.Encoding.ALAW)) ||
@@ -129,8 +124,7 @@
             }
     }
 
-    /**
-     */
+    @Override
     public AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream){
         AudioFormat sourceFormat = sourceStream.getFormat();
         AudioFormat.Encoding sourceEncoding = sourceFormat.getEncoding();
@@ -169,9 +163,7 @@
         return getConvertedStream(targetFormat, sourceStream);
     }
 
-    /**
-     * use old code...
-     */
+    @Override
     public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){
         if (!isConversionSupported(targetFormat, sourceStream.getFormat()))
             throw new IllegalArgumentException("Unsupported conversion: "
@@ -180,10 +172,6 @@
         return getConvertedStream( targetFormat, sourceStream );
     }
 
-
-    // OLD CODE
-
-
     /**
      * Opens the codec with the specified parameters.
      * @param stream stream from which data to be processed should be read
@@ -192,7 +180,6 @@
      * @throws IllegalArgumentException if the format combination supplied is
      * not supported.
      */
-    /*  public AudioInputStream getConvertedStream(AudioFormat outputFormat, AudioInputStream stream) { */
     private AudioInputStream getConvertedStream(AudioFormat outputFormat, AudioInputStream stream) {
 
         AudioInputStream cs = null;
@@ -201,7 +188,7 @@
         if( inputFormat.matches(outputFormat) ) {
             cs = stream;
         } else {
-            cs = (AudioInputStream) (new AlawCodecStream(stream, outputFormat));
+            cs = new AlawCodecStream(stream, outputFormat);
         }
 
         return cs;
@@ -214,7 +201,6 @@
      * returns an array of length 0.
      * @return array of supported output formats.
      */
-    /*  public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */
     private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
 
 
@@ -343,18 +329,20 @@
          * Note that this won't actually read anything; must read in
          * two-byte units.
          */
+        @Override
         public int read() throws IOException {
 
             byte[] b = new byte[1];
             return read(b, 0, b.length);
         }
 
-
+        @Override
         public int read(byte[] b) throws IOException {
 
             return read(b, 0, b.length);
         }
 
+        @Override
         public int read(byte[] b, int off, int len) throws IOException {
 
             // don't read fractional frames
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java	Mon Aug 22 08:27:10 2016 -0700
@@ -45,6 +45,7 @@
  */
 public final class AudioFileSoundbankReader extends SoundbankReader {
 
+    @Override
     public Soundbank getSoundbank(URL url)
             throws InvalidMidiDataException, IOException {
         try {
@@ -59,6 +60,7 @@
         }
     }
 
+    @Override
     public Soundbank getSoundbank(InputStream stream)
             throws InvalidMidiDataException, IOException {
         stream.mark(512);
@@ -108,6 +110,7 @@
         }
     }
 
+    @Override
     public Soundbank getSoundbank(File file)
             throws InvalidMidiDataException, IOException {
         try {
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatConverter.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatConverter.java	Mon Aug 22 08:27:10 2016 -0700
@@ -89,8 +89,9 @@
                 mask = (byte) 0xFF;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             byte[] ret = converter.toByteArray(in_buff, in_offset, in_len,
                     out_buff, out_offset);
 
@@ -102,8 +103,9 @@
             return ret;
         }
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             if (mask_buffer == null || mask_buffer.length < in_buff.length)
                 mask_buffer = new byte[in_buff.length];
             System.arraycopy(in_buff, 0, mask_buffer, 0, in_buff.length);
@@ -132,8 +134,9 @@
 
         double[] double_buff = null;
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int in_len = out_len * 8;
             if (bytebuffer == null || bytebuffer.capacity() < in_len) {
                 bytebuffer = ByteBuffer.allocate(in_len).order(
@@ -154,8 +157,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int out_len = in_len * 8;
             if (bytebuffer == null || bytebuffer.capacity() < out_len) {
                 bytebuffer = ByteBuffer.allocate(out_len).order(
@@ -184,8 +188,9 @@
 
         double[] double_buff = null;
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int in_len = out_len * 8;
             if (bytebuffer == null || bytebuffer.capacity() < in_len) {
                 bytebuffer = ByteBuffer.allocate(in_len).order(
@@ -206,8 +211,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int out_len = in_len * 8;
             if (bytebuffer == null || bytebuffer.capacity() < out_len) {
                 bytebuffer = ByteBuffer.allocate(out_len).order(
@@ -240,8 +246,9 @@
 
         FloatBuffer floatbuffer = null;
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int in_len = out_len * 4;
             if (bytebuffer == null || bytebuffer.capacity() < in_len) {
                 bytebuffer = ByteBuffer.allocate(in_len).order(
@@ -255,8 +262,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int out_len = in_len * 4;
             if (bytebuffer == null || bytebuffer.capacity() < out_len) {
                 bytebuffer = ByteBuffer.allocate(out_len).order(
@@ -277,8 +285,9 @@
 
         FloatBuffer floatbuffer = null;
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int in_len = out_len * 4;
             if (bytebuffer == null || bytebuffer.capacity() < in_len) {
                 bytebuffer = ByteBuffer.allocate(in_len).order(
@@ -292,8 +301,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int out_len = in_len * 4;
             if (bytebuffer == null || bytebuffer.capacity() < out_len) {
                 bytebuffer = ByteBuffer.allocate(out_len).order(
@@ -316,8 +326,9 @@
 
     // PCM 8 bit, signed
     private static class AudioFloatConversion8S extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -327,8 +338,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -341,8 +353,9 @@
 
     // PCM 8 bit, unsigned
     private static class AudioFloatConversion8U extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -352,8 +365,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -372,8 +386,9 @@
 
     // PCM 16 bit, signed, little-endian
     private static class AudioFloatConversion16SL extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int len = out_offset + out_len;
             for (int ox = out_offset; ox < len; ox++) {
@@ -383,8 +398,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ox = out_offset;
             int len = in_offset + in_len;
             for (int ix = in_offset; ix < len; ix++) {
@@ -399,8 +415,9 @@
 
     // PCM 16 bit, signed, big-endian
     private static class AudioFloatConversion16SB extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -410,8 +427,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -426,8 +444,9 @@
 
     // PCM 16 bit, unsigned, little-endian
     private static class AudioFloatConversion16UL extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -438,8 +457,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -454,8 +474,9 @@
 
     // PCM 16 bit, unsigned, big-endian
     private static class AudioFloatConversion16UB extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -466,8 +487,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -488,8 +510,9 @@
 
     // PCM 24 bit, signed, little-endian
     private static class AudioFloatConversion24SL extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -502,8 +525,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -521,8 +545,9 @@
 
     // PCM 24 bit, signed, big-endian
     private static class AudioFloatConversion24SB extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -535,8 +560,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -554,8 +580,9 @@
 
     // PCM 24 bit, unsigned, little-endian
     private static class AudioFloatConversion24UL extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -567,8 +594,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -585,8 +613,9 @@
 
     // PCM 24 bit, unsigned, big-endian
     private static class AudioFloatConversion24UB extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -598,8 +627,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -622,8 +652,9 @@
 
     // PCM 32 bit, signed, little-endian
     private static class AudioFloatConversion32SL extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -635,8 +666,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -652,8 +684,9 @@
 
     // PCM 32 bit, signed, big-endian
     private static class AudioFloatConversion32SB extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -665,8 +698,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -682,8 +716,9 @@
 
     // PCM 32 bit, unsigned, little-endian
     private static class AudioFloatConversion32UL extends AudioFloatConverter {
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -696,8 +731,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -715,8 +751,9 @@
     // PCM 32 bit, unsigned, big-endian
     private static class AudioFloatConversion32UB extends AudioFloatConverter {
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -729,8 +766,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -760,8 +798,9 @@
             this.xbytes = xbytes;
         }
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -774,8 +813,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -801,8 +841,9 @@
             this.xbytes = xbytes;
         }
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -816,8 +857,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -843,8 +885,9 @@
             this.xbytes = xbytes;
         }
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -858,8 +901,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
@@ -886,8 +930,9 @@
             this.xbytes = xbytes;
         }
 
+        @Override
         public float[] toFloatArray(byte[] in_buff, int in_offset,
-                float[] out_buff, int out_offset, int out_len) {
+                                    float[] out_buff, int out_offset, int out_len) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < out_len; i++) {
@@ -901,8 +946,9 @@
             return out_buff;
         }
 
+        @Override
         public byte[] toByteArray(float[] in_buff, int in_offset, int in_len,
-                byte[] out_buff, int out_offset) {
+                                  byte[] out_buff, int out_offset) {
             int ix = in_offset;
             int ox = out_offset;
             for (int i = 0; i < in_len; i++) {
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java	Mon Aug 22 08:27:10 2016 -0700
@@ -32,9 +32,9 @@
 import java.util.Objects;
 
 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.AudioFormat.Encoding;
 import javax.sound.sampled.spi.FormatConversionProvider;
 
 /**
@@ -63,6 +63,7 @@
             fsize = ((targetFormat.getSampleSizeInBits() + 7) / 8);
         }
 
+        @Override
         public int read() throws IOException {
             byte[] b = new byte[1];
             int ret = read(b);
@@ -71,6 +72,7 @@
             return b[0] & 0xFF;
         }
 
+        @Override
         public int read(byte[] b, int off, int len) throws IOException {
 
             int flen = len / fsize;
@@ -83,6 +85,7 @@
             return ret * fsize;
         }
 
+        @Override
         public int available() throws IOException {
             int ret = stream.available();
             if (ret < 0)
@@ -90,22 +93,27 @@
             return ret * fsize;
         }
 
+        @Override
         public void close() throws IOException {
             stream.close();
         }
 
+        @Override
         public synchronized void mark(int readlimit) {
             stream.mark(readlimit * fsize);
         }
 
+        @Override
         public boolean markSupported() {
             return stream.markSupported();
         }
 
+        @Override
         public synchronized void reset() throws IOException {
             stream.reset();
         }
 
+        @Override
         public long skip(long n) throws IOException {
             long ret = stream.skip(n / fsize);
             if (ret < 0)
@@ -141,30 +149,37 @@
                             .isBigEndian());
         }
 
+        @Override
         public int available() throws IOException {
             return (ais.available() / sourceChannels) * targetChannels;
         }
 
+        @Override
         public void close() throws IOException {
             ais.close();
         }
 
+        @Override
         public AudioFormat getFormat() {
             return targetFormat;
         }
 
+        @Override
         public long getFrameLength() {
             return ais.getFrameLength();
         }
 
+        @Override
         public void mark(int readlimit) {
             ais.mark((readlimit / targetChannels) * sourceChannels);
         }
 
+        @Override
         public boolean markSupported() {
             return ais.markSupported();
         }
 
+        @Override
         public int read(float[] b, int off, int len) throws IOException {
             int len2 = (len / targetChannels) * sourceChannels;
             if (conversion_buffer == null || conversion_buffer.length < len2)
@@ -212,10 +227,12 @@
             return (ret / sourceChannels) * targetChannels;
         }
 
+        @Override
         public void reset() throws IOException {
             ais.reset();
         }
 
+        @Override
         public long skip(long len) throws IOException {
             long ret = ais.skip((len / targetChannels) * sourceChannels);
             if (ret < 0)
@@ -305,22 +322,27 @@
             ibuffer_len = buffer_len;
         }
 
+        @Override
         public int available() throws IOException {
             return 0;
         }
 
+        @Override
         public void close() throws IOException {
             ais.close();
         }
 
+        @Override
         public AudioFormat getFormat() {
             return targetFormat;
         }
 
+        @Override
         public long getFrameLength() {
             return AudioSystem.NOT_SPECIFIED; // ais.getFrameLength();
         }
 
+        @Override
         public void mark(int readlimit) {
             ais.mark((int) (readlimit * pitch[0]));
             mark_ibuffer_index = ibuffer_index;
@@ -337,6 +359,7 @@
             }
         }
 
+        @Override
         public boolean markSupported() {
             return ais.markSupported();
         }
@@ -381,6 +404,7 @@
 
         }
 
+        @Override
         public int read(float[] b, int off, int len) throws IOException {
 
             if (cbuffer == null || cbuffer[0].length < len / nrofchannels) {
@@ -431,6 +455,7 @@
             return len - remain * nrofchannels;
         }
 
+        @Override
         public void reset() throws IOException {
             ais.reset();
             if (mark_ibuffer == null)
@@ -447,6 +472,7 @@
 
         }
 
+        @Override
         public long skip(long len) throws IOException {
             if (len < 0)
                 return 0;
@@ -474,8 +500,9 @@
                                         Encoding.PCM_UNSIGNED,
                                         Encoding.PCM_FLOAT};
 
+    @Override
     public AudioInputStream getAudioInputStream(Encoding targetEncoding,
-            AudioInputStream sourceStream) {
+                                                AudioInputStream sourceStream) {
         if (!isConversionSupported(targetEncoding, sourceStream.getFormat())) {
             throw new IllegalArgumentException(
                     "Unsupported conversion: " + sourceStream.getFormat()
@@ -496,8 +523,9 @@
         return getAudioInputStream(targetFormat, sourceStream);
     }
 
+    @Override
     public AudioInputStream getAudioInputStream(AudioFormat targetFormat,
-            AudioInputStream sourceStream) {
+                                                AudioInputStream sourceStream) {
         if (!isConversionSupported(targetFormat, sourceStream.getFormat()))
             throw new IllegalArgumentException("Unsupported conversion: "
                     + sourceStream.getFormat().toString() + " to "
@@ -526,16 +554,19 @@
                 .getFrameLength());
     }
 
+    @Override
     public Encoding[] getSourceEncodings() {
         return new Encoding[] { Encoding.PCM_SIGNED, Encoding.PCM_UNSIGNED,
                 Encoding.PCM_FLOAT };
     }
 
+    @Override
     public Encoding[] getTargetEncodings() {
         return new Encoding[] { Encoding.PCM_SIGNED, Encoding.PCM_UNSIGNED,
                 Encoding.PCM_FLOAT };
     }
 
+    @Override
     public Encoding[] getTargetEncodings(AudioFormat sourceFormat) {
         if (AudioFloatConverter.getConverter(sourceFormat) == null)
             return new Encoding[0];
@@ -543,14 +574,15 @@
                 Encoding.PCM_FLOAT };
     }
 
+    @Override
     public AudioFormat[] getTargetFormats(Encoding targetEncoding,
-            AudioFormat sourceFormat) {
+                                          AudioFormat sourceFormat) {
         Objects.requireNonNull(targetEncoding);
         if (AudioFloatConverter.getConverter(sourceFormat) == null)
             return new AudioFormat[0];
         int channels = sourceFormat.getChannels();
 
-        ArrayList<AudioFormat> formats = new ArrayList<AudioFormat>();
+        ArrayList<AudioFormat> formats = new ArrayList<>();
 
         if (targetEncoding.equals(Encoding.PCM_SIGNED))
             formats.add(new AudioFormat(Encoding.PCM_SIGNED,
@@ -598,8 +630,9 @@
         return formats.toArray(new AudioFormat[formats.size()]);
     }
 
+    @Override
     public boolean isConversionSupported(AudioFormat targetFormat,
-            AudioFormat sourceFormat) {
+                                         AudioFormat sourceFormat) {
         Objects.requireNonNull(targetFormat);
         if (AudioFloatConverter.getConverter(sourceFormat) == null)
             return false;
@@ -612,8 +645,9 @@
         return true;
     }
 
+    @Override
     public boolean isConversionSupported(Encoding targetEncoding,
-            AudioFormat sourceFormat) {
+                                         AudioFormat sourceFormat) {
         Objects.requireNonNull(targetEncoding);
         if (AudioFloatConverter.getConverter(sourceFormat) == null)
             return false;
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatInputStream.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatInputStream.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.ByteArrayInputStream;
@@ -66,14 +67,17 @@
 
         }
 
+        @Override
         public AudioFormat getFormat() {
             return format;
         }
 
+        @Override
         public long getFrameLength() {
             return buffer_len;// / format.getFrameSize();
         }
 
+        @Override
         public int read(float[] b, int off, int len) throws IOException {
             if (b == null)
                 throw new NullPointerException();
@@ -91,6 +95,7 @@
             return len;
         }
 
+        @Override
         public long skip(long len) throws IOException {
             if (pos >= buffer_len)
                 return -1;
@@ -102,21 +107,26 @@
             return len;
         }
 
+        @Override
         public int available() throws IOException {
             return buffer_len - pos;
         }
 
+        @Override
         public void close() throws IOException {
         }
 
+        @Override
         public void mark(int readlimit) {
             markpos = pos;
         }
 
+        @Override
         public boolean markSupported() {
             return true;
         }
 
+        @Override
         public void reset() throws IOException {
             pos = markpos;
         }
@@ -163,14 +173,17 @@
             this.stream = stream;
         }
 
+        @Override
         public AudioFormat getFormat() {
             return stream.getFormat();
         }
 
+        @Override
         public long getFrameLength() {
             return stream.getFrameLength();
         }
 
+        @Override
         public int read(float[] b, int off, int len) throws IOException {
             int b_len = len * framesize_pc;
             if (buffer == null || buffer.length < b_len)
@@ -182,6 +195,7 @@
             return ret / framesize_pc;
         }
 
+        @Override
         public long skip(long len) throws IOException {
             long b_len = len * framesize_pc;
             long ret = stream.skip(b_len);
@@ -190,22 +204,27 @@
             return ret / framesize_pc;
         }
 
+        @Override
         public int available() throws IOException {
             return stream.available() / framesize_pc;
         }
 
+        @Override
         public void close() throws IOException {
             stream.close();
         }
 
+        @Override
         public void mark(int readlimit) {
             stream.mark(readlimit * framesize_pc);
         }
 
+        @Override
         public boolean markSupported() {
             return stream.markSupported();
         }
 
+        @Override
         public void reset() throws IOException {
             stream.reset();
         }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,9 +22,11 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.util.Map;
+
 import javax.sound.midi.MidiUnavailableException;
 import javax.sound.midi.Synthesizer;
 import javax.sound.sampled.AudioFormat;
@@ -53,7 +55,7 @@
      * @return current audio data format
      * @see AudioFormat
      */
-    public AudioFormat getFormat();
+    AudioFormat getFormat();
 
     /**
      * Gets information about the possible properties for the synthesizer.
@@ -63,8 +65,7 @@
      * describing possible properties. This array may be an empty array if
      * no properties are required.
      */
-    public AudioSynthesizerPropertyInfo[] getPropertyInfo(
-            Map<String, Object> info);
+    AudioSynthesizerPropertyInfo[] getPropertyInfo(Map<String, Object> info);
 
     /**
      * Opens the synthesizer and starts rendering audio into
@@ -93,7 +94,7 @@
      * @see #close
      * @see #isOpen
      */
-    public void open(SourceDataLine line, Map<String, Object> info)
+    void open(SourceDataLine line, Map<String, Object> info)
             throws MidiUnavailableException;
 
     /**
@@ -123,6 +124,7 @@
      * @see #close
      * @see #isOpen
      */
-    public AudioInputStream openStream(AudioFormat targetFormat,
-            Map<String, Object> info) throws MidiUnavailableException;
+    AudioInputStream openStream(AudioFormat targetFormat,
+                                Map<String, Object> info)
+            throws MidiUnavailableException;
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/AutoClosingClip.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AutoClosingClip.java	Mon Aug 22 08:27:10 2016 -0700
@@ -28,7 +28,7 @@
 import javax.sound.sampled.Clip;
 
 /**
- * Interface for Clip objects that close themselves automatically
+ * Interface for Clip objects that close themselves automatically.
  *
  * @author Florian Bomers
  */
--- a/src/java.desktop/share/classes/com/sun/media/sound/AutoConnectSequencer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AutoConnectSequencer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -41,6 +41,5 @@
      * needs to re-connect itself to a suitable
      * device in open().
      */
-    public void setAutoConnect(Receiver autoConnectReceiver);
-
+    void setAutoConnect(Receiver autoConnectReceiver);
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSInfo.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSInfo.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSInstrument.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSInstrument.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.ArrayList;
@@ -47,8 +48,8 @@
     boolean druminstrument = false;
     byte[] guid = null;
     DLSInfo info = new DLSInfo();
-    List<DLSRegion> regions = new ArrayList<DLSRegion>();
-    List<DLSModulator> modulators = new ArrayList<DLSModulator>();
+    List<DLSRegion> regions = new ArrayList<>();
+    List<DLSModulator> modulators = new ArrayList<>();
 
     public DLSInstrument() {
         super(null, null, null, null);
@@ -62,6 +63,7 @@
         return info;
     }
 
+    @Override
     public String getName() {
         return info.name;
     }
@@ -70,6 +72,7 @@
         info.name = name;
     }
 
+    @Override
     public ModelPatch getPatch() {
         return new ModelPatch(bank, preset, druminstrument);
     }
@@ -86,6 +89,7 @@
         }
     }
 
+    @Override
     public Object getData() {
         return null;
     }
@@ -98,6 +102,7 @@
         return modulators;
     }
 
+    @Override
     public String toString() {
         if (druminstrument)
             return "Drumkit: " + info.name
@@ -362,17 +367,17 @@
         return null;
     }
 
+    @Override
     public ModelPerformer[] getPerformers() {
-        List<ModelPerformer> performers = new ArrayList<ModelPerformer>();
+        List<ModelPerformer> performers = new ArrayList<>();
 
-        Map<String, DLSModulator> modmap = new HashMap<String, DLSModulator>();
+        Map<String, DLSModulator> modmap = new HashMap<>();
         for (DLSModulator mod: getModulators()) {
             modmap.put(mod.getSource() + "x" + mod.getControl() + "=" +
                     mod.getDestination(), mod);
         }
 
-        Map<String, DLSModulator> insmodmap =
-                new HashMap<String, DLSModulator>();
+        Map<String, DLSModulator> insmodmap = new HashMap<>();
 
         for (DLSRegion zone: regions) {
             ModelPerformer performer = new ModelPerformer();
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSModulator.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSModulator.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSRegion.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSRegion.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.ArrayList;
@@ -39,7 +40,7 @@
 public final class DLSRegion {
 
     public static final int OPTION_SELFNONEXCLUSIVE = 0x0001;
-    List<DLSModulator> modulators = new ArrayList<DLSModulator>();
+    List<DLSModulator> modulators = new ArrayList<>();
     int keyfrom;
     int keyto;
     int velfrom;
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSSample.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSSample.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,10 +22,12 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.io.InputStream;
 import java.util.Arrays;
+
 import javax.sound.midi.Soundbank;
 import javax.sound.midi.SoundbankResource;
 import javax.sound.sampled.AudioFormat;
@@ -60,6 +62,7 @@
         return info;
     }
 
+    @Override
     public Object getData() {
         AudioFormat format = getFormat();
 
@@ -93,6 +96,7 @@
         this.data = new ModelByteBuffer(data, offset, length);
     }
 
+    @Override
     public String getName() {
         return info.name;
     }
@@ -109,6 +113,7 @@
         this.sampleoptions = sampleOptions;
     }
 
+    @Override
     public String toString() {
         return "Sample: " + info.name;
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSSampleLoop.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSSampleLoop.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSSampleOptions.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSSampleOptions.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.ArrayList;
@@ -40,7 +41,7 @@
     short finetune;
     int attenuation;
     long options;
-    List<DLSSampleLoop> loops = new ArrayList<DLSSampleLoop>();
+    List<DLSSampleLoop> loops = new ArrayList<>();
 
     public int getAttenuation() {
         return attenuation;
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.File;
@@ -42,9 +43,9 @@
 import javax.sound.midi.Soundbank;
 import javax.sound.midi.SoundbankResource;
 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.AudioFormat.Encoding;
 
 /**
  * A DLS Level 1 and Level 2 soundbank reader (from files/url/streams).
@@ -100,10 +101,12 @@
             return d;
         }
 
+        @Override
         public int hashCode() {
             return (int)i1;
         }
 
+        @Override
         public boolean equals(Object obj) {
             if (!(obj instanceof DLSID)) {
                 return false;
@@ -176,8 +179,8 @@
 
     private final DLSInfo info = new DLSInfo();
 
-    private final List<DLSInstrument> instruments = new ArrayList<DLSInstrument>();
-    private final List<DLSSample> samples = new ArrayList<DLSSample>();
+    private final List<DLSInstrument> instruments = new ArrayList<>();
+    private final List<DLSSample> samples = new ArrayList<>();
 
     private boolean largeFormat = false;
     private File sampleFile;
@@ -300,7 +303,7 @@
         DLSID uuid;
         long x;
         long y;
-        Stack<Long> stack = new Stack<Long>();
+        Stack<Long> stack = new Stack<>();
 
         while (riff.available() != 0) {
             int opcode = riff.readUnsignedShort();
@@ -482,7 +485,7 @@
                     }
                 }
                 if (chunk.getType().equals("lart")) {
-                    List<DLSModulator> modlist = new ArrayList<DLSModulator>();
+                    List<DLSModulator> modlist = new ArrayList<>();
                     while (chunk.hasNextChunk()) {
                         RIFFReader subchunk = chunk.nextChunk();
                         if (chunk.getFormat().equals("cdl ")) {
@@ -498,7 +501,7 @@
                 }
                 if (chunk.getType().equals("lar2")) {
                     // support for DLS level 2 ART
-                    List<DLSModulator> modlist = new ArrayList<DLSModulator>();
+                    List<DLSModulator> modlist = new ArrayList<>();
                     while (chunk.hasNextChunk()) {
                         RIFFReader subchunk = chunk.nextChunk();
                         if (chunk.getFormat().equals("cdl ")) {
@@ -582,7 +585,7 @@
         }
     }
 
-    private Map<DLSRegion, Long> temp_rgnassign = new HashMap<DLSRegion, Long>();
+    private Map<DLSRegion, Long> temp_rgnassign = new HashMap<>();
 
     private boolean readRgnChunk(DLSRegion split, RIFFReader riff)
             throws IOException {
@@ -591,7 +594,7 @@
             String format = chunk.getFormat();
             if (format.equals("LIST")) {
                 if (chunk.getType().equals("lart")) {
-                    List<DLSModulator> modlist = new ArrayList<DLSModulator>();
+                    List<DLSModulator> modlist = new ArrayList<>();
                     while (chunk.hasNextChunk()) {
                         RIFFReader subchunk = chunk.nextChunk();
                         if (chunk.getFormat().equals("cdl ")) {
@@ -607,7 +610,7 @@
                 }
                 if (chunk.getType().equals("lar2")) {
                     // support for DLS level 2 ART
-                    List<DLSModulator> modlist = new ArrayList<DLSModulator>();
+                    List<DLSModulator> modlist = new ArrayList<>();
                     while (chunk.hasNextChunk()) {
                         RIFFReader subchunk = chunk.nextChunk();
                         if (chunk.getFormat().equals("cdl ")) {
@@ -902,7 +905,7 @@
 
         RIFFWriter wvpl = writer.writeList("wvpl");
         long off = wvpl.getFilePointer();
-        List<Long> offsettable = new ArrayList<Long>();
+        List<Long> offsettable = new ArrayList<>();
         for (DLSSample sample : samples) {
             offsettable.add(Long.valueOf(wvpl.getFilePointer() - off));
             writeSample(wvpl.writeList("wave"), sample);
@@ -1179,18 +1182,22 @@
         return info;
     }
 
+    @Override
     public String getName() {
         return info.name;
     }
 
+    @Override
     public String getVersion() {
         return major + "." + minor;
     }
 
+    @Override
     public String getVendor() {
         return info.engineers;
     }
 
+    @Override
     public String getDescription() {
         return info.comments;
     }
@@ -1207,6 +1214,7 @@
         info.comments = s;
     }
 
+    @Override
     public SoundbankResource[] getResources() {
         SoundbankResource[] resources = new SoundbankResource[samples.size()];
         int j = 0;
@@ -1215,6 +1223,7 @@
         return resources;
     }
 
+    @Override
     public DLSInstrument[] getInstruments() {
         DLSInstrument[] inslist_array =
                 instruments.toArray(new DLSInstrument[instruments.size()]);
@@ -1226,6 +1235,7 @@
         return samples.toArray(new DLSSample[samples.size()]);
     }
 
+    @Override
     public Instrument getInstrument(Patch patch) {
         int program = patch.getProgram();
         int bank = patch.getBank();
@@ -1256,9 +1266,9 @@
 
     public void removeResource(SoundbankResource resource) {
         if (resource instanceof DLSInstrument)
-            instruments.remove((DLSInstrument) resource);
+            instruments.remove(resource);
         if (resource instanceof DLSSample)
-            samples.remove((DLSSample) resource);
+            samples.remove(resource);
     }
 
     public void addInstrument(DLSInstrument resource) {
--- a/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbankReader.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbankReader.java	Mon Aug 22 08:27:10 2016 -0700
@@ -29,6 +29,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+
 import javax.sound.midi.InvalidMidiDataException;
 import javax.sound.midi.Soundbank;
 import javax.sound.midi.spi.SoundbankReader;
@@ -41,6 +42,7 @@
  */
 public final class DLSSoundbankReader extends SoundbankReader {
 
+    @Override
     public Soundbank getSoundbank(URL url)
             throws InvalidMidiDataException, IOException {
         try {
@@ -52,6 +54,7 @@
         }
     }
 
+    @Override
     public Soundbank getSoundbank(InputStream stream)
             throws InvalidMidiDataException, IOException {
         try {
@@ -63,6 +66,7 @@
         }
     }
 
+    @Override
     public Soundbank getSoundbank(File file)
             throws InvalidMidiDataException, IOException {
         try {
--- a/src/java.desktop/share/classes/com/sun/media/sound/DataPusher.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DataPusher.java	Mon Aug 22 08:27:10 2016 -0700
@@ -27,7 +27,9 @@
 
 import java.util.Arrays;
 
-import javax.sound.sampled.*;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.SourceDataLine;
 
 /**
  * Class to write an AudioInputStream to a SourceDataLine.
@@ -125,7 +127,6 @@
         if (DEBUG || Printer.debug) Printer.debug("< DataPusher.start(loop="+loop+")");
     }
 
-
     public synchronized void stop() {
         if (DEBUG || Printer.debug) Printer.debug("> DataPusher.stop()");
         if (threadState == STATE_STOPPING
@@ -161,6 +162,7 @@
     /**
      * Write data to the source data line.
      */
+    @Override
     public void run() {
         byte[] buffer = null;
         boolean useStream = (ais != null);
@@ -242,5 +244,4 @@
         }
         if (DEBUG || Printer.debug)Printer.debug("DataPusher:end of thread");
     }
-
 } // class DataPusher
--- a/src/java.desktop/share/classes/com/sun/media/sound/DirectAudioDevice.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DirectAudioDevice.java	Mon Aug 22 08:27:10 2016 -0700
@@ -29,35 +29,35 @@
 import java.io.IOException;
 import java.util.Vector;
 
-import javax.sound.sampled.*;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.BooleanControl;
+import javax.sound.sampled.Clip;
+import javax.sound.sampled.Control;
+import javax.sound.sampled.DataLine;
+import javax.sound.sampled.FloatControl;
+import javax.sound.sampled.Line;
+import javax.sound.sampled.LineUnavailableException;
+import javax.sound.sampled.SourceDataLine;
+import javax.sound.sampled.TargetDataLine;
 
 // IDEA:
 // Use java.util.concurrent.Semaphore,
 // java.util.concurrent.locks.ReentrantLock and other new classes/methods
 // to improve this class's thread safety.
 
-
 /**
- * A Mixer which provides direct access to audio devices
+ * A Mixer which provides direct access to audio devices.
  *
  * @author Florian Bomers
  */
 final class DirectAudioDevice extends AbstractMixer {
 
-    // CONSTANTS
     private static final int CLIP_BUFFER_TIME = 1000; // in milliseconds
 
     private static final int DEFAULT_LINE_BUFFER_TIME = 500; // in milliseconds
 
-    // INSTANCE VARIABLES
-
-    /** number of opened lines */
-    private int deviceCountOpened = 0;
-
-    /** number of started lines */
-    private int deviceCountStarted = 0;
-
-    // CONSTRUCTOR
     DirectAudioDevice(DirectAudioDeviceProvider.DirectAudioDeviceInfo portMixerInfo) {
         // pass in Line.Info, mixer, controls
         super(portMixerInfo,              // Mixer.Info
@@ -168,6 +168,7 @@
 
     // ABSTRACT MIXER: ABSTRACT METHOD IMPLEMENTATIONS
 
+    @Override
     public Line getLine(Line.Info info) throws LineUnavailableException {
         Line.Info fullInfo = getLineInfo(info);
         if (fullInfo == null) {
@@ -216,7 +217,7 @@
         throw new IllegalArgumentException("Line unsupported: " + info);
     }
 
-
+    @Override
     public int getMaxLines(Line.Info info) {
         Line.Info fullInfo = getLineInfo(info);
 
@@ -233,26 +234,26 @@
         return 0;
     }
 
-
+    @Override
     protected void implOpen() throws LineUnavailableException {
         if (Printer.trace) Printer.trace("DirectAudioDevice: implOpen - void method");
     }
 
+    @Override
     protected void implClose() {
         if (Printer.trace) Printer.trace("DirectAudioDevice: implClose - void method");
     }
 
+    @Override
     protected void implStart() {
         if (Printer.trace) Printer.trace("DirectAudioDevice: implStart - void method");
     }
 
+    @Override
     protected void implStop() {
         if (Printer.trace) Printer.trace("DirectAudioDevice: implStop - void method");
     }
 
-
-    // IMPLEMENTATION HELPERS
-
     int getMixerIndex() {
         return ((DirectAudioDeviceProvider.DirectAudioDeviceInfo) getMixerInfo()).getIndex();
     }
@@ -319,12 +320,6 @@
         return null;
     }
 
-
-
-
-    // INNER CLASSES
-
-
     /**
      * Private inner class for the DataLine.Info objects
      * adds a little magic for the isFormatSupported so
@@ -367,7 +362,7 @@
     }
 
     /**
-     * Private inner class as base class for direct lines
+     * Private inner class as base class for direct lines.
      */
     private static class DirectDL extends AbstractDataLine implements EventDispatcher.LineMonitor {
         protected final int mixerIndex;
@@ -397,7 +392,6 @@
         // Guards all native calls.
         protected final Object lockNative = new Object();
 
-        // CONSTRUCTOR
         protected DirectDL(DataLine.Info info,
                            DirectAudioDevice mixer,
                            AudioFormat format,
@@ -414,11 +408,7 @@
 
         }
 
-
-        // ABSTRACT METHOD IMPLEMENTATIONS
-
-        // ABSTRACT LINE / DATALINE
-
+        @Override
         void implOpen(AudioFormat format, int bufferSize) throws LineUnavailableException {
             if (Printer.trace) Printer.trace(">> DirectDL: implOpen("+format+", "+bufferSize+" bytes)");
 
@@ -538,7 +528,7 @@
             if (Printer.trace) Printer.trace("<< DirectDL: implOpen() succeeded");
         }
 
-
+        @Override
         void implStart() {
             if (Printer.trace) Printer.trace(" >> DirectDL: implStart()");
 
@@ -570,6 +560,7 @@
             if (Printer.trace) Printer.trace("<< DirectDL: implStart() succeeded");
         }
 
+        @Override
         void implStop() {
             if (Printer.trace) Printer.trace(">> DirectDL: implStop()");
 
@@ -600,6 +591,7 @@
             if (Printer.trace) Printer.trace(" << DirectDL: implStop() succeeded");
         }
 
+        @Override
         void implClose() {
             if (Printer.trace) Printer.trace(">> DirectDL: implClose()");
 
@@ -625,8 +617,7 @@
             if (Printer.trace) Printer.trace("<< DirectDL: implClose() succeeded");
         }
 
-        // METHOD OVERRIDES
-
+        @Override
         public int available() {
             if (id == 0) {
                 return 0;
@@ -638,7 +629,7 @@
             return a;
         }
 
-
+        @Override
         public void drain() {
             noService = true;
             // additional safeguard against draining forever
@@ -681,6 +672,7 @@
             noService = false;
         }
 
+        @Override
         public void flush() {
             if (id != 0) {
                 // first stop ongoing read/write method
@@ -699,6 +691,7 @@
         }
 
         // replacement for getFramePosition (see AbstractDataLine)
+        @Override
         public long getLongFramePosition() {
             long pos;
             synchronized (lockNative) {
@@ -713,7 +706,6 @@
             return (pos / getFormat().getFrameSize());
         }
 
-
         /*
          * write() belongs into SourceDataLine and Clip,
          * so define it here and make it accessible by
@@ -786,6 +778,7 @@
         }
 
         // called from event dispatcher for lines that need servicing
+        @Override
         public void checkLine() {
             synchronized (lockNative) {
                 if (monitoring
@@ -826,7 +819,6 @@
             }
         }
 
-
         /////////////////// CONTROLS /////////////////////////////
 
         protected final class Gain extends FloatControl {
@@ -844,6 +836,7 @@
                       "dB", "Minimum", "", "Maximum");
             }
 
+            @Override
             public void setValue(float newValue) {
                 // adjust value within range ?? spec says IllegalArgumentException
                 //newValue = Math.min(newValue, getMaximum());
@@ -861,13 +854,13 @@
             }
         } // class Gain
 
-
         private final class Mute extends BooleanControl {
 
             private Mute() {
                 super(BooleanControl.Type.MUTE, false, "True", "False");
             }
 
+            @Override
             public void setValue(boolean newValue) {
                 super.setValue(newValue);
                 calcVolume();
@@ -881,6 +874,7 @@
                       "", "Left", "Center", "Right");
             }
 
+            @Override
             public void setValue(float newValue) {
                 setValueImpl(newValue);
                 panControl.setValueImpl(newValue);
@@ -900,6 +894,7 @@
                       "", "Left", "Center", "Right");
             }
 
+            @Override
             public void setValue(float newValue) {
                 setValueImpl(newValue);
                 balanceControl.setValueImpl(newValue);
@@ -909,19 +904,14 @@
                 super.setValue(newValue);
             }
         } // class Pan
-
-
-
     } // class DirectDL
 
-
     /**
-     * Private inner class representing a SourceDataLine
+     * Private inner class representing a SourceDataLine.
      */
     private static final class DirectSDL extends DirectDL
             implements SourceDataLine {
 
-        // CONSTRUCTOR
         private DirectSDL(DataLine.Info info,
                           AudioFormat format,
                           int bufferSize,
@@ -933,12 +923,11 @@
     }
 
     /**
-     * Private inner class representing a TargetDataLine
+     * Private inner class representing a TargetDataLine.
      */
     private static final class DirectTDL extends DirectDL
             implements TargetDataLine {
 
-        // CONSTRUCTOR
         private DirectTDL(DataLine.Info info,
                           AudioFormat format,
                           int bufferSize,
@@ -947,8 +936,7 @@
             if (Printer.trace) Printer.trace("DirectTDL CONSTRUCTOR: completed");
         }
 
-        // METHOD OVERRIDES
-
+        @Override
         public int read(byte[] b, int off, int len) {
             flushing = false;
             if (len == 0) {
@@ -1030,7 +1018,6 @@
         // auto closing clip support
         private boolean autoclosing = false;
 
-        // CONSTRUCTOR
         private DirectClip(DataLine.Info info,
                            AudioFormat format,
                            int bufferSize,
@@ -1041,6 +1028,7 @@
 
         // CLIP METHODS
 
+        @Override
         public void open(AudioFormat format, byte[] data, int offset, int bufferSize)
             throws LineUnavailableException {
 
@@ -1111,7 +1099,7 @@
             if (Printer.trace) Printer.trace("< DirectClip.open completed");
         }
 
-
+        @Override
         public void open(AudioInputStream stream) throws LineUnavailableException, IOException {
 
             // $$fb part of fix for 4679187: Clip.open() throws unexpected Exceptions
@@ -1178,17 +1166,17 @@
             } // synchronized
         }
 
-
+        @Override
         public int getFrameLength() {
             return m_lengthInFrames;
         }
 
-
+        @Override
         public long getMicrosecondLength() {
             return Toolkit.frames2micros(getFormat(), getFrameLength());
         }
 
-
+        @Override
         public void setFramePosition(int frames) {
             if (Printer.trace) Printer.trace("> DirectClip: setFramePosition: " + frames);
 
@@ -1229,6 +1217,7 @@
         }
 
         // replacement for getFramePosition (see AbstractDataLine)
+        @Override
         public long getLongFramePosition() {
             /* $$fb
              * this would be intuitive, but the definition of getFramePosition
@@ -1243,7 +1232,7 @@
             return super.getLongFramePosition();
         }
 
-
+        @Override
         public synchronized void setMicrosecondPosition(long microseconds) {
             if (Printer.trace) Printer.trace("> DirectClip: setMicrosecondPosition: " + microseconds);
 
@@ -1253,6 +1242,7 @@
             if (Printer.trace) Printer.trace("< DirectClip: setMicrosecondPosition succeeded");
         }
 
+        @Override
         public void setLoopPoints(int start, int end) {
             if (Printer.trace) Printer.trace("> DirectClip: setLoopPoints: start: " + start + " end: " + end);
 
@@ -1283,7 +1273,7 @@
             if (Printer.trace) Printer.trace("< DirectClip: setLoopPoints completed");
         }
 
-
+        @Override
         public void loop(int count) {
             // note: when count reaches 0, it means that the entire clip
             // will be played, i.e. it will play past the loop end point
@@ -1291,10 +1281,7 @@
             start();
         }
 
-        // ABSTRACT METHOD IMPLEMENTATIONS
-
-        // ABSTRACT LINE
-
+        @Override
         void implOpen(AudioFormat format, int bufferSize) throws LineUnavailableException {
             // only if audioData wasn't set in a calling open(format, byte[], frameSize)
             // this call is allowed.
@@ -1304,6 +1291,7 @@
             super.implOpen(format, bufferSize);
         }
 
+        @Override
         void implClose() {
             if (Printer.trace) Printer.trace(">> DirectClip: implClose()");
 
@@ -1333,13 +1321,14 @@
             if (Printer.trace) Printer.trace("<< DirectClip: implClose() succeeded");
         }
 
-
+        @Override
         void implStart() {
             if (Printer.trace) Printer.trace("> DirectClip: implStart()");
             super.implStart();
             if (Printer.trace) Printer.trace("< DirectClip: implStart() succeeded");
         }
 
+        @Override
         void implStop() {
             if (Printer.trace) Printer.trace(">> DirectClip: implStop()");
 
@@ -1351,8 +1340,8 @@
             if (Printer.trace) Printer.trace("<< DirectClip: implStop() succeeded");
         }
 
-
         // main playback loop
+        @Override
         public void run() {
             if (Printer.trace) Printer.trace(">>> DirectClip: run() threadID="+Thread.currentThread().getId());
             while (thread != null) {
@@ -1418,10 +1407,12 @@
            MixerClip. They should be moved to a base class, together
            with the instance variable 'autoclosing'. */
 
+        @Override
         public boolean isAutoClosing() {
             return autoclosing;
         }
 
+        @Override
         public void setAutoClosing(boolean value) {
             if (value != autoclosing) {
                 if (isOpen()) {
@@ -1435,6 +1426,7 @@
             }
         }
 
+        @Override
         protected boolean requiresServicing() {
             // no need for servicing for Clips
             return false;
@@ -1488,5 +1480,4 @@
     private static native boolean nRequiresServicing(long id, boolean isSource);
     // called in irregular intervals
     private static native void nService(long id, boolean isSource);
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/DirectAudioDeviceProvider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/DirectAudioDeviceProvider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -28,7 +28,6 @@
 import javax.sound.sampled.Mixer;
 import javax.sound.sampled.spi.MixerProvider;
 
-
 /**
  * DirectAudioDevice provider.
  *
@@ -36,8 +35,6 @@
  */
 public final class DirectAudioDeviceProvider extends MixerProvider {
 
-    // STATIC VARIABLES
-
     /**
      * Set of info objects for all port input devices on the system.
      */
@@ -48,18 +45,11 @@
      */
     private static DirectAudioDevice[] devices;
 
-
-    // STATIC
-
     static {
         // initialize
         Platform.initialize();
     }
 
-
-    // CONSTRUCTOR
-
-
     /**
      * Required public no-arg constructor.
      */
@@ -92,6 +82,7 @@
         }
     }
 
+    @Override
     public Mixer.Info[] getMixerInfo() {
         synchronized (DirectAudioDeviceProvider.class) {
             Mixer.Info[] localArray = new Mixer.Info[infos.length];
@@ -100,7 +91,7 @@
         }
     }
 
-
+    @Override
     public Mixer getMixer(Mixer.Info info) {
         synchronized (DirectAudioDeviceProvider.class) {
             // if the default device is asked, we provide the mixer
@@ -125,7 +116,6 @@
                 String.format("Mixer %s not supported by this provider", info));
     }
 
-
     private static Mixer getDevice(DirectAudioDeviceInfo info) {
         int index = info.getIndex();
         if (devices[index] == null) {
@@ -134,9 +124,6 @@
         return devices[index];
     }
 
-    // INNER CLASSES
-
-
     /**
      * Info class for DirectAudioDevices.  Adds an index value and a string for
      * making native references to a particular device.
@@ -171,7 +158,6 @@
         }
     } // class DirectAudioDeviceInfo
 
-    // NATIVE METHODS
     private static native int nGetNumDevices();
     // index: [0..nGetNumDevices()-1]
     private static native DirectAudioDeviceInfo nNewDirectAudioDeviceInfo(int deviceIndex);
--- a/src/java.desktop/share/classes/com/sun/media/sound/EmergencySoundbank.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/EmergencySoundbank.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.Random;
--- a/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java	Mon Aug 22 08:27:10 2016 -0700
@@ -35,8 +35,6 @@
 import javax.sound.sampled.LineEvent;
 import javax.sound.sampled.LineListener;
 
-
-
 /**
  * EventDispatcher.  Used by various classes in the Java Sound implementation
  * to send events.
@@ -49,39 +47,35 @@
 
     /**
      * time of inactivity until the auto closing clips
-     * are closed
+     * are closed.
      */
     private static final int AUTO_CLOSE_TIME = 5000;
 
-
     /**
-     * List of events
+     * List of events.
      */
     private final ArrayList<EventInfo> eventQueue = new ArrayList<>();
 
-
     /**
-     * Thread object for this EventDispatcher instance
+     * Thread object for this EventDispatcher instance.
      */
     private Thread thread = null;
 
-
     /*
      * support for auto-closing Clips
      */
-    private final ArrayList<ClipInfo> autoClosingClips = new ArrayList<ClipInfo>();
+    private final ArrayList<ClipInfo> autoClosingClips = new ArrayList<>();
 
     /*
      * support for monitoring data lines
      */
-    private final ArrayList<LineMonitor> lineMonitors = new ArrayList<LineMonitor>();
+    private final ArrayList<LineMonitor> lineMonitors = new ArrayList<>();
 
     /**
      * Approximate interval between calls to LineMonitor.checkLine
      */
     static final int LINE_MONITOR_TIME = 400;
 
-
     /**
      * This start() method starts an event thread if one is not already active.
      */
@@ -96,7 +90,6 @@
         }
     }
 
-
     /**
      * Invoked when there is at least one event in the queue.
      * Implement this as a callback to process one event.
@@ -153,7 +146,6 @@
         Printer.err("Unknown event type: " + eventInfo.getEvent());
     }
 
-
     /**
      * Wait until there is something in the event queue to process.  Then
      * dispatch the event to the listeners.The entire method does not
@@ -202,7 +194,6 @@
         }
     }
 
-
     /**
      * Queue the given event in the event queue.
      */
@@ -211,10 +202,10 @@
         notifyAll();
     }
 
-
     /**
      * A loop to dispatch events.
      */
+    @Override
     public void run() {
 
         while (true) {
@@ -226,7 +217,6 @@
         }
     }
 
-
     /**
      * Send audio and MIDI events.
      */
@@ -243,7 +233,6 @@
         postEvent(eventInfo);
     }
 
-
     /*
      * go through the list of registered auto-closing
      * Clip instances and close them, if appropriate
@@ -291,7 +280,7 @@
     }
 
     /**
-     * called from auto-closing clips when one of their open() method is called
+     * called from auto-closing clips when one of their open() method is called.
      */
     void autoClosingClipOpened(AutoClosingClip clip) {
         if (Printer.debug)Printer.debug("> EventDispatcher.autoClosingClipOpened ");
@@ -316,7 +305,7 @@
     }
 
     /**
-     * called from auto-closing clips when their closed() method is called
+     * called from auto-closing clips when their closed() method is called.
      */
     void autoClosingClipClosed(AutoClosingClip clip) {
         // nothing to do -- is removed from arraylist above
@@ -340,9 +329,8 @@
         if (Printer.debug)Printer.debug("< EventDispatcher.monitorLines("+lineMonitors.size()+" monitors)");
     }
 
-
     /**
-     * Add this LineMonitor instance to the list of monitors
+     * Add this LineMonitor instance to the list of monitors.
      */
     void addLineMonitor(LineMonitor lm) {
         if (Printer.trace)Printer.trace("> EventDispatcher.addLineMonitor("+lm+")");
@@ -362,7 +350,7 @@
     }
 
     /**
-     * Remove this LineMonitor instance from the list of monitors
+     * Remove this LineMonitor instance from the list of monitors.
      */
     void removeLineMonitor(LineMonitor lm) {
         if (Printer.trace)Printer.trace("> EventDispatcher.removeLineMonitor("+lm+")");
@@ -377,8 +365,6 @@
         if (Printer.debug)Printer.debug("< EventDispatcher.removeLineMonitor finished -- now ("+lineMonitors.size()+" monitors)");
     }
 
-    // /////////////////////////////////// INNER CLASSES ////////////////////////////////////////// //
-
     /**
      * Container for an event and a set of listeners to deliver it to.
      */
@@ -413,7 +399,7 @@
 
 
     /**
-     * Container for a clip with its expiration time
+     * Container for a clip with its expiration time.
      */
     private class ClipInfo {
 
@@ -421,7 +407,7 @@
         private final long expiration;
 
         /**
-         * Create a new instance of this clip Info class
+         * Create a new instance of this clip Info class.
          */
         ClipInfo(AutoClosingClip clip) {
             this.clip = clip;
@@ -440,13 +426,13 @@
 
     /**
      * Interface that a class that wants to get regular
-     * line monitor events implements
+     * line monitor events implements.
      */
     interface LineMonitor {
         /**
-         * Called by event dispatcher in regular intervals
+         * Called by event dispatcher in regular intervals.
          */
-        public void checkLine();
+        void checkLine();
     }
 
 } // class EventDispatcher
--- a/src/java.desktop/share/classes/com/sun/media/sound/FFT.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/FFT.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -588,7 +589,6 @@
             i += jmax << 1;
 
         }
-
     }
 
     // Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
@@ -682,7 +682,6 @@
             i += jmax << 1;
 
         }
-
     }
 
     private void bitreversal(double[] data) {
@@ -743,6 +742,5 @@
             data[n] = data[m];
             data[m] = tempi;
         }
-
     }
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/FastShortMessage.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/FastShortMessage.java	Mon Aug 22 08:27:10 2016 -0700
@@ -25,10 +25,11 @@
 
 package com.sun.media.sound;
 
-import javax.sound.midi.*;
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.ShortMessage;
 
 /**
- * an optimized ShortMessage that does not need an array
+ * an optimized ShortMessage that does not need an array.
  *
  * @author Florian Bomers
  */
@@ -51,6 +52,7 @@
         return packedMsg;
     }
 
+    @Override
     public byte[] getMessage() {
         int length = 0;
         try {
@@ -73,6 +75,7 @@
         return returnedArray;
     }
 
+    @Override
     public int getLength() {
         try {
             return getDataLength(packedMsg & 0xFF) + 1;
@@ -82,6 +85,7 @@
         return 0;
     }
 
+    @Override
     public void setMessage(int status) throws InvalidMidiDataException {
         // check for valid values
         int dataLength = getDataLength(status); // can throw InvalidMidiDataException
@@ -91,35 +95,39 @@
         packedMsg = (packedMsg & 0xFFFF00) | (status & 0xFF);
     }
 
-
+    @Override
     public void setMessage(int status, int data1, int data2) throws InvalidMidiDataException {
         getDataLength(status); // can throw InvalidMidiDataException
         packedMsg = (status & 0xFF) | ((data1 & 0xFF) << 8) | ((data2 & 0xFF) << 16);
     }
 
-
+    @Override
     public void setMessage(int command, int channel, int data1, int data2) throws InvalidMidiDataException {
         getDataLength(command); // can throw InvalidMidiDataException
         packedMsg = (command & 0xF0) | (channel & 0x0F) | ((data1 & 0xFF) << 8) | ((data2 & 0xFF) << 16);
     }
 
-
+    @Override
     public int getChannel() {
         return packedMsg & 0x0F;
     }
 
+    @Override
     public int getCommand() {
         return packedMsg & 0xF0;
     }
 
+    @Override
     public int getData1() {
         return (packedMsg & 0xFF00) >> 8;
     }
 
+    @Override
     public int getData2() {
         return (packedMsg & 0xFF0000) >> 16;
     }
 
+    @Override
     public int getStatus() {
         return packedMsg & 0xFF;
     }
@@ -129,6 +137,7 @@
      * as this object.
      * @return a clone of this instance.
      */
+    @Override
     public Object clone() {
         try {
             return new FastShortMessage(packedMsg);
--- a/src/java.desktop/share/classes/com/sun/media/sound/FastSysexMessage.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/FastSysexMessage.java	Mon Aug 22 08:27:10 2016 -0700
@@ -25,10 +25,11 @@
 
 package com.sun.media.sound;
 
-import javax.sound.midi.*;
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.SysexMessage;
 
 /**
- * optimized FastSysexMessage that doesn't copy the array upon instantiation
+ * optimized FastSysexMessage that doesn't copy the array upon instantiation.
  *
  * @author Florian Bomers
  */
@@ -51,6 +52,7 @@
 
     // overwrite this method so that the original data array,
     // which is shared among all transmitters, cannot be modified
+    @Override
     public void setMessage(byte[] data, int length) throws InvalidMidiDataException {
         if ((data.length == 0) || (((data[0] & 0xFF) != 0xF0) && ((data[0] & 0xFF) != 0xF7))) {
             super.setMessage(data, data.length); // will throw Exception
--- a/src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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;
--- a/src/java.desktop/share/classes/com/sun/media/sound/InvalidFormatException.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/InvalidFormatException.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java	Mon Aug 22 08:27:10 2016 -0700
@@ -69,11 +69,12 @@
         return ok;
     }
 
+    @Override
     public Soundbank getSoundbank(URL url)
             throws InvalidMidiDataException, IOException {
         if (!isZIP(url))
             return null;
-        ArrayList<Soundbank> soundbanks = new ArrayList<Soundbank>();
+        ArrayList<Soundbank> soundbanks = new ArrayList<>();
         URLClassLoader ucl = URLClassLoader.newInstance(new URL[]{url});
         InputStream stream = ucl.getResourceAsStream(
                 "META-INF/services/javax.sound.midi.Soundbank");
@@ -114,12 +115,14 @@
         return sbk;
     }
 
+    @Override
     public Soundbank getSoundbank(InputStream stream)
             throws InvalidMidiDataException, IOException {
         Objects.requireNonNull(stream);
         return null;
     }
 
+    @Override
     public Soundbank getSoundbank(File file)
             throws InvalidMidiDataException, IOException {
         return getSoundbank(file.toURI().toURL());
--- a/src/java.desktop/share/classes/com/sun/media/sound/JDK13Services.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/JDK13Services.java	Mon Aug 22 08:27:10 2016 -0700
@@ -136,7 +136,6 @@
         return value;
     }
 
-
     /** Obtain the instance name part of a default provider property.
         @param typeClass The type of the default provider property. This
         should be one of Receiver.class, Transmitter.class, Sequencer.class,
@@ -158,7 +157,6 @@
         return value;
     }
 
-
     /** Obtain the value of a default provider property.
         @param typeClass The type of the default provider property. This
         should be one of Receiver.class, Transmitter.class, Sequencer.class,
@@ -190,7 +188,6 @@
         return value;
     }
 
-
     /** Obtain a properties bundle containing property values from the
         properties file. If the properties file could not be loaded,
         the properties bundle is empty.
--- a/src/java.desktop/share/classes/com/sun/media/sound/JSSecurityManager.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/JSSecurityManager.java	Mon Aug 22 08:27:10 2016 -0700
@@ -26,19 +26,17 @@
 package com.sun.media.sound;
 
 import java.io.BufferedInputStream;
-import java.io.InputStream;
 import java.io.File;
 import java.io.FileInputStream;
-
+import java.io.InputStream;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 import java.util.ServiceLoader;
 
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
 import javax.sound.sampled.AudioPermission;
 
 /** Managing security in the Java Sound implementation.
@@ -64,7 +62,6 @@
         return (System.getSecurityManager() != null);
     }
 
-
     static void checkRecordPermission() throws SecurityException {
         if(Printer.trace) Printer.trace("JSSecurityManager.checkRecordPermission()");
         SecurityManager sm = System.getSecurityManager();
@@ -90,6 +87,7 @@
             try {
                 // invoke the privileged action using 1.2 security
                 PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
+                        @Override
                         public Void run() {
                             loadPropertiesImpl(properties, filename);
                             return null;
@@ -108,7 +106,6 @@
         }
     }
 
-
     private static void loadPropertiesImpl(Properties properties,
                                            String filename) {
         if(Printer.trace)Printer.trace(">> JSSecurityManager: loadPropertiesImpl()");
@@ -176,6 +173,7 @@
         // the iterator's hasNext() method looks through classpath for
         // the provider class names, so it requires read permissions
         PrivilegedAction<Boolean> hasNextAction = new PrivilegedAction<Boolean>() {
+            @Override
             public Boolean run() {
                 return ps.hasNext();
             }
--- a/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java	Mon Aug 22 08:27:10 2016 -0700
@@ -25,38 +25,36 @@
 
 package com.sun.media.sound;
 
+import java.applet.AudioClip;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.applet.AudioClip;
 
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.MetaEventListener;
+import javax.sound.midi.MetaMessage;
+import javax.sound.midi.MidiFileFormat;
+import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
+import javax.sound.midi.Sequence;
+import javax.sound.midi.Sequencer;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.Clip;
-import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.DataLine;
-import javax.sound.sampled.SourceDataLine;
 import javax.sound.sampled.LineEvent;
 import javax.sound.sampled.LineListener;
+import javax.sound.sampled.SourceDataLine;
 import javax.sound.sampled.UnsupportedAudioFileException;
 
-import javax.sound.midi.MidiSystem;
-import javax.sound.midi.MidiFileFormat;
-import javax.sound.midi.MetaMessage;
-import javax.sound.midi.Sequence;
-import javax.sound.midi.Sequencer;
-import javax.sound.midi.InvalidMidiDataException;
-import javax.sound.midi.MidiUnavailableException;
-import javax.sound.midi.MetaEventListener;
-
 /**
  * Java Sound audio clip;
  *
  * @author Arthur van Hoff, Kara Kytle, Jan Borgersen
  * @author Florian Bomers
  */
-
 public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener {
 
     private static final boolean DEBUG = false;
@@ -126,12 +124,12 @@
         }
     }
 
-
+    @Override
     public synchronized void play() {
         startImpl(false);
     }
 
-
+    @Override
     public synchronized void loop() {
         startImpl(true);
     }
@@ -205,6 +203,7 @@
         }
     }
 
+    @Override
     public synchronized void stop() {
 
         if (DEBUG || Printer.debug)Printer.debug("JavaSoundAudioClip->stop()");
@@ -248,13 +247,15 @@
 
     // Event handlers (for debugging)
 
+    @Override
     public synchronized void update(LineEvent event) {
         if (DEBUG || Printer.debug) Printer.debug("line event received: "+event);
     }
 
     // handle MIDI track end meta events for looping
 
-    public synchronized void meta( MetaMessage message ) {
+    @Override
+    public synchronized void meta(MetaMessage message) {
 
         if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");
 
@@ -269,12 +270,12 @@
         }
     }
 
-
+    @Override
     public String toString() {
         return getClass().toString();
     }
 
-
+    @Override
     protected void finalize() {
 
         if (clip != null) {
@@ -326,8 +327,6 @@
         return true;
     }
 
-
-
     private void readStream(AudioInputStream as, long byteLen) throws IOException {
         // arrays "only" max. 2GB
         int intLen;
@@ -371,7 +370,6 @@
         loadedAudioByteLength = totalBytesRead;
     }
 
-
     // METHODS FOR CREATING THE DEVICE
 
     private boolean createClip() {
@@ -464,7 +462,6 @@
         return true;
     }
 
-
     /*
      * private inner class representing a ByteArrayOutputStream
      * which allows retrieval of the internal array
@@ -479,5 +476,4 @@
         }
 
     } // class DirectBAOS
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/MidiDeviceReceiverEnvelope.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/MidiDeviceReceiverEnvelope.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,10 +22,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
-import javax.sound.midi.*;
-
+import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiDeviceReceiver;
+import javax.sound.midi.MidiMessage;
+import javax.sound.midi.Receiver;
 
 /**
  * Helper class which allows to convert {@code Receiver}
@@ -55,15 +58,18 @@
     }
 
     // Receiver implementation
+    @Override
     public void close() {
         receiver.close();
     }
 
+    @Override
     public void send(MidiMessage message, long timeStamp) {
         receiver.send(message, timeStamp);
     }
 
     // MidiDeviceReceiver implementation
+    @Override
     public MidiDevice getMidiDevice() {
         return device;
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/MidiDeviceTransmitterEnvelope.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/MidiDeviceTransmitterEnvelope.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,10 +22,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
-import javax.sound.midi.*;
-
+import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiDeviceTransmitter;
+import javax.sound.midi.Receiver;
+import javax.sound.midi.Transmitter;
 
 /**
  * Helper class which allows to convert {@code Transmitter}
@@ -55,20 +58,23 @@
     }
 
     // Transmitter implementation
+    @Override
     public void setReceiver(Receiver receiver) {
         transmitter.setReceiver(receiver);
     }
 
+    @Override
     public Receiver getReceiver() {
         return transmitter.getReceiver();
     }
 
+    @Override
     public void close() {
         transmitter.close();
     }
 
-
     // MidiDeviceReceiver implementation
+    @Override
     public MidiDevice getMidiDevice() {
         return device;
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/MidiInDevice.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/MidiInDevice.java	Mon Aug 22 08:27:10 2016 -0700
@@ -25,9 +25,8 @@
 
 package com.sun.media.sound;
 
-import javax.sound.midi.*;
-
-
+import javax.sound.midi.MidiUnavailableException;
+import javax.sound.midi.Transmitter;
 
 /**
  * MidiInDevice class representing functionality of MidiIn devices.
@@ -40,18 +39,14 @@
 
     private volatile Thread midiInThread;
 
-    // CONSTRUCTOR
-
     MidiInDevice(AbstractMidiDeviceProvider.Info info) {
         super(info);
         if(Printer.trace) Printer.trace("MidiInDevice CONSTRUCTOR");
     }
 
-
-    // IMPLEMENTATION OF ABSTRACT MIDI DEVICE METHODS
-
     // $$kk: 06.24.99: i have this both opening and starting the midi in device.
     // may want to separate these??
+    @Override
     protected synchronized void implOpen() throws MidiUnavailableException {
         if (Printer.trace) Printer.trace("> MidiInDevice: implOpen()");
 
@@ -75,9 +70,9 @@
         if (Printer.trace) Printer.trace("< MidiInDevice: implOpen() completed");
     }
 
-
     // $$kk: 06.24.99: i have this both stopping and closing the midi in device.
     // may want to separate these??
+    @Override
     protected synchronized void implClose() {
         if (Printer.trace) Printer.trace("> MidiInDevice: implClose()");
         long oldId = id;
@@ -98,7 +93,7 @@
         if (Printer.trace) Printer.trace("< MidiInDevice: implClose() completed");
     }
 
-
+    @Override
     public long getMicrosecondPosition() {
         long timestamp = -1;
         if (isOpen()) {
@@ -107,22 +102,21 @@
         return timestamp;
     }
 
-
     // OVERRIDES OF ABSTRACT MIDI DEVICE METHODS
 
-
+    @Override
     protected boolean hasTransmitters() {
         return true;
     }
 
-
+    @Override
     protected Transmitter createTransmitter() {
         return new MidiInTransmitter();
     }
 
     /**
       * An own class to distinguish the class name from
-      * the transmitter of other devices
+      * the transmitter of other devices.
       */
     private final class MidiInTransmitter extends BasicTransmitter {
         private MidiInTransmitter() {
@@ -130,8 +124,7 @@
         }
     }
 
-    // RUNNABLE METHOD
-
+    @Override
     public void run() {
         // while the device is started, keep trying to get messages.
         // this thread returns from native code whenever stop() or close() is called
@@ -149,9 +142,6 @@
         midiInThread = null;
     }
 
-
-    // CALLBACKS FROM NATIVE
-
     /**
      * Callback from native code when a short MIDI event is received from hardware.
      * @param packedMsg: status | data1 << 8 | data2 << 8
@@ -179,8 +169,6 @@
         getTransmitterList().sendMessage(data, timeStamp);
     }
 
-    // NATIVE METHODS
-
     private native long nOpen(int index) throws MidiUnavailableException;
     private native void nClose(long id);
 
@@ -190,6 +178,4 @@
 
     // go into native code and get messages. May be blocking
     private native void nGetMessages(long id);
-
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/MidiInDeviceProvider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/MidiInDeviceProvider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -27,7 +27,6 @@
 
 import javax.sound.midi.MidiDevice;
 
-
 /**
  * MIDI input device provider.
  *
@@ -44,16 +43,12 @@
 
     private static final boolean enabled;
 
-    // STATIC
-
     static {
         // initialize
         Platform.initialize();
         enabled = Platform.isMidiIOEnabled();
     }
 
-    // CONSTRUCTOR
-
     /**
      * Required public no-arg constructor.
      */
@@ -63,6 +58,7 @@
 
     // implementation of abstract methods in AbstractMidiDeviceProvider
 
+    @Override
     AbstractMidiDeviceProvider.Info createInfo(int index) {
         if (!enabled) {
             return null;
@@ -70,6 +66,7 @@
         return new MidiInDeviceInfo(index, MidiInDeviceProvider.class);
     }
 
+    @Override
     MidiDevice createDevice(AbstractMidiDeviceProvider.Info info) {
         if (enabled && (info instanceof MidiInDeviceInfo)) {
             return new MidiInDevice(info);
@@ -77,6 +74,7 @@
         return null;
     }
 
+    @Override
     int getNumDevices() {
         if (!enabled) {
             if (Printer.debug)Printer.debug("MidiInDevice not enabled, returning 0 devices");
@@ -87,14 +85,15 @@
         return numDevices;
     }
 
+    @Override
     MidiDevice[] getDeviceCache() { return devices; }
+    @Override
     void setDeviceCache(MidiDevice[] devices) { MidiInDeviceProvider.devices = devices; }
+    @Override
     Info[] getInfoCache() { return infos; }
+    @Override
     void setInfoCache(Info[] infos) { MidiInDeviceProvider.infos = infos; }
 
-
-    // INNER CLASSES
-
     /**
      * Info class for MidiInDevices.  Adds the
      * provider's Class to keep the provider class from being
@@ -115,9 +114,6 @@
 
     } // class MidiInDeviceInfo
 
-
-    // NATIVE METHODS
-
     private static native int nGetNumDevices();
     private static native String nGetName(int index);
     private static native String nGetVendor(int index);
--- a/src/java.desktop/share/classes/com/sun/media/sound/MidiOutDevice.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/MidiOutDevice.java	Mon Aug 22 08:27:10 2016 -0700
@@ -25,9 +25,10 @@
 
 package com.sun.media.sound;
 
-import javax.sound.midi.*;
-
-
+import javax.sound.midi.MidiMessage;
+import javax.sound.midi.MidiUnavailableException;
+import javax.sound.midi.Receiver;
+import javax.sound.midi.ShortMessage;
 
 /**
  * MidiOutDevice class representing functionality of MidiOut devices.
@@ -38,16 +39,12 @@
  */
 final class MidiOutDevice extends AbstractMidiDevice {
 
-    // CONSTRUCTOR
-
     MidiOutDevice(AbstractMidiDeviceProvider.Info info) {
                 super(info);
                 if(Printer.trace) Printer.trace("MidiOutDevice CONSTRUCTOR");
     }
 
-
-    // IMPLEMENTATION OF ABSTRACT MIDI DEVICE METHODS
-
+    @Override
     protected synchronized void implOpen() throws MidiUnavailableException {
         if (Printer.trace) Printer.trace("> MidiOutDevice: implOpen()");
         int index = ((AbstractMidiDeviceProvider.Info)getDeviceInfo()).getIndex();
@@ -58,7 +55,7 @@
         if (Printer.trace) Printer.trace("< MidiOutDevice: implOpen(): completed.");
     }
 
-
+    @Override
     protected synchronized void implClose() {
         if (Printer.trace) Printer.trace("> MidiOutDevice: implClose()");
         // prevent further action
@@ -72,7 +69,7 @@
         if (Printer.trace) Printer.trace("< MidiOutDevice: implClose(): completed");
     }
 
-
+    @Override
     public long getMicrosecondPosition() {
         long timestamp = -1;
         if (isOpen()) {
@@ -81,28 +78,23 @@
         return timestamp;
     }
 
-
-
-    // OVERRIDES OF ABSTRACT MIDI DEVICE METHODS
-
     /** Returns if this device supports Receivers.
         This implementation always returns true.
         @return true, if the device supports Receivers, false otherwise.
     */
+    @Override
     protected boolean hasReceivers() {
         return true;
     }
 
-
+    @Override
     protected Receiver createReceiver() {
         return new MidiOutReceiver();
     }
 
-
-    // INNER CLASSES
-
     final class MidiOutReceiver extends AbstractReceiver {
 
+        @Override
         void implSend(final MidiMessage message, final long timeStamp) {
             final int length = message.getLength();
             final int status = message.getStatus();
@@ -159,13 +151,8 @@
                 nSendShortMessage(id, packedMsg, timeStamp);
             }
         }
-
-
     } // class MidiOutReceiver
 
-
-    // NATIVE METHODS
-
     private native long nOpen(int index) throws MidiUnavailableException;
     private native void nClose(long id);
 
--- a/src/java.desktop/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -27,7 +27,6 @@
 
 import javax.sound.midi.MidiDevice;
 
-
 /**
  * MIDI output device provider.
  *
@@ -44,16 +43,12 @@
 
     private static final boolean enabled;
 
-    // STATIC
-
     static {
         // initialize
         Platform.initialize();
         enabled = Platform.isMidiIOEnabled();
     }
 
-    // CONSTRUCTOR
-
     /**
      * Required public no-arg constructor.
      */
@@ -61,8 +56,7 @@
         if (Printer.trace) Printer.trace("MidiOutDeviceProvider: constructor");
     }
 
-    // implementation of abstract methods in AbstractMidiDeviceProvider
-
+    @Override
     AbstractMidiDeviceProvider.Info createInfo(int index) {
         if (!enabled) {
             return null;
@@ -70,6 +64,7 @@
         return new MidiOutDeviceInfo(index, MidiOutDeviceProvider.class);
     }
 
+    @Override
     MidiDevice createDevice(AbstractMidiDeviceProvider.Info info) {
         if (enabled && (info instanceof MidiOutDeviceInfo)) {
             return new MidiOutDevice(info);
@@ -77,6 +72,7 @@
         return null;
     }
 
+    @Override
     int getNumDevices() {
         if (!enabled) {
             if (Printer.debug)Printer.debug("MidiOutDevice not enabled, returning 0 devices");
@@ -85,14 +81,15 @@
         return nGetNumDevices();
     }
 
+    @Override
     MidiDevice[] getDeviceCache() { return devices; }
+    @Override
     void setDeviceCache(MidiDevice[] devices) { MidiOutDeviceProvider.devices = devices; }
+    @Override
     Info[] getInfoCache() { return infos; }
+    @Override
     void setInfoCache(Info[] infos) { MidiOutDeviceProvider.infos = infos; }
 
-
-    // INNER CLASSES
-
     /**
      * Info class for MidiOutDevices.  Adds the
      * provider's Class to keep the provider class from being
@@ -113,9 +110,6 @@
 
     } // class MidiOutDeviceInfo
 
-
-    // NATIVE METHODS
-
     private static native int nGetNumDevices();
     private static native String nGetName(int index);
     private static native String nGetVendor(int index);
--- a/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java	Mon Aug 22 08:27:10 2016 -0700
@@ -77,7 +77,6 @@
         return ((msg[1] & 0xFF) == META_END_OF_TRACK_TYPE) && (msg[2] == 0);
     }
 
-
     /** return if the given message is a meta tempo message */
     public static boolean isMetaTempo(MidiMessage midiMsg) {
         // first check if it is a META message at all
@@ -91,7 +90,6 @@
         return ((msg[1] & 0xFF) == META_TEMPO_TYPE) && (msg[2] == 3);
     }
 
-
     /** parses this message for a META tempo message and returns
      * the tempo in MPQ, or -1 if this isn't a tempo message
      */
@@ -111,7 +109,6 @@
         return tempo;
     }
 
-
     /**
      * converts<br>
      * 1 - MPQ-Tempo to BPM tempo<br>
@@ -124,7 +121,6 @@
         return ((double) 60000000l) / tempo;
     }
 
-
     /**
      * convert tick to microsecond with given tempo.
      * Does not take tempo changes into account.
@@ -145,7 +141,6 @@
         return (long) ((((double)us) * resolution) / tempoMPQ);
     }
 
-
     /**
      * Given a tick, convert to microsecond
      * @param cache tempo info and current tempo
@@ -246,7 +241,6 @@
         return tick;
     }
 
-
     /**
      * Binary search for the event indexes of the track
      *
@@ -283,7 +277,6 @@
         return ret;
     }
 
-
     public static final class TempoCache {
         long[] ticks;
         int[] tempos; // in MPQ
@@ -310,7 +303,6 @@
             refresh(seq);
         }
 
-
         public synchronized void refresh(Sequence seq) {
             ArrayList<MidiEvent> list = new ArrayList<>();
             Track[] tracks = seq.getTracks();
@@ -373,6 +365,5 @@
             }
             return tempos[tempos.length - 1];
         }
-
     }
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelAbstractChannelMixer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelAbstractChannelMixer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -32,95 +33,123 @@
  */
 public abstract class ModelAbstractChannelMixer implements ModelChannelMixer {
 
+    @Override
     public abstract boolean process(float[][] buffer, int offset, int len);
 
+    @Override
     public abstract void stop();
 
+    @Override
     public void allNotesOff() {
     }
 
+    @Override
     public void allSoundOff() {
     }
 
+    @Override
     public void controlChange(int controller, int value) {
     }
 
+    @Override
     public int getChannelPressure() {
         return 0;
     }
 
+    @Override
     public int getController(int controller) {
         return 0;
     }
 
+    @Override
     public boolean getMono() {
         return false;
     }
 
+    @Override
     public boolean getMute() {
         return false;
     }
 
+    @Override
     public boolean getOmni() {
         return false;
     }
 
+    @Override
     public int getPitchBend() {
         return 0;
     }
 
+    @Override
     public int getPolyPressure(int noteNumber) {
         return 0;
     }
 
+    @Override
     public int getProgram() {
         return 0;
     }
 
+    @Override
     public boolean getSolo() {
         return false;
     }
 
+    @Override
     public boolean localControl(boolean on) {
         return false;
     }
 
+    @Override
     public void noteOff(int noteNumber) {
     }
 
+    @Override
     public void noteOff(int noteNumber, int velocity) {
     }
 
+    @Override
     public void noteOn(int noteNumber, int velocity) {
     }
 
+    @Override
     public void programChange(int program) {
     }
 
+    @Override
     public void programChange(int bank, int program) {
     }
 
+    @Override
     public void resetAllControllers() {
     }
 
+    @Override
     public void setChannelPressure(int pressure) {
     }
 
+    @Override
     public void setMono(boolean on) {
     }
 
+    @Override
     public void setMute(boolean mute) {
     }
 
+    @Override
     public void setOmni(boolean on) {
     }
 
+    @Override
     public void setPitchBend(int bend) {
     }
 
+    @Override
     public void setPolyPressure(int noteNumber, int pressure) {
     }
 
+    @Override
     public void setSolo(boolean soloState) {
     }
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelAbstractOscillator.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelAbstractOscillator.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,9 +22,11 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.io.IOException;
+
 import javax.sound.midi.Instrument;
 import javax.sound.midi.MidiChannel;
 import javax.sound.midi.Patch;
@@ -51,15 +53,18 @@
     public void init() {
     }
 
+    @Override
     public void close() throws IOException {
     }
 
+    @Override
     public void noteOff(int velocity) {
         on = false;
     }
 
+    @Override
     public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
-            int velocity) {
+                       int velocity) {
         this.channel = channel;
         this.voice = voice;
         this.noteNumber = noteNumber;
@@ -67,6 +72,7 @@
         on = true;
     }
 
+    @Override
     public int read(float[][] buffer, int offset, int len) throws IOException {
         return -1;
     }
@@ -91,6 +97,7 @@
         return on;
     }
 
+    @Override
     public void setPitch(float pitch) {
         this.pitch = pitch;
     }
@@ -107,14 +114,17 @@
         return samplerate;
     }
 
+    @Override
     public float getAttenuation() {
         return 0;
     }
 
+    @Override
     public int getChannels() {
         return 1;
     }
 
+    @Override
     public String getName() {
         return getClass().getName();
     }
@@ -123,6 +133,7 @@
         return new Patch(0, 0);
     }
 
+    @Override
     public ModelOscillatorStream open(float samplerate) {
         ModelAbstractOscillator oscs;
         try {
@@ -162,10 +173,12 @@
         return sbk;
     }
 
+    @Override
     public String getDescription() {
         return getName();
     }
 
+    @Override
     public Instrument getInstrument(Patch patch) {
         Instrument ins = getInstrument();
         Patch p = ins.getPatch();
@@ -182,18 +195,22 @@
         return ins;
     }
 
+    @Override
     public Instrument[] getInstruments() {
         return new Instrument[]{getInstrument()};
     }
 
+    @Override
     public SoundbankResource[] getResources() {
         return new SoundbankResource[0];
     }
 
+    @Override
     public String getVendor() {
         return null;
     }
 
+    @Override
     public String getVersion() {
         return null;
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelByteBuffer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelByteBuffer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.ByteArrayInputStream;
@@ -60,12 +61,14 @@
             left = capacity();
         }
 
+        @Override
         public int available() throws IOException {
             if (left > Integer.MAX_VALUE)
                 return Integer.MAX_VALUE;
             return (int)left;
         }
 
+        @Override
         public synchronized void mark(int readlimit) {
             try {
                 mark = raf.getFilePointer();
@@ -75,15 +78,18 @@
             }
         }
 
+        @Override
         public boolean markSupported() {
             return true;
         }
 
+        @Override
         public synchronized void reset() throws IOException {
             raf.seek(mark);
             left = markleft;
         }
 
+        @Override
         public long skip(long n) throws IOException {
             if( n < 0)
                 return 0;
@@ -95,6 +101,7 @@
             return n;
         }
 
+        @Override
         public int read(byte b[], int off, int len) throws IOException {
             if (len > left)
                 len = (int)left;
@@ -107,6 +114,7 @@
             return len;
         }
 
+        @Override
         public int read(byte[] b) throws IOException {
             int len = b.length;
             if (len > left)
@@ -120,6 +128,7 @@
             return len;
         }
 
+        @Override
         public int read() throws IOException {
             if (left == 0)
                 return -1;
@@ -130,6 +139,7 @@
             return b;
         }
 
+        @Override
         public void close() throws IOException {
             raf.close();
         }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,14 +22,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.io.IOException;
 import java.io.InputStream;
+
 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.AudioFormat.Encoding;
 
 /**
  * Wavetable oscillator for pre-loaded data.
@@ -52,6 +54,7 @@
             bigendian = format.isBigEndian();
         }
 
+        @Override
         public int read(byte[] b, int off, int len) throws IOException {
             int avail = available();
             if (avail <= 0)
@@ -82,6 +85,7 @@
             return len;
         }
 
+        @Override
         public long skip(long n) throws IOException {
             int avail = available();
             if (avail <= 0)
@@ -93,10 +97,12 @@
             return super.skip(n);
         }
 
+        @Override
         public int read(byte[] b) throws IOException {
             return read(b, 0, b.length);
         }
 
+        @Override
         public int read() throws IOException {
             byte[] b = new byte[1];
             int ret = read(b, 0, 1);
@@ -105,19 +111,23 @@
             return 0 & 0xFF;
         }
 
+        @Override
         public boolean markSupported() {
             return true;
         }
 
+        @Override
         public int available() throws IOException {
             return (int)buffer.capacity() + (int)buffer8.capacity() - pos - pos2;
         }
 
+        @Override
         public synchronized void mark(int readlimit) {
             markpos = pos;
             markpos2 = pos2;
         }
 
+        @Override
         public synchronized void reset() throws IOException {
             pos = markpos;
             pos2 = markpos2;
@@ -189,6 +199,7 @@
         return format;
     }
 
+    @Override
     public AudioFloatInputStream openStream() {
         if (buffer == null)
             return null;
@@ -230,16 +241,19 @@
                 (int)buffer.arrayOffset(), (int)buffer.capacity());
     }
 
+    @Override
     public int getChannels() {
         return getFormat().getChannels();
     }
 
+    @Override
     public ModelOscillatorStream open(float samplerate) {
         // ModelWavetableOscillator doesn't support ModelOscillatorStream
         return null;
     }
 
     // attenuation is in cB
+    @Override
     public float getAttenuation() {
         return attenuation;
     }
@@ -248,6 +262,7 @@
         this.attenuation = attenuation;
     }
 
+    @Override
     public float getLoopLength() {
         return loopLength;
     }
@@ -256,6 +271,7 @@
         this.loopLength = loopLength;
     }
 
+    @Override
     public float getLoopStart() {
         return loopStart;
     }
@@ -268,10 +284,12 @@
         this.loopType = loopType;
     }
 
+    @Override
     public int getLoopType() {
         return loopType;
     }
 
+    @Override
     public float getPitchcorrection() {
         return pitchcorrection;
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelChannelMixer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelChannelMixer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import javax.sound.midi.MidiChannel;
@@ -42,9 +43,9 @@
 public interface ModelChannelMixer extends MidiChannel {
 
     // Used to process input audio from voices mix.
-    public boolean process(float[][] buffer, int offset, int len);
+    boolean process(float[][] buffer, int offset, int len);
 
     // Is used to trigger that this mixer is not be used
     // and it should fade out.
-    public void stop();
+    void stop();
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelConnectionBlock.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelConnectionBlock.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.Arrays;
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelDestination.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelDestination.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelDirectedPlayer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelDirectedPlayer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -32,5 +33,5 @@
  */
 public interface ModelDirectedPlayer {
 
-    public void play(int performerIndex, ModelConnectionBlock[] connectionBlocks);
+    void play(int performerIndex, ModelConnectionBlock[] connectionBlocks);
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelDirector.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelDirector.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -38,9 +39,9 @@
  */
 public interface ModelDirector {
 
-    public void noteOn(int noteNumber, int velocity);
+    void noteOn(int noteNumber, int velocity);
 
-    public void noteOff(int noteNumber, int velocity);
+    void noteOff(int noteNumber, int velocity);
 
-    public void close();
+    void close();
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelIdentifier.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelIdentifier.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -134,6 +135,7 @@
         this.variable = variable;
     }
 
+    @Override
     public int hashCode() {
         int hashcode = instance;
         if(object != null) hashcode |= object.hashCode();
@@ -141,6 +143,7 @@
         return  hashcode;
     }
 
+    @Override
     public boolean equals(Object obj) {
         if (!(obj instanceof ModelIdentifier))
             return false;
@@ -159,6 +162,7 @@
         return true;
     }
 
+    @Override
     public String toString() {
         if (variable == null) {
             return object + "[" + instance + "]";
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelInstrument.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelInstrument.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import javax.sound.midi.Instrument;
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelInstrumentComparator.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelInstrumentComparator.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,9 +22,11 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.util.Comparator;
+
 import javax.sound.midi.Instrument;
 import javax.sound.midi.Patch;
 
@@ -36,6 +38,7 @@
  */
 public final class ModelInstrumentComparator implements Comparator<Instrument> {
 
+    @Override
     public int compare(Instrument arg0, Instrument arg1) {
         Patch p0 = arg0.getPatch();
         Patch p1 = arg1.getPatch();
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelMappedInstrument.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelMappedInstrument.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import javax.sound.midi.MidiChannel;
@@ -42,21 +43,25 @@
         this.ins = ins;
     }
 
+    @Override
     public Object getData() {
         return ins.getData();
     }
 
+    @Override
     public ModelPerformer[] getPerformers() {
         return ins.getPerformers();
     }
 
+    @Override
     public ModelDirector getDirector(ModelPerformer[] performers,
-            MidiChannel channel, ModelDirectedPlayer player) {
+                                     MidiChannel channel, ModelDirectedPlayer player) {
         return ins.getDirector(performers, channel, player);
     }
 
+    @Override
     public ModelChannelMixer getChannelMixer(MidiChannel channel,
-            AudioFormat format) {
+                                             AudioFormat format) {
         return ins.getChannelMixer(channel, format);
     }
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelOscillator.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelOscillator.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -32,13 +33,13 @@
  */
 public interface ModelOscillator {
 
-    public int getChannels();
+    int getChannels();
 
     /**
      * Attenuation is in cB.
      * @return
      */
-    public float getAttenuation();
+    float getAttenuation();
 
-    public ModelOscillatorStream open(float samplerate);
+    ModelOscillatorStream open(float samplerate);
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelOscillatorStream.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelOscillatorStream.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,9 +22,11 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.io.IOException;
+
 import javax.sound.midi.MidiChannel;
 import javax.sound.midi.VoiceStatus;
 
@@ -35,14 +37,14 @@
  */
 public interface ModelOscillatorStream {
 
-    public void setPitch(float pitch); // Pitch is in cents!
+    void setPitch(float pitch); // Pitch is in cents!
 
-    public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
-            int velocity);
+    void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
+                int velocity);
 
-    public void noteOff(int velocity);
+    void noteOff(int velocity);
 
-    public int read(float[][] buffer, int offset, int len) throws IOException;
+    int read(float[][] buffer, int offset, int len) throws IOException;
 
-    public void close() throws IOException;
+    void close() throws IOException;
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelPatch.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelPatch.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import javax.sound.midi.Patch;
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelPerformer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelPerformer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.ArrayList;
@@ -35,9 +36,9 @@
  */
 public final class ModelPerformer {
 
-    private final List<ModelOscillator> oscillators = new ArrayList<ModelOscillator>();
-    private List<ModelConnectionBlock> connectionBlocks
-            = new ArrayList<ModelConnectionBlock>();
+    private final List<ModelOscillator> oscillators = new ArrayList<>();
+    private List<ModelConnectionBlock> connectionBlocks = new ArrayList<>();
+
     private int keyFrom = 0;
     private int keyTo = 127;
     private int velFrom = 0;
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelSource.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelSource.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelStandardDirector.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelStandardDirector.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.Arrays;
@@ -52,9 +53,11 @@
         }
     }
 
+    @Override
     public void close() {
     }
 
+    @Override
     public void noteOff(int noteNumber, int velocity) {
         if (!noteOffUsed)
             return;
@@ -70,6 +73,7 @@
         }
     }
 
+    @Override
     public void noteOn(int noteNumber, int velocity) {
         if (!noteOnUsed)
             return;
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelStandardIndexedDirector.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelStandardIndexedDirector.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.Arrays;
@@ -156,9 +157,11 @@
         }
     }
 
+    @Override
     public void close() {
     }
 
+    @Override
     public void noteOff(int noteNumber, int velocity) {
         if (!noteOffUsed)
             return;
@@ -172,6 +175,7 @@
         }
     }
 
+    @Override
     public void noteOn(int noteNumber, int velocity) {
         if (!noteOnUsed)
             return;
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelStandardTransform.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelStandardTransform.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -73,6 +74,7 @@
         this.transform = transform;
     }
 
+    @Override
     public double transform(double value) {
         double s;
         double a;
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelTransform.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelTransform.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -31,5 +32,5 @@
  */
 public interface ModelTransform {
 
-    public abstract double transform(double value);
+    double transform(double value);
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ModelWavetable.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ModelWavetable.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -31,19 +32,19 @@
  */
 public interface ModelWavetable extends ModelOscillator {
 
-    public static final int LOOP_TYPE_OFF = 0;
-    public static final int LOOP_TYPE_FORWARD = 1;
-    public static final int LOOP_TYPE_RELEASE = 2;
-    public static final int LOOP_TYPE_PINGPONG = 4;
-    public static final int LOOP_TYPE_REVERSE = 8;
+    int LOOP_TYPE_OFF = 0;
+    int LOOP_TYPE_FORWARD = 1;
+    int LOOP_TYPE_RELEASE = 2;
+    int LOOP_TYPE_PINGPONG = 4;
+    int LOOP_TYPE_REVERSE = 8;
 
-    public AudioFloatInputStream openStream();
+    AudioFloatInputStream openStream();
 
-    public float getLoopLength();
+    float getLoopLength();
 
-    public float getLoopStart();
+    float getLoopStart();
 
-    public int getLoopType();
+    int getLoopType();
 
-    public float getPitchcorrection();
+    float getPitchcorrection();
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java	Mon Aug 22 08:27:10 2016 -0700
@@ -40,7 +40,6 @@
  */
 public final class PCMtoPCMCodec extends SunCodec {
 
-
     private static final AudioFormat.Encoding[] inputEncodings = {
         AudioFormat.Encoding.PCM_SIGNED,
         AudioFormat.Encoding.PCM_UNSIGNED,
@@ -59,8 +58,7 @@
         super( inputEncodings, outputEncodings);
     }
 
-    // NEW CODE
-
+    @Override
     public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) {
 
         final int sampleSize = sourceFormat.getSampleSizeInBits();
@@ -88,9 +86,7 @@
         return new AudioFormat.Encoding[0];
     }
 
-
-    /**
-     */
+    @Override
     public AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat){
         Objects.requireNonNull(targetEncoding);
 
@@ -113,9 +109,7 @@
         return formatArray;
     }
 
-
-    /**
-     */
+    @Override
     public AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream) {
 
         if( isConversionSupported(targetEncoding, sourceStream.getFormat()) ) {
@@ -136,9 +130,8 @@
         }
 
     }
-    /**
-     * use old code
-     */
+
+    @Override
     public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){
         if (!isConversionSupported(targetFormat, sourceStream.getFormat()))
             throw new IllegalArgumentException("Unsupported conversion: "
@@ -147,11 +140,6 @@
         return getConvertedStream( targetFormat, sourceStream );
     }
 
-
-
-
-    // OLD CODE
-
     /**
      * Opens the codec with the specified parameters.
      * @param stream stream from which data to be processed should be read
@@ -160,7 +148,6 @@
      * @throws IllegalArgumentException if the format combination supplied is
      * not supported.
      */
-    /*  public AudioInputStream getConvertedStream(AudioFormat outputFormat, AudioInputStream stream) {*/
     private AudioInputStream getConvertedStream(AudioFormat outputFormat, AudioInputStream stream) {
 
         AudioInputStream cs = null;
@@ -172,13 +159,11 @@
             cs = stream;
         } else {
 
-            cs = (AudioInputStream) (new PCMtoPCMCodecStream(stream, outputFormat));
+            cs = new PCMtoPCMCodecStream(stream, outputFormat);
         }
         return cs;
     }
 
-
-
     /**
      * Obtains the set of output formats supported by the codec
      * given a particular input format.
@@ -186,7 +171,6 @@
      * returns an array of length 0.
      * @return array of supported output formats.
      */
-    /*  public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */
     private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
 
         Vector<AudioFormat> formats = new Vector<>();
@@ -350,7 +334,6 @@
         return formatArray;
     }
 
-
     class PCMtoPCMCodecStream extends AudioInputStream {
 
         private final int PCM_SWITCH_SIGNED_8BIT                = 1;
@@ -460,7 +443,7 @@
          * Note that this only works for sign conversions.
          * Other conversions require a read of at least 2 bytes.
          */
-
+        @Override
         public int read() throws IOException {
 
             // $$jb: do we want to implement this function?
@@ -489,12 +472,13 @@
             }
         }
 
-
+        @Override
         public int read(byte[] b) throws IOException {
 
             return read(b, 0, b.length);
         }
 
+        @Override
         public int read(byte[] b, int off, int len) throws IOException {
 
 
@@ -589,9 +573,5 @@
                 }
             }
         }
-
-
-
     } // end class PCMtoPCMCodecStream
-
 } // end class PCMtoPCMCodec
--- a/src/java.desktop/share/classes/com/sun/media/sound/Platform.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/Platform.java	Mon Aug 22 08:27:10 2016 -0700
@@ -29,8 +29,6 @@
 import java.security.PrivilegedAction;
 import java.util.StringTokenizer;
 
-
-
 /**
  * Audio configuration class for exposing attributes specific to the platform or system.
  *
@@ -39,9 +37,6 @@
  */
 final class Platform {
 
-
-    // STATIC FINAL CHARACTERISTICS
-
     // native library we need to load
     private static final String libNameMain     = "jsound";
     private static final String libNameALSA     = "jsoundalsa";
@@ -74,37 +69,26 @@
         readProperties();
     }
 
-
     /**
      * Private constructor.
      */
     private Platform() {
     }
 
-
-    // METHODS FOR INTERNAL IMPLEMENTATION USE
-
-
     /**
      * Dummy method for forcing initialization.
      */
     static void initialize() {
-
         if(Printer.trace)Printer.trace("Platform: initialize()");
     }
 
-
     /**
      * Determine whether the system is big-endian.
      */
     static boolean isBigEndian() {
-
         return bigEndian;
     }
 
-
-    // PRIVATE METHODS
-
     /**
      * Load the native library or libraries.
      */
@@ -147,7 +131,6 @@
         }
     }
 
-
     static boolean isMidiIOEnabled() {
         return isFeatureLibLoaded(FEATURE_MIDIIO);
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -27,14 +27,13 @@
 
 import java.util.Vector;
 
+import javax.sound.sampled.BooleanControl;
+import javax.sound.sampled.CompoundControl;
 import javax.sound.sampled.Control;
+import javax.sound.sampled.FloatControl;
 import javax.sound.sampled.Line;
 import javax.sound.sampled.LineUnavailableException;
 import javax.sound.sampled.Port;
-import javax.sound.sampled.BooleanControl;
-import javax.sound.sampled.CompoundControl;
-import javax.sound.sampled.FloatControl;
-
 
 /**
  * A Mixer which only provides Ports.
@@ -43,7 +42,6 @@
  */
 final class PortMixer extends AbstractMixer {
 
-    // CONSTANTS
     private static final int SRC_UNKNOWN      = 0x01;
     private static final int SRC_MICROPHONE   = 0x02;
     private static final int SRC_LINE_IN      = 0x03;
@@ -56,15 +54,13 @@
     private static final int DST_LINE_OUT     = 0x0400;
     private static final int DST_MASK         = 0xFF00;
 
-    // INSTANCE VARIABLES
-    private Port.Info[] portInfos;
+    private final Port.Info[] portInfos;
     // cache of instantiated ports
     private PortMixerPort[] ports;
 
     // instance ID of the native implementation
     private long id = 0;
 
-    // CONSTRUCTOR
     PortMixer(PortMixerProvider.PortMixerInfo portMixerInfo) {
         // pass in Line.Info, mixer, controls
         super(portMixerInfo,              // Mixer.Info
@@ -121,9 +117,7 @@
         if (Printer.trace) Printer.trace("<< PortMixer: constructor completed");
     }
 
-
-    // ABSTRACT MIXER: ABSTRACT METHOD IMPLEMENTATIONS
-
+    @Override
     public Line getLine(Line.Info info) throws LineUnavailableException {
         Line.Info fullInfo = getLineInfo(info);
 
@@ -137,7 +131,7 @@
         throw new IllegalArgumentException("Line unsupported: " + info);
     }
 
-
+    @Override
     public int getMaxLines(Line.Info info) {
         Line.Info fullInfo = getLineInfo(info);
 
@@ -153,7 +147,7 @@
         return 0;
     }
 
-
+    @Override
     protected void implOpen() throws LineUnavailableException {
         if (Printer.trace) Printer.trace(">> PortMixer: implOpen (id="+id+")");
 
@@ -163,6 +157,7 @@
         if (Printer.trace) Printer.trace("<< PortMixer: implOpen succeeded.");
     }
 
+    @Override
     protected void implClose() {
         if (Printer.trace) Printer.trace(">> PortMixer: implClose");
 
@@ -181,11 +176,11 @@
         if (Printer.trace) Printer.trace("<< PortMixer: implClose succeeded");
     }
 
+    @Override
     protected void implStart() {}
+    @Override
     protected void implStop() {}
 
-    // IMPLEMENTATION HELPERS
-
     private Port.Info getPortInfo(int portIndex, int type) {
         switch (type) {
         case SRC_UNKNOWN:      return new PortInfo(nGetPortName(getID(), portIndex), true);
@@ -223,8 +218,6 @@
         return id;
     }
 
-    // INNER CLASSES
-
     /**
      * Private inner class representing a Port for the PortMixer.
      */
@@ -234,7 +227,6 @@
         private final int portIndex;
         private long id;
 
-        // CONSTRUCTOR
         private PortMixerPort(Port.Info info,
                               PortMixer mixer,
                               int portIndex) {
@@ -243,11 +235,6 @@
             this.portIndex = portIndex;
         }
 
-
-        // ABSTRACT METHOD IMPLEMENTATIONS
-
-        // ABSTRACT LINE
-
         void implOpen() throws LineUnavailableException {
             if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
             long newID = ((PortMixer) mixer).getID();
@@ -286,7 +273,6 @@
             controls = new Control[0];
         }
 
-
         void implClose() {
             if (Printer.trace) Printer.trace(">> PortMixerPort: implClose()");
             // get rid of controls
@@ -294,9 +280,8 @@
             if (Printer.trace) Printer.trace("<< PortMixerPort: implClose() succeeded");
         }
 
-        // METHOD OVERRIDES
-
         // this is very similar to open(AudioFormat, int) in AbstractDataLine...
+        @Override
         public void open() throws LineUnavailableException {
             synchronized (mixer) {
                 // if the line is not currently open, try to open it with this format and buffer size
@@ -321,6 +306,7 @@
         }
 
         // this is very similar to close() in AbstractDataLine...
+        @Override
         public void close() {
             synchronized (mixer) {
                 if (isOpen()) {
@@ -342,7 +328,7 @@
     } // class PortMixerPort
 
     /**
-     * Private inner class representing a BooleanControl for PortMixerPort
+     * Private inner class representing a BooleanControl for PortMixerPort.
      */
     private static final class BoolCtrl extends BooleanControl {
         // the handle to the native control function
@@ -360,7 +346,6 @@
             return new BCT(name);
         }
 
-
         private BoolCtrl(long controlID, String name) {
             this(controlID, createType(name));
         }
@@ -370,12 +355,14 @@
             this.controlID = controlID;
         }
 
+        @Override
         public void setValue(boolean value) {
             if (!closed) {
                 nControlSetIntValue(controlID, value?1:0);
             }
         }
 
+        @Override
         public boolean getValue() {
             if (!closed) {
                 // never use any cached values
@@ -386,7 +373,7 @@
         }
 
         /**
-         * inner class for custom types
+         * inner class for custom types.
          */
         private static final class BCT extends BooleanControl.Type {
             private BCT(String name) {
@@ -396,7 +383,7 @@
     }
 
     /**
-     * Private inner class representing a CompoundControl for PortMixerPort
+     * Private inner class representing a CompoundControl for PortMixerPort.
      */
     private static final class CompCtrl extends CompoundControl {
         private CompCtrl(String name, Control[] controls) {
@@ -404,7 +391,7 @@
         }
 
         /**
-         * inner class for custom compound control types
+         * inner class for custom compound control types.
          */
         private static final class CCT extends CompoundControl.Type {
             private CCT(String name) {
@@ -414,7 +401,7 @@
     }
 
     /**
-     * Private inner class representing a BooleanControl for PortMixerPort
+     * Private inner class representing a BooleanControl for PortMixerPort.
      */
     private static final class FloatCtrl extends FloatControl {
         // the handle to the native control function
@@ -446,12 +433,14 @@
             this.controlID = controlID;
         }
 
+        @Override
         public void setValue(float value) {
             if (!closed) {
                 nControlSetFloatValue(controlID, value);
             }
         }
 
+        @Override
         public float getValue() {
             if (!closed) {
                 // never use any cached values
@@ -462,7 +451,7 @@
         }
 
         /**
-         * inner class for custom types
+         * inner class for custom types.
          */
         private static final class FCT extends FloatControl.Type {
             private FCT(String name) {
@@ -472,7 +461,7 @@
     }
 
     /**
-     * Private inner class representing a port info
+     * Private inner class representing a port info.
      */
     private static final class PortInfo extends Port.Info {
         private PortInfo(String name, boolean isSource) {
--- a/src/java.desktop/share/classes/com/sun/media/sound/PortMixerProvider.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/PortMixerProvider.java	Mon Aug 22 08:27:10 2016 -0700
@@ -28,7 +28,6 @@
 import javax.sound.sampled.Mixer;
 import javax.sound.sampled.spi.MixerProvider;
 
-
 /**
  * Port provider.
  *
@@ -36,8 +35,6 @@
  */
 public final class PortMixerProvider extends MixerProvider {
 
-    // STATIC VARIABLES
-
     /**
      * Set of info objects for all port input devices on the system.
      */
@@ -48,18 +45,11 @@
      */
     private static PortMixer[] devices;
 
-
-    // STATIC
-
     static {
         // initialize
         Platform.initialize();
     }
 
-
-    // CONSTRUCTOR
-
-
     /**
      * Required public no-arg constructor.
      */
@@ -93,6 +83,7 @@
         }
     }
 
+    @Override
     public Mixer.Info[] getMixerInfo() {
         synchronized (PortMixerProvider.class) {
             Mixer.Info[] localArray = new Mixer.Info[infos.length];
@@ -101,6 +92,7 @@
         }
     }
 
+    @Override
     public Mixer getMixer(Mixer.Info info) {
         synchronized (PortMixerProvider.class) {
             for (int i = 0; i < infos.length; i++) {
@@ -113,7 +105,6 @@
                 String.format("Mixer %s not supported by this provider", info));
     }
 
-
     private static Mixer getDevice(PortMixerInfo info) {
         int index = info.getIndex();
         if (devices[index] == null) {
@@ -122,9 +113,6 @@
         return devices[index];
     }
 
-    // INNER CLASSES
-
-
     /**
      * Info class for PortMixers.  Adds an index value for
      * making native references to a particular device.
@@ -144,7 +132,6 @@
 
     } // class PortMixerInfo
 
-    // NATIVE METHODS
     private static native int nGetNumDevices();
     private static native PortMixerInfo nNewPortMixerInfo(int mixerIndex);
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/RIFFInvalidDataException.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/RIFFInvalidDataException.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/RIFFInvalidFormatException.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/RIFFInvalidFormatException.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.EOFException;
--- a/src/java.desktop/share/classes/com/sun/media/sound/RIFFWriter.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/RIFFWriter.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.File;
@@ -39,21 +40,21 @@
 
     private interface RandomAccessWriter {
 
-        public void seek(long chunksizepointer) throws IOException;
+        void seek(long chunksizepointer) throws IOException;
 
-        public long getPointer() throws IOException;
+        long getPointer() throws IOException;
 
-        public void close() throws IOException;
+        void close() throws IOException;
 
-        public void write(int b) throws IOException;
+        void write(int b) throws IOException;
 
-        public void write(byte[] b, int off, int len) throws IOException;
+        void write(byte[] b, int off, int len) throws IOException;
 
-        public void write(byte[] bytes) throws IOException;
+        void write(byte[] bytes) throws IOException;
 
-        public long length() throws IOException;
+        long length() throws IOException;
 
-        public void setLength(long i) throws IOException;
+        void setLength(long i) throws IOException;
     }
 
     private static class RandomAccessFileWriter implements RandomAccessWriter {
@@ -68,34 +69,42 @@
             this.raf = new RandomAccessFile(name, "rw");
         }
 
+        @Override
         public void seek(long chunksizepointer) throws IOException {
             raf.seek(chunksizepointer);
         }
 
+        @Override
         public long getPointer() throws IOException {
             return raf.getFilePointer();
         }
 
+        @Override
         public void close() throws IOException {
             raf.close();
         }
 
+        @Override
         public void write(int b) throws IOException {
             raf.write(b);
         }
 
+        @Override
         public void write(byte[] b, int off, int len) throws IOException {
             raf.write(b, off, len);
         }
 
+        @Override
         public void write(byte[] bytes) throws IOException {
             raf.write(bytes);
         }
 
+        @Override
         public long length() throws IOException {
             return raf.length();
         }
 
+        @Override
         public void setLength(long i) throws IOException {
             raf.setLength(i);
         }
@@ -113,19 +122,23 @@
             this.stream = stream;
         }
 
+        @Override
         public void seek(long chunksizepointer) throws IOException {
             pos = (int) chunksizepointer;
         }
 
+        @Override
         public long getPointer() throws IOException {
             return pos;
         }
 
+        @Override
         public void close() throws IOException {
             stream.write(buff, 0, length);
             stream.close();
         }
 
+        @Override
         public void write(int b) throws IOException {
             if (s == null)
                 s = new byte[1];
@@ -133,6 +146,7 @@
             write(s, 0, 1);
         }
 
+        @Override
         public void write(byte[] b, int off, int len) throws IOException {
             int newsize = pos + len;
             if (newsize > length)
@@ -143,14 +157,17 @@
             }
         }
 
+        @Override
         public void write(byte[] bytes) throws IOException {
             write(bytes, 0, bytes.length);
         }
 
+        @Override
         public long length() throws IOException {
             return length;
         }
 
+        @Override
         public void setLength(long i) throws IOException {
             length = (int) i;
             if (length > buff.length) {
@@ -223,6 +240,7 @@
         return writeoverride;
     }
 
+    @Override
     public void close() throws IOException {
         if (!open)
             return;
@@ -245,6 +263,7 @@
         raf = null;
     }
 
+    @Override
     public void write(int b) throws IOException {
         if (!writeoverride) {
             if (chunktype != 2) {
@@ -259,6 +278,7 @@
         raf.write(b);
     }
 
+    @Override
     public void write(byte b[], int off, int len) throws IOException {
         if (!writeoverride) {
             if (chunktype != 2) {
--- a/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -27,14 +27,27 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.WeakHashMap;
 
-import javax.sound.midi.*;
-
+import javax.sound.midi.ControllerEventListener;
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.MetaEventListener;
+import javax.sound.midi.MetaMessage;
+import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiEvent;
+import javax.sound.midi.MidiMessage;
+import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
+import javax.sound.midi.Receiver;
+import javax.sound.midi.Sequence;
+import javax.sound.midi.Sequencer;
+import javax.sound.midi.ShortMessage;
+import javax.sound.midi.Synthesizer;
+import javax.sound.midi.Track;
+import javax.sound.midi.Transmitter;
 
 /**
  * A Real Time Sequencer
@@ -48,8 +61,6 @@
 final class RealTimeSequencer extends AbstractMidiDevice
         implements Sequencer, AutoConnectSequencer {
 
-    // STATIC VARIABLES
-
     /** debugging flags */
     private static final boolean DEBUG_PUMP = false;
     private static final boolean DEBUG_PUMP_ALL = false;
@@ -73,7 +84,6 @@
     private static final Sequencer.SyncMode masterSyncMode    = Sequencer.SyncMode.INTERNAL_CLOCK;
     private static final Sequencer.SyncMode slaveSyncMode     = Sequencer.SyncMode.NO_SYNC;
 
-
     /**
      * Sequence on which this sequencer is operating.
      */
@@ -87,14 +97,12 @@
      */
     private double cacheTempoMPQ = -1;
 
-
     /**
      * cache value for tempo factor until sequence is set
      * -1 means not set.
      */
     private float cacheTempoFactor = -1;
 
-
     /** if a particular track is muted */
     private boolean[] trackMuted = null;
     /** if a particular track is solo */
@@ -108,47 +116,48 @@
      */
     private volatile boolean running;
 
-
-    /** the thread for pushing out the MIDI messages */
+    /**
+     * the thread for pushing out the MIDI messages.
+     */
     private PlayThread playThread;
 
-
     /**
-     * True if we are recording
+     * True if we are recording.
      */
     private volatile boolean recording;
 
-
     /**
-     * List of tracks to which we're recording
+     * List of tracks to which we're recording.
      */
     private final List<RecordingTrack> recordingTracks = new ArrayList<>();
 
-
     private long loopStart = 0;
     private long loopEnd = -1;
     private int loopCount = 0;
 
-
     /**
-     * Meta event listeners
+     * Meta event listeners.
      */
     private final ArrayList<Object> metaEventListeners = new ArrayList<>();
 
-
     /**
-     * Control change listeners
+     * Control change listeners.
      */
     private final ArrayList<ControllerListElement> controllerEventListeners = new ArrayList<>();
 
-
-    /** automatic connection support */
+    /**
+     * automatic connection support.
+     */
     private boolean autoConnect = false;
 
-    /** if we need to autoconnect at next open */
+    /**
+     * if we need to autoconnect at next open.
+     */
     private boolean doAutoConnectAtNextOpen = false;
 
-    /** the receiver that this device is auto-connected to */
+    /**
+     * the receiver that this device is auto-connected to.
+     */
     Receiver autoConnectedReceiver = null;
 
 
@@ -161,9 +170,9 @@
         if (Printer.trace) Printer.trace("<< RealTimeSequencer CONSTRUCTOR completed");
     }
 
-
     /* ****************************** SEQUENCER METHODS ******************** */
 
+    @Override
     public synchronized void setSequence(Sequence sequence)
         throws InvalidMidiDataException {
 
@@ -211,7 +220,7 @@
         if (Printer.trace) Printer.trace("<< RealTimeSequencer: setSequence(" + sequence +") completed");
     }
 
-
+    @Override
     public synchronized void setSequence(InputStream stream) throws IOException, InvalidMidiDataException {
 
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: setSequence(" + stream +")");
@@ -229,12 +238,12 @@
 
     }
 
-
+    @Override
     public Sequence getSequence() {
         return sequence;
     }
 
-
+    @Override
     public synchronized void start() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: start()");
 
@@ -259,7 +268,7 @@
         if (Printer.trace) Printer.trace("<< RealTimeSequencer: start() completed");
     }
 
-
+    @Override
     public synchronized void stop() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: stop()");
 
@@ -280,12 +289,12 @@
         if (Printer.trace) Printer.trace("<< RealTimeSequencer: stop() completed");
     }
 
-
+    @Override
     public boolean isRunning() {
         return running;
     }
 
-
+    @Override
     public void startRecording() {
         if (!isOpen()) {
             throw new IllegalStateException("Sequencer not open");
@@ -295,7 +304,7 @@
         recording = true;
     }
 
-
+    @Override
     public void stopRecording() {
         if (!isOpen()) {
             throw new IllegalStateException("Sequencer not open");
@@ -303,12 +312,12 @@
         recording = false;
     }
 
-
+    @Override
     public boolean isRecording() {
         return recording;
     }
 
-
+    @Override
     public void recordEnable(Track track, int channel) {
         if (!findTrack(track)) {
             throw new IllegalArgumentException("Track does not exist in the current sequence");
@@ -325,7 +334,7 @@
 
     }
 
-
+    @Override
     public void recordDisable(Track track) {
         synchronized(recordingTracks) {
             RecordingTrack rc = RecordingTrack.get(recordingTracks, track);
@@ -336,7 +345,6 @@
 
     }
 
-
     private boolean findTrack(Track track) {
         boolean found = false;
         if (sequence != null) {
@@ -351,14 +359,14 @@
         return found;
     }
 
-
+    @Override
     public float getTempoInBPM() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: getTempoInBPM() ");
 
         return (float) MidiUtils.convertTempo(getTempoInMPQ());
     }
 
-
+    @Override
     public void setTempoInBPM(float bpm) {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: setTempoInBPM() ");
         if (bpm <= 0) {
@@ -369,7 +377,7 @@
         setTempoInMPQ((float) MidiUtils.convertTempo((double) bpm));
     }
 
-
+    @Override
     public float getTempoInMPQ() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: getTempoInMPQ() ");
 
@@ -389,7 +397,7 @@
         return getDataPump().getTempoMPQ();
     }
 
-
+    @Override
     public void setTempoInMPQ(float mpq) {
         if (mpq <= 0) {
             // should throw IllegalArgumentException
@@ -410,7 +418,7 @@
         }
     }
 
-
+    @Override
     public void setTempoFactor(float factor) {
         if (factor <= 0) {
             // should throw IllegalArgumentException
@@ -428,7 +436,7 @@
         }
     }
 
-
+    @Override
     public float getTempoFactor() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: getTempoFactor() ");
 
@@ -441,7 +449,7 @@
         return getDataPump().getTempoFactor();
     }
 
-
+    @Override
     public long getTickLength() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: getTickLength() ");
 
@@ -452,7 +460,7 @@
         return sequence.getTickLength();
     }
 
-
+    @Override
     public synchronized long getTickPosition() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: getTickPosition() ");
 
@@ -463,7 +471,7 @@
         return getDataPump().getTickPos();
     }
 
-
+    @Override
     public synchronized void setTickPosition(long tick) {
         if (tick < 0) {
             // should throw IllegalArgumentException
@@ -486,7 +494,7 @@
         }
     }
 
-
+    @Override
     public long getMicrosecondLength() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: getMicrosecondLength() ");
 
@@ -497,7 +505,7 @@
         return sequence.getMicrosecondLength();
     }
 
-
+    @Override
     public long getMicrosecondPosition() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: getMicrosecondPosition() ");
 
@@ -509,7 +517,7 @@
         }
     }
 
-
+    @Override
     public void setMicrosecondPosition(long microseconds) {
         if (microseconds < 0) {
             // should throw IllegalArgumentException
@@ -534,34 +542,34 @@
         }
     }
 
-
+    @Override
     public void setMasterSyncMode(Sequencer.SyncMode sync) {
         // not supported
     }
 
-
+    @Override
     public Sequencer.SyncMode getMasterSyncMode() {
         return masterSyncMode;
     }
 
-
+    @Override
     public Sequencer.SyncMode[] getMasterSyncModes() {
         Sequencer.SyncMode[] returnedModes = new Sequencer.SyncMode[masterSyncModes.length];
         System.arraycopy(masterSyncModes, 0, returnedModes, 0, masterSyncModes.length);
         return returnedModes;
     }
 
-
+    @Override
     public void setSlaveSyncMode(Sequencer.SyncMode sync) {
         // not supported
     }
 
-
+    @Override
     public Sequencer.SyncMode getSlaveSyncMode() {
         return slaveSyncMode;
     }
 
-
+    @Override
     public Sequencer.SyncMode[] getSlaveSyncModes() {
         Sequencer.SyncMode[] returnedModes = new Sequencer.SyncMode[slaveSyncModes.length];
         System.arraycopy(slaveSyncModes, 0, returnedModes, 0, slaveSyncModes.length);
@@ -577,8 +585,7 @@
         return 0;
     }
 
-
-
+    @Override
     public synchronized void setTrackMute(int track, boolean mute) {
         int trackCount = getTrackCount();
         if (track < 0 || track >= getTrackCount()) return;
@@ -589,14 +596,14 @@
         }
     }
 
-
+    @Override
     public synchronized boolean getTrackMute(int track) {
         if (track < 0 || track >= getTrackCount()) return false;
         if (trackMuted == null || trackMuted.length <= track) return false;
         return trackMuted[track];
     }
 
-
+    @Override
     public synchronized void setTrackSolo(int track, boolean solo) {
         int trackCount = getTrackCount();
         if (track < 0 || track >= getTrackCount()) return;
@@ -607,14 +614,14 @@
         }
     }
 
-
+    @Override
     public synchronized boolean getTrackSolo(int track) {
         if (track < 0 || track >= getTrackCount()) return false;
         if (trackSolo == null || trackSolo.length <= track) return false;
         return trackSolo[track];
     }
 
-
+    @Override
     public boolean addMetaEventListener(MetaEventListener listener) {
         synchronized(metaEventListeners) {
             if (! metaEventListeners.contains(listener)) {
@@ -625,7 +632,7 @@
         }
     }
 
-
+    @Override
     public void removeMetaEventListener(MetaEventListener listener) {
         synchronized(metaEventListeners) {
             int index = metaEventListeners.indexOf(listener);
@@ -635,7 +642,7 @@
         }
     }
 
-
+    @Override
     public int[] addControllerEventListener(ControllerEventListener listener, int[] controllers) {
         synchronized(controllerEventListeners) {
 
@@ -663,7 +670,7 @@
         }
     }
 
-
+    @Override
     public int[] removeControllerEventListener(ControllerEventListener listener, int[] controllers) {
         synchronized(controllerEventListeners) {
             ControllerListElement cve = null;
@@ -690,9 +697,9 @@
         }
     }
 
-
     ////////////////// LOOPING (added in 1.5) ///////////////////////
 
+    @Override
     public void setLoopStartPoint(long tick) {
         if ((tick > getTickLength())
             || ((loopEnd != -1) && (tick > loopEnd))
@@ -702,10 +709,12 @@
         loopStart = tick;
     }
 
+    @Override
     public long getLoopStartPoint() {
         return loopStart;
     }
 
+    @Override
     public void setLoopEndPoint(long tick) {
         if ((tick > getTickLength())
             || ((loopStart > tick) && (tick != -1))
@@ -715,10 +724,12 @@
         loopEnd = tick;
     }
 
+    @Override
     public long getLoopEndPoint() {
         return loopEnd;
     }
 
+    @Override
     public void setLoopCount(int count) {
         if (count != LOOP_CONTINUOUSLY
             && count < 0) {
@@ -730,15 +741,14 @@
         }
     }
 
+    @Override
     public int getLoopCount() {
         return loopCount;
     }
 
-
     /* *********************************** play control ************************* */
 
-    /*
-     */
+    @Override
     protected void implOpen() throws MidiUnavailableException {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: implOpen()");
 
@@ -820,14 +830,15 @@
         }
     }
 
-    /** populate the caches with the current values */
+    /**
+     * populate the caches with the current values.
+     */
     private synchronized void setCaches() {
         cacheTempoFactor = getTempoFactor();
         cacheTempoMPQ = getTempoInMPQ();
     }
 
-
-
+    @Override
     protected synchronized void implClose() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: implClose() ");
 
@@ -882,7 +893,6 @@
         if (Printer.trace) Printer.trace("<< RealTimeSequencer: implStart() completed");
     }
 
-
     void implStop() {
         if (Printer.trace) Printer.trace(">> RealTimeSequencer: implStop()");
 
@@ -953,8 +963,6 @@
         getEventDispatcher().sendAudioEvents(message, sendToListeners);
     }
 
-
-
     private boolean needCaching() {
         return !isOpen() || (sequence == null) || (playThread == null);
     }
@@ -988,42 +996,39 @@
         return array;
     }
 
-
     // OVERRIDES OF ABSTRACT MIDI DEVICE METHODS
 
+    @Override
     protected boolean hasReceivers() {
         return true;
     }
 
     // for recording
+    @Override
     protected Receiver createReceiver() throws MidiUnavailableException {
         return new SequencerReceiver();
     }
 
-
+    @Override
     protected boolean hasTransmitters() {
         return true;
     }
 
-
+    @Override
     protected Transmitter createTransmitter() throws MidiUnavailableException {
         return new SequencerTransmitter();
     }
 
-
     // interface AutoConnectSequencer
+    @Override
     public void setAutoConnect(Receiver autoConnectedReceiver) {
         this.autoConnect = (autoConnectedReceiver != null);
         this.autoConnectedReceiver = autoConnectedReceiver;
     }
 
-
-
-    // INNER CLASSES
-
     /**
      * An own class to distinguish the class name from
-     * the transmitter of other devices
+     * the transmitter of other devices.
      */
     private class SequencerTransmitter extends BasicTransmitter {
         private SequencerTransmitter() {
@@ -1031,9 +1036,9 @@
         }
     }
 
-
     final class SequencerReceiver extends AbstractReceiver {
 
+        @Override
         void implSend(MidiMessage message, long timeStamp) {
             if (recording) {
                 long tickPos = 0;
@@ -1080,7 +1085,6 @@
         }
     }
 
-
     private static class RealTimeSequencerInfo extends MidiDevice.Info {
 
         private static final String name = "Real Time Sequencer";
@@ -1093,7 +1097,6 @@
         }
     } // class Info
 
-
     private class ControllerListElement {
 
         // $$jb: using an array for controllers b/c its
@@ -1202,7 +1205,6 @@
 
     } // class ControllerListElement
 
-
     static class RecordingTrack {
 
         private final Track track;
@@ -1244,7 +1246,6 @@
         }
     }
 
-
     final class PlayThread implements Runnable {
         private Thread thread;
         private final Object lock = new Object();
@@ -1351,13 +1352,13 @@
             }
         }
 
-
         /**
          * Main process loop driving the media flow.
          *
          * Make sure to NOT synchronize on RealTimeSequencer
          * anywhere here (even implicit). That is a sure deadlock!
          */
+        @Override
         public void run() {
 
             while (!interrupted) {
@@ -1409,10 +1410,9 @@
         }
     }
 
-
     /**
      * class that does the actual dispatching of events,
-     * used to be in native in MMAPI
+     * used to be in native in MMAPI.
      */
     private class DataPump {
         private float currTempo;         // MPQ tempo
@@ -1434,7 +1434,6 @@
         //private sun.misc.Perf perf = sun.misc.Perf.getPerf();
         //private long perfFreq = perf.highResFrequency();
 
-
         DataPump() {
             init();
         }
@@ -1516,8 +1515,6 @@
             trackDisabled = newDisabled;
         }
 
-
-
         synchronized void setSequence(Sequence seq) {
             if (seq == null) {
                 init();
@@ -1568,7 +1565,6 @@
             if (DEBUG_PUMP) Printer.println("  noteOff: sent "+done+" messages.");
         }
 
-
         private boolean[] makeDisabledArray() {
             if (tracks == null) {
                 return null;
@@ -1656,11 +1652,10 @@
             if (DEBUG_PUMP) Printer.println("  sendNoteOffIfOn: sent "+done+" messages.");
         }
 
-
         /**
          * Runtime application of mute/solo:
          * if a track is muted that was previously playing, send
-         *    note off events for all currently playing notes
+         *    note off events for all currently playing notes.
          */
         private void applyDisabledTracks(boolean[] oldDisabled, boolean[] newDisabled) {
             byte[][] tempArray = null;
@@ -1781,8 +1776,9 @@
             if (DEBUG_PUMP) Printer.println("  chaseTrackEvents track "+trackNum+": sent "+numControllersSent+" controllers.");
         }
 
-
-        /** chase controllers and program for all tracks */
+        /**
+         * chase controllers and program for all tracks.
+         */
         synchronized void chaseEvents(long startTick, long endTick) {
             if (DEBUG_PUMP) Printer.println(">> chaseEvents from tick "+startTick+".."+(endTick-1));
             byte[][] tempArray = new byte[128][16];
@@ -1797,7 +1793,6 @@
             if (DEBUG_PUMP) Printer.println("<< chaseEvents");
         }
 
-
         // playback related methods (pumping)
 
         private long getCurrentTimeMillis() {
@@ -1900,7 +1895,6 @@
             return changesPending;
         }
 
-
         /** the main pump method
          * @return true if end of sequence is reached
          */
@@ -2078,7 +2072,5 @@
 
             return EOM;
         }
-
     } // class DataPump
-
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/ReferenceCountingDevice.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/ReferenceCountingDevice.java	Mon Aug 22 08:27:10 2016 -0700
@@ -29,8 +29,6 @@
 import javax.sound.midi.Receiver;
 import javax.sound.midi.Transmitter;
 
-
-
 /** MidiDevice that can use reference counting for open/close.
  * This interface is intended to be used by MidiSystem.getTransmitter() and
  * MidiSystem.getReceiver().
@@ -42,11 +40,11 @@
      * This method is similar to MidiDevice.getReceiver(). However, by calling this one,
      * the device is opened implicitly. This is needed by MidiSystem.getReceiver().
      */
-    public Receiver getReceiverReferenceCounting() throws MidiUnavailableException;
+    Receiver getReceiverReferenceCounting() throws MidiUnavailableException;
 
     /** Retrieve a Transmitter that opens the device implicitly.
      * This method is similar to MidiDevice.getTransmitter(). However, by calling this one,
      * the device is opened implicitly. This is needed by MidiSystem.getTransmitter().
      */
-    public Transmitter getTransmitterReferenceCounting() throws MidiUnavailableException;
+    Transmitter getTransmitterReferenceCounting() throws MidiUnavailableException;
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2GlobalRegion.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2GlobalRegion.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2Instrument.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2Instrument.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.ArrayList;
@@ -45,8 +46,7 @@
     long genre = 0;
     long morphology = 0;
     SF2GlobalRegion globalregion = null;
-    List<SF2InstrumentRegion> regions
-            = new ArrayList<SF2InstrumentRegion>();
+    List<SF2InstrumentRegion> regions = new ArrayList<>();
 
     public SF2Instrument() {
         super(null, null, null, null);
@@ -56,6 +56,7 @@
         super(soundbank, null, null, null);
     }
 
+    @Override
     public String getName() {
         return name;
     }
@@ -64,6 +65,7 @@
         this.name = name;
     }
 
+    @Override
     public Patch getPatch() {
         if (bank == 128)
             return new ModelPatch(0, preset, true);
@@ -81,6 +83,7 @@
         }
     }
 
+    @Override
     public Object getData() {
         return null;
     }
@@ -121,6 +124,7 @@
         globalregion = zone;
     }
 
+    @Override
     public String toString() {
         if (bank == 128)
             return "Drumkit: " + name + " preset #" + preset;
@@ -129,6 +133,7 @@
                     + " preset #" + preset;
     }
 
+    @Override
     public ModelPerformer[] getPerformers() {
         int performercount = 0;
         for (SF2InstrumentRegion presetzone : regions)
@@ -138,7 +143,7 @@
 
         SF2GlobalRegion presetglobal = globalregion;
         for (SF2InstrumentRegion presetzone : regions) {
-            Map<Integer, Short> pgenerators = new HashMap<Integer, Short>();
+            Map<Integer, Short> pgenerators = new HashMap<>();
             pgenerators.putAll(presetzone.getGenerators());
             if (presetglobal != null)
                 pgenerators.putAll(presetglobal.getGenerators());
@@ -267,7 +272,7 @@
                 if (buff24 != null)
                     osc.set8BitExtensionBuffer(buff24);
 
-                Map<Integer, Short> generators = new HashMap<Integer, Short>();
+                Map<Integer, Short> generators = new HashMap<>();
                 if (layerglobal != null)
                     generators.putAll(layerglobal.getGenerators());
                 generators.putAll(layerzone.getGenerators());
@@ -608,6 +613,7 @@
                     new ModelConnectionBlock(
                         new ModelSource(ModelSource.SOURCE_NOTEON_VELOCITY,
                             new ModelTransform() {
+                                @Override
                                 public double transform(double value) {
                                     if (value < 0.5)
                                         return 1 - value * 2;
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2InstrumentRegion.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2InstrumentRegion.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2Layer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2Layer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -38,7 +38,7 @@
 
     String name = "";
     SF2GlobalRegion globalregion = null;
-    List<SF2LayerRegion> regions = new ArrayList<SF2LayerRegion>();
+    List<SF2LayerRegion> regions = new ArrayList<>();
 
     public SF2Layer(SF2Soundbank soundBank) {
         super(soundBank, null, null);
@@ -48,10 +48,12 @@
         super(null, null, null);
     }
 
+    @Override
     public Object getData() {
         return null;
     }
 
+    @Override
     public String getName() {
         return name;
     }
@@ -72,6 +74,7 @@
         globalregion = zone;
     }
 
+    @Override
     public String toString() {
         return "Layer: " + name;
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2LayerRegion.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2LayerRegion.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2Modulator.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2Modulator.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2Region.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2Region.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.ArrayList;
@@ -97,8 +98,8 @@
     public static final int GENERATOR_OVERRIDINGROOTKEY = 58;
     public static final int GENERATOR_UNUSED5 = 59;
     public static final int GENERATOR_ENDOPR = 60;
-    protected Map<Integer, Short> generators = new HashMap<Integer, Short>();
-    protected List<SF2Modulator> modulators = new ArrayList<SF2Modulator>();
+    protected Map<Integer, Short> generators = new HashMap<>();
+    protected List<SF2Modulator> modulators = new ArrayList<>();
 
     public Map<Integer, Short> getGenerators() {
         return generators;
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2Sample.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2Sample.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.InputStream;
@@ -57,6 +58,7 @@
         super(null, null, AudioInputStream.class);
     }
 
+    @Override
     public Object getData() {
 
         AudioFormat format = getFormat();
@@ -146,6 +148,7 @@
     }
     */
 
+    @Override
     public String getName() {
         return name;
     }
@@ -210,6 +213,7 @@
         this.startLoop = startLoop;
     }
 
+    @Override
     public String toString() {
         return "Sample: " + name;
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2Soundbank.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2Soundbank.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.File;
@@ -81,9 +82,9 @@
     private ModelByteBuffer sampleData24 = null;
     private File sampleFile = null;
     private boolean largeFormat = false;
-    private final List<SF2Instrument> instruments = new ArrayList<SF2Instrument>();
-    private final List<SF2Layer> layers = new ArrayList<SF2Layer>();
-    private final List<SF2Sample> samples = new ArrayList<SF2Sample>();
+    private final List<SF2Instrument> instruments = new ArrayList<>();
+    private final List<SF2Layer> layers = new ArrayList<>();
+    private final List<SF2Sample> samples = new ArrayList<>();
 
     public SF2Soundbank() {
     }
@@ -224,19 +225,15 @@
 
     private void readPdtaChunk(RIFFReader riff) throws IOException {
 
-        List<SF2Instrument> presets = new ArrayList<SF2Instrument>();
-        List<Integer> presets_bagNdx = new ArrayList<Integer>();
-        List<SF2InstrumentRegion> presets_splits_gen
-                = new ArrayList<SF2InstrumentRegion>();
-        List<SF2InstrumentRegion> presets_splits_mod
-                = new ArrayList<SF2InstrumentRegion>();
+        List<SF2Instrument> presets = new ArrayList<>();
+        List<Integer> presets_bagNdx = new ArrayList<>();
+        List<SF2InstrumentRegion> presets_splits_gen = new ArrayList<>();
+        List<SF2InstrumentRegion> presets_splits_mod = new ArrayList<>();
 
-        List<SF2Layer> instruments = new ArrayList<SF2Layer>();
-        List<Integer> instruments_bagNdx = new ArrayList<Integer>();
-        List<SF2LayerRegion> instruments_splits_gen
-                = new ArrayList<SF2LayerRegion>();
-        List<SF2LayerRegion> instruments_splits_mod
-                = new ArrayList<SF2LayerRegion>();
+        List<SF2Layer> instruments = new ArrayList<>();
+        List<Integer> instruments_bagNdx = new ArrayList<>();
+        List<SF2LayerRegion> instruments_splits_gen = new ArrayList<>();
+        List<SF2LayerRegion> instruments_splits_mod = new ArrayList<>();
 
         while (riff.hasNextChunk()) {
             RIFFReader chunk = riff.nextChunk();
@@ -830,18 +827,22 @@
 
     }
 
+    @Override
     public String getName() {
         return name;
     }
 
+    @Override
     public String getVersion() {
         return major + "." + minor;
     }
 
+    @Override
     public String getVendor() {
         return engineers;
     }
 
+    @Override
     public String getDescription() {
         return comments;
     }
@@ -858,6 +859,7 @@
         comments = s;
     }
 
+    @Override
     public SoundbankResource[] getResources() {
         SoundbankResource[] resources
                 = new SoundbankResource[layers.size() + samples.size()];
@@ -869,6 +871,7 @@
         return resources;
     }
 
+    @Override
     public SF2Instrument[] getInstruments() {
         SF2Instrument[] inslist_array
                 = instruments.toArray(new SF2Instrument[instruments.size()]);
@@ -884,6 +887,7 @@
         return samples.toArray(new SF2Sample[samples.size()]);
     }
 
+    @Override
     public Instrument getInstrument(Patch patch) {
         int program = patch.getProgram();
         int bank = patch.getBank();
@@ -972,11 +976,11 @@
 
     public void removeResource(SoundbankResource resource) {
         if (resource instanceof SF2Instrument)
-            instruments.remove((SF2Instrument)resource);
+            instruments.remove(resource);
         if (resource instanceof SF2Layer)
-            layers.remove((SF2Layer)resource);
+            layers.remove(resource);
         if (resource instanceof SF2Sample)
-            samples.remove((SF2Sample)resource);
+            samples.remove(resource);
     }
 
     public void addInstrument(SF2Instrument resource) {
--- a/src/java.desktop/share/classes/com/sun/media/sound/SF2SoundbankReader.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SF2SoundbankReader.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,12 +22,14 @@
  * 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.InputStream;
 import java.net.URL;
+
 import javax.sound.midi.InvalidMidiDataException;
 import javax.sound.midi.Soundbank;
 import javax.sound.midi.spi.SoundbankReader;
@@ -40,6 +42,7 @@
  */
 public final class SF2SoundbankReader extends SoundbankReader {
 
+    @Override
     public Soundbank getSoundbank(URL url)
             throws InvalidMidiDataException, IOException {
         try {
@@ -51,6 +54,7 @@
         }
     }
 
+    @Override
     public Soundbank getSoundbank(InputStream stream)
             throws InvalidMidiDataException, IOException {
         try {
@@ -62,6 +66,7 @@
         }
     }
 
+    @Override
     public Soundbank getSoundbank(File file)
             throws InvalidMidiDataException, IOException {
         try {
--- a/src/java.desktop/share/classes/com/sun/media/sound/SimpleInstrument.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SimpleInstrument.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,10 +22,12 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import java.util.ArrayList;
 import java.util.List;
+
 import javax.sound.midi.Patch;
 
 /**
@@ -48,8 +50,7 @@
     protected int bank = 0;
     protected boolean percussion = false;
     protected String name = "";
-    protected List<SimpleInstrumentPart> parts
-            = new ArrayList<SimpleInstrumentPart>();
+    protected List<SimpleInstrumentPart> parts = new ArrayList<>();
 
     public SimpleInstrument() {
         super(null, null, null, null);
@@ -121,6 +122,7 @@
         add(ins.getPerformers());
     }
 
+    @Override
     public ModelPerformer[] getPerformers() {
 
         int percount = 0;
@@ -166,10 +168,12 @@
         return performers;
     }
 
+    @Override
     public Object getData() {
         return null;
     }
 
+    @Override
     public String getName() {
         return this.name;
     }
@@ -178,6 +182,7 @@
         this.name = name;
     }
 
+    @Override
     public ModelPatch getPatch() {
         return new ModelPatch(bank, preset, percussion);
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SimpleSoundbank.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SimpleSoundbank.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.ArrayList;
@@ -44,21 +45,25 @@
     String version = "";
     String vendor = "";
     String description = "";
-    List<SoundbankResource> resources = new ArrayList<SoundbankResource>();
-    List<Instrument> instruments = new ArrayList<Instrument>();
+    List<SoundbankResource> resources = new ArrayList<>();
+    List<Instrument> instruments = new ArrayList<>();
 
+    @Override
     public String getName() {
         return name;
     }
 
+    @Override
     public String getVersion() {
         return version;
     }
 
+    @Override
     public String getVendor() {
         return vendor;
     }
 
+    @Override
     public String getDescription() {
         return description;
     }
@@ -79,10 +84,12 @@
         this.version = version;
     }
 
+    @Override
     public SoundbankResource[] getResources() {
         return resources.toArray(new SoundbankResource[resources.size()]);
     }
 
+    @Override
     public Instrument[] getInstruments() {
         Instrument[] inslist_array
                 = instruments.toArray(new Instrument[resources.size()]);
@@ -90,6 +97,7 @@
         return inslist_array;
     }
 
+    @Override
     public Instrument getInstrument(Patch patch) {
         int program = patch.getProgram();
         int bank = patch.getBank();
@@ -120,7 +128,7 @@
 
     public void removeResource(SoundbankResource resource) {
         if (resource instanceof Instrument)
-            instruments.remove((Instrument) resource);
+            instruments.remove(resource);
         else
             resources.remove(resource);
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SoftAbstractResampler.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftAbstractResampler.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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;
@@ -74,14 +75,17 @@
             ibuffer_order = true;
         }
 
+        @Override
         public void noteOn(MidiChannel channel, VoiceStatus voice,
-                int noteNumber, int velocity) {
+                           int noteNumber, int velocity) {
         }
 
+        @Override
         public void noteOff(int velocity) {
             noteOff_flag = true;
         }
 
+        @Override
         public void open(ModelWavetable osc, float outputsamplerate)
                 throws IOException {
 
@@ -135,6 +139,7 @@
             nextBuffer();
         }
 
+        @Override
         public void setPitch(float pitch) {
             /*
             this.pitch = (float) Math.pow(2f,
@@ -254,6 +259,7 @@
             }
         }
 
+        @Override
         public int read(float[][] buffer, int offset, int len)
                 throws IOException {
 
@@ -373,6 +379,7 @@
             return len;
         }
 
+        @Override
         public void close() throws IOException {
             stream.close();
         }
@@ -384,6 +391,7 @@
             float in_end, float[] pitch, float pitchstep, float[] out,
             int[] out_offset, int out_end);
 
+    @Override
     public final SoftResamplerStreamer openStreamer() {
         return new ModelAbstractResamplerStream();
     }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SoftAudioBuffer.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftAudioBuffer.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.Arrays;
@@ -123,6 +124,5 @@
                 }
             }
         }
-
     }
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SoftAudioProcessor.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftAudioProcessor.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 /**
@@ -31,18 +32,17 @@
  */
 public interface SoftAudioProcessor {
 
-    public void globalParameterControlChange(int[] slothpath, long param,
-            long value);
+    void globalParameterControlChange(int[] slothpath, long param, long value);
 
-    public void init(float samplerate, float controlrate);
+    void init(float samplerate, float controlrate);
 
-    public void setInput(int pin, SoftAudioBuffer input);
+    void setInput(int pin, SoftAudioBuffer input);
 
-    public void setOutput(int pin, SoftAudioBuffer output);
+    void setOutput(int pin, SoftAudioBuffer output);
 
-    public void setMixMode(boolean mix);
+    void setMixMode(boolean mix);
 
-    public void processAudio();
+    void processAudio();
 
-    public void processControlLogic();
+    void processControlLogic();
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SoftAudioPusher.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftAudioPusher.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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;
@@ -70,6 +71,7 @@
         }
     }
 
+    @Override
     public void run() {
         byte[] buffer = SoftAudioPusher.this.buffer;
         AudioInputStream ais = SoftAudioPusher.this.ais;
@@ -87,6 +89,5 @@
             active = false;
             //e.printStackTrace();
         }
-
     }
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/SoftChannel.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftChannel.java	Mon Aug 22 08:27:10 2016 -0700
@@ -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.util.ArrayList;
@@ -41,7 +42,7 @@
  */
 public final class SoftChannel implements MidiChannel, ModelDirectedPlayer {
 
-    private static boolean[] dontResetControls = new boolean[128];
+    private static final boolean[] dontResetControls = new boolean[128];
     static {
         for (int i = 0; i < dontResetControls.length; i++)
             dontResetControls[i] = false;
@@ -99,18 +100,18 @@
     private boolean solo = false;
     private boolean solomute = false;
     private final Object control_mutex;
-    private int channel;
-    private SoftVoice[] voices;
+    private final int channel;
+    private final SoftVoice[] voices;
     private int bank;
     private int program;
-    private SoftSynthesizer synthesizer;
-    private SoftMainMixer mainmixer;
-    private int[] polypressure = new int[128];
+    private final SoftSynthesizer synthesizer;
+    private final SoftMainMixer mainmixer;
+    private final int[] polypressure = new int[128];
     private int channelpressure = 0;
-    private int[] controller = new int[128];
+    private final int[] controller = new int[128];
     private int pitchbend;
-    private double[] co_midi_pitch = new double[1];
-    private double[] co_midi_channel_pressure = new double[1];
+    private final double[] co_midi_pitch = new double[1];
+    private final double[] co_midi_channel_pressure = new double[1];
     SoftTuning tuning = new SoftTuning();
     int tuning_bank = 0;
     int tuning_program = 0;
@@ -132,6 +133,7 @@
         double[] channel_pressure = co_midi_channel_pressure;
         double[] poly_pressure = new double[1];
 
+        @Override
         public double[] get(int instance, String name) {
             if (name == null)
                 return null;
@@ -145,26 +147,28 @@
         }
     }
 
-    private SoftControl[] co_midi = new SoftControl[128];
+    private final SoftControl[] co_midi = new SoftControl[128];
     {
         for (int i = 0; i < co_midi.length; i++) {
             co_midi[i] = new MidiControlObject();
         }
     }
 
-    private double[][] co_midi_cc_cc = new double[128][1];
-    private SoftControl co_midi_cc = new SoftControl() {
+    private final double[][] co_midi_cc_cc = new double[128][1];
+    private final SoftControl co_midi_cc = new SoftControl() {
         double[][] cc = co_midi_cc_cc;
+        @Override
         public double[] get(int instance, String name) {
             if (name == null)
                 return null;
             return cc[Integer.parseInt(name)];
         }
     };
-    Map<Integer, int[]> co_midi_rpn_rpn_i = new HashMap<Integer, int[]>();
-    Map<Integer, double[]> co_midi_rpn_rpn = new HashMap<Integer, double[]>();
-    private SoftControl co_midi_rpn = new SoftControl() {
+    Map<Integer, int[]> co_midi_rpn_rpn_i = new HashMap<>();
+    Map<Integer, double[]> co_midi_rpn_rpn = new HashMap<>();
+    private final SoftControl co_midi_rpn = new SoftControl() {
         Map<Integer, double[]> rpn = co_midi_rpn_rpn;
+        @Override
         public double[] get(int instance, String name) {
             if (name == null)
                 return null;
@@ -177,10 +181,11 @@
             return v;
         }
     };
-    Map<Integer, int[]> co_midi_nrpn_nrpn_i = new HashMap<Integer, int[]>();
-    Map<Integer, double[]> co_midi_nrpn_nrpn = new HashMap<Integer, double[]>();
-    private SoftControl co_midi_nrpn = new SoftControl() {
+    Map<Integer, int[]> co_midi_nrpn_nrpn_i = new HashMap<>();
+    Map<Integer, double[]> co_midi_nrpn_nrpn = new HashMap<>();
+    private final SoftControl co_midi_nrpn = new SoftControl() {
         Map<Integer, double[]> nrpn = co_midi_nrpn_nrpn;
+        @Override
         public double[] get(int instance, String name) {
             if (name == null)
                 return null;
@@ -407,6 +412,7 @@
         }
     }
 
+    @Override
     public void noteOn(int noteNumber, int velocity) {
         noteOn(noteNumber, velocity, 0);
     }
@@ -544,6 +550,7 @@
         }
     }
 
+    @Override
     public void noteOff(int noteNumber, int velocity) {
         noteNumber = restrict7Bit(noteNumber);
         velocity = restrict7Bit(velocity);
@@ -616,7 +623,7 @@
 
         }
     }
-    private int[] lastVelocity = new int[128];
+    private final int[] lastVelocity = new int[128];
     private int prevVoiceID;
     private boolean firstVoice = true;
     private int voiceNo = 0;
@@ -625,6 +632,7 @@
     private int play_delay = 0;
     private boolean play_releasetriggered = false;
 
+    @Override
     public void play(int performerIndex, ModelConnectionBlock[] connectionBlocks) {
 
         int noteNumber = play_noteNumber;
@@ -657,11 +665,13 @@
                 connectionBlocks, current_mixer, releasetriggered);
     }
 
+    @Override
     public void noteOff(int noteNumber) {
         if(noteNumber < 0 || noteNumber > 127) return;
         noteOff_internal(noteNumber, 64);
     }
 
+    @Override
     public void setPolyPressure(int noteNumber, int pressure) {
         noteNumber = restrict7Bit(noteNumber);
         pressure = restrict7Bit(pressure);
@@ -680,12 +690,14 @@
         }
     }
 
+    @Override
     public int getPolyPressure(int noteNumber) {
         synchronized (control_mutex) {
             return polypressure[noteNumber];
         }
     }
 
+    @Override
     public void setChannelPressure(int pressure) {
         pressure = restrict7Bit(pressure);
         if (current_mixer != null)
@@ -701,6 +713,7 @@
         }
     }
 
+    @Override
     public int getChannelPressure() {
         synchronized (control_mutex) {
             return channelpressure;
@@ -823,7 +836,7 @@
         05 LFO Amplitude Depth   | 00H..7FH | 0..100 percent          |  0
         */
 
-        List<ModelConnectionBlock> conns = new ArrayList<ModelConnectionBlock>();
+        List<ModelConnectionBlock> conns = new ArrayList<>();
 
         for (int i = 0; i < destination.length; i++) {
             int d = destination[i];
@@ -869,6 +882,7 @@
                 final double scale = (r / 64.0);
                 ModelTransform mt = new ModelTransform() {
                     double s = scale;
+                    @Override
                     public double transform(double value) {
                         if (s < 1)
                             value = s + (value * (1.0 - s));
@@ -923,6 +937,7 @@
 
                 ModelTransform mt = new ModelTransform() {
                     double s = scale;
+                    @Override
                     public double transform(double value) {
                         return -((5.0 / 12.0) / Math.log(10))
                                 * Math.log(1 - value * s);
@@ -1055,6 +1070,7 @@
         return (int)(keybasedcontroller_value[noteNumber][controller] * 128);
     }
 
+    @Override
     public void controlChange(int controller, int value) {
         controller = restrict7Bit(controller);
         value = restrict7Bit(value);
@@ -1241,6 +1257,7 @@
         }
     }
 
+    @Override
     public int getController(int controller) {
         synchronized (control_mutex) {
             // Should only return lower 7 bits,
@@ -1259,10 +1276,12 @@
         }
     }
 
+    @Override
     public void programChange(int program) {
         programChange(bank, program);
     }
 
+    @Override
     public void programChange(int bank, int program) {
         bank = restrict14Bit(bank);
         program = restrict7Bit(program);
@@ -1277,12 +1296,14 @@
         }
     }
 
+    @Override
     public int getProgram() {
         synchronized (control_mutex) {
             return program;
         }
     }
 
+    @Override
     public void setPitchBend(int bend) {
         bend = restrict14Bit(bend);
         if (current_mixer != null)
@@ -1297,6 +1318,7 @@
         }
     }
 
+    @Override
     public int getPitchBend() {
         synchronized (control_mutex) {
             return pitchbend;
@@ -1398,6 +1420,7 @@
                 voices[i].rpnChange(controller, val_i[0]);
     }
 
+    @Override
     public void resetAllControllers() {
         resetAllControllers(false);
     }
@@ -1463,6 +1486,7 @@
         }
     }
 
+    @Override
     public void allNotesOff() {
         if (current_mixer != null)
             current_mixer.allNotesOff();
@@ -1475,6 +1499,7 @@
         }
     }
 
+    @Override
     public void allSoundOff() {
         if (current_mixer != null)
             current_mixer.allSoundOff();
@@ -1485,10 +1510,12 @@
         }
     }
 
+    @Override
     public boolean localControl(boolean on) {
         return false;
     }
 
+    @Override
     public void setMono(boolean on) {
         if (current_mixer != null)
             current_mixer.setMono(on);
@@ -1498,12 +1525,14 @@
         }
     }
 
+    @Override
     public boolean getMono() {
         synchronized (control_mutex) {
             return mono;
         }
     }
 
+    @Override
     public void setOmni(boolean on) {
         if (current_mixer != null)
             current_mixer.setOmni(on);
@@ -1511,10 +1540,12 @@
     // Omni is not supported by GM2
     }
 
+    @Override
     public boolean getOmni() {
         return false;
     }
 
+    @Override
     public void setMute(boolean mute) {
         if (current_mixer != null)
             current_mixer.setMute(mute);
@@ -1526,12 +1557,14 @@
         }
     }
 
+    @Override
     public boolean getMute() {
         synchronized (control_mutex) {
             return mute;
         }
     }
 
+    @Override
     public void setSolo(boolean soloState) {
         if (current_mixer != null)
             current_mixer.setSolo(soloState);
@@ -1571,6 +1604,7 @@
         }
     }
 
+    @Override
     public boolean getSolo() {
         synchronized (control_mutex) {
             return solo;
--- a/src/java.desktop/share/classes/com/sun/media/sound/SoftChannelProxy.java	Fri Aug 19 11:22:17 2016 -0700
+++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftChannelProxy.java	Mon Aug 22 08:27:10 2016 -0700
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package com.sun.media.sound;
 
 import javax.sound.midi.MidiChannel;
@@ -44,156 +45,182 @@
         this.channel = channel;
     }
 
+    @Override
     public void allNotesOff() {
         if (channel == null)
             return;
         channel.allNotesOff();
     }
 
+    @Override
     public void allSoundOff() {
         if (channel == null)
             return;
         channel.allSoundOff();
     }
 
+    @Override
     public void controlChange(int controller, int value) {
         if (channel == null)
             return;
         channel.controlChange(controller, value);
     }
 
+    @Override
     public int getChannelPressure() {
         if (channel == null)
             return 0;
         return channel.getChannelPressure();
     }
 
+    @Override