From: Simon Brandhof Date: Mon, 14 Apr 2014 08:13:06 +0000 (+0200) Subject: Fix some quality flaws X-Git-Tag: 4.3~39 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=377f8fb3103b68cdfb45ac54484ac88b377cecd8;p=sonarqube.git Fix some quality flaws --- 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; /**