Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thomann2009-07-23 14:59:55 +0000
committerOlivier Thomann2009-07-23 14:59:55 +0000
commit4bcb18adef599eed2469d0c3af57b805220a0f02 (patch)
tree6a661b2ed0a10db0b28b3e34c476b890204cb39b /org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java
parentaa8f6fbf0e343000a37ce36c64e696c5aab0f7ab (diff)
downloadeclipse.jdt.core-4bcb18adef599eed2469d0c3af57b805220a0f02.tar.gz
eclipse.jdt.core-4bcb18adef599eed2469d0c3af57b805220a0f02.tar.xz
eclipse.jdt.core-4bcb18adef599eed2469d0c3af57b805220a0f02.zip
HEAD - Regression test for 284431
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.java78
1 files changed, 42 insertions, 36 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 6ec679e296..7937e6a662 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
@@ -9642,50 +9642,56 @@ public void test189() {
this.runNegativeTest(
new String[] {
"X.java",
- "interface I {\n" +
- " void m() throws CloneNotSupportedException, InterruptedException;\n" +
- "}\n" +
- "abstract class A {\n" +
- " public abstract void m() throws ClassNotFoundException, CloneNotSupportedException;\n" +
- "}\n" +
- "abstract class B extends A implements I {\n" +
- " void test() {\n" +
- " try { m(); } catch (CloneNotSupportedException e) { }\n" +
- " }\n" +
- "}\n" +
- "class X extends A implements I {\n" +
- " @Override public void m() throws CloneNotSupportedException {}\n" +
- "}\n" +
- "class Y extends A implements I {\n" +
- " @Override public void m() throws ClassNotFoundException, CloneNotSupportedException {}\n" +
+ "interface Interface {\n" +
+ " void foo() throws CloneNotSupportedException, InterruptedException;\n" +
+ "}\n" +
+ "abstract class AbstractClass1 {\n" +
+ " public abstract void foo() throws ClassNotFoundException, CloneNotSupportedException;\n" +
+ "}\n" +
+ "abstract class AbstractClass2 extends AbstractClass1 implements Interface {\n" +
+ " void bar() {\n" +
+ " try {\n" +
+ " foo();\n" +
+ " } catch (CloneNotSupportedException e) {\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "class X extends AbstractClass2 {\n" +
+ " @Override\n" +
+ " public void foo() throws CloneNotSupportedException {\n" +
+ " }\n" +
+ "}\n" +
+ "class Y extends AbstractClass2 {\n" +
+ " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException {}\n" +
"}\n" +
- "class Z extends A implements I {\n" +
- " @Override public void m() throws CloneNotSupportedException, InterruptedException {}\n" +
+ "class Z extends AbstractClass2 {\n" +
+ " @Override public void foo() throws CloneNotSupportedException, InterruptedException {}\n" +
"}\n" +
- "class All extends A implements I {\n" +
- " @Override public void m() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
+ "class All extends AbstractClass2 {\n" +
+ " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
"}"
},
"----------\n" +
- "1. ERROR in X.java (at line 16)\n" +
- " @Override public void m() throws ClassNotFoundException, CloneNotSupportedException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception ClassNotFoundException is not compatible with throws clause in I.m()\n" +
+ "1. ERROR in X.java (at line 22)\n" +
+ " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception ClassNotFoundException is not compatible with throws clause in Interface.foo()\n" +
"----------\n" +
- "2. ERROR in X.java (at line 19)\n" +
- " @Override public void m() throws CloneNotSupportedException, InterruptedException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception InterruptedException is not compatible with throws clause in A.m()\n" +
+ "2. ERROR in X.java (at line 25)\n" +
+ " @Override public void foo() throws CloneNotSupportedException, InterruptedException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception InterruptedException is not compatible with throws clause in AbstractClass1.foo()\n" +
"----------\n" +
- "3. ERROR in X.java (at line 22)\n" +
- " @Override public void m() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception ClassNotFoundException is not compatible with throws clause in I.m()\n" +
+ "3. ERROR in X.java (at line 28)\n" +
+ " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception ClassNotFoundException is not compatible with throws clause in Interface.foo()\n" +
"----------\n" +
- "4. ERROR in X.java (at line 22)\n" +
- " @Override public void m() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Exception InterruptedException is not compatible with throws clause in A.m()\n" +
+ "4. ERROR in X.java (at line 28)\n" +
+ " @Override public void foo() throws ClassNotFoundException, CloneNotSupportedException, InterruptedException {}\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Exception InterruptedException is not compatible with throws clause in AbstractClass1.foo()\n" +
"----------\n"
);
}

Back to the top