aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorLéo Geoffroy <leo.geoffroy@sonarsource.com>2022-11-23 15:57:02 +0100
committersonartech <sonartech@sonarsource.com>2022-12-01 20:03:11 +0000
commit66b8bff0dcc778eb93da92cd408214bbfca82c2a (patch)
treee60388bdf0bdbc60434d00eae81b8e6dffe39fad /sonar-core
parent24d4519ea1b8a4426dd90e0bb80b2b09bd7a1c12 (diff)
downloadsonarqube-66b8bff0dcc778eb93da92cd408214bbfca82c2a.tar.gz
sonarqube-66b8bff0dcc778eb93da92cd408214bbfca82c2a.zip
SONAR-17592 Persist Message formatting from plugin api
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
index ceabe70333c..5a4da59435b 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
@@ -67,6 +67,7 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure.
private String severity = null;
private boolean manualSeverity = false;
private String message = null;
+ private Object messageFormattings = null;
private Integer line = null;
private Double gap = null;
private Duration effort = null;
@@ -261,10 +262,21 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure.
}
public DefaultIssue setMessage(@Nullable String s) {
+ //TODO trim messageFormattings?
this.message = StringUtils.abbreviate(StringUtils.trim(s), MESSAGE_MAX_SIZE);
return this;
}
+ @CheckForNull
+ public <T> T getMessageFormattings() {
+ return (T) messageFormattings;
+ }
+
+ public DefaultIssue setMessageFormattings(@Nullable Object messageFormattings) {
+ this.messageFormattings = messageFormattings;
+ return this;
+ }
+
@Override
@CheckForNull
public Integer line() {