import java.util.ArrayList; class Reference<T> { } class WeakReference extends Reference { } class Item<Key, T> extends WeakReference { { Reference ref = null; Item item = (Item) ref; equals(item); } } // assign raw to generic are allowed class a { void f(a t){ t.hashCode(); } } class b { a f(a raw) { a unbound = raw; raw = unbound; a generic = raw; raw.f(raw); raw.f(generic); generic.f(raw); generic.f(generic); generic.f(new a()); generic = raw; return raw; } } class List { V[] toArray (V[] vs) { return vs; } void add(T t) { t.hashCode(); } } class c { /*String[] f () { List l = new List(); error descr="Incompatible types. Found: 'java.lang.Object[]', required: 'java.lang.String[]'">return l.toArray (new String[0]); l = new List(); return l.toArray (new String[0]); } } class d { class Y <T> { } class Z <T> extends Y { } class Pair { void foo(Y y) { y.hashCode(); } } Pair pair; void bar(Y y) { pair.foo(y); } } class e { String foo () { MyList myList = new MyList(); return myList.get(0); } static class MyList<T> extends ArrayList{ } } class ccc { static Comparable f() { return new Comparable () { public int compareTo(final Object o) { return 0; } }; } } class ddd { COMP comp; ddd foo() { return comp; //no unchecked warning is signalled here } } class G1 { T t; } class G2 { T t; static ArrayList f() { return null; } } class Inst { static void f () { G2> g2 = new G2>(); for (G1 g1 : g2.f()) { g1.toString(); } } } class A111 { T t; V f(V v) { return v; } String g(A111 a) { //noinspection unchecked return a.f(""); } } class A1 { V f(V v) { return v; } } class A11 extends A1 { T t; //this is OK, type parameters of base class are not raw String s = new A11().f(""); } //IDEADEV-26163 class Test1 { X x; java.util.ArrayList foo = new java.util.ArrayList(); public static Number foo() { return new Test1().foo.get(0); } } //end of IDEADEV-26163 /////////////// signatures in non-parameterized class are not erased public class C3 { public int get(Class c) { return 0; } } class Cp extends C3 { public T i; } class C extends Cp/**/ { @Override public int get(Class c) { return 0; } } //////////////