RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v9]
Kevin Rushforth
kcr at openjdk.org
Fri Apr 19 17:55:03 UTC 2024
On Fri, 19 Apr 2024 12:43:33 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:
>
> Fix test
I left a comment regarding the unit test. Please use a shim class instead of making `WinTextRangeProvider` public.
modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java line 40:
> 38: * GlassTextRangeProvider implements ITextRangeProvider.
> 39: */
> 40: public final class WinTextRangeProvider {
Making both this class and the newly added method public just for the purpose of a unit test is not a pattern we want to use. Instead, leave them as default (package) scope and create a public `WinTextRangeProvideShim` class underneath the shims.
-------------
PR Review: https://git.openjdk.org/jfx/pull/1442#pullrequestreview-2012032615
PR Review Comment: https://git.openjdk.org/jfx/pull/1442#discussion_r1572720221
More information about the openjfx-dev
mailing list