@OverrideShouldInvoke

Robbe Pincket robbepincket at live.be
Thu Feb 9 18:09:20 UTC 2023


On 2023-02-09 16:07 UTC, Archie Cobbs wrote:

> The rough proposal is:
>   - Add a new annotation @OverrideShouldInvoke. If a method Sub.foo()
>   overrides a superclass method Sup.foo() that has an @OverrideShouldInvoke
>   annotation, and nowhere in Sub.foo() does it invoke Sup.foo() (via a
>   super.foo() expression), then an error occurs.
>   - Add a new property boolean withoutInvokingSuper default false to the
>   @Overrides annotation that allows Sub.foo() to suppress this error if it
>   "really knows what it's doing".

Having 'Should' in the annotation name, and then making it produce
an error instead of a warning annoys greatly. It doesn't feel like
that agrees with RFC 2119.

If it's a warning it could also be suppressed by a simple
`@SuppressWarnings` instead of a new argument on `@Override`

Regards
Robbe Pincket
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230209/21af277b/attachment-0001.htm>


More information about the amber-dev mailing list