JDK-6713527 : Synthesizer.unloadAllInstruments(Soundbank) does not throw IllegalArgumentException
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: OpenJDK6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2008-06-11
  • Updated: 2012-03-22
  • Resolved: 2008-11-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
OpenJDK6Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The specification on javax.sound.midi.Synthesizer.unloadAllInstruments(Soundbank) says:
------------------------------------------------------------------------------------------
void unloadAllInstruments(Soundbank soundbank)
    . . .
    Throws:
        IllegalArgumentException - thrown if the soundbank is not supported.
------------------------------------------------------------------------------------------

The following testcase checks this behavior:
api/javax_sound/midi/Synthesizer/index.html#unload[unload001]

Here is the excerpt of the meaningful part of the code:
------------------------------------------------------------------------------------------
        . . .
        try {
            synth = MidiSystem.getSynthesizer();
            synth.open();
            sBank = new MySoundbank();

            if (!synth.isSoundbankSupported(sBank)) {
                synth.unloadAllInstruments(sBank);
                failed = true;
                log.println("IllegalArgumentException should be thrown for "
                        + "unsupported banks!");
            }
        } catch (IllegalArgumentException ie) {
            log.println("Soundbank is not compatible. OKAY");

        }
------------------------------------------------------------------------------------------

And here is the output:

IllegalArgumentException should be thrown for unsupported banks!
unload001: Failed.

Comments
EVALUATION Test passes after fix for 6748251 "Apply IcedTea midi sound patch" was applied in OpenJDK 6 b13.
19-11-2008

EVALUATION Yes, the tests should pass.
19-08-2008