aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2014-04-14 10:13:06 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2014-04-14 10:13:54 +0200
commit377f8fb3103b68cdfb45ac54484ac88b377cecd8 (patch)
treef44b860a9b346bca82b4af29f9fee7c0785f8f3f
parent3528f2ab23699dee6bf4e1ef83ee9ca54b310d18 (diff)
downloadsonarqube-377f8fb3103b68cdfb45ac54484ac88b377cecd8.tar.gz
sonarqube-377f8fb3103b68cdfb45ac54484ac88b377cecd8.zip
Fix some quality flaws
-rw-r--r--sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java14
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rule.java2
2 files changed, 8 insertions, 8 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java b/sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java
index d8e8052d05e..38713732c28 100644
--- a/sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java
+++ b/sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java
@@ -34,8 +34,8 @@ import org.sonar.core.resource.SnapshotDto;
import javax.annotation.Nullable;
import java.sql.*;
-import java.util.Comparator;
-import java.util.List;
+import java.sql.Date;
+import java.util.*;
class MeasureFilterSql {
@@ -128,13 +128,15 @@ class MeasureFilterSql {
}
private void appendDateConditions(StringBuilder sb) {
- if (filter.getFromDate() != null) {
+ java.util.Date fromDate = filter.getFromDate();
+ if (fromDate != null) {
sb.append(" AND s.created_at >= ? ");
- dateParameters.add(new Date(filter.getFromDate().getTime()));
+ dateParameters.add(new Date(fromDate.getTime()));
}
- if (filter.getToDate() != null) {
+ java.util.Date toDate = filter.getToDate();
+ if (toDate != null) {
sb.append(" AND s.created_at <= ? ");
- dateParameters.add(new Date(filter.getToDate().getTime()));
+ dateParameters.add(new Date(toDate.getTime()));
}
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rule.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rule.java
index 35653424eb8..d0a6cec8a44 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rule.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rule.java
@@ -19,13 +19,11 @@
*/
package org.sonar.api.batch.rule;
-import com.google.common.annotations.Beta;
import org.sonar.api.batch.debt.DebtRemediationFunction;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.RuleStatus;
import javax.annotation.CheckForNull;
-
import java.util.Collection;
/**