diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StreamRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StreamRules.java index 274731f57e4..a9f599392d9 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StreamRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/StreamRules.java @@ -626,20 +626,9 @@ R after( } } - static final class StreamConcat { - @BeforeTemplate - Stream before(Stream s1, Stream s2) { - return Stream.of(s1, s2).flatMap(Function.identity()); - } - - @AfterTemplate - Stream after(Stream s1, Stream s2) { - return Stream.concat(s1, s2); - } - } - static final class StreamsConcat { @BeforeTemplate + @SuppressWarnings("StreamOfArray") Stream before(@Repeated Stream stream) { return Stream.of(Refaster.asVarargs(stream)).flatMap(Function.identity()); } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestInput.java index e4aa2da0e94..b3c3bfee94a 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestInput.java @@ -251,10 +251,6 @@ ImmutableSet testStreamFlatMapCollect() { return Stream.of(1).collect(flatMapping(n -> Stream.of(n, n), toImmutableSet())); } - Stream testStreamConcat() { - return Stream.of(Stream.of(1), Stream.of(2)).flatMap(Function.identity()); - } - Stream testStreamsConcat() { return Stream.of(Stream.of(1), Stream.of(2), Stream.of(3), Stream.of(4)) .flatMap(Function.identity()); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestOutput.java index 3c7260f3719..14066851e8f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/StreamRulesTestOutput.java @@ -252,10 +252,6 @@ ImmutableSet testStreamFlatMapCollect() { return Stream.of(1).flatMap(n -> Stream.of(n, n)).collect(toImmutableSet()); } - Stream testStreamConcat() { - return Stream.concat(Stream.of(1), Stream.of(2)); - } - Stream testStreamsConcat() { return Streams.concat(Stream.of(1), Stream.of(2), Stream.of(3), Stream.of(4)); }