On Fri, 19 Apr 2024 17:57:09 GMT, Andy Goryachev <ango...@openjdk.org> 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 378:
> 
>> 376:         if (text == null) return null;
>> 377:         validateRange(text);
>> 378:         int endOffset = getValidStringIndex(start, maxLength, end);
> 
> If I presume the arguments are (start, length, maxLength), the last two 
> arguments on this line only need to be swapped.  They seem to be correct on 
> LL 394, 498.

`maxLength` is the parameter of the `GetText` method. The caller asks for the 
text, but only with `maxLength` length. Therefore, `start + maxLength`. `end` 
is the real end of the current string. After `end` there are no characters. 
Ensured by `validateRange`.

I can add a comment. I love to add comments, but I learned at 
https://github.com/openjdk/jdk/pull/10704 that only higher-level comments are 
desired...

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

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

Reply via email to