RFR: 8360070: AccessibleText.getBeforeIndex returns null for last character
Alexander Zuev
kizune at openjdk.org
Mon Jul 14 16:23:40 UTC 2025
On Wed, 25 Jun 2025 04:43:14 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:
> I got your point now. The spec says that `index an index within the text` and that means the value should range from 0 to length - 1. And that means, `getBeforeIndex` won't be able to fetch the last character and `getAfterIndex` won't be able to fetch the first character.
Here i disagree, the "within the text" does not imply that the position behind the last character is not within the text. Otherwise with the caret is at the end of the text it is impossible to request last word or character before the caret position which is one of the valid use cases of this accessibility method. I think the fix is valid.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25941#issuecomment-3070187941
More information about the client-libs-dev
mailing list