aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2019-11-06 13:34:22 -0600
committerSonarTech <sonartech@sonarsource.com>2019-12-09 20:46:15 +0100
commit63c9fb57a0f00f06c782cec8d2ffdf8d9e8b2f1b (patch)
tree05ab4e935651a5a1a52cdd4f0b43510794c58cd0 /server/sonar-db-dao
parent0a6525b3f63132a719e96a16233aef04fcf535cd (diff)
downloadsonarqube-63c9fb57a0f00f06c782cec8d2ffdf8d9e8b2f1b.tar.gz
sonarqube-63c9fb57a0f00f06c782cec8d2ffdf8d9e8b2f1b.zip
SONAR-12626 remove references to SLB
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java4
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java4
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java1
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentQuery.java2
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDao.java3
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueMapper.java2
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/issue/PrIssueDto.java (renamed from server/sonar-db-dao/src/main/java/org/sonar/db/issue/ShortBranchIssueDto.java)18
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/issue/IssueMapper.xml2
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java2
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/metric/MetricDtoTest.java3
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java1
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java1
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java3
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java2
14 files changed, 19 insertions, 29 deletions
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 a52af3d913e..79c428cf7e2 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
@@ -73,7 +73,7 @@ import org.sonar.db.issue.IssueChangeDto;
import org.sonar.db.issue.IssueChangeMapper;
import org.sonar.db.issue.IssueDto;
import org.sonar.db.issue.IssueMapper;
-import org.sonar.db.issue.ShortBranchIssueDto;
+import org.sonar.db.issue.PrIssueDto;
import org.sonar.db.mapping.ProjectMappingDto;
import org.sonar.db.mapping.ProjectMappingsMapper;
import org.sonar.db.measure.LiveMeasureMapper;
@@ -190,7 +190,6 @@ public class MyBatis implements Startable {
confBuilder.loadAlias("IssueChange", IssueChangeDto.class);
confBuilder.loadAlias("KeyLongValue", KeyLongValue.class);
confBuilder.loadAlias("Issue", IssueDto.class);
- confBuilder.loadAlias("ShortBranchIssue", ShortBranchIssueDto.class);
confBuilder.loadAlias("Measure", MeasureDto.class);
confBuilder.loadAlias("NotificationQueue", NotificationQueueDto.class);
confBuilder.loadAlias("Organization", OrganizationDto.class);
@@ -200,6 +199,7 @@ public class MyBatis implements Startable {
confBuilder.loadAlias("PermissionTemplate", PermissionTemplateDto.class);
confBuilder.loadAlias("PermissionTemplateUser", PermissionTemplateUserDto.class);
confBuilder.loadAlias("Plugin", PluginDto.class);
+ confBuilder.loadAlias("PrIssue", PrIssueDto.class);
confBuilder.loadAlias("ProjectAlmBinding", ProjectAlmBindingDto.class);
confBuilder.loadAlias("ProjectQgateAssociation", ProjectQgateAssociationDto.class);
confBuilder.loadAlias("ProjectMapping", ProjectMappingDto.class);
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java
index 17289805693..08dee30c11c 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java
@@ -74,8 +74,8 @@ public class BranchDto {
/**
* UUID of the branch:
- * - in which the short-lived branch or pull request will be merged into
- * - that is the base of long-lived branch.
+ * - in which the pull request will be merged into
+ * - that is the base of a branch.
* <p>
* Can be null if information is not known.
*/
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java
index 3b2802be577..214dfb66006 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java
@@ -42,7 +42,6 @@ import org.sonar.db.DbSession;
import static com.google.common.base.Preconditions.checkArgument;
import static org.sonar.core.component.ComponentKeys.checkProjectKey;
-import static org.sonar.core.component.ComponentKeys.isValidProjectKey;
/**
* Class used to rename the key of a project and its resources.
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentQuery.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentQuery.java
index c393546898d..77fd0367097 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentQuery.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentQuery.java
@@ -200,7 +200,7 @@ public class ComponentQuery {
/**
* Filter on date of last analysis. On projects, all branches and pull requests are taken into
- * account. For example the analysis of a short-lived branch is included in the filter
+ * account. For example the analysis of a branch is included in the filter
* even if the main branch has never been analyzed.
*/
public Builder setAnyBranchAnalyzedAfter(@Nullable Long l) {
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 60da3909145..5df0ed95259 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
@@ -23,7 +23,6 @@ import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.Set;
-
import org.sonar.db.Dao;
import org.sonar.db.DbSession;
import org.sonar.db.RowNotFoundException;
@@ -74,7 +73,7 @@ public class IssueDao implements Dao {
return mapper(dbSession).selectNonClosedByModuleOrProject(module.projectUuid(), likeModuleUuidPath);
}
- public List<ShortBranchIssueDto> selectOpenByComponentUuids(DbSession dbSession, Collection<String> componentUuids) {
+ public List<PrIssueDto> selectOpenByComponentUuids(DbSession dbSession, Collection<String> componentUuids) {
return executeLargeInputs(componentUuids, mapper(dbSession)::selectOpenByComponentUuids);
}
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 e399267440d..cece3bf833c 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
@@ -38,7 +38,7 @@ public interface IssueMapper {
List<IssueDto> selectByKeysIfNotUpdatedAt(@Param("keys") List<String> keys, @Param("updatedAt") long updatedAt);
- List<ShortBranchIssueDto> selectOpenByComponentUuids(List<String> componentUuids);
+ List<PrIssueDto> selectOpenByComponentUuids(List<String> componentUuids);
void insert(IssueDto issue);
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/ShortBranchIssueDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/PrIssueDto.java
index bdb34339ab8..cebbc06f3a0 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/ShortBranchIssueDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/PrIssueDto.java
@@ -27,7 +27,7 @@ import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.rule.RuleKey;
import org.sonar.db.component.KeyType;
-public final class ShortBranchIssueDto implements Serializable {
+public final class PrIssueDto implements Serializable {
private String kee;
private String message;
@@ -46,7 +46,7 @@ public final class ShortBranchIssueDto implements Serializable {
return kee;
}
- public ShortBranchIssueDto setKee(String s) {
+ public PrIssueDto setKee(String s) {
this.kee = s;
return this;
}
@@ -56,7 +56,7 @@ public final class ShortBranchIssueDto implements Serializable {
return message;
}
- public ShortBranchIssueDto setMessage(@Nullable String s) {
+ public PrIssueDto setMessage(@Nullable String s) {
this.message = s;
return this;
}
@@ -66,7 +66,7 @@ public final class ShortBranchIssueDto implements Serializable {
return line;
}
- public ShortBranchIssueDto setLine(@Nullable Integer i) {
+ public PrIssueDto setLine(@Nullable Integer i) {
this.line = i;
return this;
}
@@ -78,7 +78,7 @@ public final class ShortBranchIssueDto implements Serializable {
return branchKey;
}
- public ShortBranchIssueDto setBranchKey(String s) {
+ public PrIssueDto setBranchKey(String s) {
this.branchKey = s;
return this;
}
@@ -87,7 +87,7 @@ public final class ShortBranchIssueDto implements Serializable {
return keyType;
}
- public ShortBranchIssueDto setKeyType(KeyType s) {
+ public PrIssueDto setKeyType(KeyType s) {
this.keyType = s;
return this;
}
@@ -96,7 +96,7 @@ public final class ShortBranchIssueDto implements Serializable {
return status;
}
- public ShortBranchIssueDto setStatus(@Nullable String s) {
+ public PrIssueDto setStatus(@Nullable String s) {
this.status = s;
return this;
}
@@ -106,7 +106,7 @@ public final class ShortBranchIssueDto implements Serializable {
return checksum;
}
- public ShortBranchIssueDto setChecksum(@Nullable String s) {
+ public PrIssueDto setChecksum(@Nullable String s) {
this.checksum = s;
return this;
}
@@ -127,7 +127,7 @@ public final class ShortBranchIssueDto implements Serializable {
return issueUpdateDate;
}
- public ShortBranchIssueDto setIssueUpdateDate(Long issueUpdateDate) {
+ public PrIssueDto setIssueUpdateDate(Long issueUpdateDate) {
this.issueUpdateDate = issueUpdateDate;
return this;
}
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 499f37a3cdb..8aba7f1cd67 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
@@ -289,7 +289,7 @@
and i.updated_at &lt;&gt; #{updatedAt,jdbcType=BIGINT}
</select>
- <select id="selectOpenByComponentUuids" parameterType="map" resultType="ShortBranchIssue">
+ <select id="selectOpenByComponentUuids" parameterType="map" resultType="PrIssue">
select
i.kee as kee,
i.message as message,
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java
index 2361a6872a5..fffce192a76 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java
@@ -225,7 +225,7 @@ public class IssueDaoTest {
ComponentDto file = db.components().insertComponent(newFileDto(projectBranch));
IssueDto fpIssue = db.issues().insert(rule, projectBranch, file, i -> i.setStatus("RESOLVED").setResolution("FALSE-POSITIVE"));
- ShortBranchIssueDto fp = underTest.selectOpenByComponentUuids(db.getSession(), Collections.singletonList(file.uuid())).get(0);
+ PrIssueDto fp = underTest.selectOpenByComponentUuids(db.getSession(), Collections.singletonList(file.uuid())).get(0);
assertThat(fp.getLine()).isEqualTo(fpIssue.getLine());
assertThat(fp.getMessage()).isEqualTo(fpIssue.getMessage());
assertThat(fp.getChecksum()).isEqualTo(fpIssue.getChecksum());
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/metric/MetricDtoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/metric/MetricDtoTest.java
index a496b042d71..f460b707d3a 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/metric/MetricDtoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/metric/MetricDtoTest.java
@@ -25,9 +25,6 @@ import org.junit.rules.ExpectedException;
import static com.google.common.base.Strings.repeat;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.sonar.api.measures.Metric.ValueType.DATA;
-import static org.sonar.api.measures.Metric.ValueType.INT;
-import static org.sonar.api.measures.Metric.ValueType.STRING;
public class MetricDtoTest {
@Rule
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java
index cb7a8fbdaf5..978855b5092 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/permission/template/PermissionTemplateDaoTest.java
@@ -31,7 +31,6 @@ import org.sonar.api.web.UserRole;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.organization.OrganizationDto;
-import org.sonar.db.permission.PermissionQuery;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.UserDto;
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java
index 3eb348a8797..ed75ec4e818 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java
@@ -19,7 +19,6 @@
*/
package org.sonar.db.rule;
-import com.hazelcast.map.impl.querycache.accumulator.Accumulator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java
index 1f02bd04a34..ca072da52a1 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java
@@ -19,7 +19,6 @@
*/
package org.sonar.db.user;
-import com.tngtech.java.junit.dataprovider.DataProvider;
import com.tngtech.java.junit.dataprovider.DataProviderRunner;
import java.util.ArrayList;
import java.util.Collection;
@@ -28,9 +27,9 @@ import java.util.List;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.sonar.api.impl.utils.TestSystem2;
import org.sonar.api.user.UserQuery;
import org.sonar.api.utils.DateUtils;
-import org.sonar.api.impl.utils.TestSystem2;
import org.sonar.db.DatabaseUtils;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
index 2eced5e23ed..627981dc371 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
@@ -25,8 +25,6 @@ import javax.annotation.Nullable;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.db.newcodeperiod.NewCodePeriodDto;
-import org.sonar.db.newcodeperiod.NewCodePeriodType;
import org.sonar.db.organization.OrganizationDto;
import static com.google.common.base.Preconditions.checkArgument;