RFR: 8304831: TextFlow.hitTest.insertionIndex incorrect with surrogate pairs [v4]
Phil Race
prr at openjdk.org
Thu Jun 1 20:59:18 UTC 2023
On Thu, 1 Jun 2023 20:53:07 GMT, Phil Race <prr at openjdk.org> wrote:
>>> 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.
Regarding
"If we can initialize insertionIndex to a positive value, then the buggy code in HitInfo.getInsertionIndex()
will never get executed, and we can remove it later (in JDK-8302511)."
it seems to me that this new code has been pretty much copied from the supposedly buggy code there ..
I'm not sure that code is actually buggy (comments over in that bug), rather that the instance was constructed
with bad data.
But maybe this code here also needs to make sure it won't cause AIOB
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1091#discussion_r1213671378
More information about the openjfx-dev
mailing list