mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
change signature: expand expr lambda to block lambda when exception should be caught; don't expand method ref to lambda when only unchecked exceptions were added (IDEA-152386)
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Action {
|
||||
public void ac<caret>ting(String s) {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Client {
|
||||
public static void consumer(String val, Consumer<String> func) {
|
||||
func.accept(val);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Action a = new Action();
|
||||
consumer("hello", (s) -> a.acting(s));
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import java.io.IOException;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Action {
|
||||
public void acting(String s) throws IOException {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Client {
|
||||
public static void consumer(String val, Consumer<String> func) {
|
||||
func.accept(val);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Action a = new Action();
|
||||
consumer("hello", (s) -> {
|
||||
try {
|
||||
a.acting(s);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Action {
|
||||
public void ac<caret>ting(String s) {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Client {
|
||||
public static void consumer(String val, Consumer<String> func) {
|
||||
func.accept(val);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Action a = new Action();
|
||||
consumer("hello", a::acting);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Action {
|
||||
public void acting(String s) throws NullPointerException {
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Client {
|
||||
public static void consumer(String val, Consumer<String> func) {
|
||||
func.accept(val);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Action a = new Action();
|
||||
consumer("hello", a::acting);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user