On Thu, 5 Sep 2024 17:24:50 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

> What is the benefit of this change?

It enforces a system invariant at compile-time instead of run-time.

> Also, this change is breaking. One can currently create a Node:
> 
> ```
> public class CanCreateNode extends Application {
>     @Override
>     public void init() {
>         Node n1 = new Node() {
>         };
>         class Yo extends Node {
>         }
>         Yo n2 = new Yo();
>     }
> ```

You can't do anything meaningful with this node. As soon as you add it to a 
scene graph, you'll get a runtime exception. The fact that you can't extend 
`Node` is a system invariant, finding pathological situations in which you 
won't get an exception is just a loophole.

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

PR Comment: https://git.openjdk.org/jfx/pull/1556#issuecomment-2332310139

Reply via email to