View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule4853methodsandconstructorsannotations;
2   
3   /** Some javadoc. */
4   public class InputMethodsAndConstructorsAnnotations {
5     /** Some javadoc. */
6     public @interface SomeAnnotation1 {}
7   
8     /** Some javadoc. */
9     public @interface SomeAnnotation2 {}
10  
11    // ********testing methods.***********
12  
13    /** testing. */
14    @SomeAnnotation1
15    @SomeAnnotation2
16    void test1() {}
17  
18    /** testing. */
19    @SomeAnnotation1 void test2() {}
20  
21    /** testing. */
22    @SomeAnnotation1 @SomeAnnotation2
23    // violation above 'Annotation 'SomeAnnotation2' should be alone on line.'
24    void test3() {}
25  
26    @SomeAnnotation1
27    @SomeAnnotation2
28    /** testing. */ // violation 'Javadoc comment is placed in the wrong location.'
29    void test4() {}
30  
31    @SomeAnnotation1 @SomeAnnotation2
32    // violation above 'Annotation 'SomeAnnotation2' should be alone on line.'
33    /** testing. */ // violation 'Javadoc comment is placed in the wrong location.'
34    void test5() {}
35  
36    @SomeAnnotation1 @SomeAnnotation2 void test6() {}
37    // violation above 'Annotation 'SomeAnnotation2' should be alone on line.'
38  
39    @SuppressWarnings("blah") void test7() {}
40    // violation above 'Annotation 'SuppressWarnings' should be alone on line.'
41  
42    // ********testing constructors.*********
43  
44    /** testing. */
45    @SomeAnnotation1
46    @SomeAnnotation2
47    InputMethodsAndConstructorsAnnotations() {}
48  
49    /** testing. */
50    @SomeAnnotation1 InputMethodsAndConstructorsAnnotations(float f) {}
51  
52    /** testing. */
53    @SomeAnnotation1 @SomeAnnotation2
54    // violation above 'Annotation 'SomeAnnotation2' should be alone on line.'
55    InputMethodsAndConstructorsAnnotations(int x) {}
56  
57    @SomeAnnotation1
58    @SomeAnnotation2
59    /** testing. */ // violation 'Javadoc comment is placed in the wrong location.'
60    InputMethodsAndConstructorsAnnotations(String str) {}
61  
62    @SomeAnnotation1 @SomeAnnotation2
63    // violation above 'Annotation 'SomeAnnotation2' should be alone on line.'
64    /** testing. */ // violation 'Javadoc comment is placed in the wrong location.'
65    InputMethodsAndConstructorsAnnotations(double d) {}
66  
67    // violation below 'Annotation 'SomeAnnotation2' should be alone on line.'
68    @SomeAnnotation1 @SomeAnnotation2  InputMethodsAndConstructorsAnnotations(String a,
69                                                                              String b) {}
70  
71    // violation below 'Annotation 'SuppressWarnings' should be alone on line.'
72    @SuppressWarnings("blah") InputMethodsAndConstructorsAnnotations(int x, int y) {}
73  }