Re: [jfx21u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-15 Thread Andy Goryachev
On Wed, 15 May 2024 16:20:04 GMT, Jose Pereda wrote: > Hi all, > > This pull request contains a backport of commit > [d3da033a](https://github.com/openjdk/jfx/commit/d3da033a2dd5c287733545935242a8d1f71c0554) > from the [openjdk/jfx](https://git.openjdk.org/jfx) repository. > > The commit bein

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

2024-05-15 Thread Jose Pereda
Hi all, This pull request contains a backport of commit [d3da033a](https://github.com/openjdk/jfx/commit/d3da033a2dd5c287733545935242a8d1f71c0554) from the [openjdk/jfx](https://git.openjdk.org/jfx) repository. The commit being backported was authored by Oliver Kopp on 8 May 2024 and was revie

Re: [jfx22u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-13 Thread Kevin Rushforth
On Mon, 13 May 2024 17:26:02 GMT, Ambarish Rapte wrote: >> Ah, I see. In that case, reordering to match mainline seems good. > > May be I am missing something here, > I verified the order, it is same as mainline jfx. (jfx has 3 more, that > follow the new addition) In that case, my earlier comm

Re: [jfx22u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-13 Thread Ambarish Rapte
On Mon, 13 May 2024 16:42:05 GMT, Kevin Rushforth wrote: >> forgot to mention the diff is just a different ordering. > > Ah, I see. In that case, reordering to match mainline seems good. May be I am missing something here, I verified the order, it is same as mainline jfx. (jfx has 3 more, that f

Re: [jfx22u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-13 Thread Kevin Rushforth
On Mon, 13 May 2024 16:39:43 GMT, Andy Goryachev wrote: >> Probably not as part of this backport. Also, the fact that they are >> different suggests that there might be another fix that is in mainline but >> not in jfx22u (and we wouldn't choose to backport another fix just to avoid >> a merge

Re: [jfx22u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-13 Thread Andy Goryachev
On Mon, 13 May 2024 15:54:47 GMT, Kevin Rushforth wrote: >> tests/system/src/test/.classpath line 17: >> >>> 15: >>> 16: >>> 17: >> value="javafx.graphics/com.sun.glass.ui=ALL-UNNAMED:javafx.graphics/com.sun.glass.ui.monocle=ALL-U

Re: [jfx22u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-13 Thread Andy Goryachev
On Mon, 13 May 2024 09:36:39 GMT, Ambarish Rapte wrote: > The backport is almost clean. > While cherry picking the mainline commit, a minor merge conflict was shown in > a the file `tests/system/src/test/.classpath` : The mainline file has a few > additional exports compared to 22u. > > Test p

Re: [jfx22u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-13 Thread Kevin Rushforth
On Mon, 13 May 2024 15:13:20 GMT, Andy Goryachev wrote: >> The backport is almost clean. >> While cherry picking the mainline commit, a minor merge conflict was shown >> in a the file `tests/system/src/test/.classpath` : The mainline file has a >> few additional exports compared to 22u. >> >>

Re: [jfx22u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-13 Thread Kevin Rushforth
On Mon, 13 May 2024 09:36:39 GMT, Ambarish Rapte wrote: > The backport is almost clean. > While cherry picking the mainline commit, a minor merge conflict was shown in > a the file `tests/system/src/test/.classpath` : The mainline file has a few > additional exports compared to 22u. > > Test p

Re: [jfx22u] RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField

2024-05-13 Thread Andy Goryachev
On Mon, 13 May 2024 09:36:39 GMT, Ambarish Rapte wrote: > The backport is almost clean. > While cherry picking the mainline commit, a minor merge conflict was shown in > a the file `tests/system/src/test/.classpath` : The mainline file has a few > additional exports compared to 22u. > > Test p

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

2024-05-13 Thread Ambarish Rapte
The backport is almost clean. While cherry picking the mainline commit, a minor merge conflict was shown in a the file `tests/system/src/test/.classpath` : The mainline file has a few additional exports compared to 22u. Test passes on windows. - Commit messages: - 8330462: StringI

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-08 Thread Kevin Rushforth
On Wed, 8 May 2024 13:56:43 GMT, Oliver Kopp wrote: > Looking forward to the next JavaFX release where this fix is included! It should be available in the next EA build of JavaFX 23. @arapte will backport it to jfx22u for JavaFX 22.0.2. - PR Comment: https://git.openjdk.org/jfx/pu

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-08 Thread Andy Goryachev
On Wed, 8 May 2024 13:56:43 GMT, Oliver Kopp wrote: >>>Thank you. I committed at >>>https://github.com/openjdk/jfx/commit/d03bdd40a3340bd85397fe2ceaa7f053a58da6c5 >>> (with you as author, hope this is in line with the policies?!). >> >> Thanks @koppor, the fix looks good. >> That's a great gest

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-08 Thread Oliver Kopp
On Tue, 7 May 2024 06:32:58 GMT, Ambarish Rapte wrote: >> Oliver Kopp has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Streamline WinTextRangeProviderTest >> >> Source: >> https://github.com/openjdk/jfx/pull/1442#pullrequestreview-2

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v25]

2024-05-08 Thread Kevin Rushforth
On Thu, 2 May 2024 23:32:19 GMT, Oliver Kopp wrote: >> The fix looks good, I have few comments about the test. >> 1. The test does not compile without fix, hence it won't fail without fix as >> we are only testing the newly added helper method. >> 2. It is not required to change the error stream

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v28]

2024-05-07 Thread Ambarish Rapte
On Tue, 7 May 2024 20:39:13 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v28]

2024-05-07 Thread Andy Goryachev
On Tue, 7 May 2024 20:39:13 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v28]

2024-05-07 Thread Kevin Rushforth
On Tue, 7 May 2024 20:39:13 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v28]

2024-05-07 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v27]

2024-05-07 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Kevin Rushforth
On Tue, 7 May 2024 19:25:53 GMT, Andy Goryachev wrote: >> They just read the `os.name` with `System.getProperty("os.name") but that >> only includes the Standard values. >> https://github.com/junit-team/junit5/blob/db47616ab4ccf38ff63e8bff41050d5102c9ff15/junit-jupiter-api/src/main/java/org/juni

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Andy Goryachev
On Tue, 7 May 2024 19:13:02 GMT, Christoph wrote: >>> EnabledOnOs >> >> thank you @Siedlerchr for this info. >> I wonder what criteria are set for determining the OS value, and do they >> match jfx ones? > > They just read the `os.name` with `System.getProperty("os.name") but that > only inclu

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Christoph
On Tue, 7 May 2024 18:53:17 GMT, Andy Goryachev wrote: >> Junit 5 has an EnabledOnOs annotation >> https://junit.org/junit5/docs/5.2.0/api/org/junit/jupiter/api/condition/EnabledOnOs.html > >> EnabledOnOs > > thank you @Siedlerchr for this info. > I wonder what criteria are set for determining

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Andy Goryachev
On Tue, 7 May 2024 18:47:04 GMT, Christoph wrote: > EnabledOnOs thank you @Siedlerchr for this info. I wonder what criteria are set for determining the OS value, and do they match jfx ones? - PR Review Comment: https://git.openjdk.org/jfx/pull/1442#discussion_r1592928523

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Andy Goryachev
On Thu, 2 May 2024 23:35:12 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Christoph
On Tue, 7 May 2024 18:46:26 GMT, Oliver Kopp wrote: >> We still want to use `assumeTrue` as the pattern (for flexibility), so the >> question is whether there is a better place besides a method annotated with >> `@BeforeAll` to put it (which also means duplicating the assumption in the >> `@Af

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Oliver Kopp
On Tue, 7 May 2024 18:30:25 GMT, Kevin Rushforth wrote: >> maybe >> https://stackoverflow.com/questions/26115139/junit-ignore-or-skip-entire-test-class >> ? > > We still want to use `assumeTrue` as the pattern (for flexibility), so the > question is whether there is a better place besides a meth

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Andy Goryachev
On Thu, 2 May 2024 23:35:12 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Kevin Rushforth
On Tue, 7 May 2024 16:39:47 GMT, Andy Goryachev wrote: >> is there a good way to skip the whole file entirely, e.g. via junit >> annotation? > > maybe > https://stackoverflow.com/questions/26115139/junit-ignore-or-skip-entire-test-class > ? We still want to use `assumeTrue` as the pattern (for

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Andy Goryachev
On Tue, 7 May 2024 16:37:06 GMT, Andy Goryachev wrote: >> tests/system/src/test/java/test/com/sun/glass/ui/win/WinTextRangeProviderTest.java >> line 56: >> >>> 54: @AfterAll >>> 55: static void shutdown() { >>> 56: Util.shutdown(); >> >> This fails on Mac and Linux because the

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Andy Goryachev
On Tue, 7 May 2024 16:29:33 GMT, Kevin Rushforth wrote: >> Oliver Kopp has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Streamline WinTextRangeProviderTest >> >> Source: >> https://github.com/openjdk/jfx/pull/1442#pullrequestreview-

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-07 Thread Kevin Rushforth
On Thu, 2 May 2024 23:35:12 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-06 Thread Ambarish Rapte
On Thu, 2 May 2024 23:35:12 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v25]

2024-05-02 Thread Oliver Kopp
On Thu, 2 May 2024 10:03:46 GMT, Ambarish Rapte wrote: > 1. The test does not compile without fix, hence it won't fail without fix > as we are only testing the newly added helper method. Yes, we could not build on existing a11y test. > 2. It is not required to change the error stream,

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v26]

2024-05-02 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v25]

2024-05-02 Thread Ambarish Rapte
On Wed, 1 May 2024 04:46:29 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-05-01 Thread Kevin Rushforth
On Mon, 29 Apr 2024 17:53:50 GMT, Ambarish Rapte wrote: >> I applied the software engineering principle to leave the code cleaner than >> seen. (Martin Fowler et all) >> >> Should I revert this? > > Sorry for not being clear. I just wanted to point out that it is not required > for the issue

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v25]

2024-05-01 Thread Kevin Rushforth
On Wed, 1 May 2024 04:46:29 GMT, Oliver Kopp 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` compar

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-04-30 Thread Oliver Kopp
On Mon, 29 Apr 2024 14:10:42 GMT, Ambarish Rapte wrote: > In addition to the > [evaluation](https://bugs.openjdk.org/browse/JDK-8330462?focusedId=14666181&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14666181) > added by `@jperedadnr` to > [JDK-8330462](https:/

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v25]

2024-04-30 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-04-29 Thread Ambarish Rapte
On Mon, 29 Apr 2024 15:47:54 GMT, Oliver Kopp wrote: >> modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java >> line 104: >> >>> 102: int length = text.length(); >>> 103: start = Utils.clamp(0, start, length); >>> 104: end = Utils.clamp(st

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-04-29 Thread Oliver Kopp
On Mon, 29 Apr 2024 12:35:19 GMT, Ambarish Rapte wrote: >> Oliver Kopp has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert using utility method > > modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java >

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-04-29 Thread Oliver Kopp
On Mon, 29 Apr 2024 14:09:52 GMT, Ambarish Rapte wrote: >> Oliver Kopp has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert using utility method > > modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java >

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-04-29 Thread Ambarish Rapte
On Fri, 26 Apr 2024 22:58:37 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-04-29 Thread Ambarish Rapte
On Fri, 26 Apr 2024 22:58:37 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-04-26 Thread Andy Goryachev
On Fri, 26 Apr 2024 22:58:37 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-26 Thread Oliver Kopp
On Fri, 26 Apr 2024 09:57:34 GMT, Ambarish Rapte wrote: >> Oliver Kopp has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Make use of Utils.clamp function > > Here is a capture from my machine. > I have two copies of source code: One with f

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v24]

2024-04-26 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-26 Thread Oliver Kopp
On Fri, 26 Apr 2024 09:57:34 GMT, Ambarish Rapte wrote: >> Oliver Kopp has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Make use of Utils.clamp function > > Here is a capture from my machine. > I have two copies of source code: One with f

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-26 Thread Oliver Kopp
On Thu, 25 Apr 2024 21:41:14 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-26 Thread Kevin Rushforth
On Fri, 26 Apr 2024 09:57:34 GMT, Ambarish Rapte wrote: > Here is a capture from my machine. > I have two copies of source code: One with fix and other without fix. > Please do unmute the video playback, you can listen to Narrator voice output. @arapte Thank you for doing this and attaching it.

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-26 Thread Ambarish Rapte
On Thu, 25 Apr 2024 21:41:14 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-26 Thread Oliver Kopp
On Thu, 25 Apr 2024 21:41:14 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-25 Thread Oliver Kopp
On Thu, 25 Apr 2024 21:41:14 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-25 Thread Carl Christian Snethlage
On Thu, 25 Apr 2024 21:41:14 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v23]

2024-04-25 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v22]

2024-04-25 Thread Andy Goryachev
On Thu, 25 Apr 2024 20:09:53 GMT, Carl Christian Snethlage wrote: > Tried on my local machine (win10) w/o patch with narrator: Thank you for checking this out! so you see the windows cursor decouple from the narrator focus rectangle? And when you press left/right, the narrator focus does not

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v22]

2024-04-25 Thread Andy Goryachev
On Thu, 25 Apr 2024 19:54:37 GMT, Oliver Kopp wrote: > ... and no luck with Eclipse ... I assume you imported the whole jfx repository into Eclipse as a gradle build as described here https://wiki.openjdk.org/display/OpenJFX/Using+an+IDE#UsinganIDE-UsingEclipse If not, you could still use comm

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v22]

2024-04-25 Thread Carl Christian Snethlage
On Thu, 25 Apr 2024 19:39:02 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v22]

2024-04-25 Thread Oliver Kopp
On Thu, 25 Apr 2024 19:39:02 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v22]

2024-04-25 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v21]

