On Fri, 29 May 2026 00:04:51 GMT, Sergey Bylokhov <[email protected]> wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8385017
>
> src/java.desktop/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java
>  line 213:
> 
>> 211:         }
>> 212:         if (buffer.array() == null) {
>> 213:             InputStream is = buffer.getInputStream();
> 
> this seems to be the same "buffer.getInputStream" use above?

I've added a check there too.

> src/java.desktop/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java
>  line 215:
> 
>> 213:             InputStream is = buffer.getInputStream();
>> 214:             if (is == null) {
>> 215:                 return null;
> 
> This method is only used in SoftAbstractResampler. And when this one returns 
> null, that will throw  
> [NPE](https://github.com/openjdk/jdk/blob/114e3c61060752e34f7a075318ea7d2cff40744b/src/java.desktop/share/classes/com/sun/media/sound/SoftAbstractResampler.java#L103):
> 
>             stream = osc.openStream();
> ...
>             samplerateconv = stream.getFormat().getSampleRate() / 
> outputsamplerate;

when you pull on the loose strand of wool ... 
anyway I've made that method check for null and throw the already specified 
IOException

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

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

Reply via email to