summaryrefslogtreecommitdiffstats
path: root/xml/src/main/java
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2011-02-14 13:48:28 -0800
committerJesse Wilson <jessewilson@google.com>2011-02-14 13:48:28 -0800
commit6964efff70b23aaa1b4ce983a036ebc0b2d6d408 (patch)
tree66ff62ff1ca515a5e17576668a6a881bff04632d /xml/src/main/java
parent4266d94c95569a9add5cf5a1f0382d3e29325b9e (diff)
parent995a384234fd0ba9233ebcce380628bbe346b911 (diff)
downloadlibcore-6964efff70b23aaa1b4ce983a036ebc0b2d6d408.zip
libcore-6964efff70b23aaa1b4ce983a036ebc0b2d6d408.tar.gz
libcore-6964efff70b23aaa1b4ce983a036ebc0b2d6d408.tar.bz2
Merge commit '995a3842' into manualmerge
Conflicts: expectations/knownfailures.txt Change-Id: Iee137d2c0c5e8bfa6994258f5fab8e07caeb86e1
Diffstat (limited to 'xml/src/main/java')
-rw-r--r--xml/src/main/java/org/kxml2/io/KXmlParser.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/xml/src/main/java/org/kxml2/io/KXmlParser.java b/xml/src/main/java/org/kxml2/io/KXmlParser.java
index f9d6461..4b4f328 100644
--- a/xml/src/main/java/org/kxml2/io/KXmlParser.java
+++ b/xml/src/main/java/org/kxml2/io/KXmlParser.java
@@ -422,6 +422,10 @@ public class KXmlParser implements XmlPullParser, Closeable {
throw new XmlPullParserException("Unexpected token", this, null);
}
+ if (depth == 0 && (type == ENTITY_REF || type == TEXT || type == CDSECT)) {
+ throw new XmlPullParserException("Unexpected token", this, null);
+ }
+
if (justOneToken) {
return type;
}
@@ -2027,7 +2031,6 @@ public class KXmlParser implements XmlPullParser, Closeable {
public void require(int type, String namespace, String name)
throws XmlPullParserException, IOException {
-
if (type != this.type
|| (namespace != null && !namespace.equals(getNamespace()))
|| (name != null && !name.equals(getName()))) {