langtools/test/tools/javac/conditional/Conditional.java
author ysuenaga
Wed, 30 Mar 2016 21:05:13 +0900
changeset 37218 c7241bc368bf
parent 30716 1bbdff43424d
permissions -rw-r--r--
8151674: STW phases at Concurrent GC should count in PerfCounter Reviewed-by: jmasa, sla, tschatzl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
30716
1bbdff43424d 8074408: Group 12: golden files for tests in tools/javac dir
sogoel
parents: 14547
diff changeset
     2
 * @test /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 5077054
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary Conditional operator applies assignment conversion
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @author Tim Hanson, BEA
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 *
14547
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents: 14057
diff changeset
     7
 * @compile Conditional.java
30716
1bbdff43424d 8074408: Group 12: golden files for tests in tools/javac dir
sogoel
parents: 14547
diff changeset
     8
 * @compile/fail/ref=Conditional.out -XDrawDiagnostics  -source 7 Conditional.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 Conditional {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
    void test() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        String[] sa = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
        List<String> ls = sa == null ? Arrays.asList(sa) :
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
            Collections.emptyList();
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
}