On Thu, 16 Jun 2022 03:49:34 GMT, Sergey Bylokhov <[email protected]> wrote:

>> Yeah. I think it makes sense to amend behavior here and not catch 
>> IOException. Callers should be ready for it.
>
> This getSoundbank method is called when we iterate over providers and check 
> which can be used, unfortunately, that code is not ready for the IOException 
> and we return "null" -> the next provider will be checked. This is a kind of 
> compatibility quirk.

Doesn't IOException mean the next provider is to be checked?

That is the IOException could be handled in the iterator, its code may need to 
be updated for that. Then the implementations of `getSoundbank(URL)` could 
propagate the IOException too and eliminate duplicate code.

`InvalidMidiDataException` isn't caught there, so the iterator code should 
handle it.

-------------

PR: https://git.openjdk.org/jdk/pull/8154

Reply via email to