Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4916887

SPEC: MidiDevice.get[Receiver|Transmitter]() should specify IllegalArgumentExc.

XMLWordPrintable

      For the class javax.sound.midi.MidiDevice, the specification of the methods getReceiver() and getTransmitter() specifies throwing a MidiUnavailableException in case a receiver/transmitter "is not available due to resource restrictions". However, the specification does not state clearly the behaviour iftransmitters/receivers aren't supported by the device at all. "Not supported at all" is definitely different from "resource restriction". An application program can find out if receivers/transmitters are available at all by calling getMaxReceivers()/getMaxTransmitters(). So getTransmitter()/getReceiver() should rather throw an IllegalArgumentException than a MidiUnavailableException for the case that Receivers/Transmitters aren't supported.

            amenkov Alex Menkov
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: