Merge branch 'bug-1499' into pmd/5.4.x

This commit is contained in:
Andreas Dangel
2016-07-02 16:54:50 +02:00
3 changed files with 7 additions and 3 deletions

View File

@ -77,7 +77,7 @@ public final class XMLRenderer implements Renderer {
transformer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS, "codefragment");
StringWriter writer = new StringWriter();
transformer.transform(new DOMSource(doc), new StreamResult(writer));
return writer.getBuffer().toString();
return writer.toString();
} catch (TransformerException e) {
throw new IllegalStateException(e);
}

View File

@ -12,6 +12,8 @@ import org.junit.contrib.java.lang.system.RestoreSystemProperties;
import org.junit.contrib.java.lang.system.StandardOutputStreamLog;
import org.junit.rules.TestRule;
import net.sourceforge.pmd.PMD;
public class CPDCommandLineInterfaceTest {
@Rule
public final TestRule restoreSystemProperties = new RestoreSystemProperties();
@ -27,7 +29,6 @@ public class CPDCommandLineInterfaceTest {
"--files", "src/test/resources/net/sourceforge/pmd/cpd/files/",
"--format", "xml"
});
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<pmd-cpd/>\n", log.getLog());
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "\n" + "<pmd-cpd/>" + PMD.EOL, log.getLog());
}
}

View File

@ -14,4 +14,7 @@
**Bugfixes:**
* General
* [#1499](https://sourceforge.net/p/pmd/bugs/1499/): \[core] CPD test break PMD 5.5.1 build on Windows
**API Changes:**