mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
disable add exception to catch/generalize catch inside functional interface inside try statement (IDEA-135171)
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
// "Add 'catch' clause(s)" "true"
|
||||
import java.io.IOException;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class C {
|
||||
static Object get() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
void method() {
|
||||
try {
|
||||
Supplier<Object> lambda1 = () -> {
|
||||
try {
|
||||
return C.get();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
};
|
||||
} catch( Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Add 'catch' clause(s)" "false"
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class C {
|
||||
static Object get() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
void method() {
|
||||
try {
|
||||
Supplier<Object> lambda1 = () -> C.ge<caret>t();
|
||||
} catch( Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// "Add 'catch' clause(s)" "true"
|
||||
import java.io.IOException;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class C {
|
||||
static Object get() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
void method() {
|
||||
try {
|
||||
Supplier<Object> lambda1 = () -> {
|
||||
try {
|
||||
return C.ge<caret>t();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
};
|
||||
} catch( Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Add 'catch' clause(s)" "false"
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class C {
|
||||
static Object get() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
void method() {
|
||||
try {
|
||||
Supplier<Object> lambda1 = C::g<caret>et;
|
||||
} catch( Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Generalize catch for 'java.lang.Exception' to 'java.lang.Exception'" "false"
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class C {
|
||||
static Object get() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
void method() {
|
||||
try {
|
||||
Supplier<Object> lambda1 = () -> C.ge<caret>t();
|
||||
} catch( Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Generalize catch for 'java.lang.Exception' to 'java.lang.Exception'" "false"
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class C {
|
||||
static Object get() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
void method() {
|
||||
try {
|
||||
Supplier<Object> lambda1 = C::g<caret>et;
|
||||
} catch( Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user