RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]

Phil Race prr at openjdk.org
Thu Jun 1 20:59:17 UTC 2023


On Tue, 16 May 2023 17:53:00 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Initializing the insertion index directly with character index looks better. In this way we can avoid additional conditional logic as well. Changed code to do so.
>> Added additional test case. This tests the condition present in line 430.
>> I couldn't create the scenario to hit line 473. If you have any suggestions please let me know.
>> 
>> While testing I found that `testTextFlowInsertionIndexUsingMultipleEmojis()` was failing intermittently when all the tests are run. Hence added small delay.
>
>> I couldn't create the scenario to hit line 473. If you have any suggestions please let me know.
> 
> I can't seem to trigger this code path (I wonder if it's possible to hit it at all).  Anyway, the code there looks correct to me, even if this condition would never happen.

Assuming line 473 is the one still there today, it looks to me as if that would be reached if you had the caret on an empty line that isn't the last line.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1091#discussion_r1213669254


More information about the openjfx-dev mailing list