langtools/test/tools/javac/generics/UncheckedConstructor.java
author hseigel
Wed, 02 Mar 2016 23:48:41 +0000
changeset 36397 c487ced7231c
parent 30721 1024d425d97e
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
30721
1024d425d97e 8074425: Group 13b: golden files for tests in tools/javac/generics dir
sogoel
parents: 5520
diff changeset
     2
 * @test /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 4951260
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary compiler disallows raw call to generic constructor
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @author gafter
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 *
2985
f43e1241e7fb 6843761: Update langtools tests to remove unncessary -source and -target options
darcy
parents: 10
diff changeset
     7
 * @compile       -Werror                  UncheckedConstructor.java
30721
1024d425d97e 8074425: Group 13b: golden files for tests in tools/javac/generics dir
sogoel
parents: 5520
diff changeset
     8
 * @compile/fail/ref=UncheckedConstructor.out -XDrawDiagnostics  -Werror -Xlint:unchecked UncheckedConstructor.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
import java.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
class G3 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
    G3(Enumeration<Object> e) { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
    static void g() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
        new G3(new Enumeration() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
                public boolean hasMoreElements() { return false; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
                public Object nextElement() { return null; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
            });
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
}