test/tools/javac/warnings/6747671/T6747671.java

Wed, 08 Oct 2014 14:16:40 -0700

author
asaha
date
Wed, 08 Oct 2014 14:16:40 -0700
changeset 2586
f5e5ca7505e2
parent 2038
8d1c48de706d
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Merge

mcimadamore@122 1 /**
jjg@384 2 * @test /nodynamiccopyright/
jlahoda@2038 3 * @bug 6747671 8022567
mcimadamore@122 4 * @summary -Xlint:rawtypes
mcimadamore@122 5 * @compile/ref=T6747671.out -XDrawDiagnostics -Xlint:rawtypes T6747671.java
mcimadamore@122 6 */
mcimadamore@122 7
mcimadamore@122 8
mcimadamore@122 9 class T6747671<E> {
mcimadamore@122 10
mcimadamore@122 11 static class B<X> {}
mcimadamore@122 12
mcimadamore@122 13 class A<X> {
mcimadamore@122 14 class X {}
mcimadamore@122 15 class Z<Y> {}
mcimadamore@122 16 }
mcimadamore@122 17
mcimadamore@122 18
mcimadamore@122 19 A.X x1;//raw warning
mcimadamore@122 20 A.Z z1;//raw warning
mcimadamore@122 21
mcimadamore@122 22 T6747671.B<Integer> b1;//ok
mcimadamore@122 23 T6747671.B b2;//raw warning
mcimadamore@122 24
mcimadamore@122 25 A<String>.X x2;//ok
mcimadamore@122 26 A<String>.Z<Integer> z2;//ok
mcimadamore@122 27 A<B>.Z<A<B>> z3;//raw warning (2)
mcimadamore@122 28
mcimadamore@122 29 void test(Object arg1, B arg2) {//raw warning
mcimadamore@638 30 boolean b = arg1 instanceof A;//ok
mcimadamore@638 31 Object a = (A)arg1;//ok
mcimadamore@122 32 A a2 = new A() {};//raw warning (2)
mcimadamore@122 33 a2.new Z() {};//raw warning
mcimadamore@122 34 }
jlahoda@2038 35
jlahoda@2038 36 @TA B @TA[] arr = new @TA B @TA [0];//JDK-8022567: raw warning (2)
jlahoda@2038 37 Class<B[]> classes1;//no warning
jlahoda@2038 38 Class<B>[] classes2;//no warning
jlahoda@2038 39
jlahoda@2038 40 @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE)
jlahoda@2038 41 @interface TA { }
jjg@384 42 }

mercurial