diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-02-03 10:29:04 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-02-03 10:29:35 +0100 |
commit | 9b3e2cc9103c5c0e7cdd4566e455e56b9d73b303 (patch) | |
tree | e3bb69ba2b6cc54bf86b57f093949268662e2490 /sonar-core/src | |
parent | d9e2f9e9f2db7fc540b3a31ab8468c6ed91b1d7e (diff) | |
download | sonarqube-9b3e2cc9103c5c0e7cdd4566e455e56b9d73b303.tar.gz sonarqube-9b3e2cc9103c5c0e7cdd4566e455e56b9d73b303.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-core/src')
6 files changed, 9 insertions, 26 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 d54c8761c6e..c7577ffd83b 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 @@ -19,7 +19,6 @@ */ package org.sonar.core.duplication; -import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; import org.sonar.api.BatchComponent; import org.sonar.api.ServerComponent; diff --git a/sonar-core/src/main/java/org/sonar/core/purge/PurgeSnapshotQuery.java b/sonar-core/src/main/java/org/sonar/core/purge/PurgeSnapshotQuery.java index 5c9c3eccdf0..b9b1b44be9d 100644 --- a/sonar-core/src/main/java/org/sonar/core/purge/PurgeSnapshotQuery.java +++ b/sonar-core/src/main/java/org/sonar/core/purge/PurgeSnapshotQuery.java @@ -19,13 +19,10 @@ */ package org.sonar.core.purge; -import java.util.Date; - public final class PurgeSnapshotQuery { private Long rootProjectId; private Long rootSnapshotId; private Long resourceId; - private Date beforeBuildDate; private String[] scopes; private String[] qualifiers; private String[] status; @@ -49,17 +46,8 @@ public final class PurgeSnapshotQuery { return this; } - public Date getBeforeBuildDate() { - return beforeBuildDate; - } - - public PurgeSnapshotQuery setBeforeBuildDate(Date beforeBuildDate) { - this.beforeBuildDate = beforeBuildDate; - return this; - } - public String[] getScopes() { - return scopes; + return scopes;//NOSONAR May expose internal representation by returning reference to mutable object } public PurgeSnapshotQuery setScopes(String[] scopes) { @@ -68,7 +56,7 @@ public final class PurgeSnapshotQuery { } public String[] getQualifiers() { - return qualifiers; + return qualifiers;//NOSONAR May expose internal representation by returning reference to mutable object } public PurgeSnapshotQuery setQualifiers(String[] qualifiers) { @@ -77,7 +65,7 @@ public final class PurgeSnapshotQuery { } public String[] getStatus() { - return status; + return status;//NOSONAR May expose internal representation by returning reference to mutable object } public PurgeSnapshotQuery setStatus(String[] status) { diff --git a/sonar-core/src/main/java/org/sonar/core/purge/PurgeableSnapshotDto.java b/sonar-core/src/main/java/org/sonar/core/purge/PurgeableSnapshotDto.java index a9aceeacbdf..f51b1218c61 100644 --- a/sonar-core/src/main/java/org/sonar/core/purge/PurgeableSnapshotDto.java +++ b/sonar-core/src/main/java/org/sonar/core/purge/PurgeableSnapshotDto.java @@ -31,7 +31,7 @@ public class PurgeableSnapshotDto implements Comparable<PurgeableSnapshotDto> { private boolean isLast; public Date getDate() { - return date; + return date;//NOSONAR May expose internal representation by returning reference to mutable object } public long getSnapshotId() { @@ -47,7 +47,7 @@ public class PurgeableSnapshotDto implements Comparable<PurgeableSnapshotDto> { } public void setDate(Date date) { - this.date = date; + this.date = date;//NOSONAR May expose internal representation by incorporating reference to mutable object } public PurgeableSnapshotDto setSnapshotId(long snapshotId) { diff --git a/sonar-core/src/main/java/org/sonar/core/resource/ResourceIndexerDao.java b/sonar-core/src/main/java/org/sonar/core/resource/ResourceIndexerDao.java index 24d6a04ddf1..66148d5fba0 100644 --- a/sonar-core/src/main/java/org/sonar/core/resource/ResourceIndexerDao.java +++ b/sonar-core/src/main/java/org/sonar/core/resource/ResourceIndexerDao.java @@ -21,7 +21,6 @@ package org.sonar.core.resource; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; -import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.ResultContext; import org.apache.ibatis.session.ResultHandler; import org.apache.ibatis.session.SqlSession; diff --git a/sonar-core/src/main/java/org/sonar/core/resource/SnapshotDto.java b/sonar-core/src/main/java/org/sonar/core/resource/SnapshotDto.java index f211be6aac3..7b0020b4c5a 100644 --- a/sonar-core/src/main/java/org/sonar/core/resource/SnapshotDto.java +++ b/sonar-core/src/main/java/org/sonar/core/resource/SnapshotDto.java @@ -67,20 +67,20 @@ public final class SnapshotDto { } public Date getDate() { - return date; + return date;//NOSONAR May expose internal representation by returning reference to mutable object } public SnapshotDto setDate(Date date) { - this.date = date; + this.date = date;// NOSONAR May expose internal representation by incorporating reference to mutable object return this; } public Date getBuildDate() { - return buildDate; + return buildDate;//NOSONAR May expose internal representation by returning reference to mutable object } public SnapshotDto setBuildDate(Date buildDate) { - this.buildDate = buildDate; + this.buildDate = buildDate;// NOSONAR May expose internal representation by incorporating reference to mutable object return this; } diff --git a/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml b/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml index b1144d9a6da..de31a052238 100644 --- a/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml @@ -21,9 +21,6 @@ <if test="resourceId != null"> and s.project_id=#{resourceId} </if> - <if test="beforeBuildDate != null"> - and s.build_date <= #{beforeBuildDate} - </if> <if test="status != null"> and s.status in <foreach item="s" index="index" collection="status" open="(" separator="," close=")">#{s}</foreach> |