mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Java inspection: Fixed test data for "Move return to computation" (IDEA-121153)
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Move 'return' to computation of the value of 'n'" "true"
|
||||
// "Move 'return' to computation of the value of 's'" "true"
|
||||
import java.io.*;
|
||||
|
||||
class T {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Move 'return' to computation of the value of 'n'" "true"
|
||||
// "Move 'return' to computation of the value of 'r'" "true"
|
||||
class T {
|
||||
String f(String[] a) {
|
||||
String r = "";
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// "Move 'return' to computation of the value of 'n'" "true"
|
||||
class T {
|
||||
int f(int a) {
|
||||
int n = -1;
|
||||
int t = a;
|
||||
while (t != null) {
|
||||
if (t == 1) {
|
||||
n = 10;
|
||||
}
|
||||
else if (t == 2) {
|
||||
n = 20;
|
||||
}
|
||||
else {
|
||||
t = t + 1;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,6 +6,6 @@ class T {
|
||||
n = 1;
|
||||
System.out.println();
|
||||
}
|
||||
return n;
|
||||
re<caret>turn n;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,6 +6,6 @@ class T {
|
||||
if (b) n = 1;
|
||||
else n = 2;
|
||||
}
|
||||
r<return>eturn n;
|
||||
r<caret>eturn n;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,6 +6,6 @@ class T {
|
||||
if (b) n = 1;
|
||||
}
|
||||
else n = 2;
|
||||
re<before>turn n;
|
||||
re<caret>turn n;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// "Move 'return' to computation of the value of 'n'" "true"
|
||||
// "Move 'return' to computation of the value of 's'" "true"
|
||||
import java.io.*;
|
||||
|
||||
class T {
|
||||
@@ -7,7 +7,7 @@ class T {
|
||||
try (BufferedReader r = open()) {
|
||||
s = r.readLine();
|
||||
}
|
||||
re<return>turn s;
|
||||
re<caret>turn s;
|
||||
}
|
||||
|
||||
private static BufferedReader open() throws FileNotFoundException {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Move 'return' to computation of the value of 'n'" "true"
|
||||
// "Move 'return' to computation of the value of 'r'" "true"
|
||||
class T {
|
||||
String f(String[] a) {
|
||||
String r = "";
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// "Move 'return' to computation of the value of 'n'" "true"
|
||||
class T {
|
||||
int f(int a) {
|
||||
int n = -1;
|
||||
int t = a;
|
||||
while (t != null) {
|
||||
if (t == 1) {
|
||||
n = 10;
|
||||
}
|
||||
else if (t == 2) {
|
||||
n = 20;
|
||||
}
|
||||
else {
|
||||
t = t + 1;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
ret<caret>urn n;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user