aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2022-11-29 03:49:09 -0600
committersonartech <sonartech@sonarsource.com>2022-12-01 20:03:12 +0000
commit1f5842ee24c4b544acb2c8dea81754809e70dab9 (patch)
treee6cbcac862d0b3de1273518d0754c789183e9306 /sonar-core
parent7f4d7aabc87647aa40386ab2708544e023ca0896 (diff)
downloadsonarqube-1f5842ee24c4b544acb2c8dea81754809e70dab9.tar.gz
sonarqube-1f5842ee24c4b544acb2c8dea81754809e70dab9.zip
SONAR-17592 Manage formattings for truncation of messages
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java3
-rw-r--r--sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java6
2 files changed, 1 insertions, 8 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 5a4da59435b..3b7dffb95b6 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
@@ -262,8 +262,7 @@ 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);
+ this.message = StringUtils.abbreviate(s, MESSAGE_MAX_SIZE);
return this;
}
diff --git a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
index 9f16990058b..78ba1d218dd 100644
--- a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
@@ -148,12 +148,6 @@ public class DefaultIssueTest {
}
@Test
- public void message_should_be_trimmed() {
- issue.setMessage(" foo ");
- assertThat(issue.message()).isEqualTo("foo");
- }
-
- @Test
public void message_could_be_null() {
issue.setMessage(null);
assertThat(issue.message()).isNull();