Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 311-315
Link Here
|
311 |
"Problem : Unhandled exception type Exception [ resource : </Project/p/Use.java> range : <92,132> category : <40> severity : <2>]" |
311 |
"Problem : Unhandled exception type Exception [ resource : </Project/p/Use.java> range : <92,132> category : <40> severity : <2>]" |
312 |
); |
312 |
); |
313 |
} |
313 |
} |
|
|
314 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=294057 |
315 |
public void testHierarchyNonCycle() throws JavaModelException { |
316 |
IPath projectPath = env.addProject("Project", "1.5"); |
317 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
318 |
env.setOutputFolder(projectPath, ""); |
319 |
|
320 |
env.addClass(projectPath, "superint", "SuperInterface", |
321 |
"package superint;\n" + |
322 |
"public interface SuperInterface<G extends SuperInterface.SuperInterfaceGetter,\n" + |
323 |
" S extends SuperInterface.SuperInterfaceSetter> {\n" + |
324 |
" public interface SuperInterfaceGetter {}\n" + |
325 |
" public interface SuperInterfaceSetter {}\n" + |
326 |
"}\n" |
327 |
); |
328 |
env.addClass(projectPath, "subint", "SubInterface", |
329 |
"package subint;\n" + |
330 |
"import superint.SuperInterface;\n" + |
331 |
"public interface SubInterface extends\n" + |
332 |
" SuperInterface<SubInterface.SubInterfaceGetter,\n" + |
333 |
" SubInterface.SubInterfaceSetter> {\n" + |
334 |
" public interface SubInterfaceGetter extends SuperInterfaceGetter {}\n" + |
335 |
" public interface SubInterfaceSetter extends SuperInterfaceSetter {}\n" + |
336 |
"}\n" |
337 |
); |
338 |
|
339 |
fullBuild(projectPath); |
340 |
expectingProblemsFor( |
341 |
projectPath, |
342 |
"Problem : Bound mismatch: The type SubInterface.SubInterfaceGetter is not a valid substitute for the bounded parameter <G extends SuperInterface.SuperInterfaceGetter> of the type SuperInterface<G,S> [ resource : </Project/subint/SubInterface.java> range : <105,136> category : <40> severity : <2>]\n" + |
343 |
"Problem : Bound mismatch: The type SubInterface.SubInterfaceSetter is not a valid substitute for the bounded parameter <S extends SuperInterface.SuperInterfaceSetter> of the type SuperInterface<G,S> [ resource : </Project/subint/SubInterface.java> range : <157,188> category : <40> severity : <2>]\n" + |
344 |
"Problem : SuperInterfaceGetter cannot be resolved to a type [ resource : </Project/subint/SubInterface.java> range : <244,264> category : <40> severity : <2>]\n" + |
345 |
"Problem : SuperInterfaceSetter cannot be resolved to a type [ resource : </Project/subint/SubInterface.java> range : <320,340> category : <40> severity : <2>]" |
346 |
); |
347 |
} |
348 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=294057 (variation) |
349 |
public void testHierarchyNonCycle2() throws JavaModelException { |
350 |
IPath projectPath = env.addProject("Project", "1.5"); |
351 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
352 |
env.setOutputFolder(projectPath, ""); |
353 |
|
354 |
env.addClass(projectPath, "superint", "SuperInterface", |
355 |
"package superint;\n" + |
356 |
"public interface SuperInterface<G extends SuperInterface.SuperInterfaceGetter,\n" + |
357 |
" S extends SuperInterface.SuperInterfaceSetter> {\n" + |
358 |
" public interface SuperInterfaceGetter {}\n" + |
359 |
" public interface SuperInterfaceSetter {}\n" + |
360 |
"}\n" |
361 |
); |
362 |
env.addClass(projectPath, "subint", "SubInterface", |
363 |
"package subint;\n" + |
364 |
"import superint.SuperInterface;\n" + |
365 |
"import superint.SuperInterface.SuperInterfaceGetter;\n" + |
366 |
"import superint.SuperInterface.SuperInterfaceSetter;\n" + |
367 |
"public interface SubInterface extends\n" + |
368 |
" SuperInterface<SubInterface.SubInterfaceGetter,\n" + |
369 |
" SubInterface.SubInterfaceSetter> {\n" + |
370 |
" public interface SubInterfaceGetter extends SuperInterfaceGetter {}\n" + |
371 |
" public interface SubInterfaceSetter extends SuperInterfaceSetter {}\n" + |
372 |
"}\n" |
373 |
); |
374 |
|
375 |
fullBuild(projectPath); |
376 |
expectingNoProblems(); |
377 |
} |
314 |
|
378 |
|
315 |
} |
379 |
} |