View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="AvoidNoArgumentSuperConstructorCall"/>
5     </module>
6   </module>
7   */
8   package com.puppycrawl.tools.checkstyle.checks.coding.avoidnoargumentsuperconstructorcall;
9   
10  // xdoc section -- start
11  class SuperClass {
12    public SuperClass() {}
13    public SuperClass(int arg) {}
14  }
15  class Example1 extends SuperClass {
16    Example1() {
17      //violation below,'Unnecessary call to superclass constructor with no arguments.'
18      super();
19    }
20  
21    Example1(int arg) {
22      super(arg); // ok, explicit constructor invocation with argument
23    }
24  
25    Example1(long arg) {
26      // ok, no explicit constructor invocation
27    }
28  }
29  // xdoc section -- end