diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-03-05 19:22:20 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-03-05 19:22:20 +0100 |
commit | 6c7dcb3a2af976d6cfdf7ac7dec2cedbe6013619 (patch) | |
tree | f8e4f151a9f103568db3f006de6661baf9b098f8 /sonar-plugin-api/src/main/java/org/sonar | |
parent | 1c8bb2241f785b7e83827ea1d4d74d881f415612 (diff) | |
download | sonarqube-6c7dcb3a2af976d6cfdf7ac7dec2cedbe6013619.tar.gz sonarqube-6c7dcb3a2af976d6cfdf7ac7dec2cedbe6013619.zip |
SONAR-5056 Update Issue.debt from Long to Duration
Diffstat (limited to 'sonar-plugin-api/src/main/java/org/sonar')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java | 5 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java index c11356bd7c0..e30990f12dc 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java @@ -21,6 +21,7 @@ package org.sonar.api.i18n; import org.sonar.api.BatchComponent; import org.sonar.api.ServerComponent; +import org.sonar.api.utils.Duration; import javax.annotation.Nullable; @@ -105,10 +106,10 @@ public interface I18n extends ServerComponent, BatchComponent { /** * Return the formatted work duration. * <br> - * Example : format(Locale.ENGLISH, WorkDuration.create(10, 2, 0, 8)) -> 10d 2h + * Example : format(Locale.ENGLISH, Duration.create(10 * 24 * 60 + 2 * 60)) -> 10d 2h * * @since 4.3 */ - String formatWorkDuration(Locale locale, long duration); + String formatWorkDuration(Locale locale, Duration duration); } 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 7ef2cc6c6f6..02547538274 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,6 +33,7 @@ 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.Duration; import javax.annotation.CheckForNull; import javax.annotation.Nullable; @@ -59,7 +60,7 @@ public class DefaultIssue implements Issue { private String message; private Integer line; private Double effortToFix; - private Long debt; + private Duration debt; private String status; private String resolution; private String reporter; @@ -209,11 +210,16 @@ public class DefaultIssue implements Issue { * Elapsed time to fix the issue */ @CheckForNull - public Long debt() { + public Duration debt() { return debt; } - public DefaultIssue setDebt(@Nullable Long t) { + @CheckForNull + public Long debtInMinutes(){ + return debt != null ? debt.toMinutes() : null; + } + + public DefaultIssue setDebt(@Nullable Duration t) { this.debt = t; return this; } |