jdk-24/test/langtools/tools/javac/conditional/Conditional.java
2022-09-01 16:43:50 +00:00

19 lines
367 B
Java

/*
* @test /nodynamiccopyright/
* @bug 5077054
* @summary Conditional operator applies assignment conversion
* @author Tim Hanson, BEA
*
* @compile Conditional.java
*/
import java.util.*;
class Conditional {
void test() {
String[] sa = null;
List<String> ls = sa == null ? Arrays.asList(sa) :
Collections.emptyList();
}
}