On Mon, 5 Oct 2026 07:40:10 GMT, Robert Lichtenberger <[email protected]> wrote:
>> As analysed in the bug, the previousWord() method does not work correctly if >> at the word boundary a character is found that is neither letter nor digit. >> This fix changes the method so that only ranges of whitespace will be >> skipped, resulting in correct word selection behaviour. >> A test case has been added to TextAreaTest. >> gradlew :controls:test --tests test.javafx.scene.control.Text*Test has been >> executed to ensure no regressions happen in other text related classes. No >> errors were reported. >> >> >> --------- >> - [X] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Robert Lichtenberger has updated the pull request incrementally with one > additional commit since the last revision: > > 8264588: Add test for followup JDK-8393470 modules/javafx.controls/src/test/java/test/javafx/scene/control/TextAreaTest.java line 564: > 562: } > 563: > 564: // test against JDK-8264588 remove, git blame will show where the test belongs to anyway :) modules/javafx.controls/src/test/java/test/javafx/scene/control/TextAreaTest.java line 566: > 564: // test against JDK-8264588 > 565: @Test > 566: public void previousWord() { maybe `testPreviousWordWithHashSign` ? modules/javafx.controls/src/test/java/test/javafx/scene/control/TextAreaTest.java line 568: > 566: public void previousWord() { > 567: txtArea.setText("This is Bug #123456"); > 568: txtArea.positionCaret(16); // in the middle of 123456 Minor: I would suggest to put the comment above the method, reads better as we humans tend to read top-to-bottom Suggestion: // in the middle of 123456 txtArea.positionCaret(16); modules/javafx.controls/src/test/java/test/javafx/scene/control/behavior/TextAreaBehaviorTest.java line 126: > 124: @Test > 125: @Disabled("JDK-8393470") > 126: public void testDoubleClick() { `testDoubleClickWithDifferentSpecialChars` maybe? modules/javafx.controls/src/test/java/test/javafx/scene/control/behavior/TextAreaBehaviorTest.java line 131: > 129: clickCharacter(0, 2, true) > 130: ); > 131: Assertions.assertEquals("Bug", control.getSelectedText()); preexisting in this class, but I would recommend to statically import `Assertions` like in almost every other test class ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2334#discussion_r4183438651 PR Review Comment: https://git.openjdk.org/jfx/pull/2334#discussion_r4183445086 PR Review Comment: https://git.openjdk.org/jfx/pull/2334#discussion_r4183456778 PR Review Comment: https://git.openjdk.org/jfx/pull/2334#discussion_r4183460830 PR Review Comment: https://git.openjdk.org/jfx/pull/2334#discussion_r4183433178
