Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipe Mulet2006-06-28 11:31:31 +0000
committerPhilipe Mulet2006-06-28 11:31:31 +0000
commit1abf092cc9941b45ed5546b2ed9c2cc6c3730fab (patch)
treeee2f58a797eaa1926f54c851c54eb66587d07468 /org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
parent5e316e04fef5f8e4af836b577d556cc9e63234fc (diff)
downloadeclipse.jdt.core-1abf092cc9941b45ed5546b2ed9c2cc6c3730fab.tar.gz
eclipse.jdt.core-1abf092cc9941b45ed5546b2ed9c2cc6c3730fab.tar.xz
eclipse.jdt.core-1abf092cc9941b45ed5546b2ed9c2cc6c3730fab.zip
148957
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
index a4e50d97a0..54812b488e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
@@ -5572,4 +5572,53 @@ public void _test095() {
"}\n"},
"");
}
+
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148957
+public void test096() {
+ this.runNegativeTest(
+ new String[] {
+ "ProblemClass.java",//===================
+ "import java.util.Collection;\n" +
+ "import javax.swing.JLabel;\n" +
+ "interface SuperInterface {\n" +
+ " public <A extends JLabel> void doIt(Collection<A> as);\n" +
+ "}\n" +
+ "\n" +
+ "public class ProblemClass implements SuperInterface {\n" +
+ " public void doIt(Collection<? extends JLabel> as) {\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in ProblemClass.java (at line 7)\n" +
+ " public class ProblemClass implements SuperInterface {\n" +
+ " ^^^^^^^^^^^^\n" +
+ "The type ProblemClass must implement the inherited abstract method SuperInterface.doIt(Collection<A>)\n" +
+ "----------\n" +
+ "2. ERROR in ProblemClass.java (at line 8)\n" +
+ " public void doIt(Collection<? extends JLabel> as) {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Name clash: The method doIt(Collection<? extends JLabel>) of type ProblemClass has the same erasure as doIt(Collection<A>) of type SuperInterface but does not override it\n" +
+ "----------\n");
+}
+
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148957 - variation
+public void test097() {
+ this.runConformTest(
+ new String[] {
+ "ProblemClass.java",//===================
+ "import java.util.Collection;\n" +
+ "import javax.swing.JLabel;\n" +
+ "interface SuperInterface {\n" +
+ " public <A extends JLabel> void doIt(Collection<A> as);\n" +
+ "}\n" +
+ "\n" +
+ "public class ProblemClass implements SuperInterface {\n" +
+ " public <B extends JLabel> void doIt(Collection<B> as) {\n" +
+ " }\n" +
+ "}\n"
+ },
+ ""
+ );
+}
}

Back to the top