diff options
author | Matteo Mara <matteo.mara@sonarsource.com> | 2023-01-10 15:16:50 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-01-10 20:03:01 +0000 |
commit | 54b60b1adac5b703398163ee5edf5a621efc0d24 (patch) | |
tree | 2c4595fea6ddefca2b5f33cc9c26000ffb5750ce /server/sonar-webserver-pushapi | |
parent | 295a87208f8c9898fbdc733a438587dc03a16877 (diff) | |
download | sonarqube-54b60b1adac5b703398163ee5edf5a621efc0d24.tar.gz sonarqube-54b60b1adac5b703398163ee5edf5a621efc0d24.zip |
[NO-JIRA] Remove reported code smells about usages of toList
Diffstat (limited to 'server/sonar-webserver-pushapi')
-rw-r--r-- | server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java b/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java index 37ff4e45463..23fd0db37a8 100644 --- a/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java +++ b/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java @@ -98,14 +98,14 @@ public class QualityProfileChangeEventServiceImpl implements QualityProfileChang try (DbSession dbSession = dbClient.openSession(false)) { List<OrgActiveRuleDto> activeRuleDtos = dbClient.activeRuleDao().selectByProfile(dbSession, profileDto); - List<String> activeRuleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getUuid).collect(Collectors.toList()); + List<String> activeRuleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getUuid).toList(); Map<String, List<ActiveRuleParamDto>> paramsByActiveRuleUuid = dbClient.activeRuleDao().selectParamsByActiveRuleUuids(dbSession, activeRuleUuids) .stream().collect(Collectors.groupingBy(ActiveRuleParamDto::getActiveRuleUuid)); Map<String, String> activeRuleUuidByRuleUuid = activeRuleDtos.stream().collect(Collectors.toMap(ActiveRuleDto::getRuleUuid, ActiveRuleDto::getUuid)); - List<String> ruleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getRuleUuid).collect(Collectors.toList()); + List<String> ruleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getRuleUuid).toList(); List<RuleDto> ruleDtos = dbClient.ruleDao().selectByUuids(dbSession, ruleUuids); for (RuleDto ruleDto : ruleDtos) { @@ -124,7 +124,7 @@ public class QualityProfileChangeEventServiceImpl implements QualityProfileChang try (DbSession dbSession = dbClient.openSession(false)) { List<OrgActiveRuleDto> activeRuleDtos = dbClient.activeRuleDao().selectByProfile(dbSession, profileDto); - List<String> ruleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getRuleUuid).collect(Collectors.toList()); + List<String> ruleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getRuleUuid).toList(); List<RuleDto> ruleDtos = dbClient.ruleDao().selectByUuids(dbSession, ruleUuids); for (RuleDto ruleDto : ruleDtos) { @@ -280,7 +280,7 @@ public class QualityProfileChangeEventServiceImpl implements QualityProfileChang .stream() .map(profile -> getQualityProfileAssociatedProjects(dbSession, profile)) .flatMap(Collection::stream) - .collect(Collectors.toList()); + .toList(); } private List<ProjectDto> getQualityProfileAssociatedProjects(DbSession dbSession, QProfileDto profile) { |