JDK-6713533 : Synthesizer.unloadInstruments(Soundbank,Patch[]) 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.
Related Reports
Duplicate :  
Relates :  
Relates :  
The specification of javax.sound.midi.Synthesizer.unloadInstruments(Soundbank,Patch[]) says:
void unloadInstruments(Soundbank soundbank,
                       Patch[] patchList)
    . . . 
        IllegalArgumentException - thrown if the soundbank is not supported.

The following testcase checks this behavior:

Here is the excerpt of the meaningful part of the code:
        . . .

        try {
            synth = MidiSystem.getSynthesizer();
            sBank = new MySoundbank();

            if (!synth.isSoundbankSupported(sBank)) {
                instrs = sBank.getInstruments();
                pList = new Patch[instrs.length];
                for (int i = 0; i < instrs.length; i++) {
                    pList[i] = instrs[i].getPatch();
                synth.unloadInstruments(sBank, pList);
                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!
unload006: Failed.

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

EVALUATION Yes, the tests should pass.