ExtractChainedMapAction: more specific message; Guava FluentIterable support; Collection.forEach test

This commit is contained in:
Tagir Valeev
2017-03-07 13:50:45 +07:00
parent fdfa078e77
commit ed8f4efbef
35 changed files with 104 additions and 41 deletions
@@ -1,4 +1,4 @@
// "Extract variable 'lowerCase' to separate mapping method" "true"
// "Extract variable 'lowerCase' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'arr' to separate mapping method" "true"
// "Extract variable 'arr' to 'mapToObj' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'l' to separate mapping method" "true"
// "Extract variable 'l' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'l' to separate mapping method" "true"
// "Extract variable 'l' to 'asLongStream' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -0,0 +1,8 @@
// "Extract variable 'trimmed' to 'stream().map' operation" "true"
import java.util.Collection;
public class StreamExtract {
void hasNonEmpty(Collection<String> list) {
list.stream().map(String::trim).forEach(trimmed -> System.out.println(trimmed + ":" + trimmed));
}
}
@@ -1,4 +1,4 @@
// "Extract variable 'y' to separate mapping method" "true"
// "Extract variable 'y' to 'mapToInt' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'y' to separate mapping method" "true"
// "Extract variable 'y' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 's' to separate mapping method" "true"
// "Extract variable 's' to 'mapToObj' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'i' to separate mapping method" "true"
// "Extract variable 'i' to 'mapToInt' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'fn' to separate mapping method" "true"
// "Extract variable 'fn' to 'map' operation" "true"
import java.util.*;
import java.util.function.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'set' to separate mapping method" "true"
// "Extract variable 'set' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'y' to separate mapping method" "true"
// "Extract variable 'y' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'l' to separate mapping method" "true"
// "Extract variable 'l' to 'asLongStream' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'lc' to separate mapping method" "true"
// "Extract variable 'lc' to 'thenApply' operation" "true"
import java.util.concurrent.CompletableFuture;
public class Test {
@@ -1,4 +1,4 @@
// "Extract variable 'lowerCase' to separate mapping method" "true"
// "Extract variable 'lowerCase' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'lowerCase' to separate mapping method" "false"
// "Disable 'Extract to separate mapping method'" "false"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'arr' to separate mapping method" "true"
// "Extract variable 'arr' to 'mapToObj' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'l' to separate mapping method" "true"
// "Extract variable 'l' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'l' to separate mapping method" "true"
// "Extract variable 'l' to 'asLongStream' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -0,0 +1,11 @@
// "Extract variable 'trimmed' to 'stream().map' operation" "true"
import java.util.Collection;
public class StreamExtract {
void hasNonEmpty(Collection<String> list) {
list.forEach(s -> {
String <caret>trimmed = s.trim();
System.out.println(trimmed + ":" + trimmed);
});
}
}
@@ -1,4 +1,4 @@
// "Extract variable 'y' to separate mapping method" "true"
// "Extract variable 'y' to 'mapToInt' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'y' to separate mapping method" "false"
// "Disable 'Extract to separate mapping method'" "false"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'y' to separate mapping method" "true"
// "Extract variable 'y' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 's' to separate mapping method" "true"
// "Extract variable 's' to 'mapToObj' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'i' to separate mapping method" "true"
// "Extract variable 'i' to 'mapToInt' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'i' to separate mapping method" "false"
// "Disable 'Extract to separate mapping method'" "false"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'fn' to separate mapping method" "true"
// "Extract variable 'fn' to 'map' operation" "true"
import java.util.*;
import java.util.function.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'set' to separate mapping method" "true"
// "Extract variable 'set' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'y' to separate mapping method" "true"
// "Extract variable 'y' to 'map' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'l' to separate mapping method" "true"
// "Extract variable 'l' to 'asLongStream' operation" "true"
import java.util.*;
import java.util.stream.*;
@@ -1,4 +1,4 @@
// "Extract variable 'lc' to separate mapping method" "true"
// "Extract variable 'lc' to 'thenApply' operation" "true"
import java.util.concurrent.CompletableFuture;
public class Test {