mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
HighlightUtil: suggest fix for cases when method has void return type and return statement value type is unknown (IDEA-216279)
GitOrigin-RevId: 2af7ce37a427c8ec6f5175fc820ec0eecbf719c9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6742e9aab5
commit
8ec9a2e0ce
+7
@@ -0,0 +1,7 @@
|
||||
// "Delete return statement" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Delete return value '"foo"'" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
if (b) return;
|
||||
System.out.println("bar");
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Delete return statement" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Delete return value 'null'" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
if (b) return;
|
||||
System.out.println("bar");
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Delete return statement" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
return<caret> "foo";
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Delete return statement" "false"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
return<caret> getWithSideEffects();
|
||||
}
|
||||
|
||||
private String getWithSideEffects() {
|
||||
System.out.println("baz");
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Delete return value '"foo"'" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
if (b) return<caret> "foo";
|
||||
System.out.println("bar");
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Delete return statement" "false"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
if (b) return<caret> getWithSideEffects();
|
||||
System.out.println("bar");
|
||||
}
|
||||
|
||||
private String getWithSideEffects() {
|
||||
System.out.println("baz");
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Delete return statement" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
return<caret> null;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Delete return value 'null'" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo(boolean b) {
|
||||
if (b) return<caret> null;
|
||||
System.out.println("bar");
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Change return type for method 'foo'" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
<caret><selection>void</selection> foo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Change return type for method 'foo'" "true"
|
||||
|
||||
class Test {
|
||||
|
||||
void foo() {
|
||||
return <caret>null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user