From c190bcb42388e17abc2c3ba26864ceb43058c89e Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 30 May 2013 14:20:44 +0200 Subject: [PATCH] Fix quality flaws --- .../org/sonar/plugins/core/issue/CountOpenIssuesDecorator.java | 2 +- sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java | 1 - .../src/main/java/org/sonar/core/issue/ActionPlanStats.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/CountOpenIssuesDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/CountOpenIssuesDecorator.java index cfae7606a5f..aea3cd13071 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/CountOpenIssuesDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/CountOpenIssuesDecorator.java @@ -260,7 +260,7 @@ public class CountOpenIssuesDecorator implements Decorator { } @VisibleForTesting - int countIssuesAfterDate(Collection issues, Date targetDate) { + int countIssuesAfterDate(Collection issues, @Nullable Date targetDate) { if (issues == null) { return 0; } diff --git a/sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java b/sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java index f3da90111a1..fa59a1d64c4 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java +++ b/sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java @@ -59,7 +59,6 @@ public class ScanIssues implements BatchComponent { private DefaultIssue newIssue(Violation violation) { return (DefaultIssue) new DefaultIssueBuilder() .componentKey(violation.getResource().getEffectiveKey()) -// .projectKey(violation.getResource().getEffectiveKey()) .ruleKey(RuleKey.of(violation.getRule().getRepositoryKey(), violation.getRule().getKey())) .effortToFix(violation.getCost()) .line(violation.getLineId()) diff --git a/sonar-core/src/main/java/org/sonar/core/issue/ActionPlanStats.java b/sonar-core/src/main/java/org/sonar/core/issue/ActionPlanStats.java index a9e67fda15e..dc42120042a 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/ActionPlanStats.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/ActionPlanStats.java @@ -71,6 +71,6 @@ public class ActionPlanStats extends DefaultActionPlan { } public boolean overDue(){ - return super.status() == ActionPlan.STATUS_OPEN && new Date().after(super.deadLine()); + return super.status() == ActionPlan.STATUS_OPEN && super.deadLine() != null && new Date().after(super.deadLine()); } } -- 2.39.5