On Mon, 18 May 2020 05:42:17 GMT, Ajit Ghaisas <aghai...@openjdk.org> wrote:
>> hmm .. yeah I'm aware of getContainer vs. getMenus - but they should be the >> same size, shouldn't they? >> >> Anyway, if focusedIndex != getMenus().indexOf all users of focusedIndex have >> to include a check for validity. That >> might be prevented by not allowing it here in the method, in setting its >> value not unconditionally to the given index >> but guard it against being valid: >> focusedMenuIndex = index >= getMenus().size() ? -1 : index >> >> Then focused is either valid or -1. > > Good suggestion on not setting the foucusedMenuIndex unconditionally. > Also, we need to check for index < -1 : just to tighten up this method. > I have added this check. glad we came to an agreement at last :) ------------- PR: https://git.openjdk.java.net/jfx/pull/216