AvoidNoArgumentSuperConstructorCall

Since Checkstyle 8.29

Description

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.

Examples

To configure the check:

<module name="Checker">
  <module name="TreeWalker">
    <module name="AvoidNoArgumentSuperConstructorCall"/>
  </module>
</module>
        

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
    }
}
        

Example of Usage

Violation Messages

All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.

Package

com.puppycrawl.tools.checkstyle.checks.coding

Parent Module

TreeWalker