diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledFor.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledFor.java
deleted file mode 100644
index 098854f69b60..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledFor.java
+++ /dev/null
@@ -1,13 +0,0 @@
-class T {
- int f(int[] a) {
- int n = -1;
- myLabel:
- for (int i = 0; i < a.length; i++) {
- if (a[0] == 0) {
- n = i;
- break myLabel;
- }
- }
- return n;
- }
-}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledFor2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledFor2.java
deleted file mode 100644
index 875bdfb19114..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledFor2.java
+++ /dev/null
@@ -1,11 +0,0 @@
-class T {
- int f(int[] a) {
- int n = -1;
- myLabel:
- for (int i = 0; i < a.length; i++) {
- n = i;
- if (a[0] == 0) break myLabel;
- }
- return n;
- }
-}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledIf.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledIf.java
deleted file mode 100644
index 82067b472c18..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/LabeledIf.java
+++ /dev/null
@@ -1,9 +0,0 @@
-class T {
- int f(boolean b) {
- int n = 0;
- myLabel:
- if (b) n = 1;
- else break myLabel;
- return n;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedBlock.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedBlock.java
deleted file mode 100644
index 474f1d55f83e..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedBlock.java
+++ /dev/null
@@ -1,9 +0,0 @@
-class T {
- int f() {
- int n;
- {
- n = 1;
- }
- return n;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedBlockSideEffect.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedBlockSideEffect.java
deleted file mode 100644
index b085a4dd6651..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedBlockSideEffect.java
+++ /dev/null
@@ -1,10 +0,0 @@
-class T {
- int f() {
- int n;
- {
- n = 1;
- System.out.println();
- }
- return n;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIf.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIf.java
deleted file mode 100644
index fb6f7cd1c4b3..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIf.java
+++ /dev/null
@@ -1,11 +0,0 @@
-class T {
- int f(boolean a, boolean b) {
- int n = -1;
- if (a) {
- if (b) {
- n = 1;
- }
- }
- return n;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIfInnerElse.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIfInnerElse.java
deleted file mode 100644
index 06bde7faac0a..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIfInnerElse.java
+++ /dev/null
@@ -1,10 +0,0 @@
-class T {
- int f(boolean a, boolean b) {
- int n = -1;
- if (a) {
- if (b) n = 1;
- else n = 2;
- }
- return n;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIfOuterElse.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIfOuterElse.java
deleted file mode 100644
index ae1b6a0d2672..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/NestedIfOuterElse.java
+++ /dev/null
@@ -1,10 +0,0 @@
-class T {
- int f(boolean a, boolean b) {
- int n = -1;
- if (a) {
- if (b) n = 1;
- }
- else n = 2;
- return n;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/ReturnOutsideTryWithResources.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/ReturnOutsideTryWithResources.java
deleted file mode 100644
index 71e87f22de37..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/ReturnOutsideTryWithResources.java
+++ /dev/null
@@ -1,15 +0,0 @@
-import java.io.*;
-
-class T {
- private static String getString() throws IOException {
- String s;
- try (BufferedReader r = open()) {
- s = r.readLine();
- }
- return s;
- }
-
- private static BufferedReader open() throws FileNotFoundException {
- return null;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/SimpleDoWhile.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/SimpleDoWhile.java
deleted file mode 100644
index 7b9a0fec76bd..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/SimpleDoWhile.java
+++ /dev/null
@@ -1,25 +0,0 @@
-class T {
- String f(String a) {
- String r = "";
- int i = 0;
- do {
- int j = a.indexOf(",", i);
- String s = j > i ? a.substring(i, j) : a.substring(i);
- if (s.startsWith("@")) {
- r = s;
- break;
- }
- i = j + 1;
- }
- while (i >= 0);
- return r;
- }
-
- boolean hasNext() {
- return true;
- }
-
- String next() {
- return null;
- }
-}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/SimpleForeach.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/SimpleForeach.java
deleted file mode 100644
index f77d41b7ee34..000000000000
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/SimpleForeach.java
+++ /dev/null
@@ -1,12 +0,0 @@
-class T {
- String f(String[] a) {
- String r = "";
- for (String s : a) {
- if (s != null && s.contains("@")) {
- r = s + ":" + s.length();
- break;
- }
- }
- return r;
- }
-}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledFor.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledFor.java
new file mode 100644
index 000000000000..37e2e90549b5
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledFor.java
@@ -0,0 +1,13 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(int[] a) {
+ int n = -1;
+ myLabel:
+ for (int i = 0; i < a.length; i++) {
+ if (a[0] == 0) {
+ return i;
+ }
+ }
+ return n;
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledFor2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledFor2.java
new file mode 100644
index 000000000000..861fb83eb003
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledFor2.java
@@ -0,0 +1,12 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(int[] a) {
+ int n = -1;
+ myLabel:
+ for (int i = 0; i < a.length; i++) {
+ n = i;
+ if (a[0] == 0) return n;
+ }
+ return n;
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledIf.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledIf.java
new file mode 100644
index 000000000000..7674e011b245
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterLabeledIf.java
@@ -0,0 +1,9 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(boolean b) {
+ int n = 0;
+ myLabel:
+ if (b) return 1;
+ else return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedBlock.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedBlock.java
new file mode 100644
index 000000000000..31b709aa2647
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedBlock.java
@@ -0,0 +1,9 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f() {
+ int n;
+ {
+ return 1;
+ }
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedBlockSideEffect.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedBlockSideEffect.java
new file mode 100644
index 000000000000..7e5867826d10
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedBlockSideEffect.java
@@ -0,0 +1,11 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f() {
+ int n;
+ {
+ n = 1;
+ System.out.println();
+ return n;
+ }
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIf.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIf.java
new file mode 100644
index 000000000000..78abbd78e05b
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIf.java
@@ -0,0 +1,12 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(boolean a, boolean b) {
+ int n = -1;
+ if (a) {
+ if (b) {
+ return 1;
+ }
+ }
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIfInnerElse.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIfInnerElse.java
new file mode 100644
index 000000000000..ae6127c6881c
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIfInnerElse.java
@@ -0,0 +1,11 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(boolean a, boolean b) {
+ int n = -1;
+ if (a) {
+ if (b) return 1;
+ else return 2;
+ }
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIfOuterElse.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIfOuterElse.java
new file mode 100644
index 000000000000..866b42c74562
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterNestedIfOuterElse.java
@@ -0,0 +1,11 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(boolean a, boolean b) {
+ int n = -1;
+ if (a) {
+ if (b) return 1;
+ }
+ else return 2;
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterReturnOutsideTryWithResources.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterReturnOutsideTryWithResources.java
new file mode 100644
index 000000000000..a6e1106622b0
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterReturnOutsideTryWithResources.java
@@ -0,0 +1,15 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+import java.io.*;
+
+class T {
+ private static String getString() throws IOException {
+ String s;
+ try (BufferedReader r = open()) {
+ return r.readLine();
+ }
+ }
+
+ private static BufferedReader open() throws FileNotFoundException {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterSimpleDoWhile.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterSimpleDoWhile.java
new file mode 100644
index 000000000000..82b7f13511d6
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterSimpleDoWhile.java
@@ -0,0 +1,25 @@
+// "Move 'return' to computation of the value of 'r'" "true"
+class T {
+ String f(String a) {
+ String r = "";
+ int i = 0;
+ do {
+ int j = a.indexOf(",", i);
+ String s = j > i ? a.substring(i, j) : a.substring(i);
+ if (s.startsWith("@")) {
+ return s;
+ }
+ i = j + 1;
+ }
+ while (i >= 0);
+ return r;
+ }
+
+ boolean hasNext() {
+ return true;
+ }
+
+ String next() {
+ return null;
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterSimpleForeach.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterSimpleForeach.java
new file mode 100644
index 000000000000..4b7b632f265b
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterSimpleForeach.java
@@ -0,0 +1,12 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ String f(String[] a) {
+ String r = "";
+ for (String s : a) {
+ if (s != null && s.contains("@")) {
+ return s + ":" + s.length();
+ }
+ }
+ return r;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterTryWhile1.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterTryWhile1.java
new file mode 100644
index 000000000000..a8020c7ceee3
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterTryWhile1.java
@@ -0,0 +1,23 @@
+// "Move 'return' to computation of the value of 'r'" "true"
+class T {
+ String f(String p) {
+ String r = null;
+ try {
+ while (true) {
+ String n = next();
+ if (n != null) {
+ String t = n.toLowerCase();
+ if (t.equals(p)) {
+ return n;
+ }
+ }
+ }
+ } finally {
+ System.out.println();
+ }
+ }
+
+ String next() {
+ return "";
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterTryWhile2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterTryWhile2.java
new file mode 100644
index 000000000000..1a6dcc6e112d
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/afterTryWhile2.java
@@ -0,0 +1,24 @@
+// "Move 'return' to computation of the value of 'r'" "true"
+class T {
+ String f(String p) {
+ String r = null;
+ try {
+ while (true) {
+ String n = next();
+ if (n != null) return r;
+ if ("@".eqals(n)) {
+ String t = n.toLowerCase();
+ if (t.equals(p)) {
+ return n;
+ }
+ }
+ }
+ } finally {
+ System.out.println();
+ }
+ }
+
+ String next() {
+ return "";
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledFor.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledFor.java
new file mode 100644
index 000000000000..1e8878cd6e85
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledFor.java
@@ -0,0 +1,14 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(int[] a) {
+ int n = -1;
+ myLabel:
+ for (int i = 0; i < a.length; i++) {
+ if (a[0] == 0) {
+ n = i;
+ break myLabel;
+ }
+ }
+ return n;
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledFor2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledFor2.java
new file mode 100644
index 000000000000..8dda8c86eb6f
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledFor2.java
@@ -0,0 +1,12 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(int[] a) {
+ int n = -1;
+ myLabel:
+ for (int i = 0; i < a.length; i++) {
+ n = i;
+ if (a[0] == 0) break myLabel;
+ }
+ return n;
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledIf.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledIf.java
new file mode 100644
index 000000000000..798d26283373
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeLabeledIf.java
@@ -0,0 +1,10 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(boolean b) {
+ int n = 0;
+ myLabel:
+ if (b) n = 1;
+ else break myLabel;
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedBlock.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedBlock.java
new file mode 100644
index 000000000000..fa5faaffd48a
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedBlock.java
@@ -0,0 +1,10 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f() {
+ int n;
+ {
+ n = 1;
+ }
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedBlockSideEffect.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedBlockSideEffect.java
new file mode 100644
index 000000000000..850e6b084971
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedBlockSideEffect.java
@@ -0,0 +1,11 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f() {
+ int n;
+ {
+ n = 1;
+ System.out.println();
+ }
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIf.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIf.java
new file mode 100644
index 000000000000..a28f57fc90df
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIf.java
@@ -0,0 +1,12 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(boolean a, boolean b) {
+ int n = -1;
+ if (a) {
+ if (b) {
+ n = 1;
+ }
+ }
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIfInnerElse.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIfInnerElse.java
new file mode 100644
index 000000000000..09f985c4089a
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIfInnerElse.java
@@ -0,0 +1,11 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(boolean a, boolean b) {
+ int n = -1;
+ if (a) {
+ if (b) n = 1;
+ else n = 2;
+ }
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIfOuterElse.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIfOuterElse.java
new file mode 100644
index 000000000000..b93c3d4fb8ca
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeNestedIfOuterElse.java
@@ -0,0 +1,11 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ int f(boolean a, boolean b) {
+ int n = -1;
+ if (a) {
+ if (b) n = 1;
+ }
+ else n = 2;
+ return n;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeReturnOutsideTryWithResources.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeReturnOutsideTryWithResources.java
new file mode 100644
index 000000000000..fada06089426
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeReturnOutsideTryWithResources.java
@@ -0,0 +1,16 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+import java.io.*;
+
+class T {
+ private static String getString() throws IOException {
+ String s;
+ try (BufferedReader r = open()) {
+ s = r.readLine();
+ }
+ return s;
+ }
+
+ private static BufferedReader open() throws FileNotFoundException {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeSimpleDoWhile.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeSimpleDoWhile.java
new file mode 100644
index 000000000000..9d65a5ad57d2
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeSimpleDoWhile.java
@@ -0,0 +1,26 @@
+// "Move 'return' to computation of the value of 'r'" "true"
+class T {
+ String f(String a) {
+ String r = "";
+ int i = 0;
+ do {
+ int j = a.indexOf(",", i);
+ String s = j > i ? a.substring(i, j) : a.substring(i);
+ if (s.startsWith("@")) {
+ r = s;
+ break;
+ }
+ i = j + 1;
+ }
+ while (i >= 0);
+ return r;
+ }
+
+ boolean hasNext() {
+ return true;
+ }
+
+ String next() {
+ return null;
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeSimpleForeach.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeSimpleForeach.java
new file mode 100644
index 000000000000..b11d745bf6f4
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeSimpleForeach.java
@@ -0,0 +1,13 @@
+// "Move 'return' to computation of the value of 'n'" "true"
+class T {
+ String f(String[] a) {
+ String r = "";
+ for (String s : a) {
+ if (s != null && s.contains("@")) {
+ r = s + ":" + s.length();
+ break;
+ }
+ }
+ return r;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeTryWhile1.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeTryWhile1.java
new file mode 100644
index 000000000000..49301036ff7f
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeTryWhile1.java
@@ -0,0 +1,25 @@
+// "Move 'return' to computation of the value of 'r'" "true"
+class T {
+ String f(String p) {
+ String r = null;
+ try {
+ while (true) {
+ String n = next();
+ if (n != null) {
+ String t = n.toLowerCase();
+ if (t.equals(p)) {
+ r = n;
+ break;
+ }
+ }
+ }
+ } finally {
+ System.out.println();
+ }
+ return r;
+ }
+
+ String next() {
+ return "";
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeTryWhile2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeTryWhile2.java
new file mode 100644
index 000000000000..83e2c777c230
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/returnSeparatedFromComputation/beforeTryWhile2.java
@@ -0,0 +1,26 @@
+// "Move 'return' to computation of the value of 'r'" "true"
+class T {
+ String f(String p) {
+ String r = null;
+ try {
+ while (true) {
+ String n = next();
+ if (n != null) break;
+ if ("@".eqals(n)) {
+ String t = n.toLowerCase();
+ if (t.equals(p)) {
+ r = n;
+ break;
+ }
+ }
+ }
+ } finally {
+ System.out.println();
+ }
+ return r;
+ }
+
+ String next() {
+ return "";
+ }
+}
\ No newline at end of file