diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-03-11 08:09:01 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-03-11 08:09:01 +0100 |
commit | dce23fcf9ac907f6621ab0c11c397febff280ebc (patch) | |
tree | f819d4a7216d35389a3063b0f0a96cde49cb62db /sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt | |
parent | 1ffa320fb3e44cdaf635678a04c473ca4f348514 (diff) | |
download | sonarqube-dce23fcf9ac907f6621ab0c11c397febff280ebc.tar.gz sonarqube-dce23fcf9ac907f6621ab0c11c397febff280ebc.zip |
SONAR-5056 Read debt from rule during analysis
Diffstat (limited to 'sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt')
7 files changed, 62 insertions, 2 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/Characteristic.java b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/Characteristic.java index 2f670b2bb76..b669135b684 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/Characteristic.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/Characteristic.java @@ -43,8 +43,6 @@ public interface Characteristic { List<? extends Characteristic> children(); - List<? extends Requirement> requirements(); - boolean isRoot(); Date createdAt(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/Requirement.java b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/Requirement.java index 31f2ff781ed..d6eb82895b5 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/Requirement.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/Requirement.java @@ -28,7 +28,9 @@ import java.util.Date; /** * @since 4.1 + * @deprecated since 4.3 */ +@Deprecated public interface Requirement { Integer id(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/TechnicalDebtModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/TechnicalDebtModel.java index a4d1bf42509..ad99777dc58 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/TechnicalDebtModel.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/TechnicalDebtModel.java @@ -37,12 +37,24 @@ public interface TechnicalDebtModel { @CheckForNull Characteristic characteristicByKey(String key); + /** + * @deprecated since 4.3 + */ @CheckForNull + @Deprecated Requirement requirementsByRule(RuleKey ruleKey); + /** + * @deprecated since 4.3 + */ @CheckForNull + @Deprecated Requirement requirementsById(Integer id); + /** + * @deprecated since 4.3 + */ + @Deprecated List<? extends Requirement> requirements(); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/internal/DefaultRequirement.java b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/internal/DefaultRequirement.java index b46196312a2..cf604216971 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/internal/DefaultRequirement.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/batch/internal/DefaultRequirement.java @@ -32,6 +32,10 @@ import javax.annotation.CheckForNull; import java.util.Date; +/** + * @deprecated since 4.3 + */ +@Deprecated public class DefaultRequirement implements Requirement { public static final String FUNCTION_LINEAR = "linear"; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/Characteristic.java b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/Characteristic.java index 1befa3cb282..a1347ecacd5 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/Characteristic.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/Characteristic.java @@ -89,6 +89,10 @@ public interface Characteristic { boolean isRoot(); + /** + * @deprecated since 4.3 + */ + @Deprecated boolean isRequirement(); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/TechnicalDebtManager.java b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/TechnicalDebtManager.java index e013aee2be0..f97294c381e 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/TechnicalDebtManager.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/TechnicalDebtManager.java @@ -33,6 +33,10 @@ public interface TechnicalDebtManager extends ServerComponent { List<Characteristic> findRootCharacteristics(); + /** + * @deprecated since 4.3 + */ + @Deprecated Characteristic findRequirementByRule(Rule rule); Characteristic findCharacteristicById(Integer id); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java index 12e8d64d562..06918b3b3a6 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java @@ -151,11 +151,19 @@ public class DefaultCharacteristic implements Characteristic { return this; } + /** + * @deprecated since 4.3 + */ + @Deprecated @CheckForNull public Integer factorValue() { return factorValue; } + /** + * @deprecated since 4.3 + */ + @Deprecated public DefaultCharacteristic setFactorValue(@Nullable Integer factorValue) { this.factorValue = factorValue; return this; @@ -166,6 +174,10 @@ public class DefaultCharacteristic implements Characteristic { return factorUnit; } + /** + * @deprecated since 4.3 + */ + @Deprecated public DefaultCharacteristic setFactorUnit(@Nullable WorkDuration.UNIT factorUnit) { this.factorUnit = factorUnit; return this; @@ -194,26 +206,46 @@ public class DefaultCharacteristic implements Characteristic { return this; } + /** + * @deprecated since 4.3 + */ + @Deprecated @CheckForNull public Integer offsetValue() { return offsetValue; } + /** + * @deprecated since 4.3 + */ + @Deprecated public DefaultCharacteristic setOffsetValue(@Nullable Integer offsetValue) { this.offsetValue = offsetValue; return this; } + /** + * @deprecated since 4.3 + */ + @Deprecated @CheckForNull public WorkDuration.UNIT offsetUnit() { return offsetUnit; } + /** + * @deprecated since 4.3 + */ + @Deprecated public DefaultCharacteristic setOffsetUnit(@Nullable WorkDuration.UNIT offsetUnit) { this.offsetUnit = offsetUnit; return this; } + /** + * @deprecated since 4.3 + */ + @Deprecated public static WorkDuration.UNIT toUnit(@Nullable String requirementUnit) { if (requirementUnit != null) { if (WorkUnit.DAYS.equals(requirementUnit)) { @@ -243,6 +275,10 @@ public class DefaultCharacteristic implements Characteristic { return parentId == null; } + /** + * @deprecated since 4.3 + */ + @Deprecated public boolean isRequirement() { return ruleKey != null; } |