langtools/test/tools/javac/generics/UncheckedConstructor.java
author sogoel
Fri, 15 May 2015 16:53:42 -0700
changeset 30721 1024d425d97e
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8074425: Group 13b: golden files for tests in tools/javac/generics dir Reviewed-by: jjg, darcy, mcimadamore
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
}