Lines 31228-31231
Link Here
|
31228 |
"The return type is incompatible with AbstractEditPart.getViewer()\n" + |
31228 |
"The return type is incompatible with AbstractEditPart.getViewer()\n" + |
31229 |
"----------\n"); |
31229 |
"----------\n"); |
31230 |
} |
31230 |
} |
|
|
31231 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 |
31232 |
public void test0989() { |
31233 |
this.runNegativeTest( |
31234 |
new String[] { |
31235 |
"Child.java",//=================== |
31236 |
"public class Child extends Parent<Object> {}\n" + |
31237 |
"abstract class Parent<T> extends Grandparent<T> implements IParent {}\n" + |
31238 |
"interface IParent<T> extends IGrandparent<T> {}\n" + |
31239 |
"abstract class Grandparent<T> implements IGrandparent<T> {}\n" + |
31240 |
"interface IGrandparent<T> {}", // =================, // ================= |
31241 |
}, |
31242 |
"----------\n" + |
31243 |
"1. ERROR in Child.java (at line 2)\n" + |
31244 |
" abstract class Parent<T> extends Grandparent<T> implements IParent {}\n" + |
31245 |
" ^^^^^^\n" + |
31246 |
"The interface IGrandparent cannot be implemented more than once with different arguments: IGrandparent<T> and IGrandparent\n" + |
31247 |
"----------\n" + |
31248 |
"2. WARNING in Child.java (at line 2)\n" + |
31249 |
" abstract class Parent<T> extends Grandparent<T> implements IParent {}\n" + |
31250 |
" ^^^^^^^\n" + |
31251 |
"IParent is a raw type. References to generic type IParent<T> should be parameterized\n" + |
31252 |
"----------\n"); |
31253 |
} |
31254 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 - variation |
31255 |
public void test0990() { |
31256 |
this.runNegativeTest( |
31257 |
new String[] { |
31258 |
"Child.java",//=================== |
31259 |
"public class Child extends Parent<Object> {}\n" + |
31260 |
"abstract class Parent<T> extends Grandparent<T> implements IParent<?> {}\n" + |
31261 |
"interface IParent<T> extends IGrandparent<T> {}\n" + |
31262 |
"abstract class Grandparent<T> implements IGrandparent<T> {}\n" + |
31263 |
"interface IGrandparent<T> {}", // =================, // ================= |
31264 |
}, |
31265 |
"----------\n" + |
31266 |
"1. ERROR in Child.java (at line 1)\n" + |
31267 |
" public class Child extends Parent<Object> {}\n" + |
31268 |
" ^^^^^\n" + |
31269 |
"The hierarchy of the type Child is inconsistent\n" + |
31270 |
"----------\n" + |
31271 |
"2. ERROR in Child.java (at line 2)\n" + |
31272 |
" abstract class Parent<T> extends Grandparent<T> implements IParent<?> {}\n" + |
31273 |
" ^^^^^^^\n" + |
31274 |
"The type Parent cannot extend or implement IParent<?>. A supertype may not specify any wildcard\n" + |
31275 |
"----------\n"); |
31276 |
} |
31277 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 - variation |
31278 |
public void test0991() { |
31279 |
this.runNegativeTest( |
31280 |
new String[] { |
31281 |
"X.java",//=================== |
31282 |
"public class X extends SX<String> implements IX<Object> {}\n" + |
31283 |
"class SX<T> extends TX<Thread> implements IX<T> {}\n" + |
31284 |
"class TX<U> implements IX<U> {}\n" + |
31285 |
"interface IX<V> {}\n", // =================, // ================= |
31286 |
}, |
31287 |
"----------\n" + |
31288 |
"1. ERROR in X.java (at line 1)\n" + |
31289 |
" public class X extends SX<String> implements IX<Object> {}\n" + |
31290 |
" ^\n" + |
31291 |
"The interface IX cannot be implemented more than once with different arguments: IX<Thread> and IX<Object>\n" + |
31292 |
"----------\n" + |
31293 |
"2. ERROR in X.java (at line 2)\n" + |
31294 |
" class SX<T> extends TX<Thread> implements IX<T> {}\n" + |
31295 |
" ^^\n" + |
31296 |
"The interface IX cannot be implemented more than once with different arguments: IX<Thread> and IX<T>\n" + |
31297 |
"----------\n"); |
31298 |
} |
31299 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 - variation |
31300 |
public void test0992() { |
31301 |
this.runNegativeTest( |
31302 |
new String[] { |
31303 |
"X.java",//=================== |
31304 |
"import java.util.*;\n" + |
31305 |
"public abstract class X<T0> implements Collection, I<T0> {\n" + |
31306 |
" \n" + |
31307 |
" void foo() {\n" + |
31308 |
" this.add(new Object());\n" + |
31309 |
" this.add(null);\n" + |
31310 |
" }\n" + |
31311 |
"}\n" + |
31312 |
"interface I<T1> extends Collection<String> {\n" + |
31313 |
"}\n", // =================, // ================= |
31314 |
}, |
31315 |
"----------\n" + |
31316 |
"1. ERROR in X.java (at line 2)\n" + |
31317 |
" public abstract class X<T0> implements Collection, I<T0> {\n" + |
31318 |
" ^\n" + |
31319 |
"The interface Collection cannot be implemented more than once with different arguments: Collection<String> and Collection\n" + |
31320 |
"----------\n" + |
31321 |
"2. WARNING in X.java (at line 2)\n" + |
31322 |
" public abstract class X<T0> implements Collection, I<T0> {\n" + |
31323 |
" ^^^^^^^^^^\n" + |
31324 |
"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" + |
31325 |
"----------\n" + |
31326 |
"3. WARNING in X.java (at line 5)\n" + |
31327 |
" this.add(new Object());\n" + |
31328 |
" ^^^^^^^^^^^^^^^^^^^^^^\n" + |
31329 |
"Type safety: The method add(Object) belongs to the raw type Collection. References to generic type Collection<E> should be parameterized\n" + |
31330 |
"----------\n" + |
31331 |
"4. WARNING in X.java (at line 6)\n" + |
31332 |
" this.add(null);\n" + |
31333 |
" ^^^^^^^^^^^^^^\n" + |
31334 |
"Type safety: The method add(Object) belongs to the raw type Collection. References to generic type Collection<E> should be parameterized\n" + |
31335 |
"----------\n"); |
31336 |
} |
31231 |
} |
31337 |
} |