mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
lambda <-> anonymous <-> method ref: collapse lambda block when applicable refactored (IDEA-134509)
This commit is contained in:
+3
-1
@@ -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){
|
||||
|
||||
+9
@@ -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());
|
||||
}
|
||||
}
|
||||
+13
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user