diff options
author | Stephan Herrmann | 2012-12-09 22:16:07 +0000 |
---|---|---|
committer | Stephan Herrmann | 2012-12-09 22:16:07 +0000 |
commit | 1e8305535ff304200778a08eb6eb4025791a09c1 (patch) | |
tree | 7fa0330d3e61f28e6bfe611f0ac3700fcc1100da /org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java | |
parent | 5da4268a6e911ad3865241747a8e9714544fc990 (diff) | |
download | eclipse.jdt.core-1e8305535ff304200778a08eb6eb4025791a09c1.tar.gz eclipse.jdt.core-1e8305535ff304200778a08eb6eb4025791a09c1.tar.xz eclipse.jdt.core-1e8305535ff304200778a08eb6eb4025791a09c1.zip |
Bug 388739 - [1.8][compiler] consider default methods when detecting
whether a class needs to be declared abstract
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.java | 42 |
1 files changed, 19 insertions, 23 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 51c7ea6eac..83753dc470 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 @@ -14,6 +14,7 @@ * Stephan Herrmann - Contribution for * bug 388800 - [1.8] adjust tests to 1.8 JRE * bug 388795 - [compiler] detection of name clash depends on order of super interfaces + * bug 388739 - [1.8][compiler] consider default methods when detecting whether a class needs to be declared abstract *******************************************************************************/ package org.eclipse.jdt.core.tests.compiler.regression; @@ -2041,7 +2042,7 @@ public class MethodVerifyTest extends AbstractComparableTest { "1. ERROR in X.java (at line 3)\n" + " public class X<T extends I&J> {}\n" + " ^\n" + - "The return types are incompatible for the inherited methods J.foo(), I.foo()\n" + + "The return types are incompatible for the inherited methods I.foo(), J.foo()\n" + "----------\n" // types J and I are incompatible; both define foo(), but with unrelated return types ); @@ -2367,7 +2368,7 @@ public class MethodVerifyTest extends AbstractComparableTest { "1. ERROR in Y.java (at line 1)\n" + " abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" + " ^\n" + - "Name clash: The method equalTo(T) of type Equivalent<T> has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" + + "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" + "----------\n"); } } @@ -2387,29 +2388,29 @@ public class MethodVerifyTest extends AbstractComparableTest { "1. ERROR in Y.java (at line 2)\n" + " public abstract boolean equalTo(Object other);\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + - "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" + + "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" + "----------\n" + "2. ERROR in Y.java (at line 2)\n" + " public abstract boolean equalTo(Object other);\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + - "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" + + "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" + "----------\n" : // name clash: equalTo(java.lang.Object) in Y and equalTo(T) in Equivalent<java.lang.String> have the same erasure, yet neither overrides the other "----------\n" + "1. ERROR in Y.java (at line 1)\n" + " abstract class Y implements Equivalent<String>, EqualityComparable<Integer> {\n" + " ^\n" + - "Name clash: The method equalTo(T) of type Equivalent<T> has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" + + "Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" + "----------\n" + "2. ERROR in Y.java (at line 2)\n" + " public abstract boolean equalTo(Object other);\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + - "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" + + "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" + "----------\n" + "3. ERROR in Y.java (at line 2)\n" + " public abstract boolean equalTo(Object other);\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + - "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type EqualityComparable<T> but does not override it\n" + + "Name clash: The method equalTo(Object) of type Y has the same erasure as equalTo(T) of type Equivalent<T> but does not override it\n" + "----------\n" ); } @@ -9101,7 +9102,7 @@ public void test140() { "1. ERROR in X.java (at line 1)\n" + " public abstract class X implements J, K {}\n" + " ^\n" + - "The return types are incompatible for the inherited methods K.foo(Number), J.foo(Number)\n" + + "The return types are incompatible for the inherited methods J.foo(Number), K.foo(Number)\n" + "----------\n" + "2. WARNING in X.java (at line 6)\n" + " XX foo(Number n);\n" + @@ -9715,7 +9716,7 @@ public void test155() { "1. ERROR in X.java (at line 9)\n" + " public abstract class X implements I, J {\n" + " ^\n" + - "The return types are incompatible for the inherited methods J.foo(), I.foo()\n" + + "The return types are incompatible for the inherited methods I.foo(), J.foo()\n" + "----------\n" ); } @@ -9740,7 +9741,7 @@ public void test156() { "1. ERROR in X.java (at line 10)\n" + " public abstract class X implements I, J {\n" + " ^\n" + - "The return types are incompatible for the inherited methods J.foo(), I.foo()\n" + + "The return types are incompatible for the inherited methods I.foo(), J.foo()\n" + "----------\n" ); } @@ -9767,7 +9768,7 @@ public void test157() { "1. ERROR in X.java (at line 7)\n" + " interface C extends A, B {}\n" + " ^\n" + - "The return types are incompatible for the inherited methods B.foo(), A.foo()\n" + + "The return types are incompatible for the inherited methods A.foo(), B.foo()\n" + "----------\n" ); } @@ -9799,7 +9800,7 @@ public void test158() { "1. ERROR in X.java (at line 17)\n" + " public abstract class X extends Root implements AFoo, BFoo {\n" + " ^\n" + - "The return types are incompatible for the inherited methods BFoo.bar(), AFoo.bar()\n" + + "The return types are incompatible for the inherited methods AFoo.bar(), BFoo.bar()\n" + "----------\n" ); } @@ -9830,17 +9831,17 @@ public void test159() { "1. ERROR in X.java (at line 15)\n" + " public abstract class X extends Root implements AFoo, BFoo {}\n" + " ^\n" + - "The return types are incompatible for the inherited methods BFoo.bar(), AFoo.bar()\n" + + "The return types are incompatible for the inherited methods AFoo.bar(), BFoo.bar()\n" + "----------\n" + "2. ERROR in X.java (at line 16)\n" + " abstract class Y extends X {}\n" + " ^\n" + - "The return types are incompatible for the inherited methods BFoo.bar(), AFoo.bar()\n" + + "The return types are incompatible for the inherited methods AFoo.bar(), BFoo.bar()\n" + "----------\n" + "3. ERROR in X.java (at line 17)\n" + " class Z extends X {}\n" + " ^\n" + - "The type Z must implement the inherited abstract method AFoo.bar()\n" + + "The type Z must implement the inherited abstract method BFoo.bar()\n" + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=208010 @@ -10810,7 +10811,7 @@ public void test185() { "1. ERROR in A.java (at line 3)\n" + " class A implements I, J {}\n" + " ^\n" + - "The type A must implement the inherited abstract method I.hello()\n" + + "The type A must implement the inherited abstract method J.hello()\n" + "----------\n" ); } @@ -13395,11 +13396,6 @@ public void testBug317719f() throws Exception { " Zork z;\n" + " ^^^^\n" + "Zork cannot be resolved to a type\n" + - "----------\n" + - "5. ERROR in X.java (at line 7)\n" + - " class ChildX<Z> extends X<Z>{}\n" + - " ^^^^^^\n" + - "Duplicate methods named forAccountSet with the parameters (List<R>) and (List) are defined by the type X<Z>\n" + "----------\n": "----------\n" + "1. ERROR in X.java (at line 3)\n" + @@ -13734,7 +13730,7 @@ public void test354229() { "1. ERROR in X.java (at line 8)\n" + " interface C extends A, B { \n" + " ^\n" + - "Name clash: The method get(List<String>) of type A has the same erasure as get(List<Integer>) of type B but does not override it\n" + + "Name clash: The method get(List<Integer>) of type B has the same erasure as get(List<String>) of type A but does not override it\n" + "----------\n" + "2. ERROR in X.java (at line 10)\n" + " Zork z;\n" + @@ -13800,7 +13796,7 @@ public void test354229c() { "1. ERROR in X.java (at line 7)\n" + " interface E extends X, Y {\n" + " ^\n" + - "Name clash: The method e(Action<T>) of type X has the same erasure as e(Action<S>) of type Y but does not override it\n" + + "Name clash: The method e(Action<S>) of type Y has the same erasure as e(Action<T>) of type X but does not override it\n" + "----------\n" + "2. ERROR in X.java (at line 10)\n" + " Zork z;\n" + |