1 /*xml
2 <module name="Checker">
3 <module name="TreeWalker">
4 <module name="AnnotationOnSameLine">
5 <property name="tokens"
6 value="INTERFACE_DEF, VARIABLE_DEF, CTOR_DEF"/>
7 </module>
8 </module>
9 </module>
10 */
11
12 package com.puppycrawl.tools.checkstyle.checks.annotation.annotationonsameline;
13
14 import javax.annotation.Nullable;
15
16 // xdoc section -- start
17 @Deprecated interface Foo { // OK
18
19 void doSomething();
20
21 }
22
23 class Example2 implements Foo {
24
25 // violation below, "should be on the same line with its target."
26 @SuppressWarnings("deprecation")
27 public Example2() {
28 }
29
30 @Override // OK
31 public void doSomething() {
32 }
33
34 // violation below, "should be on the same line with its target."
35 @Nullable
36 String s;
37
38 }
39 // xdoc section -- end