diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-07-24 16:49:07 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-07-24 16:49:42 +0200 |
commit | 94c8b938393edc30d7bcd1693c125113a9327a58 (patch) | |
tree | c23ead21bfc657c4639c0158af9b6a99a724739d | |
parent | 191a847984fe81c93e022e147d77707c52b199bb (diff) | |
download | sonarqube-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
-rw-r--r-- | it/it-tests/src/test/java/plugins/PluginsTest.java | 8 | ||||
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java | 14 |
2 files changed, 8 insertions, 14 deletions
diff --git a/it/it-tests/src/test/java/plugins/PluginsTest.java b/it/it-tests/src/test/java/plugins/PluginsTest.java index 499c3b638c5..ef69102ecb3 100644 --- a/it/it-tests/src/test/java/plugins/PluginsTest.java +++ b/it/it-tests/src/test/java/plugins/PluginsTest.java @@ -34,6 +34,7 @@ import plugins.checks.PythonCheck; import plugins.checks.RpgCheck; import plugins.checks.SwiftCheck; import plugins.checks.Validation; +import plugins.checks.VbCheck; import plugins.checks.WebCheck; /** @@ -45,11 +46,8 @@ public class PluginsTest { /** * Temporarily disabled plugins. To be re-enabled. */ - static final Set<String> DISABLED_PLUGINS = Sets.newHashSet("devcockpit", "views", /* FIXME */"vb"); + static final Set<String> DISABLED_PLUGINS = Sets.newHashSet("devcockpit", "views"); - /** - * See http://license.internal.sonarsource.com/it/ - */ static final Set<String> LICENSED_PLUGINS = Sets.newHashSet( "abap", "cobol", "cpp", "devcockpit", "objc", "pli", "plsql", "report", "rpg", "sqale", "swift", "vb", "vbnet", "views"); @@ -63,7 +61,7 @@ public class PluginsTest { // TODO new PliCheck() is temporarily disabled as PLI plugin does not support multi-language feature. See sonar-project.properties static final List<Check> CHECKS = Arrays.asList((Check) new AbapCheck(), new CobolCheck(), new CCheck(), new CppCheck(), new CssCheck(), new FlexCheck(), new GroovyCheck(), new JavaCheck(), new JavascriptCheck(), new PhpCheck(), new RpgCheck(), - new PythonCheck(), new SwiftCheck(), /* FIXME new VbCheck(), */ new WebCheck()); + new PythonCheck(), new SwiftCheck(), new VbCheck(), new WebCheck()); static Orchestrator orchestrator; 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; } |