mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
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
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user