aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-core/src/main')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/duplication/DuplicationDao.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/duplication/DuplicationMapper.java3
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml1
3 files changed, 5 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/duplication/DuplicationDao.java b/sonar-core/src/main/java/org/sonar/core/duplication/DuplicationDao.java
index 2d98f947ca8..e557d061ca7 100644
--- a/sonar-core/src/main/java/org/sonar/core/duplication/DuplicationDao.java
+++ b/sonar-core/src/main/java/org/sonar/core/duplication/DuplicationDao.java
@@ -36,11 +36,11 @@ public class DuplicationDao implements BatchComponent, ServerComponent {
this.mybatis = mybatis;
}
- public List<DuplicationUnitDto> selectCandidates(int resourceSnapshotId, Integer lastSnapshotId) {
+ public List<DuplicationUnitDto> selectCandidates(int resourceSnapshotId, Integer lastSnapshotId, String language) {
SqlSession session = mybatis.openSession();
try {
DuplicationMapper mapper = session.getMapper(DuplicationMapper.class);
- return mapper.selectCandidates(resourceSnapshotId, lastSnapshotId);
+ return mapper.selectCandidates(resourceSnapshotId, lastSnapshotId, language);
} finally {
MyBatis.closeSessionQuietly(session);
}
diff --git a/sonar-core/src/main/java/org/sonar/core/duplication/DuplicationMapper.java b/sonar-core/src/main/java/org/sonar/core/duplication/DuplicationMapper.java
index fa4b30052cb..f7afbb79af4 100644
--- a/sonar-core/src/main/java/org/sonar/core/duplication/DuplicationMapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/duplication/DuplicationMapper.java
@@ -27,7 +27,8 @@ public interface DuplicationMapper {
List<DuplicationUnitDto> selectCandidates(
@Param("resource_snapshot_id") int resourceSnapshotId,
- @Param("last_project_snapshot_id") Integer lastSnapshotId);
+ @Param("last_project_snapshot_id") Integer lastSnapshotId,
+ @Param("language") String language);
void batchInsert(DuplicationUnitDto unit);
diff --git a/sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml b/sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml
index c1dc43121e4..2f0af1b57e7 100644
--- a/sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/duplication/DuplicationMapper.xml
@@ -11,6 +11,7 @@
AND to_blocks.snapshot_id = snapshot.id
AND snapshot.islast = ${_true}
AND snapshot.project_id = res.id
+ AND res.language = #{language}
<if test="last_project_snapshot_id != null">
AND to_blocks.project_snapshot_id != #{last_project_snapshot_id}
</if>