aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionIgnoredAnnotations.java
blob: 3a4f37b20cb58c2dac1bd3ddc05f89daaa3be504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
package com.puppycrawl.tools.checkstyle.checks.design;

public class InputDesignForExtensionIgnoredAnnotations {

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    /**
     * Javadoc.
     * @param obj object.
     * @return boolean.
     */
    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    @Deprecated
    public void testFoo() throws Exception {
        final int a = 5;
        final int b = 6;
    }

    @Deprecated
    public String toString() {
        return super.toString();
    }

    public int foo1() {return  1;} // violation

    /**
     *
     * @return
     */
    public int foo2() {return 2;}

    public void foo3() {}

    public class C extends B {
        @Deprecated
        @Override
        public void testFoo() {
            super.testFoo();
        }
    }

    public class B {
        /** Test foo*/
        public void testFoo() {
            final int a = 6;
        }
    }

    // Deprecated
    @Deprecated
    public void foo4() {return;}

    /*
     * Deprecated
     */
    @Deprecated
    public void foo5() {return;}

    @java.lang.Deprecated
    public void foo6() {return;}

    // Single line comment
    @Deprecated
    public void foo7() {
        return;
    }

    // Single line comments
    // organized in a block
    @Deprecated
    public void foo8() {
        return;
    }

    /** Javadoc comment */
    @Deprecated
    public void foo9() {
        return;
    }

    /* Block comment */
    @Deprecated
    public void foo10() {
        return;
    }

    @Deprecated
    /** */
    public int foo11() {
        return 1;
    }

    @Deprecated
    /* */
    public int foo12() {
        return 1;
    }

    @Deprecated
    /* */
    public void foo13() { }

    @Deprecated
    /** */
    public void foo14() { }

    @Deprecated
    /** */
    public void foo15() { /** */ }

    @Deprecated
    // comment
    public void foo16() { }

    @Deprecated
    @InputLocalAnnotations.ClassRule
    public void foo17() { return; }

    @Deprecated
    @InputLocalAnnotations.ClassRule
    /** */
    public void foo18() { return; }

    @Deprecated
    /** */
    @InputLocalAnnotations.ClassRule
    public void foo19() { return; }

    /** */
    @Deprecated
    @InputLocalAnnotations.ClassRule
    public void foo20() { return; }

    @InputLocalAnnotations.ClassRule // violation
    public void foo21() { return; }

    private int age;

    @Inject // violation
    public void setAge(int age) {
        this.age = age;
    }

    public @interface Inject { }

    public @MyAnnotation void foo22() {
        foo1();
    }

    @MyAnnotation public void foo23() {
        foo1();
    }

    public void foo24(@MyAnnotation int a) { // violation
        foo1();
    }

    public @interface MyAnnotation { }
}