]> source.dussan.org Git - sonarqube.git/commitdiff
Fix some quality flaws
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 14 Apr 2014 08:13:06 +0000 (10:13 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 14 Apr 2014 08:13:54 +0000 (10:13 +0200)
sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rule.java

index d8e8052d05e159f6cda964d75472deb6e2e95938..38713732c281fb0b67708138f5efd74ded8de3a6 100644 (file)
@@ -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()));
     }
   }
 
index 35653424eb856f763fb7577ab1a6e43315d39508..d0a6cec8a44bfeb45cc3aa3c514310080c6b4c51 100644 (file)
  */
 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;
 
 /**