View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="DesignForExtension">
5         <property name="requiredJavadocPhrase" value="This implementation"/>
6       </module>
7     </module>
8   </module>
9   */
10  package com.puppycrawl.tools.checkstyle.checks.design.designforextension;
11  
12  // xdoc section -- start
13  public abstract class Example3 {
14    private int bar;
15  
16    public int m1() {return 2;}  // violation
17  
18    public int m2() {return 8;}  // violation
19  
20    private void m3() {m4();}  // OK. Private method.
21  
22    protected void m4() { }  // OK. No implementation.
23  
24    public abstract void m5();  // OK. Abstract method.
25  
26    /**
27     * This implementation ...
28     @return some int value.
29     */
30    public int m6() {return 1;}  // OK. Have required javadoc.
31  
32    /**
33     * Some comments ...
34     */
35    public int m7() {return 1;}  // violation
36  
37    /**
38     * This
39     * implementation ...
40     */
41    public int m8() {return 2;}  // violation
42  
43    @Override                    // violation
44    public String toString() {
45      return "";
46    }
47  }
48  // xdoc section -- end