Class AvoidNoArgumentSuperConstructorCallCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public final class AvoidNoArgumentSuperConstructorCallCheck
    extends AbstractCheck

    Checks if call to superclass constructor without arguments is present. Such invocation is redundant because constructor body implicitly begins with a superclass constructor invocation super(); See specification for detailed information.

    To configure the check:

     <module name="AvoidNoArgumentSuperConstructorCall"/>
     

    Example of violations

     class MyClass extends SomeOtherClass {
         MyClass() {
             super(); // violation
         }
    
         MyClass(int arg) {
             super(arg); // OK, call with argument have to be explicit
         }
    
         MyClass(long arg) {
             // OK, call is implicit
         }
     }
     

    Parent is com.puppycrawl.tools.checkstyle.TreeWalker

    Violation Message Keys:

    • super.constructor.call
    Since:
    8.29