diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-04-03 15:13:02 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-04-03 15:13:02 +0200 |
commit | 68af82a779fc632759c607d31ed6258a015a35c4 (patch) | |
tree | 96716855bc9c3f0140e5f610361be342be4cb307 /sonar-core | |
parent | 1856d055923715759ed71a42ab1ff0deabf809f9 (diff) | |
download | sonarqube-68af82a779fc632759c607d31ed6258a015a35c4.tar.gz sonarqube-68af82a779fc632759c607d31ed6258a015a35c4.zip |
rename Collectors to MoreCollectors
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java | 2 | ||||
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java (renamed from sonar-core/src/main/java/org/sonar/core/util/stream/Collectors.java) | 8 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/util/stream/MoreCollectorsTest.java (renamed from sonar-core/src/test/java/org/sonar/core/util/stream/CollectorsTest.java) | 18 |
3 files changed, 14 insertions, 14 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java b/sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java index 2a67bc6bf8a..6406336c580 100644 --- a/sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java +++ b/sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java @@ -63,7 +63,7 @@ import static org.sonar.api.measures.CoreMetrics.TEST_EXECUTION_TIME; import static org.sonar.api.measures.CoreMetrics.TEST_FAILURES; import static org.sonar.api.measures.CoreMetrics.UNCOVERED_CONDITIONS; import static org.sonar.api.measures.CoreMetrics.UNCOVERED_LINES; -import static org.sonar.core.util.stream.Collectors.toSet; +import static org.sonar.core.util.stream.MoreCollectors.toSet; /** * This class is used to know the list of metrics that can be sent in the analysis report. diff --git a/sonar-core/src/main/java/org/sonar/core/util/stream/Collectors.java b/sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java index ae28d03fc03..64616cf921d 100644 --- a/sonar-core/src/main/java/org/sonar/core/util/stream/Collectors.java +++ b/sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java @@ -38,11 +38,11 @@ import java.util.stream.Collector; import static java.util.Objects.requireNonNull; -public final class Collectors { +public final class MoreCollectors { private static final int DEFAULT_HASHMAP_CAPACITY = 0; - private Collectors() { + private MoreCollectors() { // prevents instantiation } @@ -118,7 +118,7 @@ public final class Collectors { } /** - * Does {@code java.util.stream.Collectors.toCollection(() -> new ArrayList<>(size));} which is equivalent to + * Does {@code java.util.stream.MoreCollectors.toCollection(() -> new ArrayList<>(size));} which is equivalent to * {@link #toArrayList()} but avoiding array copies when the size of the resulting list is already known. * * <p>Note: using this method with a parallel stream will likely not have the expected memory usage benefit as all @@ -139,7 +139,7 @@ public final class Collectors { } /** - * Does {@code java.util.stream.Collectors.toCollection(() -> new HashSet<>(size));} which is equivalent to + * Does {@code java.util.stream.MoreCollectors.toCollection(() -> new HashSet<>(size));} which is equivalent to * {@link #toHashSet()} but avoiding array copies when the size of the resulting set is already known. * * <p>Note: using this method with a parallel stream will likely not have the expected memory usage benefit as all diff --git a/sonar-core/src/test/java/org/sonar/core/util/stream/CollectorsTest.java b/sonar-core/src/test/java/org/sonar/core/util/stream/MoreCollectorsTest.java index d15ae533cf6..8a1e1c01a82 100644 --- a/sonar-core/src/test/java/org/sonar/core/util/stream/CollectorsTest.java +++ b/sonar-core/src/test/java/org/sonar/core/util/stream/MoreCollectorsTest.java @@ -40,15 +40,15 @@ import org.junit.rules.ExpectedException; import static java.util.function.Function.identity; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; -import static org.sonar.core.util.stream.Collectors.index; -import static org.sonar.core.util.stream.Collectors.join; -import static org.sonar.core.util.stream.Collectors.toArrayList; -import static org.sonar.core.util.stream.Collectors.toHashSet; -import static org.sonar.core.util.stream.Collectors.toList; -import static org.sonar.core.util.stream.Collectors.toSet; -import static org.sonar.core.util.stream.Collectors.uniqueIndex; - -public class CollectorsTest { +import static org.sonar.core.util.stream.MoreCollectors.index; +import static org.sonar.core.util.stream.MoreCollectors.join; +import static org.sonar.core.util.stream.MoreCollectors.toArrayList; +import static org.sonar.core.util.stream.MoreCollectors.toHashSet; +import static org.sonar.core.util.stream.MoreCollectors.toList; +import static org.sonar.core.util.stream.MoreCollectors.toSet; +import static org.sonar.core.util.stream.MoreCollectors.uniqueIndex; + +public class MoreCollectorsTest { private static final List<String> HUGE_LIST = IntStream.range(0, 2_000).mapToObj(String::valueOf).collect(java.util.stream.Collectors.toList()); private static final Set<String> HUGE_SET = new HashSet<>(HUGE_LIST); |