forked from sevntu-checkstyle/sevntu.checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputCustomDeclarationOrder.java
174 lines (134 loc) · 3.36 KB
/
InputCustomDeclarationOrder.java
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
167
168
169
170
171
172
173
174
package com.github.sevntu.checkstyle.checks.coding;
import java.util.ArrayList;
public class InputCustomDeclarationOrder {
public static final int TEST = 0;
public final int test = 1;
private static final long serialVersionUID = 1L;
int test1 = 1;
private static final String[] TEST_NAMES = new String[] { "Task 1",
"Task 2", "Task N" };
@SuppressWarnings("test")
private AbstractTest test2;
protected double test3;
@SuppressWarnings("serial")
private final ArrayList<String[]> test4 = new ArrayList<String[]>()
{
private int innerTest1;
public int innerTest2;
public String test() {
return null;
}
};
private InputCustomDeclarationOrder() {
//constructor
}
public static String newTest(String aTest) {
return null;
}
protected String test() {
return "test";
}
InputCustomDeclarationOrder(int aTest) {
//constructor
}
public void createTest() {
};
public static void editTest() {
}
public abstract class AbstractTest extends
InputCustomDeclarationOrder
{
private static final long INNER_T1 = 1L;
public final int innerT2 = 0;
String innerT3;
@Override
protected String test() {
return "test";
}
private String innerTest() {
return null;
}
private void innerTest1() {
}
}
private static class Test {
private abstract static class AbstractTest1 {
}
public abstract class AbstractrTest2 {
}
}
@Deprecated
public boolean test1() {
return true;
}
public boolean test2() {
return true;
}
public static int test5;
protected void test3() {
}
}
class Test {
Test() {
}
private String someTest;
void test() {
}
}
// Check must ignore these cases:
class ClassForIssue58 {
public Object createB() {
class B {
}
return new B();
}
void otherMethod() {
}
}
class ClassForIssue58 {
private void simplePrivate() {
class Inner {
int number;
public void get(){}
private void set(){}
}
}
protected void simpleProtected() {
class Inner {
private int a;
protected int b;
int c;
public int d;
private void a(){}
void c(){}
public void d(){}
class AnotherClass{
public void t(){}
private void y(){}
}
}
}
public void simplePublic() {
class Inner {
private int a;
protected int b;
int c;
public int d;
private void a(){}
void c(){}
public void d(){}
class AnotherClass{
public boolean right;
private boolean left;
}
}
}
public void abc() {
class A {
public boolean is;
}
class B {
private boolean is;
}
}
}