Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Commit

Permalink
Use StringEscapeUtils.escapeXml() instead of escapeHtml() in all places
Browse files Browse the repository at this point in the history
This is not strictly required for fixing tests, but for consistency with
analysis-core.

Also, the Lint results file in fact is XML instead of HTML, so escapeXml()
is the more appropriate method.
  • Loading branch information
sschuberth committed Sep 16, 2014
1 parent dcbe37f commit feac537
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -100,7 +100,7 @@ private Collection<FileAnnotation> convert(final List<LintIssue> issues, final S

final Priority priority = getPriority(issue.getSeverity());
String category = issue.getCategory();
String explanation = StringEscapeUtils.escapeHtml(issue.getExplanation());
String explanation = StringEscapeUtils.escapeXml(issue.getExplanation());

// If category is missing the file is from pre-r21 Lint, so show an explanation
if (category == null) {
Expand All @@ -112,8 +112,8 @@ private Collection<FileAnnotation> convert(final List<LintIssue> issues, final S
LintAnnotation annotation = new LintAnnotation(priority, issue.getMessage(),
category, issue.getId(), lineNumber);
annotation.setExplanation(explanation);
annotation.setErrorLines(StringEscapeUtils.escapeHtml(issue.getErrorLine1()),
StringEscapeUtils.escapeHtml(issue.getErrorLine2()));
annotation.setErrorLines(StringEscapeUtils.escapeXml(issue.getErrorLine1()),
StringEscapeUtils.escapeXml(issue.getErrorLine2()));
annotation.setModuleName(moduleName);
annotation.setFileName(filename);

Expand Down

0 comments on commit feac537

Please sign in to comment.