@@ -21,7 +21,6 @@ void identification() {
21
21
"Members, constructors and methods should follow standard ordering." )))
22
22
.addSourceLines (
23
23
"A.java" ,
24
- "" ,
25
24
"// BUG: Diagnostic matches: MemberOrdering" ,
26
25
"class A {" ,
27
26
" char a = 'a';" ,
@@ -30,22 +29,23 @@ void identification() {
30
29
"" ,
31
30
" void m2() {}" ,
32
31
"" ,
33
- " public A () {}" ,
32
+ " public A() {}" ,
34
33
"" ,
35
34
" private static String BAR = \" bar\" ;" ,
36
35
" char b = 'b';" ,
37
36
"" ,
38
37
" void m1() {" ,
39
38
" System.out.println(\" foo\" );" ,
40
39
" }" ,
40
+ "" ,
41
41
" static int TWO = 2;" ,
42
42
"" ,
43
43
" class Inner {}" ,
44
+ "" ,
44
45
" static class StaticInner {}" ,
45
46
"}" )
46
47
.addSourceLines (
47
48
"B.java" ,
48
- "" ,
49
49
"class B {" ,
50
50
" private static String FOO = \" foo\" ;" ,
51
51
" static int ONE = 1;" ,
@@ -56,14 +56,17 @@ void identification() {
56
56
" char a = 'a';" ,
57
57
"" ,
58
58
" char b = 'b';" ,
59
- " public B () {}" ,
59
+ "" ,
60
+ " public B() {}" ,
60
61
"" ,
61
62
" void m1() {" ,
62
63
" System.out.println(\" foo\" );" ,
63
64
" }" ,
65
+ "" ,
64
66
" void m2() {}" ,
65
67
"" ,
66
68
" class Inner {}" ,
69
+ "" ,
67
70
" static class StaticInner {}" ,
68
71
"}" )
69
72
.doTest ();
@@ -74,7 +77,6 @@ void replacementFirstSuggestedFix() {
74
77
BugCheckerRefactoringTestHelper .newInstance (MemberOrdering .class , getClass ())
75
78
.addInputLines (
76
79
"A.java" ,
77
- "" ,
78
80
"class A {" ,
79
81
" private static final int X = 1;" ,
80
82
" char a = 'a';" ,
@@ -83,14 +85,15 @@ void replacementFirstSuggestedFix() {
83
85
"" ,
84
86
" void m2() {}" ,
85
87
"" ,
86
- " public A () {}" ,
88
+ " public A() {}" ,
87
89
"" ,
88
90
" private static String BAR = \" bar\" ;" ,
89
91
" char b = 'b';" ,
90
92
"" ,
91
93
" void m1() {" ,
92
94
" System.out.println(\" foo\" );" ,
93
95
" }" ,
96
+ "" ,
94
97
" static int TWO = 2;" ,
95
98
"" ,
96
99
" class Inner {}" ,
@@ -99,7 +102,6 @@ void replacementFirstSuggestedFix() {
99
102
"}" )
100
103
.addOutputLines (
101
104
"A.java" ,
102
- "" ,
103
105
"@SuppressWarnings(\" MemberOrdering\" )" ,
104
106
"class A {" ,
105
107
" private static final int X = 1;" ,
@@ -109,14 +111,15 @@ void replacementFirstSuggestedFix() {
109
111
"" ,
110
112
" void m2() {}" ,
111
113
"" ,
112
- " public A () {}" ,
114
+ " public A() {}" ,
113
115
"" ,
114
116
" private static String BAR = \" bar\" ;" ,
115
117
" char b = 'b';" ,
116
118
"" ,
117
119
" void m1() {" ,
118
120
" System.out.println(\" foo\" );" ,
119
121
" }" ,
122
+ "" ,
120
123
" static int TWO = 2;" ,
121
124
"" ,
122
125
" class Inner {}" ,
@@ -126,6 +129,7 @@ void replacementFirstSuggestedFix() {
126
129
.doTest (TestMode .TEXT_MATCH );
127
130
}
128
131
132
+ @ SuppressWarnings ("ErrorProneTestHelperSourceFormat" )
129
133
@ Test
130
134
void replacementSecondSuggestedFix () {
131
135
BugCheckerRefactoringTestHelper .newInstance (MemberOrdering .class , getClass ())
@@ -152,12 +156,10 @@ void replacementSecondSuggestedFix() {
152
156
" static int TWO = 2;" ,
153
157
"" ,
154
158
" class Inner {}" ,
155
- "" ,
156
159
" static class StaticInner {}" ,
157
160
"}" )
158
161
.addOutputLines (
159
162
"A.java" ,
160
- "" ,
161
163
"class A {" ,
162
164
" private static final int X = 1;" ,
163
165
" private static String FOO = \" foo\" ;" ,
@@ -177,12 +179,12 @@ void replacementSecondSuggestedFix() {
177
179
" }" ,
178
180
"" ,
179
181
" class Inner {}" ,
180
- "" ,
181
182
" static class StaticInner {}" ,
182
183
"}" )
183
184
.doTest (TestMode .TEXT_MATCH );
184
185
}
185
186
187
+ @ SuppressWarnings ("ErrorProneTestHelperSourceFormat" )
186
188
@ Test
187
189
void replacementSecondSuggestedFixWithDefaultConstructor () {
188
190
BugCheckerRefactoringTestHelper .newInstance (MemberOrdering .class , getClass ())
@@ -208,32 +210,29 @@ void replacementSecondSuggestedFixWithDefaultConstructor() {
208
210
.doTest (TestMode .TEXT_MATCH );
209
211
}
210
212
213
+ @ SuppressWarnings ("ErrorProneTestHelperSourceFormat" )
211
214
@ Test
212
215
void replacementSecondSuggestedFixWithComments () {
213
216
BugCheckerRefactoringTestHelper .newInstance (MemberOrdering .class , getClass ())
214
217
.setFixChooser (SECOND )
215
218
.addInputLines (
216
219
"A.java" ,
217
- "" ,
218
220
"class A {" ,
219
221
" // `m1()` comment." ,
220
222
" void m1() {" ,
221
223
" // Print line 'foo' to stdout." ,
222
224
" System.out.println(\" foo\" );" ,
223
225
" }" ,
224
- "" ,
225
226
" // foo" ,
226
227
" /** Instantiates a new {@link A} instance. */" ,
227
228
" public A () {}" ,
228
229
"}" )
229
230
.addOutputLines (
230
231
"A.java" ,
231
- "" ,
232
232
"class A {" ,
233
233
" // foo" ,
234
234
" /** Instantiates a new {@link A} instance. */" ,
235
235
" public A () {}" ,
236
- "" ,
237
236
" // `m1()` comment." ,
238
237
" void m1() {" ,
239
238
" // Print line 'foo' to stdout." ,
0 commit comments