On Fri, 25 Sep 2026 17:49:04 GMT, Phil Race <[email protected]> wrote:
> > the method returns -1 (since -1 is already established as “not
> > computable/no visual position” as per the Utilities.getPositionAbove/Below
> > spec)
>
> However, for EAST/WEST, it never needs to use target and might currently
> return something more useful than -1. Should the return -1 only be in the
> NORTH/SOUTH code path ?
I am returning -1 in NORTH/SOUTH codepath only, no?
switch (direction) {
case NORTH:
case SOUTH:
{
if (pos == -1) {
pos = (direction == NORTH) ? Math.max(0, getEndOffset() - 1) :
getStartOffset();
break;
}
Container container = getContainer();
if (!(container instanceof JTextComponent target)) {
return -1;
}
or am I misinterpreting your suggestion?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/33049#issuecomment-5865315706