Skip to content

Commit

Permalink
Add new SonarCloud suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Apr 25, 2023
1 parent 06c8a0b commit 653403b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ Optional<T> after(Stream<T> stream) {

static final class StreamMax<T> {
@BeforeTemplate
@SuppressWarnings("java:S1155" /* This violation will be rewritten. */)
Optional<T> before(Stream<T> stream, Comparator<? super T> comparator) {
return Refaster.anyOf(
stream.min(comparator.reversed()),
Expand Down Expand Up @@ -410,6 +411,7 @@ boolean after(Stream<T> stream) {

static final class StreamMapToIntSum<T> {
@BeforeTemplate
@SuppressWarnings("java:S1155" /* This violation will be rewritten. */)
long before(Stream<T> stream, ToIntFunction<T> mapper) {
return stream.collect(summingInt(mapper));
}
Expand All @@ -429,6 +431,7 @@ int after(Stream<T> stream, ToIntFunction<T> mapper) {

static final class StreamMapToDoubleSum<T> {
@BeforeTemplate
@SuppressWarnings("java:S1155" /* This violation will be rewritten. */)
double before(Stream<T> stream, ToDoubleFunction<T> mapper) {
return stream.collect(summingDouble(mapper));
}
Expand All @@ -448,6 +451,7 @@ static final class StreamMapToDoubleSum<T> {

static final class StreamMapToLongSum<T> {
@BeforeTemplate
@SuppressWarnings("java:S1155" /* This violation will be rewritten. */)
long before(Stream<T> stream, ToLongFunction<T> mapper) {
return stream.collect(summingLong(mapper));
}
Expand Down Expand Up @@ -503,6 +507,7 @@ LongSummaryStatistics after(Stream<T> stream, ToLongFunction<T> mapper) {

static final class StreamCount<T> {
@BeforeTemplate
@SuppressWarnings("java:S1155" /* This violation will be rewritten. */)
long before(Stream<T> stream) {
return stream.collect(counting());
}
Expand All @@ -515,6 +520,7 @@ long after(Stream<T> stream) {

static final class StreamReduce<T> {
@BeforeTemplate
@SuppressWarnings("java:S1155" /* This violation will be rewritten. */)
Optional<T> before(Stream<T> stream, BinaryOperator<T> accumulator) {
return stream.collect(reducing(accumulator));
}
Expand All @@ -527,6 +533,7 @@ Optional<T> after(Stream<T> stream, BinaryOperator<T> accumulator) {

static final class StreamReduceWithIdentity<T> {
@BeforeTemplate
@SuppressWarnings("java:S1155" /* This violation will be rewritten. */)
T before(Stream<T> stream, T identity, BinaryOperator<T> accumulator) {
return stream.collect(reducing(identity, accumulator));
}
Expand All @@ -553,6 +560,7 @@ R after(

static final class StreamMapCollect<T, U, R> {
@BeforeTemplate
@SuppressWarnings("java:S1155" /* This violation will be rewritten. */)
R before(
Stream<T> stream,
Function<? super T, ? extends U> mapper,
Expand Down

0 comments on commit 653403b

Please sign in to comment.