On Tue, 22 Sep 2026 12:46:09 GMT, Kevin Walls <[email protected]> wrote:

> Setting "jmx.remote.x.notification.buffer.size" to Integer.MAX_VALUE causes a 
> NegativeArraySizeException, as the value has 1 added before making a new 
> array.  An Exception should be thrown, but an expected, checked Exception.
> 
> The EnvHelp method getNotifBufferSize(env) should throw 
> IllegalArgumentException if we are near the limit.
> 
> This should apply whether value is set from the System Property or env 
> setting.
> 
> In the affected method in EnvHelp.java I've made some whitespace adjustments, 
> the key change is the check at the new line 290.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 48241cf1
Author:    Kevin Walls <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/48241cf183c745c668299b52d311a1a9facc8a32
Stats:     52 lines in 2 files changed: 40 ins; 3 del; 9 mod

8392788: JMX notification buffer size Integer.MAX_VALUE causes 
NegativeArraySizeException

Reviewed-by: cjplummer

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

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

Reply via email to