aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api-impl/src/main
diff options
context:
space:
mode:
authorLéo Geoffroy <99647462+leo-geoffroy-sonarsource@users.noreply.github.com>2022-12-07 18:54:00 +0100
committersonartech <sonartech@sonarsource.com>2022-12-07 20:02:57 +0000
commit32d84b0f2f4aad6653a08509d2ddf058334e0d82 (patch)
tree27b0c55a9a3af6e4d3f8779c684cdd777fe81ce2 /sonar-plugin-api-impl/src/main
parent6895a5b7e08fc745f92f19f56723b4e15d91e187 (diff)
downloadsonarqube-32d84b0f2f4aad6653a08509d2ddf058334e0d82.tar.gz
sonarqube-32d84b0f2f4aad6653a08509d2ddf058334e0d82.zip
SONAR-17745 Message of issue location should be trimmed
Diffstat (limited to 'sonar-plugin-api-impl/src/main')
-rw-r--r--sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssueLocation.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssueLocation.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssueLocation.java
index 2dc92187466..c9d123f12dc 100644
--- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssueLocation.java
+++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssueLocation.java
@@ -33,6 +33,7 @@ import org.sonar.api.issue.Issue;
import static java.util.Objects.requireNonNull;
import static org.apache.commons.lang.StringUtils.abbreviate;
+import static org.apache.commons.lang.StringUtils.trim;
import static org.sonar.api.utils.Preconditions.checkArgument;
import static org.sonar.api.utils.Preconditions.checkState;
@@ -64,7 +65,7 @@ public class DefaultIssueLocation implements NewIssueLocation, IssueLocation {
@Override
public DefaultIssueLocation message(String message) {
validateMessage(message);
- this.message = abbreviate(message, Issue.MESSAGE_MAX_SIZE);
+ this.message = abbreviate(trim(message), Issue.MESSAGE_MAX_SIZE);
return this;
}