Merge branch 'master' into development

This commit is contained in:
Daniel Gultsch 2014-04-18 01:07:45 +02:00
commit 625fbe7d81
1 changed files with 28 additions and 24 deletions

View File

@ -51,8 +51,9 @@ public class XmlReader {
public Tag readTag() throws XmlPullParserException, IOException { public Tag readTag() throws XmlPullParserException, IOException {
if (wakeLock.isHeld()) { if (wakeLock.isHeld()) {
wakeLock.release(); //release wake look while waiting on next parser event wakeLock.release();
} }
try {
while(parser.next() != XmlPullParser.END_DOCUMENT) { while(parser.next() != XmlPullParser.END_DOCUMENT) {
wakeLock.acquire(); wakeLock.acquire();
if (parser.getEventType() == XmlPullParser.START_TAG) { if (parser.getEventType() == XmlPullParser.START_TAG) {
@ -76,7 +77,10 @@ public class XmlReader {
if (wakeLock.isHeld()) { if (wakeLock.isHeld()) {
wakeLock.release(); wakeLock.release();
} }
return null; //end document; } catch (ArrayIndexOutOfBoundsException e) {
throw new IOException("xml parser mishandled ArrayIndexOufOfBounds", e);
}
return null;
} }
public Element readElement(Tag currentTag) throws XmlPullParserException, IOException { public Element readElement(Tag currentTag) throws XmlPullParserException, IOException {