StreamToLoopInspection refactoring: strings replaced with actual PsiType's (as they are valid now); removed unnecessary code due to all PsiExpressions are also valid

This commit is contained in:
Tagir Valeev
2017-03-21 14:21:29 +07:00
parent 69632b09da
commit f764692965
12 changed files with 183 additions and 214 deletions
@@ -15,10 +15,10 @@ public class Main {
boolean seen = false;
int best = 0;
for (Index index : set.asList()) {
int i = index.asInteger();
if (!seen || i < best) {
int asInteger = index.asInteger();
if (!seen || asInteger < best) {
seen = true;
best = i;
best = asInteger;
}
}
return seen ? OptionalInt.of(best) : OptionalInt.empty();
@@ -10,8 +10,8 @@ public class Main {
List<Integer> list = new ArrayList<>();
for (int x : input) {
if (x > 0) {
Integer i = x * 2;
list.add(i);
Integer integer = x * 2;
list.add(integer);
}
}
return list;
@@ -130,8 +130,8 @@ public class Main {
private static List<String> testMethodRef(List<List<String>> list) {
List<String> result = new ArrayList<>();
for (List<String> strings : list) {
for (String s : strings) {
result.add(s);
for (String string : strings) {
result.add(string);
}
}
return result;
@@ -140,8 +140,8 @@ public class Main {
private static List<String> testMethodRef2(List<String[]> list) {
List<String> result = new ArrayList<>();
for (String[] strings : list) {
for (String s : strings) {
result.add(s);
for (String t : strings) {
result.add(t);
}
}
return result;
@@ -39,7 +39,7 @@ public class Main {
public static boolean testIsPresent(List<List<String>> list) {
for (List<String> strings : list) {
if (strings != null) {
for (String s : strings) {
for (String string : strings) {
return true;
}
}