From 22b8b6d4ad713c4abbca5c9b992e873499246b83 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Thu, 17 Nov 2022 14:33:31 +0100 Subject: [PATCH] [NO JIRA] Remove unused code --- .../src/main/java/org/sonar/db/MyBatis.java | 2 - .../java/org/sonar/db/audit/AuditMapper.java | 2 - .../db/component/ApplicationProjectsDao.java | 4 - .../component/ApplicationProjectsMapper.java | 2 - .../org/sonar/db/component/BranchDao.java | 4 - .../org/sonar/db/component/BranchMapper.java | 3 - .../component/ComponentDtoWithSnapshotId.java | 33 ------- .../sonar/db/component/ComponentMapper.java | 2 - .../java/org/sonar/db/issue/IssueDao.java | 9 -- .../java/org/sonar/db/issue/IssueMapper.java | 2 - .../org/sonar/db/measure/LiveMeasureDao.java | 4 - .../db/newcodeperiod/NewCodePeriodDao.java | 7 -- .../db/newcodeperiod/NewCodePeriodParser.java | 4 - .../template/PermissionTemplateMapper.java | 8 -- .../org/sonar/db/plugin/PluginMapper.java | 1 - .../org/sonar/db/project/ProjectMapper.java | 2 - .../sonar/db/property/PropertiesMapper.java | 2 - .../qualitygate/ProjectQgateAssociation.java | 79 ---------------- .../db/qualityprofile/ActiveRuleMapper.java | 3 - .../sonar/db/rule/RuleRepositoryMapper.java | 3 - .../org/sonar/db/user/GroupMembershipDao.java | 9 -- .../sonar/db/user/GroupMembershipMapper.java | 2 - .../org/sonar/db/audit/AuditMapper.xml | 11 --- .../component/ApplicationProjectsMapper.xml | 9 -- .../org/sonar/db/component/BranchMapper.xml | 7 -- .../sonar/db/component/ComponentMapper.xml | 4 - .../org/sonar/db/issue/IssueMapper.xml | 60 ------------ .../template/PermissionTemplateMapper.xml | 34 ------- .../org/sonar/db/project/ProjectMapper.xml | 10 +- .../sonar/db/property/PropertiesMapper.xml | 12 --- .../db/qualityprofile/ActiveRuleMapper.xml | 14 --- .../java/org/sonar/db/issue/IssueDaoTest.java | 92 ------------------- .../exception/RedirectionException.java | 25 ----- .../exception/package-info.java | 23 ----- 34 files changed, 1 insertion(+), 487 deletions(-) delete mode 100644 server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDtoWithSnapshotId.java delete mode 100644 server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociation.java delete mode 100644 server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/exception/RedirectionException.java delete mode 100644 server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/exception/package-info.java diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java index 72f8c31e770..07919816261 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java @@ -50,7 +50,6 @@ import org.sonar.db.component.AnalysisPropertyValuePerProject; import org.sonar.db.component.ApplicationProjectsMapper; import org.sonar.db.component.BranchMapper; import org.sonar.db.component.ComponentDto; -import org.sonar.db.component.ComponentDtoWithSnapshotId; import org.sonar.db.component.ComponentKeyUpdaterMapper; import org.sonar.db.component.ComponentMapper; import org.sonar.db.component.ComponentWithModuleUuidDto; @@ -194,7 +193,6 @@ public class MyBatis { confBuilder.loadAlias("CeTaskCharacteristic", CeTaskCharacteristicDto.class); confBuilder.loadAlias("Component", ComponentDto.class); confBuilder.loadAlias("ComponentWithModuleUuid", ComponentWithModuleUuidDto.class); - confBuilder.loadAlias("ComponentWithSnapshot", ComponentDtoWithSnapshotId.class); confBuilder.loadAlias("DuplicationUnit", DuplicationUnitDto.class); confBuilder.loadAlias("Event", EventDto.class); confBuilder.loadAlias("FilePathWithHash", FilePathWithHashDto.class); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditMapper.java index 398d50b9e8e..2e2c85a9eca 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditMapper.java @@ -27,8 +27,6 @@ public interface AuditMapper { void insert(@Param("dto") AuditDto auditDto); - void delete(@Param("uuids") List uuids); - List selectByPeriodPaginated(@Param("start")long start, @Param("end") long end, @Param("pagination") Pagination pagination); List selectOlderThan(@Param("beforeTimestamp") long beforeTimestamp); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsDao.java index 18b9e3272d2..ec0a3b1513b 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsDao.java @@ -102,10 +102,6 @@ public class ApplicationProjectsDao implements Dao { return session.getMapper(ApplicationProjectsMapper.class); } - public void updateApplicationBranchName(DbSession dbSession, String applicationBranchUuid, String newName) { - getMapper(dbSession).updateApplicationBranchName(applicationBranchUuid, newName); - } - public void removeAllProjectBranchesOfAppBranch(DbSession dbSession, String applicationBranchUuid) { getMapper(dbSession).removeAllProjectBranchesOfAppBranch(applicationBranchUuid); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsMapper.java index 4ef0376269f..8fcf9b64238 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ApplicationProjectsMapper.java @@ -61,8 +61,6 @@ public interface ApplicationProjectsMapper { int countApplicationProjects(@Param("applicationUuid") String applicationUuid); - void updateApplicationBranchName(@Param("uuid") String uuid, @Param("newName") String newName); - Set selectApplicationsFromProjectBranch(@Param("projectUuid") String projectUuid, @Param("branchKey") String branchKey); Set selectApplicationsFromProjects(@Param("projectUuids") Collection projectUuids); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDao.java index 39242c80ac6..1dff7ccc75b 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDao.java @@ -165,10 +165,6 @@ public class BranchDao implements Dao { return mapper(dbSession).updateNeedIssueSync(branchUuid, needIssueSync, now); } - public void deleteBranch(DbSession dbSession, String projectUuid, String branchKey) { - mapper(dbSession).deleteBranch(projectUuid, branchKey); - } - public boolean doAnyOfComponentsNeedIssueSync(DbSession session, List components) { if (!components.isEmpty()) { List result = new LinkedList<>(); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchMapper.java index 691ef746cbd..eebd797906a 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchMapper.java @@ -34,8 +34,6 @@ public interface BranchMapper { int updateMainBranchName(@Param("projectUuid") String projectUuid, @Param("newBranchName") String newBranchName, @Param("now") long now); - int updateManualBaseline(@Param("uuid") String uuid, @Nullable @Param("analysisUuid") String analysisUuid, @Param("now") long now); - int updateExcludeFromPurge(@Param("uuid") String uuid, @Param("excludeFromPurge") boolean excludeFromPurge, @Param("now") long now); @@ -75,5 +73,4 @@ public interface BranchMapper { short doAnyOfComponentsNeedIssueSync(@Param("componentKeys") List components); - void deleteBranch(@Param("projectUuid") String projectUuid, @Param("branchKey") String branchKey); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDtoWithSnapshotId.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDtoWithSnapshotId.java deleted file mode 100644 index c8c48686304..00000000000 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDtoWithSnapshotId.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.component; - -public class ComponentDtoWithSnapshotId extends ComponentDto { - private Long snapshotId; - - public Long getSnapshotId() { - return snapshotId; - } - - public ComponentDtoWithSnapshotId setSnapshotId(Long snapshotId) { - this.snapshotId = snapshotId; - return this; - } -} diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentMapper.java index f669ff574df..52340ca7660 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentMapper.java @@ -132,8 +132,6 @@ public interface ComponentMapper { void setPrivateForRootComponentUuid(@Param("branchUuid") String branchUuid, @Param("isPrivate") boolean isPrivate); - void delete(String componentUuid); - List selectComponentsFromPullRequestsTargetingCurrentBranchThatHaveOpenIssues(@Param("referenceBranchUuid") String referenceBranchUuid, @Param("currentBranchUuid") String currentBranchUuid); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java index 80ccda2b0d7..f2fa7be583f 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java @@ -71,11 +71,6 @@ public class IssueDao implements Dao { languages, Pagination.forPage(page).andSize(BIG_PAGE_SIZE)); } - public Set selectIssueKeysByComponentUuidAndChangedSinceDate(DbSession session, String componentUuid, long changedSince, int page) { - return selectIssueKeysByComponentUuidAndChangedSinceDate(session, componentUuid, changedSince, emptyList(), emptyList(), - emptyList(), page); - } - public Set selectIssueKeysByComponentUuidAndChangedSinceDate(DbSession session, String componentUuid, long changedSince, List includingRepositories, List excludingRepositories, List languages, int page) { @@ -108,10 +103,6 @@ public class IssueDao implements Dao { return executeLargeInputs(componentUuids, mapper(dbSession)::selectOpenByComponentUuids); } - public Collection selectBranchHotspotsCount(DbSession dbSession, String branchUuid, long leakPeriodBeginningDate) { - return mapper(dbSession).selectBranchHotspotsCount(branchUuid, leakPeriodBeginningDate); - } - public Collection selectIssueGroupsByComponent(DbSession dbSession, ComponentDto component, long leakPeriodBeginningDate) { return mapper(dbSession).selectIssueGroupsByComponent(component, leakPeriodBeginningDate); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java index f040fc89480..ff0d7a33731 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java @@ -76,8 +76,6 @@ public interface IssueMapper { List selectNonClosedByModuleOrProject(@Param("projectUuid") String projectUuid, @Param("likeModuleUuidPath") String likeModuleUuidPath); - Collection selectBranchHotspotsCount(@Param("rootUuid") String rootUuid, @Param("leakPeriodBeginningDate") long leakPeriodBeginningDate); - Collection selectIssueGroupsByComponent(@Param("component") ComponentDto component, @Param("leakPeriodBeginningDate") long leakPeriodBeginningDate); List selectByBranch(@Param("keys") Set keys, @Nullable @Param("changedSince") Long changedSince); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/LiveMeasureDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/LiveMeasureDao.java index 7bbdd0c44e6..b1cb9d7362f 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/LiveMeasureDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/LiveMeasureDao.java @@ -113,10 +113,6 @@ public class LiveMeasureDao implements Dao { mapper(dbSession).insert(dto, Uuids.create(), system2.now()); } - public void update(DbSession dbSession, LiveMeasureDto dto) { - mapper(dbSession).update(dto, system2.now()); - } - public void insertOrUpdate(DbSession dbSession, LiveMeasureDto dto) { LiveMeasureMapper mapper = mapper(dbSession); long now = system2.now(); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodDao.java index 82b2d02702b..c59df0ef221 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodDao.java @@ -90,13 +90,6 @@ public class NewCodePeriodDao implements Dao { return ofNullable(mapper(dbSession).selectByBranch(projectUuid, branchUuid)); } - public NewCodePeriodDto selectBestMatchForBranch(DbSession dbSession, String projectUuid, String branchUuid) { - return selectByBranch(dbSession, projectUuid, branchUuid) - .or(() -> selectByProject(dbSession, projectUuid) - .or(() -> selectGlobal(dbSession))) - .orElse(NewCodePeriodDto.defaultInstance()); - } - public Set selectBranchesReferencing(DbSession dbSession, String projectUuid, String referenceBranchName) { return mapper(dbSession).selectBranchesReferencing(projectUuid, referenceBranchName); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodParser.java b/server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodParser.java index bd34248c777..fb0631c7d72 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodParser.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/newcodeperiod/NewCodePeriodParser.java @@ -26,10 +26,6 @@ public class NewCodePeriodParser { // static only } - public static LocalDate parseDate(String value) { - return LocalDate.parse(value); - } - public static int parseDays(String value) { return Integer.parseInt(value); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateMapper.java index e20f17a29f9..7fa547b06e2 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/permission/template/PermissionTemplateMapper.java @@ -38,20 +38,14 @@ public interface PermissionTemplateMapper { int deleteByUuid(String templateUuid); - void deleteByUuids(@Param("templateUuids") List templateUuids); - void deleteUserPermissionsByTemplateUuid(String templateUuid); - void deleteUserPermissionsByTemplateUuids(@Param("templateUuids") List templateUuids); - int deleteUserPermissionsByUserUuid(@Param("userUuid") String userUuid); int deleteUserPermission(PermissionTemplateUserDto permissionTemplateUser); void deleteGroupPermissionsByTemplateUuid(String templateUuid); - void deleteGroupPermissionsByTemplateUuids(@Param("templateUuids") List templateUuids); - int deleteGroupPermission(PermissionTemplateGroupDto permissionTemplateGroup); PermissionTemplateDto selectByUuid(String templateUuid); @@ -86,8 +80,6 @@ public interface PermissionTemplateMapper { int countGroupsWithPermission(@Param("templateUuid") String templateUuid, @Param("permission") String permission, @Nullable @Param("groupUuid") String groupUuid); - List selectTemplateUuids(); - List selectAllGroupPermissionTemplatesByGroupUuid(@Param("groupUuid") String groupUuid); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/plugin/PluginMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/plugin/PluginMapper.java index d71ce79afec..c14edc192e8 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/plugin/PluginMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/plugin/PluginMapper.java @@ -34,5 +34,4 @@ public interface PluginMapper { void update(PluginDto dto); - void delete(@Param("uuid") String uuid); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java index 3fc983b8eb4..3b2b3096964 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java @@ -47,8 +47,6 @@ public interface ProjectMapper { List selectAll(); - void updateKey(@Param("uuid") String uuid, @Param("newKey") String newKey, @Param("updatedAt") long updatedAt); - void updateTags(ProjectDto project); void update(ProjectDto project); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java index 47006f65dbd..50faa522fa8 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java @@ -34,8 +34,6 @@ public interface PropertiesMapper { List selectGlobalProperties(); - List selectProjectProperties(String resourceKey); - PropertyDto selectByKey(PropertyDto key); List selectByKeys(@Param("keys") List keys); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociation.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociation.java deleted file mode 100644 index e910bb49987..00000000000 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociation.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.qualitygate; - -import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.commons.lang.builder.ToStringStyle; - -public class ProjectQgateAssociation { - - private Long id; - private String name; - private boolean isMember; - - public Long id() { - return id; - } - - public ProjectQgateAssociation setId(Long id) { - this.id = id; - return this; - } - - public String name() { - return name; - } - - public ProjectQgateAssociation setName(String name) { - this.name = name; - return this; - } - - public boolean isMember() { - return isMember; - } - - public ProjectQgateAssociation setMember(boolean isMember) { - this.isMember = isMember; - return this; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectQgateAssociation that = (ProjectQgateAssociation) o; - return name.equals(that.name); - } - - @Override - public int hashCode() { - return name.hashCode(); - } -} diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java index 968adaa370f..060fdf65549 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java @@ -43,8 +43,6 @@ public interface ActiveRuleMapper { @CheckForNull ActiveRuleDto selectByKey(@Param("ruleProfileUuid") String ruleProfileUuid, @Param("repository") String repository, @Param("rule") String rule); - List selectByKeys(@Param("keys") List keys); - List selectOrgByRuleUuid(@Param("ruleUuid") String ruleUuid); List selectByRuleUuid(String ruleUuid); @@ -86,5 +84,4 @@ public interface ActiveRuleMapper { void scrollByRuleProfileUuidForIndexing(@Param("ruleProfileUuid") String ruleProfileUuid, ResultHandler handler); - List selectByQualityProfileUuid(@Param("qualityProfileUuid") String qualityProfileUuid); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryMapper.java index 6a2c9d2c119..fbb70f7e5ba 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryMapper.java @@ -34,9 +34,6 @@ public interface RuleRepositoryMapper { List selectByQueryAndLanguage(@Param("query") String query,@Param("language") @Nullable String language); - @CheckForNull - RuleRepositoryDto selectByKey(@Param("key") String key); - void insert(@Param("repository") RuleRepositoryDto repository, @Param("now") long now); void update(@Param("repository") RuleRepositoryDto repository); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipDao.java index 67e8fbc5467..40c1c872f20 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipDao.java @@ -70,15 +70,6 @@ public class GroupMembershipDao implements Dao { return result; } - public Map countGroupsByUsers(DbSession dbSession, List logins) { - List loginGroupCount = mapper(dbSession).countGroupsByUsers(logins); - Map map = new HashMap<>(); - for (LoginGroupCount l : loginGroupCount) { - map.put(l.login(), l.groupCount()); - } - return map; - } - public List selectGroupUuidsByUserUuid(DbSession dbSession, String userUuid) { return mapper(dbSession).selectGroupUuidsByUserUuid(userUuid); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipMapper.java index d3577a92cd9..d05947b4e09 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipMapper.java @@ -36,8 +36,6 @@ public interface GroupMembershipMapper { List countUsersByGroup(@Param("groupUuids") List groupUuids); - List countGroupsByUsers(@Param("logins") List logins); - List selectGroupsByLogins(@Param("logins") List logins); List selectGroupUuidsByUserUuid(@Param("userUuid") String userUuid); diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/audit/AuditMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/audit/AuditMapper.xml index f0d9c9249b4..edf3aaa7329 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/audit/AuditMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/audit/AuditMapper.xml @@ -110,15 +110,4 @@ where uuid in (select a.uuid from audits a where a.created_at < #{threshold,jdbcType=BIGINT} order by a.created_at fetch first 100000 rows only) - - - delete - from audits - where - uuid in - - #{uuid,jdbcType=VARCHAR} - - - diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ApplicationProjectsMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ApplicationProjectsMapper.xml index 747ce122c2b..0217e510910 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ApplicationProjectsMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ApplicationProjectsMapper.xml @@ -158,15 +158,6 @@ ap.application_uuid = #{applicationUuid,jdbcType=VARCHAR} - - UPDATE - project_branches - SET - kee = #{newName,jdbcType=VARCHAR} - WHERE - uuid = #{uuid,jdbcType=VARCHAR} - - SELECT DISTINCT p.kee as kee, p.uuid as uuid FROM components p JOIN issues i diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/issue/IssueMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/issue/IssueMapper.xml index 84824708ea9..655c142af2e 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/issue/IssueMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/issue/IssueMapper.xml @@ -359,66 +359,6 @@ i.issue_type <> 4 - - - - - - - - - - - -