aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @author mcimadamore aoqi@0: * @bug 6714835 aoqi@0: * @summary Safe cast is rejected (with warning) by javac aoqi@0: * @compile/fail/ref=T6714835.out -Xlint:unchecked -Werror -XDrawDiagnostics T6714835.java aoqi@0: */ aoqi@0: aoqi@0: import java.util.*; aoqi@0: aoqi@0: class T6714835 { aoqi@0: void cast1(Iterable x) { aoqi@0: Collection x1 = (Collection)x; //ok aoqi@0: Collection x2 = (Collection)x; //warn aoqi@0: } aoqi@0: aoqi@0: void cast2(Iterable x) { aoqi@0: Collection x1 = (Collection)x; //ok aoqi@0: Collection x2 = (Collection)x; //warn aoqi@0: } aoqi@0: }