jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/MixerProvider.java
changeset 34412 bed825be8cd8
parent 25859 3317bb8137f4
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/MixerProvider.java	Fri Nov 20 17:54:58 2015 -0600
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/MixerProvider.java	Sun Nov 22 17:27:33 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
 
 package javax.sound.sampled.spi;
 
+import java.util.Objects;
+
 import javax.sound.sampled.Mixer;
 
 /**
@@ -49,9 +51,11 @@
      *         queried
      * @return {@code true} if the specified mixer is supported, otherwise
      *         {@code false}
+     * @throws NullPointerException if {@code info} is {@code null}
      * @see #getMixerInfo()
      */
     public boolean isMixerSupported(Mixer.Info info) {
+        Objects.requireNonNull(info);
 
         Mixer.Info infos[] = getMixerInfo();
 
@@ -78,17 +82,21 @@
     public abstract Mixer.Info[] getMixerInfo();
 
     /**
-     * Obtains an instance of the mixer represented by the info object.
+     * Obtains an instance of the mixer represented by the info object. If
+     * {@code null} is passed, then the default mixer will be returned.
      * <p>
      * The full set of the mixer info objects that represent the mixers
      * supported by this {@code MixerProvider} may be obtained through the
      * {@code getMixerInfo} method. Use the {@code isMixerSupported} method to
      * test whether this {@code MixerProvider} supports a particular mixer.
      *
-     * @param  info an info object that describes the desired mixer
+     * @param  info an info object that describes the desired mixer, or
+     *         {@code null} for the default mixer
      * @return mixer instance
      * @throws IllegalArgumentException if the info object specified does not
-     *         match the info object for a mixer supported by this MixerProvider
+     *         match the info object for a mixer supported by this
+     *         {@code MixerProvider}, or if this {@code MixerProvider} does not
+     *         have default mixer, but default mixer has been requested
      * @see #getMixerInfo()
      * @see #isMixerSupported(Mixer.Info)
      */