On Tue, 8 Oct 2024 14:44:37 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

> FocusTraversal accepts null nodes, making the code more resilient

In what way is it more resilient? `traverse` does nothing if the node is 
`null`, which means that passing `null` is a bug more often than not. `null` 
nodes can't be displayed in the scenegraph anyway, so what is the use case of 
passing in `null`? Resilient code is usually more restrictive, guiding the user 
away from misuse, not one that accepts everything.

> the static nature of FocusTraversal indicates that it is not something 
> related to particular node, but happens in the context of the scene graph

But methods like `next` of `left` *are* related to a particular node - the one 
that indicates to which node focus will be moved. `Node::requestFocus` means 
"give focus to me", `Node::focuseNext` means "give focus to the next node from 
me".

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

PR Comment: https://git.openjdk.org/jfx/pull/1555#issuecomment-2402911154

Reply via email to