Lines 139-144
Link Here
|
139 |
"The type X is never used locally\n" + |
139 |
"The type X is never used locally\n" + |
140 |
"----------\n"); |
140 |
"----------\n"); |
141 |
} |
141 |
} |
|
|
142 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
143 |
public void test005() { |
144 |
this.runNegativeTest(new String[] { |
145 |
"p1/GreenBox.java", |
146 |
"package p1;\n" + |
147 |
"import static p1.BrownBox.*;\n" + |
148 |
"public interface GreenBox {\n" + |
149 |
" public static class Cat extends Object {}\n" + |
150 |
"}\n", |
151 |
"p1/BrownBox.java", |
152 |
"package p1;\n" + |
153 |
"import static p1.GreenBox.*;\n" + |
154 |
"public interface BrownBox {\n" + |
155 |
" public static class BlackCat extends Cat {}\n" + |
156 |
"}\n", |
157 |
}, |
158 |
"----------\n" + |
159 |
"1. WARNING in p1\\GreenBox.java (at line 2)\n" + |
160 |
" import static p1.BrownBox.*;\n" + |
161 |
" ^^^^^^^^^^^\n" + |
162 |
"The import p1.BrownBox is never used\n" + |
163 |
"----------\n"); |
164 |
} |
165 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
166 |
public void test006() { |
167 |
this.runNegativeTest(new String[] { |
168 |
"p1/BrownBox.java", |
169 |
"package p1;\n" + |
170 |
"import static p1.GreenBox.*;\n" + |
171 |
"public interface BrownBox {\n" + |
172 |
" public static class BlackCat extends Cat {}\n" + |
173 |
"}\n", |
174 |
"p1/GreenBox.java", |
175 |
"package p1;\n" + |
176 |
"import static p1.BrownBox.*;\n" + |
177 |
"public interface GreenBox {\n" + |
178 |
" public static class Cat extends Object {}\n" + |
179 |
"}\n", |
180 |
}, |
181 |
"----------\n" + |
182 |
"1. WARNING in p1\\GreenBox.java (at line 2)\n" + |
183 |
" import static p1.BrownBox.*;\n" + |
184 |
" ^^^^^^^^^^^\n" + |
185 |
"The import p1.BrownBox is never used\n" + |
186 |
"----------\n"); |
187 |
} |
188 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
189 |
public void test007() { |
190 |
this.runNegativeTest(new String[] { |
191 |
"p1/BrownBox.java", |
192 |
"package p1;\n" + |
193 |
"import static p1.GreenBox.*;\n" + |
194 |
"public interface BrownBox {\n" + |
195 |
" public static class BlackCat extends Cat {}\n" + |
196 |
"}\n", |
197 |
"p1/GreenBox.java", |
198 |
"package p1;\n" + |
199 |
"import static p1.BrownBox.*;\n" + |
200 |
"public interface GreenBox {\n" + |
201 |
" public static class Cat extends java.lang.Object {}\n" + |
202 |
"}\n", |
203 |
}, |
204 |
"----------\n" + |
205 |
"1. WARNING in p1\\GreenBox.java (at line 2)\n" + |
206 |
" import static p1.BrownBox.*;\n" + |
207 |
" ^^^^^^^^^^^\n" + |
208 |
"The import p1.BrownBox is never used\n" + |
209 |
"----------\n"); |
210 |
} |
211 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
212 |
public void test008() { |
213 |
this.runNegativeTest(new String[] { |
214 |
"p1/BrownBox.java", |
215 |
"package p1;\n" + |
216 |
"import static p1.GreenBox.*;\n" + |
217 |
"public interface BrownBox {\n" + |
218 |
" public static class BlackCat extends Cat {}\n" + |
219 |
"}\n", |
220 |
"p1/GreenBox.java", |
221 |
"package p1;\n" + |
222 |
"import static p1.BrownBox.*;\n" + |
223 |
"public interface GreenBox {\n" + |
224 |
" public static class Cat extends BlackCat {}\n" + |
225 |
"}\n", |
226 |
}, |
227 |
"----------\n" + |
228 |
"1. ERROR in p1\\BrownBox.java (at line 4)\n" + |
229 |
" public static class BlackCat extends Cat {}\n" + |
230 |
" ^^^^^^^^\n" + |
231 |
"The hierarchy of the type BlackCat is inconsistent\n" + |
232 |
"----------\n" + |
233 |
"----------\n" + |
234 |
"1. ERROR in p1\\GreenBox.java (at line 4)\n" + |
235 |
" public static class Cat extends BlackCat {}\n" + |
236 |
" ^^^^^^^^\n" + |
237 |
"Cycle detected: a cycle exists in the type hierarchy between GreenBox.Cat and BrownBox.BlackCat\n" + |
238 |
"----------\n"); |
239 |
} |
240 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
241 |
public void test009() { |
242 |
this.runNegativeTest(new String[] { |
243 |
"p1/GreenBox.java", |
244 |
"package p1;\n" + |
245 |
"import static p1.BrownBox.*;\n" + |
246 |
"public interface GreenBox {\n" + |
247 |
" public static class Cat extends BlackCat {}\n" + |
248 |
"}\n", |
249 |
"p1/BrownBox.java", |
250 |
"package p1;\n" + |
251 |
"import static p1.GreenBox.*;\n" + |
252 |
"public interface BrownBox {\n" + |
253 |
" public static class BlackCat extends Cat {}\n" + |
254 |
"}\n", |
255 |
}, |
256 |
"----------\n" + |
257 |
"1. ERROR in p1\\GreenBox.java (at line 4)\n" + |
258 |
" public static class Cat extends BlackCat {}\n" + |
259 |
" ^^^\n" + |
260 |
"The hierarchy of the type Cat is inconsistent\n" + |
261 |
"----------\n" + |
262 |
"----------\n" + |
263 |
"1. ERROR in p1\\BrownBox.java (at line 4)\n" + |
264 |
" public static class BlackCat extends Cat {}\n" + |
265 |
" ^^^\n" + |
266 |
"Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and GreenBox.Cat\n" + |
267 |
"----------\n"); |
268 |
} |
269 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
270 |
public void test0010() { |
271 |
this.runNegativeTest(new String[] { |
272 |
"p1/GreenBox.java", |
273 |
"package p1;\n" + |
274 |
"import static p1.BrownBox.*;\n" + |
275 |
"interface SuperInterface {\n" + |
276 |
" public static class Cat extends BlackCat {}\n" + |
277 |
"}\n" + |
278 |
"public interface GreenBox {\n" + |
279 |
"}\n", |
280 |
"p1/BrownBox.java", |
281 |
"package p1;\n" + |
282 |
"import static p1.GreenBox.*;\n" + |
283 |
"public interface BrownBox {\n" + |
284 |
" public static class BlackCat extends Cat {}\n" + |
285 |
"}\n", |
286 |
}, |
287 |
"----------\n" + |
288 |
"1. ERROR in p1\\GreenBox.java (at line 4)\n" + |
289 |
" public static class Cat extends BlackCat {}\n" + |
290 |
" ^^^\n" + |
291 |
"The hierarchy of the type Cat is inconsistent\n" + |
292 |
"----------\n" + |
293 |
"----------\n" + |
294 |
"1. ERROR in p1\\BrownBox.java (at line 4)\n" + |
295 |
" public static class BlackCat extends Cat {}\n" + |
296 |
" ^^^\n" + |
297 |
"Cat cannot be resolved to a type\n" + |
298 |
"----------\n"); |
299 |
} |
300 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
301 |
public void test0011() { |
302 |
this.runNegativeTest(new String[] { |
303 |
"p1/GreenBox.java", |
304 |
"package p1;\n" + |
305 |
"import static p1.BrownBox.*;\n" + |
306 |
"interface SuperInterface {\n" + |
307 |
" public static class Cat extends BlackCat {}\n" + |
308 |
"}\n" + |
309 |
"public interface GreenBox extends SuperInterface {\n" + |
310 |
"}\n", |
311 |
"p1/BrownBox.java", |
312 |
"package p1;\n" + |
313 |
"import static p1.GreenBox.*;\n" + |
314 |
"public interface BrownBox {\n" + |
315 |
" public static class BlackCat extends Cat {}\n" + |
316 |
"}\n", |
317 |
}, |
318 |
"----------\n" + |
319 |
"1. ERROR in p1\\GreenBox.java (at line 4)\n" + |
320 |
" public static class Cat extends BlackCat {}\n" + |
321 |
" ^^^\n" + |
322 |
"The hierarchy of the type Cat is inconsistent\n" + |
323 |
"----------\n" + |
324 |
"----------\n" + |
325 |
"1. ERROR in p1\\BrownBox.java (at line 4)\n" + |
326 |
" public static class BlackCat extends Cat {}\n" + |
327 |
" ^^^\n" + |
328 |
"Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and SuperInterface.Cat\n" + |
329 |
"----------\n"); |
330 |
} |
331 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
332 |
public void test0012() { |
333 |
this.runNegativeTest(new String[] { |
334 |
"p1/GreenBox.java", |
335 |
"package p1;\n" + |
336 |
"import static p1.BrownBox.*;\n" + |
337 |
"interface SuperInterface {\n" + |
338 |
" public static class Cat extends BlackCat {}\n" + |
339 |
"}\n" + |
340 |
"public interface GreenBox extends SuperInterface {\n" + |
341 |
"}\n", |
342 |
"p1/BrownBox.java", |
343 |
"package p1;\n" + |
344 |
"import static p1.GreenBox.*;\n" + |
345 |
"public interface BrownBox {\n" + |
346 |
" public static class BlackCat extends GreenBox.Cat {}\n" + |
347 |
"}\n", |
348 |
}, |
349 |
"----------\n" + |
350 |
"1. ERROR in p1\\GreenBox.java (at line 4)\n" + |
351 |
" public static class Cat extends BlackCat {}\n" + |
352 |
" ^^^\n" + |
353 |
"The hierarchy of the type Cat is inconsistent\n" + |
354 |
"----------\n" + |
355 |
"----------\n" + |
356 |
"1. ERROR in p1\\BrownBox.java (at line 4)\n" + |
357 |
" public static class BlackCat extends GreenBox.Cat {}\n" + |
358 |
" ^^^^^^^^^^^^\n" + |
359 |
"Cycle detected: a cycle exists in the type hierarchy between BrownBox.BlackCat and SuperInterface.Cat\n" + |
360 |
"----------\n"); |
361 |
} |
362 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
363 |
public void test0013() { |
364 |
this.runNegativeTest(new String[] { |
365 |
"cycle/X.java", |
366 |
"package cycle;\n" + |
367 |
"class X extends Y {}\n" + |
368 |
"class Y extends X {}\n", |
369 |
}, |
370 |
"----------\n" + |
371 |
"1. ERROR in cycle\\X.java (at line 2)\n" + |
372 |
" class X extends Y {}\n" + |
373 |
" ^\n" + |
374 |
"The hierarchy of the type X is inconsistent\n" + |
375 |
"----------\n" + |
376 |
"2. ERROR in cycle\\X.java (at line 3)\n" + |
377 |
" class Y extends X {}\n" + |
378 |
" ^\n" + |
379 |
"Cycle detected: a cycle exists in the type hierarchy between Y and X\n" + |
380 |
"----------\n"); |
381 |
} |
382 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=319885 |
383 |
public void test0014() { |
384 |
this.runNegativeTest(new String[] { |
385 |
"cycle/X.java", |
386 |
"package cycle;\n" + |
387 |
"class X extends Y {}\n" + |
388 |
"class Y extends Z {}\n" + |
389 |
"class Z extends A {}\n" + |
390 |
"class A extends B {}\n" + |
391 |
"class B extends C {}\n" + |
392 |
"class C extends X {}\n" |
393 |
}, |
394 |
"----------\n" + |
395 |
"1. ERROR in cycle\\X.java (at line 2)\n" + |
396 |
" class X extends Y {}\n" + |
397 |
" ^\n" + |
398 |
"The hierarchy of the type X is inconsistent\n" + |
399 |
"----------\n" + |
400 |
"2. ERROR in cycle\\X.java (at line 3)\n" + |
401 |
" class Y extends Z {}\n" + |
402 |
" ^\n" + |
403 |
"The hierarchy of the type Y is inconsistent\n" + |
404 |
"----------\n" + |
405 |
"3. ERROR in cycle\\X.java (at line 4)\n" + |
406 |
" class Z extends A {}\n" + |
407 |
" ^\n" + |
408 |
"The hierarchy of the type Z is inconsistent\n" + |
409 |
"----------\n" + |
410 |
"4. ERROR in cycle\\X.java (at line 5)\n" + |
411 |
" class A extends B {}\n" + |
412 |
" ^\n" + |
413 |
"The hierarchy of the type A is inconsistent\n" + |
414 |
"----------\n" + |
415 |
"5. ERROR in cycle\\X.java (at line 6)\n" + |
416 |
" class B extends C {}\n" + |
417 |
" ^\n" + |
418 |
"The hierarchy of the type B is inconsistent\n" + |
419 |
"----------\n" + |
420 |
"6. ERROR in cycle\\X.java (at line 7)\n" + |
421 |
" class C extends X {}\n" + |
422 |
" ^\n" + |
423 |
"Cycle detected: a cycle exists in the type hierarchy between C and X\n" + |
424 |
"----------\n"); |
425 |
} |
142 |
public static Class testClass() { |
426 |
public static Class testClass() { |
143 |
return InnerClass15Test.class; |
427 |
return InnerClass15Test.class; |
144 |
} |
428 |
} |