diff options
author | Pierre <pierre.guillot@sonarsource.com> | 2020-12-08 13:01:37 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-12-09 20:07:21 +0000 |
commit | 2ac64829407349d696108c9d09c70d7ea2ad266a (patch) | |
tree | 8ac9725c0d669fa1187935726960c613b6352e15 /sonar-plugin-api/src/main | |
parent | fc6b79aaba37e38c01a5cac7d061b401a17947f8 (diff) | |
download | sonarqube-2ac64829407349d696108c9d09c70d7ea2ad266a.tar.gz sonarqube-2ac64829407349d696108c9d09c70d7ea2ad266a.zip |
remove use of Stream.peek()
Diffstat (limited to 'sonar-plugin-api/src/main')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java index 45d5fcc3184..cb20a4195f6 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java @@ -20,6 +20,7 @@ package org.sonar.api.config; import java.util.ArrayList; +import java.util.Arrays; import java.util.EnumMap; import java.util.LinkedHashSet; import java.util.List; @@ -510,11 +511,15 @@ public final class PropertyDefinition { } private static void addQualifiers(List<String> target, String first, String... rest) { - Stream.concat(Stream.of(first), stream(rest)).peek(PropertyDefinition.Builder::validateQualifier).forEach(target::add); + List<String> qualifiers = new ArrayList<>(); + qualifiers.add(first); + qualifiers.addAll(Arrays.asList(rest)); + addQualifiers(target, qualifiers); } private static void addQualifiers(List<String> target, List<String> qualifiers) { - qualifiers.stream().peek(PropertyDefinition.Builder::validateQualifier).forEach(target::add); + qualifiers.forEach(PropertyDefinition.Builder::validateQualifier); + target.addAll(qualifiers); } private static void validateQualifier(@Nullable String qualifier) { |