Files
Anna Kozlova f1536bb969 use lambda to avoid context remapping (IDEA-185448)
for anonymous class this expressions have to be encoded to point to outer class, for lambda expressions there is no need for that. Leave unchanged (array initializer) for old java versions
2018-01-30 19:38:53 +03:00

11 lines
239 B
Java

import java.util.*;
class Test {
private final Collection<Integer> collection = new ArrayList<>();
{
List<Integer> l = Collections.unmodifiableList((List<Integer>)this.collection);
System.out.println(l);
}
}