convert anonym class to onle-line lambda if possible (IDEA-90820)

This commit is contained in:
Anna Kozlova
2012-08-30 20:14:36 +04:00
parent 4672022e91
commit bb0b0c008a
5 changed files with 31 additions and 6 deletions
@@ -1,8 +1,6 @@
// "Replace with lambda" "true"
class Test {
{
Comparable<String> c = o -> {
return 0;
};
Comparable<String> c = o -> 0;
}
}
@@ -9,8 +9,6 @@ class Test2 {
static <T> I<T> bar(I<T> i){return i;}
{
bar((List<String> list) -> {
return null; //To change body of implemented methods use File | Settings | File Templates.
});
bar((List<String> list) -> null);
}
}
@@ -0,0 +1,9 @@
// "Replace with lambda" "true"
class Test {
{
Comparable<String> c = o -> {
System.out.println();
return 0;
};
}
}
@@ -0,0 +1,12 @@
// "Replace with lambda" "true"
class Test {
{
Comparable<String> c = new Compa<caret>rable<String>() {
@Override
public int compareTo(String o) {
System.out.println();
return 0;
}
};
}
}