Make public classes not intended for extension final

Author: mpkorstanjeCreated Jul 2, 2026Updated Aug 18, 2026
Labelstype: task

As seen in https://github.com/junit-team/junit-framework/issues/938, https://github.com/junit-team/junit-framework/pull/5708, https://github.com/junit-team/junit-framework/pull/5765, ect we have some classes that are not intended for extension. Effective Java 2nd edition recommends making theses class final (or replacing all public constructors).

While not technically a breaking change - the class wasn't design for extension and shouldn't be extended - we can defer this until the next major version.

Deliverables

  • Enable the DesignForExtension rule in check-style.
  • Make every class not intended for extension final.
  • Update/remove the extension is strongly discouraged wording from the documentation.

Source: junit-team/junit-framework