2024-04-25 Thread Oliver Kopp
On Thu, 25 Apr 2024 18:03:17 GMT, Andy Goryachev wrote: > focus rectangle follows the windows cursor and announces the letter at the > cursor. I did not change branches, but downloaded a binary from the net. I type "abcdef" in the text field and then press cursor left - no change of the lette

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v21]

2024-04-25 Thread Andy Goryachev
On Thu, 25 Apr 2024 06:37:00 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v20]

2024-04-25 Thread Oliver Kopp
On Thu, 25 Apr 2024 15:37:09 GMT, Andy Goryachev wrote: > Nope, this fix breaks Narrator. I think, I do not get what Narrator is doing. If I type "Testx" into a Text field, what should be highlighted? ![image](https://github.com/openjdk/jfx/assets/1366654/690e9331-3a92-4e4f-b6fd-a312f29cc592)

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v7]

2024-04-25 Thread Andy Goryachev
On Thu, 25 Apr 2024 12:55:48 GMT, Oliver Kopp wrote: > Can you help me Sure! So I copied the test class (renamed, since we have another one with the name of TextAreaTest to `tests\system\src\test\java\test\com\sun\glass\ui\win`, same dir where WinTextRangeProviderTest.java resides. Here is t

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v20]

2024-04-25 Thread Andy Goryachev
On Thu, 25 Apr 2024 06:49:24 GMT, Oliver Kopp wrote: > I tested it with a JFX distribution without the fix. Also happens there. Nope, this fix breaks Narrator. The window cursor is moving but the narrator outlines the trailing 't' as Ambarish described. (every time I change branches for the p

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v7]

