From d5f38685a9d9ea8e92a992d73f9cf22e7c744e01 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 3 Apr 2014 18:17:20 +0200 Subject: [PATCH] SONAR-5056 Move batch DebtRemediationFunction from rule to debt package --- .../src/main/java/org/sonar/batch/issue/ModuleIssues.java | 6 +++++- .../src/main/java/org/sonar/batch/rule/RulesProvider.java | 2 +- .../test/java/org/sonar/batch/issue/ModuleIssuesTest.java | 2 +- .../test/java/org/sonar/batch/rule/RulesProviderTest.java | 2 +- .../api/batch/{rule => debt}/DebtRemediationFunction.java | 2 +- .../src/main/java/org/sonar/api/batch/rule/Rule.java | 1 + .../java/org/sonar/api/batch/rule/internal/DefaultRule.java | 2 +- .../java/org/sonar/api/batch/rule/internal/NewRule.java | 2 +- .../DebtRemediationFunctionTest.java} | 4 ++-- .../org/sonar/api/batch/rule/internal/RulesBuilderTest.java | 2 +- 10 files changed, 15 insertions(+), 10 deletions(-) rename sonar-plugin-api/src/main/java/org/sonar/api/batch/{rule => debt}/DebtRemediationFunction.java (98%) rename sonar-plugin-api/src/test/java/org/sonar/api/batch/{rule/DefaultDebtRemediationFunctionTest.java => debt/DebtRemediationFunctionTest.java} (97%) diff --git a/sonar-batch/src/main/java/org/sonar/batch/issue/ModuleIssues.java b/sonar-batch/src/main/java/org/sonar/batch/issue/ModuleIssues.java index 5eaa0726038..c0a49d68671 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/issue/ModuleIssues.java +++ b/sonar-batch/src/main/java/org/sonar/batch/issue/ModuleIssues.java @@ -21,7 +21,11 @@ package org.sonar.batch.issue; import com.google.common.base.Objects; import com.google.common.base.Strings; -import org.sonar.api.batch.rule.*; +import org.sonar.api.batch.debt.DebtRemediationFunction; +import org.sonar.api.batch.rule.ActiveRule; +import org.sonar.api.batch.rule.ActiveRules; +import org.sonar.api.batch.rule.Rule; +import org.sonar.api.batch.rule.Rules; import org.sonar.api.issue.internal.DefaultIssue; import org.sonar.api.resources.Project; import org.sonar.api.rule.RuleKey; diff --git a/sonar-batch/src/main/java/org/sonar/batch/rule/RulesProvider.java b/sonar-batch/src/main/java/org/sonar/batch/rule/RulesProvider.java index ef479b27f00..49b4cf95986 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/rule/RulesProvider.java +++ b/sonar-batch/src/main/java/org/sonar/batch/rule/RulesProvider.java @@ -27,8 +27,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.batch.debt.DebtCharacteristic; import org.sonar.api.batch.debt.DebtModel; +import org.sonar.api.batch.debt.DebtRemediationFunction; import org.sonar.api.batch.debt.internal.DefaultDebtModel; -import org.sonar.api.batch.rule.DebtRemediationFunction; import org.sonar.api.batch.rule.Rules; import org.sonar.api.batch.rule.internal.NewRule; import org.sonar.api.batch.rule.internal.RulesBuilder; diff --git a/sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java b/sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java index 6be76b5d95d..3df87485b74 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java @@ -26,7 +26,7 @@ import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; -import org.sonar.api.batch.rule.DebtRemediationFunction; +import org.sonar.api.batch.debt.DebtRemediationFunction; import org.sonar.api.batch.rule.internal.ActiveRulesBuilder; import org.sonar.api.batch.rule.internal.RulesBuilder; import org.sonar.api.issue.internal.DefaultIssue; diff --git a/sonar-batch/src/test/java/org/sonar/batch/rule/RulesProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/rule/RulesProviderTest.java index 5ec693d2bc1..3bf623aab5a 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/rule/RulesProviderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/rule/RulesProviderTest.java @@ -25,9 +25,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; +import org.sonar.api.batch.debt.DebtRemediationFunction; import org.sonar.api.batch.debt.internal.DefaultDebtCharacteristic; import org.sonar.api.batch.debt.internal.DefaultDebtModel; -import org.sonar.api.batch.rule.DebtRemediationFunction; import org.sonar.api.batch.rule.Rule; import org.sonar.api.batch.rule.RuleParam; import org.sonar.api.batch.rule.Rules; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/DebtRemediationFunction.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/debt/DebtRemediationFunction.java similarity index 98% rename from sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/DebtRemediationFunction.java rename to sonar-plugin-api/src/main/java/org/sonar/api/batch/debt/DebtRemediationFunction.java index 5ce0a5e2482..97fd9e0a591 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/DebtRemediationFunction.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/debt/DebtRemediationFunction.java @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.api.batch.rule; +package org.sonar.api.batch.debt; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; 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 475d8e7b600..66d42e2be5c 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 @@ -20,6 +20,7 @@ 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; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRule.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRule.java index cd93c077d60..7e311e2901c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/DefaultRule.java @@ -20,7 +20,7 @@ package org.sonar.api.batch.rule.internal; import com.google.common.collect.ImmutableMap; -import org.sonar.api.batch.rule.DebtRemediationFunction; +import org.sonar.api.batch.debt.DebtRemediationFunction; import org.sonar.api.batch.rule.Rule; import org.sonar.api.batch.rule.RuleParam; import org.sonar.api.rule.RuleKey; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java index c921a41ecc4..5843672ade0 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java @@ -21,7 +21,7 @@ package org.sonar.api.batch.rule.internal; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; -import org.sonar.api.batch.rule.DebtRemediationFunction; +import org.sonar.api.batch.debt.DebtRemediationFunction; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.RuleStatus; import org.sonar.api.rule.Severity; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/DefaultDebtRemediationFunctionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/debt/DebtRemediationFunctionTest.java similarity index 97% rename from sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/DefaultDebtRemediationFunctionTest.java rename to sonar-plugin-api/src/test/java/org/sonar/api/batch/debt/DebtRemediationFunctionTest.java index 4bcb659a5b2..dfbd2d2beef 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/DefaultDebtRemediationFunctionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/debt/DebtRemediationFunctionTest.java @@ -18,14 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.api.batch.rule; +package org.sonar.api.batch.debt; import org.junit.Test; import org.sonar.api.utils.Duration; import static org.fest.assertions.Assertions.assertThat; -public class DefaultDebtRemediationFunctionTest { +public class DebtRemediationFunctionTest { @Test public void create_linear() throws Exception { diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java index 074fe58aef7..e7a445bf904 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java @@ -20,7 +20,7 @@ package org.sonar.api.batch.rule.internal; import org.junit.Test; -import org.sonar.api.batch.rule.DebtRemediationFunction; +import org.sonar.api.batch.debt.DebtRemediationFunction; import org.sonar.api.batch.rule.Rule; import org.sonar.api.batch.rule.Rules; import org.sonar.api.rule.RuleKey; -- 2.39.5