aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-auth-saml
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2023-01-10 15:16:50 +0100
committersonartech <sonartech@sonarsource.com>2023-01-10 20:03:01 +0000
commit54b60b1adac5b703398163ee5edf5a621efc0d24 (patch)
tree2c4595fea6ddefca2b5f33cc9c26000ffb5750ce /server/sonar-auth-saml
parent295a87208f8c9898fbdc733a438587dc03a16877 (diff)
downloadsonarqube-54b60b1adac5b703398163ee5edf5a621efc0d24.tar.gz
sonarqube-54b60b1adac5b703398163ee5edf5a621efc0d24.zip
[NO-JIRA] Remove reported code smells about usages of toList
Diffstat (limited to 'server/sonar-auth-saml')
-rw-r--r--server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlStatusChecker.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlStatusChecker.java b/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlStatusChecker.java
index cf9ce133f80..4ed1f7967da 100644
--- a/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlStatusChecker.java
+++ b/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlStatusChecker.java
@@ -27,7 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
-import java.util.stream.Collectors;
import static org.sonar.auth.saml.SamlSettings.GROUP_NAME_ATTRIBUTE;
import static org.sonar.auth.saml.SamlSettings.USER_EMAIL_ATTRIBUTE;
@@ -50,7 +49,7 @@ public final class SamlStatusChecker {
samlAuthenticationStatus.getErrors().add(e.getMessage());
}
- samlAuthenticationStatus.getErrors().addAll(auth.getErrors().stream().filter(Objects::nonNull).collect(Collectors.toList()));
+ samlAuthenticationStatus.getErrors().addAll(auth.getErrors().stream().filter(Objects::nonNull).toList());
if (auth.getLastErrorReason() != null) {
samlAuthenticationStatus.getErrors().add(auth.getLastErrorReason());
}
@@ -122,7 +121,7 @@ public final class SamlStatusChecker {
.stream()
.filter(entry -> !entry.getValue().isEmpty() && (auth.getAttribute(entry.getValue()) == null || auth.getAttribute(entry.getValue()).isEmpty()))
.map(entry -> String.format("Mapping not found for the property %s, the field %s is not available in the SAML response.", entry.getKey(), entry.getValue()))
- .collect(Collectors.toList());
+ .toList();
}
}