aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-07-24 16:49:07 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-07-24 16:49:42 +0200
commit94c8b938393edc30d7bcd1693c125113a9327a58 (patch)
treec23ead21bfc657c4639c0158af9b6a99a724739d /sonar-core
parent191a847984fe81c93e022e147d77707c52b199bb (diff)
downloadsonarqube-94c8b938393edc30d7bcd1693c125113a9327a58.tar.gz
sonarqube-94c8b938393edc30d7bcd1693c125113a9327a58.zip
Revert hacks related to sprint on removal of Decorator
* forbid negative effort to fix on issues * enable VB in plugin tests
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
index 5cc063aba2d..f16e8d3c2e2 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
@@ -49,6 +49,8 @@ import org.sonar.api.rule.Severity;
import org.sonar.api.utils.Duration;
import org.sonar.core.issue.tracking.Trackable;
+import static java.lang.String.format;
+
/**
* PLUGINS MUST NOT BE USED THIS CLASS, EXCEPT FOR UNIT TESTING.
*
@@ -253,7 +255,7 @@ public class DefaultIssue implements Issue, Trackable {
}
public DefaultIssue setLine(@Nullable Integer l) {
- Preconditions.checkArgument(l == null || l > 0, "Line must be null or greater than zero (got " + l + ")");
+ Preconditions.checkArgument(l == null || l > 0, format("Line must be null or greater than zero (got %d)", l));
this.line = l;
return this;
}
@@ -265,14 +267,8 @@ public class DefaultIssue implements Issue, Trackable {
}
public DefaultIssue setEffortToFix(@Nullable Double d) {
- //Preconditions.checkArgument(d == null || d >= 0, "Effort to fix must be greater than or equal 0 (got " + d + ")");
- if (d != null) {
- // FIXME this is temp hack while Decorator are not dropped (Comment Density common-rule is buggy as
- // the measure comment_line_density is compute by CE)
- this.effortToFix = Math.max(d, 0.0);
- } else {
- this.effortToFix = null;
- }
+ Preconditions.checkArgument(d == null || d >= 0, format("Effort to fix must be greater than or equal 0 (got %s)", d));
+ this.effortToFix = d;
return this;
}