Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-25511] [JENKINS-17309] Reverted XML escaping of message.
Revert of fix for JENKINS-17309. Previous solution was too aggressive, it makes sense to escape only messages from parsers that parse non-XML files. XML parsers should not escape entities at all.
AbstractAnnotation never escapes entities now, only GCC parser escapes and invokes constructor with escaped message.
  • Loading branch information
uhafner committed Nov 16, 2014
1 parent 15d6527 commit 067654f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion checkstyle.iml
Expand Up @@ -20,7 +20,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.jvnet.hudson.plugins:analysis-core:1.65" level="project" />
<orderEntry type="module" module-name="analysis-core" />
<orderEntry type="library" name="Maven: de.java2html:java2html:5.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.3.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-digester3:3.2" level="project" />
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.65</version>
<version>1.66-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Expand Up @@ -7,7 +7,6 @@
import java.util.Iterator;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.junit.Test;

import static org.junit.Assert.*;
Expand Down Expand Up @@ -38,12 +37,11 @@ public void issue25511() throws InvocationTargetException {
Iterator<FileAnnotation> iterator = annotations.iterator();

FileAnnotation annotation = iterator.next();
assertEquals("Wrong message text", annotation.getMessage(),
"&apos;,&apos; is not followed by whitespace.");
assertEquals("Wrong message text", "',' is not followed by whitespace.",
annotation.getMessage());

annotation = iterator.next();
assertEquals("Wrong message text", annotation.getMessage(),
"Type hint &quot;kEvent&quot; missing for $event at position 1");
assertEquals("Wrong message text", "Type hint \"kEvent\" missing for $event at position 1", annotation.getMessage());
}

/**
Expand Down Expand Up @@ -113,7 +111,7 @@ public void analyseCheckStyleFile() throws InvocationTargetException {
"Checks that classes are designed for extension."));
assertEquals(
"Wrong message detected.",
StringEscapeUtils.escapeXml("Die Methode 'detectPackageName' ist nicht fr Vererbung entworfen - muss abstract, final oder leer sein."),
"Die Methode 'detectPackageName' ist nicht fr Vererbung entworfen - muss abstract, final oder leer sein.",
warning.getMessage());
hasChecked = true;
}
Expand Down

0 comments on commit 067654f

Please sign in to comment.