2024-04-25 Thread Oliver Kopp
On Fri, 19 Apr 2024 17:33:39 GMT, Andy Goryachev wrote: >> I am new to testing in the JFX project. It seems that `test.` is required as >> package prefix. Thus, I did not use the approach of package-private methods >> and classes, but needed to make the class and the tested method public. >> >

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v20]

2024-04-24 Thread Oliver Kopp
On Wed, 24 Apr 2024 15:28:30 GMT, Ambarish Rapte wrote: > 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. I tested it with a JFX distribution without the fix. Also happens there. Can you check, to

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

2024-04-24 Thread Oliver Kopp
On Wed, 24 Apr 2024 15:26:27 GMT, Kevin Rushforth wrote: >> Interesting = @kevinrushforth what do you think? > > An excellent question. If it is robust, then it seems OK. Using Junit5 > Assumptions is more flexible, though, so might lean toward wanting to use > that. Either way, test this on th

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v21]

2024-04-24 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v16]

2024-04-24 Thread Andy Goryachev
On Wed, 24 Apr 2024 20:05:34 GMT, Kevin Rushforth wrote: >> Done. >> >> I opened the project in Eclipse (instead of IntelliJ). How can I run the >> test in Eclipse? >> >> A simple "run" does not work, because the output is then: >> >> >> WARNING: Unknown module: javafx.base specified to --pa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v16]

