RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

Andy Goryachev angorya at openjdk.org
Thu Apr 18 14:50:06 UTC 2024


On Thu, 18 Apr 2024 12:01:52 GMT, Oliver Kopp <duke at openjdk.org> wrote:

> Fixes https://bugs.openjdk.org/browse/JDK-8330462.
> 
> If the parameter `maxLength` is larger than `Integer.MAX_VALUE - start`, then an addition of `start` to it leads to a negative value. This is "fixed" by using `Math.max` comparing the `maxLength` and `maxLength + start`.

The code looks right.  I can't verify the fix with the deepl app.

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

Marked as reviewed by angorya (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/1442#pullrequestreview-2009127163


More information about the openjfx-dev mailing list