On Wed, 27 May 2026 18:09:42 GMT, Phil Race <[email protected]> wrote:

>> A fix for a theoretical NPE because a method might return null and it is 
>> used.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> 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 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;

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

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

Reply via email to