2024-04-24 Thread Kevin Rushforth
On Wed, 24 Apr 2024 07:45:40 GMT, Oliver Kopp wrote: >> Please replace tests/system/src/test/.classpath with this: >> >> >> >> >> >> >> >> >> >> >> >> >> > value="javaf

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v20]

2024-04-24 Thread Ambarish Rapte
On Wed, 24 Apr 2024 12:54:01 GMT, Oliver Kopp 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` compa

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

2024-04-24 Thread Kevin Rushforth
On Tue, 23 Apr 2024 19:00:49 GMT, Andy Goryachev wrote: >> 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 `Pla

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v20]

2024-04-24 Thread Oliver Kopp
On Wed, 24 Apr 2024 14:35:07 GMT, Ambarish Rapte wrote: > Sorry for jumping in little late. You are jumping in at the perfect time IMHO 🎉. (We refined the fix, added working tests meanwhile). - PR Comment: https://git.openjdk.org/jfx/pull/1442#issuecomment-2075129419

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v20]

2024-04-24 Thread Ambarish Rapte
On Wed, 24 Apr 2024 12:54:01 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v16]

2024-04-24 Thread Andy Goryachev
On Wed, 24 Apr 2024 07:45:40 GMT, Oliver Kopp wrote: >> Please replace tests/system/src/test/.classpath with this: >> >> >> >> >> >> >> >> >> >> >> >> >> > value="javaf

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v20]

