On Wed, 27 May 2026 17:45:34 GMT, Sergey Bylokhov <[email protected]> wrote:

>> src/java.desktop/share/classes/com/sun/media/sound/ModelByteBuffer.java line 
>> 205:
>> 
>>> 203:             try (InputStream is = getInputStream()) {
>>> 204:                 if (is == null) {
>>> 205:                    throw new IOException("null stream");
>> 
>> This was the actual complaint
>
> That `getInputStream` method is used in a few other places that can also not 
> be ready for null.
> It can return null because it catches the IOException and returns null 
> instead. Maybe it would be better to just throw the IOException there, 
> instead of returning null and then checking and throwing?

I thought about changing it to throw the exception but that is a "signature" 
change on the method which seemed more risky. And at least some other cases 
would need to now catch IOException. So I chose this approach.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31299#discussion_r3312822767

Reply via email to