< prev index next >

src/java.desktop/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -24,10 +24,11 @@
  */
 
 package javax.sound.midi.spi;
 
 import java.util.Arrays;
+import java.util.Objects;
 
 import javax.sound.midi.MidiDevice;
 
 /**
  * A {@code MidiDeviceProvider} is a factory or provider for a particular type

@@ -44,12 +45,14 @@
      *
      * @param  info an info object that describes the device for which support
      *         is queried
      * @return {@code true} if the specified device is supported, otherwise
      *         {@code false}
+     * @throws NullPointerException if {@code info} is {@code null}
      */
     public boolean isDeviceSupported(final MidiDevice.Info info) {
+        Objects.requireNonNull(info);
         return Arrays.asList(getDeviceInfo()).contains(info);
     }
 
     /**
      * Obtains the set of info objects representing the device or devices

@@ -65,8 +68,9 @@
      * @param  info an info object that describes the desired device
      * @return device instance
      * @throws IllegalArgumentException if the info object specified does not
      *         match the info object for a device supported by this
      *         {@code MidiDeviceProvider}
+     * @throws NullPointerException if {@code info} is {@code null}
      */
     public abstract MidiDevice getDevice(MidiDevice.Info info);
 }
< prev index next >