HDFS-12828. OIV ReverseXML Processor fails with escaped characters

Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
Erik Krogen 2018-04-18 14:38:23 +09:00 committed by Akira Ajisaka
parent bcb57b1f89
commit 2d9e791a90
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
2 changed files with 8 additions and 3 deletions

View File

@ -385,8 +385,8 @@ private void loadNodeChildrenHelper(Node parent, String expected,
break;
case XMLEvent.CHARACTERS:
String val = XMLUtils.
unmangleXmlString(ev.asCharacters().getData(), true);
parent.setVal(val);
unmangleXmlString(ev.asCharacters().getData(), false);
parent.setVal(parent.getVal() + val);
events.nextEvent();
break;
case XMLEvent.ATTRIBUTE:

View File

@ -194,10 +194,15 @@ public static void createOriginalFSImage() throws IOException {
dirCount++;
writtenFiles.put(emptydir.toString(), hdfs.getFileStatus(emptydir));
//Create a directory whose name should be escaped in XML
//Create directories whose name should be escaped in XML
Path invalidXMLDir = new Path("/dirContainingInvalidXMLChar\u0000here");
hdfs.mkdirs(invalidXMLDir);
dirCount++;
Path entityRefXMLDir = new Path("/dirContainingEntityRef&here");
hdfs.mkdirs(entityRefXMLDir);
dirCount++;
writtenFiles.put(entityRefXMLDir.toString(),
hdfs.getFileStatus(entityRefXMLDir));
//Create a directory with sticky bits
Path stickyBitDir = new Path("/stickyBit");