RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v20]
Ambarish Rapte
arapte at openjdk.org
Wed Apr 24 15:32:37 UTC 2024
On Wed, 24 Apr 2024 12:54:01 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:
>
> Re-order for more clearness
I tested the fix with a simple TextArea sample and observed an issue that: Windows Narrator reads only the last character of the Text in a TextArea, when moving the cursor, and the focus rect does not move with cursor.
Steps:
1. Launch Windows Narrator (shortcut key combination: Windows + Ctrl + Enter)
2. Run a simple TextArea sample with fix
public class TextAreaTest extends Application {
@Override
public void start(Stage primaryStage) {
primaryStage.setScene(new Scene(new VBox(new TextArea("javafx test"))));
primaryStage.show();
}
}
-> Observe that a Fcous Rect is drawn around all text in TextArea.
3. Press right arrow key to move cursor
-> Observe that:
i. Focus rect is drawn around the last character, even though the cursor is elsewhere
ii. With every right arrow key press, Narrator always read 't'
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1442#issuecomment-2075219300
More information about the openjfx-dev
mailing list