Java inspection: Fixed test data for "Move return to computation" (IDEA-121153)

This commit is contained in:
Pavel Dolgov
2016-09-06 19:05:05 +03:00
parent 34872c5443
commit 30724a89e6
9 changed files with 50 additions and 8 deletions
@@ -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,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 = "";
@@ -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;
}
}
@@ -6,6 +6,6 @@ class T {
n = 1;
System.out.println();
}
return n;
re<caret>turn n;
}
}
@@ -6,6 +6,6 @@ class T {
if (b) n = 1;
else n = 2;
}
r<return>eturn n;
r<caret>eturn n;
}
}
@@ -6,6 +6,6 @@ class T {
if (b) n = 1;
}
else n = 2;
re<before>turn n;
re<caret>turn n;
}
}
@@ -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,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 = "";
@@ -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;
}
}