lambda: effectively final parameters: copy in final variable if needed - never make implicitly final

This commit is contained in:
Anna Kozlova
2012-08-21 14:39:41 +04:00
parent c85e90f7c1
commit a0d858fa5b
13 changed files with 126 additions and 27 deletions
@@ -1,7 +1,7 @@
// "Replace with lambda" "true"
class Test {
{
Comparable<String> c = (o)->{
Comparable<String> c = o->{
return 0;
};
}
@@ -1,7 +1,7 @@
// "Replace with lambda" "true"
class Test {
{
Comparable<String> c = (final String o)->{
Comparable<String> c = o->{
Runnable r = new Runnable() {
@Override
public void run() {