Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
18 lines
367 B
Java
18 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();
|
|
}
|
|
}
|