View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="AnnotationOnSameLine"/>
5     </module>
6   </module>
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.annotation.annotationonsameline;
10  
11  import org.junit.Before;
12  
13  // xdoc section -- start
14  class Example1 {
15  
16    // violation below, "should be on the same line with its target."
17    @SuppressWarnings("deprecation")
18    public Example1() {
19    }
20  
21    @SuppressWarnings("unchecked") public void fun2() {  // OK
22    }
23  
24    public void fun1() {
25    }
26  
27  }
28  
29  @SuppressWarnings("unchecked") class Test1 extends Example1 {  // OK
30  
31    @Deprecated public Test1() {  // OK
32    }
33  
34    @Override // violation, "should be on the same line with its target."
35    public void fun1() {
36    }
37  
38    @Before // violation, "should be on the same line with its target."
39    @Override public void fun2() {  // OK
40    }
41  
42    // violation below, "should be on the same line with its target."
43    @SuppressWarnings("deprecation")
44    @Before public void fun3() {
45    }
46  
47  }
48  // xdoc section -- end