lambda <-> anonymous <-> method ref: collapse lambda block when applicable refactored (IDEA-134509)

This commit is contained in:
Anna Kozlova
2014-12-18 19:20:21 +01:00
parent 683b7413e7
commit e6371b208f
7 changed files with 93 additions and 67 deletions
@@ -5,7 +5,9 @@ import java.util.Set;
class Test {
public static void main(String[] args) {
Set<String> strings = new HashSet<>();
new Test().query((ResultSet var1) -> strings.add("Col1"));
new Test().query(var1 -> {
return strings.add("Col1");
});
}
public void query(RowCallbackHandler rch){
@@ -0,0 +1,9 @@
// "Replace with lambda" "true"
import javax.swing.*;
class Test {
String c = null;
public void main(String[] args){
SwingUtilities.invokeLater(() -> c.substring(0).toString());
}
}
@@ -0,0 +1,13 @@
// "Replace with lambda" "true"
import javax.swing.*;
class Test {
String c = null;
public void main(String[] args){
SwingUtilities.invokeLater(new Runna<caret>ble() {
public void run() {
c.substring(0).toString();
}
});
}
}