langtools/test/tools/javac/cast/6557182/T6557182.java
author peterz
Fri, 28 May 2010 13:32:40 +0400
changeset 5594 3db39773da2e
parent 3766 7e2df99e9223
permissions -rw-r--r--
6954231: SynthTextPaneUI.installUI() doesn't set component to opaque even if prop was not set by client progr Reviewed-by: alexp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1992
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
     1
/*
3766
7e2df99e9223 6875336: some tests should use /nodynamiccopyright/
jjg
parents: 1992
diff changeset
     2
 * @test /nodynamiccopyright/
1992
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
     3
 * @author Maurizio Cimadamore
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
     4
 * @bug     6557182
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
     5
 * @summary  Unchecked warning *and* inconvertible types
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T6557182.out -XDrawDiagnostics -Xlint:unchecked T6557182.java
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
     7
 */
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
     8
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
     9
class T6557182 {
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    10
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    11
    <T extends Number & Comparable<String>> void test1(T t) {
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    12
        Comparable<Integer> ci = (Comparable<Integer>) t;
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    13
    }
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    14
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    15
    <T extends Number & Comparable<? extends Number>> void test2(T t) {
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    16
        Comparable<Integer> ci = (Comparable<Integer>) t;
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    17
    }
7be5dee022d5 6557182: Unchecked warning *and* inconvertible types
mcimadamore
parents:
diff changeset
    18
}