-DesignForExtension.desc = Checks that classes are designed for extension. More specifically, it enforces a programming style where superclasses provide empty "hooks" that can be implemented by subclasses.<br/>\r\nThe exact rule is that nonprivate, nonstatic methods of classes that can be subclassed must either be\r\n<ul>\r\n<li>abstract or</li>\r\n<li>final or</li>\r\n<li>have an empty implementation</li>\r\n</ul>\r\nRationale: This API design style protects superclasses against beeing broken by subclasses. The downside is that subclasses are limited in their flexibility, in particular they cannot prevent execution of code in the superclass, but that also means that subclasses cannot corrupt the state of the superclass by forgetting to call the super method.
0 commit comments