StreamApiMigrationInspection: preserve comments on cleanUp limit/bufferedReader

This commit is contained in:
Tagir Valeev
2017-11-27 15:22:25 +07:00
parent 211e15074b
commit 5b8f3b2bfe
5 changed files with 10 additions and 5 deletions
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
public class Main {
List<String> test(BufferedReader br) throws IOException {
List<String> result;
/*comment*/
result = br.lines().map(String::trim).collect(Collectors.toList());
return result;
}
@@ -8,7 +8,7 @@ import java.util.List;
public class Main {
List<String> test(BufferedReader br) throws IOException {
List<String> result = new ArrayList<>();
String line = "";
String line = /*comment*/"";
wh<caret>ile(null != (line = br.readLine())) {
result.add(line.trim());
}
@@ -5,6 +5,7 @@ import java.util.stream.Collectors;
public class Main {
public Set<String> test(String[] array) {
/*initial count*/
Set<String> set = Arrays.stream(array).filter(Objects::nonNull).limit(10).collect(Collectors.toSet());
return set;
}
@@ -4,7 +4,7 @@ import java.util.*;
public class Main {
public Set<String> test(String[] array) {
int count = 0;
int count = /*initial count*/0;
Set<String> set = new HashSet<>();
for(String str : a<caret>rray) {
if (str != null) {