HADOOP-7542. Reverting the patch to address issues.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1178308 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2011-10-03 06:45:10 +00:00
parent 7aa8a3c9f8
commit 4ee39ffe6a
3 changed files with 2 additions and 22 deletions

View File

@ -4,10 +4,6 @@ Trunk (unreleased changes)
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES
HADOOP-7542. Change Configuration XML format to 1.1 to add support for
serializing additional characters. This requires XML1.1
support in the XML parser (Christopher Egner via harsh)
IMPROVEMENTS IMPROVEMENTS
HADOOP-7595. Upgrade dependency to Avro 1.5.3. (Alejandro Abdelnur via atm) HADOOP-7595. Upgrade dependency to Avro 1.5.3. (Alejandro Abdelnur via atm)

View File

@ -1632,10 +1632,6 @@ private synchronized Document asXmlDocument() throws IOException {
try { try {
doc = doc =
DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
// Allow a broader set of control characters to appear in job confs.
// cf https://issues.apache.org/jira/browse/MAPREDUCE-109
doc.setXmlVersion( "1.1" );
} catch (ParserConfigurationException pe) { } catch (ParserConfigurationException pe) {
throw new IOException(pe); throw new IOException(pe);
} }

View File

@ -58,7 +58,7 @@ protected void tearDown() throws Exception {
} }
private void startConfig() throws IOException{ private void startConfig() throws IOException{
out.write("<?xml version=\"1.1\"?>\n"); out.write("<?xml version=\"1.0\"?>\n");
out.write("<configuration>\n"); out.write("<configuration>\n");
} }
@ -221,18 +221,6 @@ public void testCommentsInValue() throws IOException {
assertEquals("this contains a comment", conf.get("my.comment")); assertEquals("this contains a comment", conf.get("my.comment"));
} }
public void testControlAInValue() throws IOException {
out = new BufferedWriter(new FileWriter(CONFIG));
startConfig();
appendProperty("my.char", "&#1;");
appendProperty("my.string", "some&#1;string");
endConfig();
Path fileResource = new Path(CONFIG);
conf.addResource(fileResource);
assertEquals("\u0001", conf.get("my.char"));
assertEquals("some\u0001string", conf.get("my.string"));
}
public void testTrim() throws IOException { public void testTrim() throws IOException {
out=new BufferedWriter(new FileWriter(CONFIG)); out=new BufferedWriter(new FileWriter(CONFIG));
startConfig(); startConfig();
@ -310,7 +298,7 @@ public void testWriteXml() throws IOException {
conf.writeXml(baos); conf.writeXml(baos);
String result = baos.toString(); String result = baos.toString();
assertTrue("Result has proper header", result.startsWith( assertTrue("Result has proper header", result.startsWith(
"<?xml version=\"1.1\" encoding=\"UTF-8\" standalone=\"no\"?><configuration>")); "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><configuration>"));
assertTrue("Result has proper footer", result.endsWith("</configuration>")); assertTrue("Result has proper footer", result.endsWith("</configuration>"));
} }