langtools/test/tools/javac/conditional/Conditional.java
author sogoel
Fri, 15 May 2015 01:56:14 -0700
changeset 30716 1bbdff43424d
parent 14547 86d8d242b0c4
permissions -rw-r--r--
8074408: Group 12: golden files for tests in tools/javac dir Reviewed-by: jjg

/*
 * @test /nodynamiccopyright/
 * @bug 5077054
 * @summary Conditional operator applies assignment conversion
 * @author Tim Hanson, BEA
 *
 * @compile Conditional.java
 * @compile/fail/ref=Conditional.out -XDrawDiagnostics  -source 7 Conditional.java
 */

import java.util.*;

class Conditional {
    void test() {
        String[] sa = null;
        List<String> ls = sa == null ? Arrays.asList(sa) :
            Collections.emptyList();
    }
}