Some classes could be sealed
John Hendrikx
john.hendrikx at gmail.com
Wed Feb 1 16:39:40 UTC 2023
I think this may be a bit unclear from this post, but you're proposing I
think to make `Node`, `Shape` and `Shape3D` sealed. For those unaware,
you're not allowed to extend these classes (despite being public). For
example Node says in its documentation:
* An application should not extend the Node class directly. Doing so
may lead to
* an UnsupportedOperationException being thrown.
Currently this is enforced at runtime in NodeHelper.
--John
On 01/02/2023 15:47, Thiago Milczarek Sayão wrote:
> Hi,
>
> NodeHelper.java has this:
> throw new UnsupportedOperationException(
> "Applications should not extend the " + nodeType +" class directly.");
>
> I think it's replaceable with selead classes. Am I right?
>
> The benefit will be compile time error instead of runtime.
>
>
> -- Thiago.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20230201/e5600652/attachment.htm>
More information about the openjfx-dev
mailing list