aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-01-13 12:26:22 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-01-13 12:26:22 +0100
commite92ffa6e63e7321ab090e764cdf5307a67268d78 (patch)
tree77f1710045105b0f5299740a88a50eb2cfbc9386 /sonar-plugin-api
parentb009b7b057a9dc02f55371854458ed1f688a8823 (diff)
downloadsonarqube-e92ffa6e63e7321ab090e764cdf5307a67268d78.tar.gz
sonarqube-e92ffa6e63e7321ab090e764cdf5307a67268d78.zip
fix quality flaws
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssueComment.java27
1 files changed, 14 insertions, 13 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssueComment.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssueComment.java
index ad77a21f1c1..1388477326f 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssueComment.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssueComment.java
@@ -24,6 +24,7 @@ import org.sonar.api.utils.internal.Uuids;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
+
import java.io.Serializable;
import java.util.Date;
@@ -41,6 +42,18 @@ public class DefaultIssueComment implements Serializable, IssueComment {
private String markdownText;
private boolean isNew;
+ public static DefaultIssueComment create(String issueKey, @Nullable String login, String markdownText) {
+ DefaultIssueComment comment = new DefaultIssueComment();
+ comment.setIssueKey(issueKey);
+ comment.setKey(Uuids.create());
+ Date now = new Date();
+ comment.setUserLogin(login);
+ comment.setMarkdownText(markdownText);
+ comment.setCreatedAt(now).setUpdatedAt(now);
+ comment.setNew(true);
+ return comment;
+ }
+
@Override
public String markdownText() {
return markdownText;
@@ -100,7 +113,7 @@ public class DefaultIssueComment implements Serializable, IssueComment {
return updatedAt;
}
- public DefaultIssueComment setUpdatedAt(Date updatedAt) {
+ public DefaultIssueComment setUpdatedAt(@Nullable Date updatedAt) {
this.updatedAt = updatedAt;
return this;
}
@@ -113,16 +126,4 @@ public class DefaultIssueComment implements Serializable, IssueComment {
isNew = b;
return this;
}
-
- public static DefaultIssueComment create(String issueKey, @Nullable String login, String markdownText) {
- DefaultIssueComment comment = new DefaultIssueComment();
- comment.setIssueKey(issueKey);
- comment.setKey(Uuids.create());
- Date now = new Date();
- comment.setUserLogin(login);
- comment.setMarkdownText(markdownText);
- comment.setCreatedAt(now).setUpdatedAt(now);
- comment.setNew(true);
- return comment;
- }
}