From 54b60b1adac5b703398163ee5edf5a621efc0d24 Mon Sep 17 00:00:00 2001 From: Matteo Mara Date: Tue, 10 Jan 2023 15:16:50 +0100 Subject: [NO-JIRA] Remove reported code smells about usages of toList --- .../qualityprofile/QualityProfileChangeEventServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/sonar-webserver-pushapi') 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 activeRuleDtos = dbClient.activeRuleDao().selectByProfile(dbSession, profileDto); - List activeRuleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getUuid).collect(Collectors.toList()); + List activeRuleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getUuid).toList(); Map> paramsByActiveRuleUuid = dbClient.activeRuleDao().selectParamsByActiveRuleUuids(dbSession, activeRuleUuids) .stream().collect(Collectors.groupingBy(ActiveRuleParamDto::getActiveRuleUuid)); Map activeRuleUuidByRuleUuid = activeRuleDtos.stream().collect(Collectors.toMap(ActiveRuleDto::getRuleUuid, ActiveRuleDto::getUuid)); - List ruleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getRuleUuid).collect(Collectors.toList()); + List ruleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getRuleUuid).toList(); List 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 activeRuleDtos = dbClient.activeRuleDao().selectByProfile(dbSession, profileDto); - List ruleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getRuleUuid).collect(Collectors.toList()); + List ruleUuids = activeRuleDtos.stream().map(ActiveRuleDto::getRuleUuid).toList(); List 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 getQualityProfileAssociatedProjects(DbSession dbSession, QProfileDto profile) { -- cgit v1.2.3