import java.util.*; abstract class C { abstract T f(int t); void ff(T t) {} C covariant1() { return null; } C covariant2() { return null; } A get() { return null; } } abstract class D extends C> { abstract U f(int t); // overloaded, not overrridden int ff(int u) { return 0; } int ff(C u) { return 0; } Object covariant1() { return null; } D covariant2() { return null; } A get() { return null; } } abstract class C1 { abstract T f(int t); } abstract class D1 extends C1> { abstract C1 f(int i); } class CC { CC f() { return null; } CC f2() { return null; } CC f3() { return null; } K f(V v) { return null; } int fPrimitive() { return 0; } } class DD extends CC { DD f() { return null; } DD f2() { return null; } CC f3() { return null; } O f(O o) { return null; } // incompatible although assignable double fPrimitive() { return 0; } } interface Gen { void f(Gen cc); } class Raw implements Gen { public void f(Gen o) { abstract class MyComparator { abstract int compare(T t, T t1); } // raw type implemetation new MyComparator() { public int compare(Object t, Object t1) { return 0; } }; } } class Gen2 implements Gen { public void f(Gen o) {} } ////////////// ERASURE CONFLICT class A1 { T id(T t) { return t; } } interface I1 { T id(T t); } class A2 extends A1 { T id(T t) { return t; } } class A3 extends A1 { Object id(Object o) { return o; } } class A4 extends A1 implements I1 { String id(String t) { return null;} public Integer id(Integer i) { return null; } } interface II1 { T id(int t); } interface II2 { T id(int t); } abstract class A5 implements II1, II2 {} abstract class A6 implements II1, II2 {} abstract class A7 implements II1, II2{} abstract class A8 implements II1, II2{} abstract class HasGenericMethods { abstract

void toArray(P[] p); } public class RawOverridesGenericMethods extends HasGenericMethods{ public void toArray(Object[] ps) { } } class CloneTest { interface A { A dup(); } interface B extends A { B dup(); } interface C extends A { C dup(); } interface D extends B, C { D dup(); } interface X extends C, B { X dup(); } interface E extends C,A { E dup(); } } /////////////// class ArrBase { C getC() { return null; } Object[] getO() { return null; } } class ArrTest extends ArrBase { C getC() { return null; } String[] getO() { return null; } } /////////// class BarIU { public B[] toArray(B[] ts) { return null; } } interface IU { public I[] toArray(I[] ts); } public class BarIUBarIU extends BarIU implements IU{ public T[] toArray(T[] ts) { return null; } } ////////////////////// class MyIterator { } class AAA { public MyIterator iterator() { return null; } } interface III { MyIterator iterator(); } class CCC extends AAA implements III { public MyIterator iterator() { return null; } } ////////////////////////////////// interface CloneCovariant { CloneCovariant clone(); } interface ICloneCovariant extends CloneCovariant { } interface Cmp { int compareTo (T t); } class Singleton implements Cmp> { public int compareTo(Singleton t1) { return 0; } } class e { void u (T t) {} } class f extends e { //If we inherit by erasure, then no type parameters must be present void u (Object o) {} } //SCR 41593, the following overriding is valid interface q { q foo(); } interface p { p foo(); } class r implements q, p { public r foo() { return null; } } //IDEADEV-2255: this overriding is OK class Example { interface Property { T t(); } public static void main(String[] args) { new ValueChangeListener() { public void valueChanged(Property parent, E oldValue, E newValue) { } }; } interface ValueChangeListener { void valueChanged(Property property, E oldValue, E newValue); } } //IDEADEV-3310: there is no hiding("static overriding") in this code thus no return-type-substitutability should be checked class BaseClass {} class SubClass extends BaseClass {} class BaseBugReport { public static java.util.Set doSomething() { return null; } } class SubBugReport extends BaseBugReport { public static java.util.Set doSomething() { return null; } } class First { void m(T t) { System.out.println("A: " + t); } } class Second extends First { //@Override void m(S t) { System.out.println("B: " + t); } } class Third extends Second { void m(Number t) { System.out.println("D#m(Number): " + t); } //@Override void m(Integer t) { System.out.println("D#m(Integer): " + t); } } //IDEADEV-4587: this code is OK interface SuperA { T method() throws E; } interface SuperB { T method() throws E; } interface MyInterface extends SuperA, SuperB { } //IDEADEV-2832 class IDEADEV2832Test { public static void main(String[] args) { Listener dl = new Listener() { public void listen(String obj) { } public void listen(Object obj) { } }; } } interface Listener { void listen(T obj); } //end of IDEADEV-2832 //IDEADEV-8393 class Super { public String sameErasure(final List arg) { System.out.println("Int list"); return null; } } final class Manista extends Super { public Collection sameErasure(final List arg) { System.out.println("String list"); return null; } } //end of IDEADEV-8393 /////////////////// public class Prim { Object g() { return null; } } class SPrim extends Prim { byte[] g() { return null; } } //IDEADEV-21921 interface TypeDispatcher { public void dispatch(Class clazz, S obj); } class DefaultDispatcher implements TypeDispatcher { public void dispatch(Class clazz, S obj) { } } interface Node { } class BubbleTypeDispatcher extends DefaultDispatcher { } //end of IDEADEV-21921 //////////////////////////////////////// public class Bug2 extends SmartList implements Places { } interface Places extends java.util.List {} class SmartList extends java.util.AbstractList{ public E get(int index) { return null; } public int size() { return 0; } } ////////////////IDEADEV-23176 class ActionImplementation extends MyAbstractAction { public void actionPerformed() { throw new RuntimeException(); } } abstract class MyAbstractAction extends AbstractAction implements MyAction { } interface MyAction extends Action, BoundBean { } interface BoundBean { void addPropertyChangeListener(); void removePropertyChangeListener(); } interface Action extends ActionListener { public void addPropertyChangeListener(); public void removePropertyChangeListener(); } interface ActionListener { public void actionPerformed(); } abstract class AbstractAction implements Action{ public synchronized void addPropertyChangeListener() { } public synchronized void removePropertyChangeListener() { } } ////////////////////////////// class A extends BaseBuild implements SRunningBuild{ } interface Build { boolean isPersonal(); } class BaseBuild implements Build { public boolean isPersonal() { return false; } } interface HistoryBuild { boolean isPersonal(); } interface SRunningBuild extends Build,HistoryBuild{ } //////////////////////////////////// interface PsiReferenceExpression extends PsiElement, PsiJavaCodeReferenceElement{} interface PsiJavaCodeReferenceElement extends Cloneable, PsiQualifiedReference{} interface PsiQualifiedReference extends PsiElement {} interface PsiElement { String toString(); } ///////////////////////IDEADEV-24300 //////////////////////// public class ActionContext { } public abstract class ContextAction { protected abstract void performAction(AC context); } public class OurAction extends TableContextAction { protected void performAction(TableContext context) { } } public class TableContext extends ActionContext> { } public abstract class TableContextAction extends ContextAction> { } ///////////////////////////////IDEADEV-23176 ///////////////////// public interface MyListModel { } public interface MyList { Object get(int i); int hashCode(); } public interface MutableListModel extends MyListModel, MyList { } public class ListModelImpl { public Object get(int i) { return null; } } public class MutableListModelImpl extends ListModelImpl implements MutableListModel { } /////////////////////////////////////////////////////////////// public class InheritanceBug { interface A { Object clone(); } interface B { } interface C extends A, B { } class X implements C { public Object clone() { return null; } } class Y extends X { } } /////////////////////////////////////// class ideadev { interface A { A f(); } interface B extends A { B f(); } interface C extends A,B { } class s implements C { public A f() { return null; } } class sOk implements C { public B f() { return null; } } } interface OverrideObject { void notify(); }