From 653403b106900b61f623b4af3ed4ebfa580b1a8b Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Tue, 25 Apr 2023 11:32:50 +0200 Subject: [PATCH] Add new SonarCloud suppressions --- .../tech/picnic/errorprone/refasterrules/StreamRules.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 02aed995576..bdfce8f7f8f 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 @@ -308,6 +308,7 @@ Optional after(Stream stream) { static final class StreamMax { @BeforeTemplate + @SuppressWarnings("java:S1155" /* This violation will be rewritten. */) Optional before(Stream stream, Comparator comparator) { return Refaster.anyOf( stream.min(comparator.reversed()), @@ -410,6 +411,7 @@ boolean after(Stream stream) { static final class StreamMapToIntSum { @BeforeTemplate + @SuppressWarnings("java:S1155" /* This violation will be rewritten. */) long before(Stream stream, ToIntFunction mapper) { return stream.collect(summingInt(mapper)); } @@ -429,6 +431,7 @@ int after(Stream stream, ToIntFunction mapper) { static final class StreamMapToDoubleSum { @BeforeTemplate + @SuppressWarnings("java:S1155" /* This violation will be rewritten. */) double before(Stream stream, ToDoubleFunction mapper) { return stream.collect(summingDouble(mapper)); } @@ -448,6 +451,7 @@ static final class StreamMapToDoubleSum { static final class StreamMapToLongSum { @BeforeTemplate + @SuppressWarnings("java:S1155" /* This violation will be rewritten. */) long before(Stream stream, ToLongFunction mapper) { return stream.collect(summingLong(mapper)); } @@ -503,6 +507,7 @@ LongSummaryStatistics after(Stream stream, ToLongFunction mapper) { static final class StreamCount { @BeforeTemplate + @SuppressWarnings("java:S1155" /* This violation will be rewritten. */) long before(Stream stream) { return stream.collect(counting()); } @@ -515,6 +520,7 @@ long after(Stream stream) { static final class StreamReduce { @BeforeTemplate + @SuppressWarnings("java:S1155" /* This violation will be rewritten. */) Optional before(Stream stream, BinaryOperator accumulator) { return stream.collect(reducing(accumulator)); } @@ -527,6 +533,7 @@ Optional after(Stream stream, BinaryOperator accumulator) { static final class StreamReduceWithIdentity { @BeforeTemplate + @SuppressWarnings("java:S1155" /* This violation will be rewritten. */) T before(Stream stream, T identity, BinaryOperator accumulator) { return stream.collect(reducing(identity, accumulator)); } @@ -553,6 +560,7 @@ R after( static final class StreamMapCollect { @BeforeTemplate + @SuppressWarnings("java:S1155" /* This violation will be rewritten. */) R before( Stream stream, Function mapper,