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

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

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

        try {
            synth = MidiSystem.getSynthesizer();
            synth.open();
            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.

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