diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2014-02-19 12:28:38 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2014-02-25 18:52:32 +0100 |
commit | 23124a18155d030527aa7760b35a0bea5744f9ce (patch) | |
tree | 16cbf1b35ca932b177e42b6a4d068704df643cf0 /sonar-plugin-api/src/main/java/org/sonar | |
parent | 0fae2d552337885d31d10348c9900e7ce993dfb4 (diff) | |
download | sonarqube-23124a18155d030527aa7760b35a0bea5744f9ce.tar.gz sonarqube-23124a18155d030527aa7760b35a0bea5744f9ce.zip |
SONAR-4996 Update issue debt to seconds (backend + display)
Diffstat (limited to 'sonar-plugin-api/src/main/java/org/sonar')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java | 12 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/WorkDurationFactory.java | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java index 6c13c90c9b9..9904cfaef79 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java @@ -33,11 +33,9 @@ import org.sonar.api.issue.Issue; import org.sonar.api.issue.IssueComment; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.Severity; -import org.sonar.api.utils.WorkDuration; import javax.annotation.CheckForNull; import javax.annotation.Nullable; - import java.io.Serializable; import java.util.*; @@ -59,7 +57,7 @@ public class DefaultIssue implements Issue { private String message; private Integer line; private Double effortToFix; - private WorkDuration technicalDebt; + private Long debt; private String status; private String resolution; private String reporter; @@ -196,12 +194,12 @@ public class DefaultIssue implements Issue { * Elapsed time to fix the issue */ @CheckForNull - public WorkDuration technicalDebt() { - return technicalDebt; + public Long debt() { + return debt; } - public DefaultIssue setTechnicalDebt(@Nullable WorkDuration t) { - this.technicalDebt = t; + public DefaultIssue setDebt(@Nullable Long t) { + this.debt = t; return this; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/WorkDurationFactory.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/WorkDurationFactory.java index 7ecf0d83ba3..89078a964a4 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/WorkDurationFactory.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/WorkDurationFactory.java @@ -48,4 +48,11 @@ public final class WorkDurationFactory implements BatchComponent, ServerComponen return settings.getInt(CoreProperties.HOURS_IN_DAY); } + /** + * @since 4.3 + */ + public WorkDuration createFromSeconds(long durationInSeconds) { + return WorkDuration.createFromSeconds(durationInSeconds, hoursInDay); + } + } |