RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v15]

Oliver Kopp duke at openjdk.org
Tue Apr 23 17:47:04 UTC 2024


On Tue, 23 Apr 2024 12:17:55 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`.
>
> Oliver Kopp has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add missing exports

tests/system/src/test/java/test/com/sun/glass/ui/win/WinTextRangeProviderTest.java line 48:

> 46: import static org.junit.jupiter.api.Assertions.assertEquals;
> 47: 
> 48: @EnabledOnOs({OS.WINDOWS})

I did not use `Platform`s OS detection, because this seems to be more resource friendly and native JUnit5. I can switch to the style of `test.com.sun.glass.ui.gtk.Gtk2RemovalCommon`, i.e., use `if (!PlatformUtil.isWindows()) return;` in all test methdos.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1442#discussion_r1576649207


More information about the openjfx-dev mailing list