Did I dream it? I could have sworn I read something about java 7, providing annotations that you could put on a method so that all subclasses call super. Was it renamed or dropped, or was it never considered?
It was part of JSR 305: Annotations for detecting software defects and was called @OverridingMethodsMustInvokeSuper .
@OverridingMethodsMustInvokeSuper
JSR is inactive, but the reference implementation is bundled with FindBugs
Perhaps this was suggested for the Coin project, which accepted many proposals, but chose the best / easiest from the list.
You can do it instead.
public final void method() { // super code subClassMethod(); } protected void subClassMethod() { // can be overridden. }
Source: https://habr.com/ru/post/1385555/More articles:ZeroClipboard / zClip - how to get attached to live events? - javascriptTwitter-like UITableView design - iosHow can I get which radio is selected through jQuery in IE7 and IE8? - jqueryHow to unlock a form when an application has a lot of data sets - delphiFacebook Insights Object The object does not return time period data - c #How to remove border of column headings in JTable? - javaWhy is this freezing code javaHow does memoize interact with binding in Clojure? - performanceDjango template - stop processing template - pythonASP.NET MVC 3 and quiet routing - jqueryAll Articles