test/langtools/tools/javac/generics/6245699/T6245699b.java
author vromero
Tue, 24 Apr 2018 08:13:30 -0700
changeset 49872 0798eab12791
parent 47216 71c04702a3d5
permissions -rw-r--r--
8201281: Truncated error message with Incompatible : null Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
25694
ba47ecb5bfee 8048837: .out files for generics tests in tools/javac dir - part 3
sogoel
parents: 5520
diff changeset
     2
 * @test    /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug     6270396 6245699
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary Missing bridge for final method (gives AbstractMethodError at runtime)
25694
ba47ecb5bfee 8048837: .out files for generics tests in tools/javac dir - part 3
sogoel
parents: 5520
diff changeset
     5
 * @compile/fail/ref=T6245699b.out -XDrawDiagnostics  T6245699b.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
public class T6245699b {
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
    public static void main(String[] args) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
        IBar b = new Bar();
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
        String x = b.doIt();
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
    static class Foo<T> {
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        public final T doIt() { return null; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
    static interface IBar {
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
        String doIt();
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
    static class Bar extends Foo<String> implements IBar {
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
        public String doIt() { // assert that a final method can't be overridden
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
            return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
}