|
Lines 83-99
Link Here
|
| 83 |
"1. ERROR in I.java (at line 5)\n" + |
83 |
"1. ERROR in I.java (at line 5)\n" + |
| 84 |
" public default synchronized void foo2() { System.exit(0); }\n" + |
84 |
" public default synchronized void foo2() { System.exit(0); }\n" + |
| 85 |
" ^^^^^^\n" + |
85 |
" ^^^^^^\n" + |
| 86 |
"Illegal modifier for the interface method foo2; only public, abstract and strictfp are permitted\n" + |
86 |
"Illegal modifier for the interface method foo2; only public, abstract, default, static and strictfp are permitted\n" + |
| 87 |
"----------\n" + |
87 |
"----------\n" + |
| 88 |
"2. ERROR in I.java (at line 7)\n" + |
88 |
"2. ERROR in I.java (at line 7)\n" + |
| 89 |
" public default strictfp synchronized void foo4() {}\n" + |
89 |
" public default strictfp synchronized void foo4() {}\n" + |
| 90 |
" ^^^^^^\n" + |
90 |
" ^^^^^^\n" + |
| 91 |
"Illegal modifier for the interface method foo4; only public, abstract and strictfp are permitted\n" + |
91 |
"Illegal modifier for the interface method foo4; only public, abstract, default, static and strictfp are permitted\n" + |
| 92 |
"----------\n" + |
92 |
"----------\n" + |
| 93 |
"3. ERROR in I.java (at line 8)\n" + |
93 |
"3. ERROR in I.java (at line 8)\n" + |
| 94 |
" public default strictfp synchronized @Annot void foo5() {}\n" + |
94 |
" public default strictfp synchronized @Annot void foo5() {}\n" + |
| 95 |
" ^^^^^^\n" + |
95 |
" ^^^^^^\n" + |
| 96 |
"Illegal modifier for the interface method foo5; only public, abstract and strictfp are permitted\n" + |
96 |
"Illegal modifier for the interface method foo5; only public, abstract, default, static and strictfp are permitted\n" + |
| 97 |
"----------\n"); |
97 |
"----------\n"); |
| 98 |
} |
98 |
} |
| 99 |
|
99 |
|
|
Lines 148-169
Link Here
|
| 148 |
"1. ERROR in I.java (at line 5)\n" + |
148 |
"1. ERROR in I.java (at line 5)\n" + |
| 149 |
" public synchronized void foo2();\n" + |
149 |
" public synchronized void foo2();\n" + |
| 150 |
" ^^^^^^\n" + |
150 |
" ^^^^^^\n" + |
| 151 |
"Illegal modifier for the interface method foo2; only public & abstract are permitted\n" + |
151 |
"Illegal modifier for the interface method foo2; only public, abstract, default, static and strictfp are permitted\n" + |
| 152 |
"----------\n" + |
152 |
"----------\n" + |
| 153 |
"2. ERROR in I.java (at line 6)\n" + |
153 |
"2. ERROR in I.java (at line 6)\n" + |
| 154 |
" strictfp void foo3();\n" + |
154 |
" strictfp void foo3();\n" + |
| 155 |
" ^^^^^^\n" + |
155 |
" ^^^^^^\n" + |
| 156 |
"Illegal modifier for the interface method foo3; only public & abstract are permitted\n" + |
156 |
"Illegal modifiers for the interface method foo3; strictfp is not permitted for abstract interface methods\n" + |
| 157 |
"----------\n" + |
157 |
"----------\n" + |
| 158 |
"3. ERROR in I.java (at line 7)\n" + |
158 |
"3. ERROR in I.java (at line 7)\n" + |
| 159 |
" public strictfp synchronized void foo4();\n" + |
159 |
" public strictfp synchronized void foo4();\n" + |
| 160 |
" ^^^^^^\n" + |
160 |
" ^^^^^^\n" + |
| 161 |
"Illegal modifier for the interface method foo4; only public & abstract are permitted\n" + |
161 |
"Illegal modifiers for the interface method foo4; strictfp is not permitted for abstract interface methods\n" + |
| 162 |
"----------\n" + |
162 |
"----------\n" + |
| 163 |
"4. ERROR in I.java (at line 8)\n" + |
163 |
"4. ERROR in I.java (at line 7)\n" + |
|
|
164 |
" public strictfp synchronized void foo4();\n" + |
| 165 |
" ^^^^^^\n" + |
| 166 |
"Illegal modifier for the interface method foo4; only public, abstract, default, static and strictfp are permitted\n" + |
| 167 |
"----------\n" + |
| 168 |
"5. ERROR in I.java (at line 8)\n" + |
| 164 |
" public strictfp synchronized @Annot void foo5();\n" + |
169 |
" public strictfp synchronized @Annot void foo5();\n" + |
| 165 |
" ^^^^^^\n" + |
170 |
" ^^^^^^\n" + |
| 166 |
"Illegal modifier for the interface method foo5; only public & abstract are permitted\n" + |
171 |
"Illegal modifiers for the interface method foo5; strictfp is not permitted for abstract interface methods\n" + |
|
|
172 |
"----------\n" + |
| 173 |
"6. ERROR in I.java (at line 8)\n" + |
| 174 |
" public strictfp synchronized @Annot void foo5();\n" + |
| 175 |
" ^^^^^^\n" + |
| 176 |
"Illegal modifier for the interface method foo5; only public, abstract, default, static and strictfp are permitted\n" + |
| 167 |
"----------\n"); |
177 |
"----------\n"); |
| 168 |
} |
178 |
} |
| 169 |
|
179 |
|
|
Lines 184-190
Link Here
|
| 184 |
"1. ERROR in I.java (at line 2)\n" + |
194 |
"1. ERROR in I.java (at line 2)\n" + |
| 185 |
" native void foo1();\n" + |
195 |
" native void foo1();\n" + |
| 186 |
" ^^^^^^\n" + |
196 |
" ^^^^^^\n" + |
| 187 |
"Illegal modifier for the interface method foo1; only public & abstract are permitted\n" + |
197 |
"Illegal modifier for the interface method foo1; only public, abstract, default, static and strictfp are permitted\n" + |
| 188 |
"----------\n" + |
198 |
"----------\n" + |
| 189 |
"2. ERROR in I.java (at line 3)\n" + |
199 |
"2. ERROR in I.java (at line 3)\n" + |
| 190 |
" static void foo2();\n" + |
200 |
" static void foo2();\n" + |
|
Lines 194-215
Link Here
|
| 194 |
"3. ERROR in I.java (at line 4)\n" + |
204 |
"3. ERROR in I.java (at line 4)\n" + |
| 195 |
" native default void foo3() {}\n" + |
205 |
" native default void foo3() {}\n" + |
| 196 |
" ^^^^^^\n" + |
206 |
" ^^^^^^\n" + |
| 197 |
"Illegal modifier for the interface method foo3; only public, abstract and strictfp are permitted\n" + |
207 |
"Illegal modifier for the interface method foo3; only public, abstract, default, static and strictfp are permitted\n" + |
| 198 |
"----------\n" + |
208 |
"----------\n" + |
| 199 |
"4. ERROR in I.java (at line 5)\n" + |
209 |
"4. ERROR in I.java (at line 5)\n" + |
| 200 |
" default native void foo4() {}\n" + |
210 |
" default native void foo4() {}\n" + |
| 201 |
" ^^^^^^\n" + |
211 |
" ^^^^^^\n" + |
| 202 |
"Illegal modifier for the interface method foo4; only public, abstract and strictfp are permitted\n" + |
212 |
"Illegal modifier for the interface method foo4; only public, abstract, default, static and strictfp are permitted\n" + |
| 203 |
"----------\n" + |
213 |
"----------\n" + |
| 204 |
"5. ERROR in I.java (at line 6)\n" + |
214 |
"5. ERROR in I.java (at line 6)\n" + |
| 205 |
" static default void foo5() {}\n" + |
215 |
" static default void foo5() {}\n" + |
| 206 |
" ^^^^^^\n" + |
216 |
" ^^^^^^\n" + |
| 207 |
"Illegal modifier for the interface method foo5; only public, abstract and strictfp are permitted\n" + |
217 |
"Illegal combination of modifiers for the interface method foo5; only one of abstract, default, or static permitted\n" + |
| 208 |
"----------\n" + |
218 |
"----------\n" + |
| 209 |
"6. ERROR in I.java (at line 7)\n" + |
219 |
"6. ERROR in I.java (at line 7)\n" + |
| 210 |
" default static void foo6() {}\n" + |
220 |
" default static void foo6() {}\n" + |
| 211 |
" ^^^^^^\n" + |
221 |
" ^^^^^^\n" + |
| 212 |
"Illegal modifier for the interface method foo6; only public, abstract and strictfp are permitted\n" + |
222 |
"Illegal combination of modifiers for the interface method foo6; only one of abstract, default, or static permitted\n" + |
| 213 |
"----------\n"); |
223 |
"----------\n"); |
| 214 |
} |
224 |
} |
| 215 |
|
225 |
|
|
Lines 230-241
Link Here
|
| 230 |
"1. ERROR in I.java (at line 4)\n" + |
240 |
"1. ERROR in I.java (at line 4)\n" + |
| 231 |
" public abstract default void foo2() {}\n" + |
241 |
" public abstract default void foo2() {}\n" + |
| 232 |
" ^^^^^^\n" + |
242 |
" ^^^^^^\n" + |
| 233 |
"Illegal modifier for the interface method foo2; only public, abstract and strictfp are permitted\n" + |
243 |
"Illegal combination of modifiers for the interface method foo2; only one of abstract, default, or static permitted\n" + |
| 234 |
"----------\n" + |
244 |
"----------\n" + |
| 235 |
"2. ERROR in I.java (at line 5)\n" + |
245 |
"2. ERROR in I.java (at line 5)\n" + |
| 236 |
" default abstract void foo3() {}\n" + |
246 |
" default abstract void foo3() {}\n" + |
| 237 |
" ^^^^^^\n" + |
247 |
" ^^^^^^\n" + |
| 238 |
"Illegal modifier for the interface method foo3; only public, abstract and strictfp are permitted\n" + |
248 |
"Illegal combination of modifiers for the interface method foo3; only one of abstract, default, or static permitted\n" + |
| 239 |
"----------\n" + |
249 |
"----------\n" + |
| 240 |
"3. ERROR in I.java (at line 6)\n" + |
250 |
"3. ERROR in I.java (at line 6)\n" + |
| 241 |
" void foo4() { }\n" + |
251 |
" void foo4() { }\n" + |
|
Lines 245-251
Link Here
|
| 245 |
"4. ERROR in I.java (at line 7)\n" + |
255 |
"4. ERROR in I.java (at line 7)\n" + |
| 246 |
" abstract static default void foo5() {}\n" + |
256 |
" abstract static default void foo5() {}\n" + |
| 247 |
" ^^^^^^\n" + |
257 |
" ^^^^^^\n" + |
| 248 |
"Illegal modifier for the interface method foo5; only public, abstract and strictfp are permitted\n" + |
258 |
"Illegal combination of modifiers for the interface method foo5; only one of abstract, default, or static permitted\n" + |
| 249 |
"----------\n"); |
259 |
"----------\n"); |
| 250 |
} |
260 |
} |
| 251 |
|
261 |
|
|
Lines 1354-1370
Link Here
|
| 1354 |
"2. ERROR in I.java (at line 4)\n" + |
1364 |
"2. ERROR in I.java (at line 4)\n" + |
| 1355 |
" public static default void foo2 () {};\n" + |
1365 |
" public static default void foo2 () {};\n" + |
| 1356 |
" ^^^^^^^\n" + |
1366 |
" ^^^^^^^\n" + |
| 1357 |
"Illegal modifier for the interface method foo2; only public, abstract and strictfp are permitted\n" + |
1367 |
"Illegal combination of modifiers for the interface method foo2; only one of abstract, default, or static permitted\n" + |
| 1358 |
"----------\n" + |
1368 |
"----------\n" + |
| 1359 |
"3. ERROR in I.java (at line 5)\n" + |
1369 |
"3. ERROR in I.java (at line 5)\n" + |
| 1360 |
" abstract static void foo3();\n" + |
1370 |
" abstract static void foo3();\n" + |
| 1361 |
" ^^^^^^\n" + |
1371 |
" ^^^^^^\n" + |
| 1362 |
"Illegal modifier for the interface method foo3; only public & abstract are permitted\n" + |
1372 |
"Illegal combination of modifiers for the interface method foo3; only one of abstract, default, or static permitted\n" + |
| 1363 |
"----------\n" + |
1373 |
"----------\n" + |
| 1364 |
"4. ERROR in I.java (at line 6)\n" + |
1374 |
"4. ERROR in I.java (at line 6)\n" + |
| 1365 |
" abstract static void foo4() {}\n" + |
1375 |
" abstract static void foo4() {}\n" + |
| 1366 |
" ^^^^^^\n" + |
1376 |
" ^^^^^^\n" + |
| 1367 |
"Illegal modifier for the interface method foo4; only public & abstract are permitted\n" + |
1377 |
"Illegal combination of modifiers for the interface method foo4; only one of abstract, default, or static permitted\n" + |
| 1368 |
"----------\n"); |
1378 |
"----------\n"); |
| 1369 |
} |
1379 |
} |
| 1370 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780 |
1380 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399780 |
|
Lines 2039-2042
Link Here
|
| 2039 |
}, |
2049 |
}, |
| 2040 |
"In B.set(CharSequence)"); |
2050 |
"In B.set(CharSequence)"); |
| 2041 |
} |
2051 |
} |
|
|
2052 |
|
| 2053 |
// test for different error messages in modifiers. |
| 2054 |
public void test400977() { |
| 2055 |
runNegativeTest( |
| 2056 |
new String[] { |
| 2057 |
"I.java", |
| 2058 |
"public interface I {\n" + |
| 2059 |
" default abstract void foo();\n" + |
| 2060 |
" public abstract default strictfp final void bar();" + |
| 2061 |
"}\n"}, |
| 2062 |
"----------\n" + |
| 2063 |
"1. ERROR in I.java (at line 2)\n" + |
| 2064 |
" default abstract void foo();\n" + |
| 2065 |
" ^^^^^\n" + |
| 2066 |
"Illegal combination of modifiers for the interface method foo; only one of abstract, default, or static permitted\n" + |
| 2067 |
"----------\n" + |
| 2068 |
"2. ERROR in I.java (at line 3)\n" + |
| 2069 |
" public abstract default strictfp final void bar();}\n" + |
| 2070 |
" ^^^^^\n" + |
| 2071 |
"Illegal modifiers for the interface method bar; strictfp is not permitted for abstract interface methods\n" + |
| 2072 |
"----------\n" + |
| 2073 |
"3. ERROR in I.java (at line 3)\n" + |
| 2074 |
" public abstract default strictfp final void bar();}\n" + |
| 2075 |
" ^^^^^\n" + |
| 2076 |
"Illegal combination of modifiers for the interface method bar; only one of abstract, default, or static permitted\n" + |
| 2077 |
"----------\n" + |
| 2078 |
"4. ERROR in I.java (at line 3)\n" + |
| 2079 |
" public abstract default strictfp final void bar();}\n" + |
| 2080 |
" ^^^^^\n" + |
| 2081 |
"Illegal modifier for the interface method bar; only public, abstract, default, static and strictfp are permitted\n" + |
| 2082 |
"----------\n"); |
| 2083 |
} |
| 2084 |
|
| 2042 |
} |
2085 |
} |