langtools/test/tools/javac/generics/7034511/T7034511b.java
author mcimadamore
Mon, 02 May 2011 12:05:41 +0100
changeset 9607 94b7adcaccad
parent 9301 da48f63f0b22
child 17544 80db48a54a9f
permissions -rw-r--r--
7040883: Compilation error: "length in Array is defined in an inaccessible class or interface" Summary: Fix of 7034511 (now backed out) is causing spurious accessibility errors Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9301
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
     1
/*
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
9607
94b7adcaccad 7040883: Compilation error: "length in Array is defined in an inaccessible class or interface"
mcimadamore
parents: 9301
diff changeset
     3
 * @ignore backing out 7034511, see 7040883
94b7adcaccad 7040883: Compilation error: "length in Array is defined in an inaccessible class or interface"
mcimadamore
parents: 9301
diff changeset
     4
 * @bug     7034511 7040883
9301
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
     5
 * @summary Loophole in typesafety
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T7034511b.out -XDrawDiagnostics T7034511b.java
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
     7
 */
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
     8
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
     9
class T7034511b {
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
    10
    static class MyList<E> {
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
    11
        E toArray(E[] e) { return null; }
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
    12
    }
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
    13
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
    14
    void test(MyList<?> ml, Object o[]) {
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
    15
        ml.toArray(o);
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
    16
    }
da48f63f0b22 7034511: Loophole in typesafety
mcimadamore
parents:
diff changeset
    17
}