2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2015-05-15 08:56:14 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2007-12-01 00:00:00 +00:00
|
|
|
* @bug 5077054
|
|
|
|
* @summary Conditional operator applies assignment conversion
|
|
|
|
* @author Tim Hanson, BEA
|
|
|
|
*
|
2012-11-17 19:01:03 +00:00
|
|
|
* @compile Conditional.java
|
2018-07-12 21:13:15 +00:00
|
|
|
* @compile/fail/ref=Conditional.out -XDrawDiagnostics -source 7 -Xlint:-options Conditional.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
class Conditional {
|
|
|
|
void test() {
|
|
|
|
String[] sa = null;
|
|
|
|
List<String> ls = sa == null ? Arrays.asList(sa) :
|
|
|
|
Collections.emptyList();
|
|
|
|
}
|
|
|
|
}
|