2024-04-24 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v18]

2024-04-24 Thread Oliver Kopp
On Wed, 24 Apr 2024 07:45:50 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v19]

2024-04-24 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v16]

2024-04-24 Thread Oliver Kopp
On Tue, 23 Apr 2024 20:23:40 GMT, Andy Goryachev wrote: >> tests/system/src/test/java/test/com/sun/glass/ui/win/WinTextRangeProviderTest.java >> line 28: >> >>> 26: >>> 27: import com.sun.javafx.PlatformUtil; >>> 28: import com.sun.glass.ui.win.WinTextRangeProviderShim; >> >> this generates a

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v18]

2024-04-24 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v17]

2024-04-24 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v16]

2024-04-23 Thread Andy Goryachev
On Tue, 23 Apr 2024 17:47:03 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v16]

2024-04-23 Thread Andy Goryachev
On Tue, 23 Apr 2024 20:09:50 GMT, Andy Goryachev wrote: >> Oliver Kopp has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Fix JavaDoc formatting >> - Discard changes to modules/javafx.graphics/src/test/addExports > > tests/system/src/tes

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v16]

2024-04-23 Thread Andy Goryachev
On Tue, 23 Apr 2024 17:47:03 GMT, Oliver Kopp 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` compa

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

2024-04-23 Thread Andy Goryachev
On Tue, 23 Apr 2024 17:42:03 GMT, Oliver Kopp wrote: >> 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: >

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v7]

2024-04-23 Thread Oliver Kopp
On Fri, 19 Apr 2024 17:33:39 GMT, Andy Goryachev wrote: >> I am new to testing in the JFX project. It seems that `test.` is required as >> package prefix. Thus, I did not use the approach of package-private methods >> and classes, but needed to make the class and the tested method public. >> >

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

2024-04-23 Thread Oliver Kopp
On Tue, 23 Apr 2024 12:17:55 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v16]

2024-04-23 Thread Oliver Kopp
> 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 h

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

2024-04-23 Thread Oliver Kopp
On Tue, 23 Apr 2024 12:17:55 GMT, Oliver Kopp 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` compa

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

2024-04-23 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v14]

2024-04-23 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v7]

2024-04-22 Thread Kevin Rushforth
On Fri, 19 Apr 2024 18:27:12 GMT, Oliver Kopp wrote: > > I think you need to add > > The mentioned issue is fixed. Now, I get > > ``` > java.lang.UnsatisfiedLinkError: 'void > com.sun.glass.ui.win.WinTextRangeProvider._initIDs()' > at > javafx.graphics@23-internal/com.sun.glass.ui.win.W

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v9]

2024-04-22 Thread Andy Goryachev
On Sat, 20 Apr 2024 14:50:15 GMT, Oliver Kopp wrote: >> modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java >> line 116: >> >>> 114: return fixedMaxEnd; >>> 115: } >>> 116: } >> >> Frankly, I have hard time understanding this code (maybe

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v13]

2024-04-20 Thread Oliver Kopp
On Sat, 20 Apr 2024 15:36:44 GMT, Oliver Kopp 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` compa

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v13]

2024-04-20 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v9]

2024-04-20 Thread Oliver Kopp
On Fri, 19 Apr 2024 18:41:14 GMT, Andy Goryachev wrote: > So I really have two comments: a) the code looks way too complex and b) if an > average developer (like me) cannot figure out what it does within 10 seconds, > a good comment would help. Sure thing. I applied the one "usual pattern" of

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v12]

2024-04-20 Thread Oliver Kopp
> 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 h

Re: RFR: 8330462: StringIndexOutOfBoundException when typing anything into TextField [v9]

2024-04-20 Thread Oliver Kopp
On Fri, 19 Apr 2024 17:55:12 GMT, Andy Goryachev wrote: >> Oliver Kopp has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix test > > modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java > line 116: > >> 1

  1   2   >