sonos

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b0f0d72de20458e9191a9a22852ea4f41a14b391
parent 959d919f79b883ec877426264df5783fe33f3527
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun,  7 Aug 2011 05:27:19 -0700

XML: work around an Android runtime bug

Sadly, Matcher caches the toString() value of CharSequences its matching against,
so we have to reset() it (causing even more copies...) from time to time.

Diffstat:
Mnet/frotz/sonos/XML.java | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/frotz/sonos/XML.java b/net/frotz/sonos/XML.java @@ -92,6 +92,10 @@ public class XML { tmp.offset = 0; tmp.count = end; + + /* hack: work around Android bug */ + mAttr.reset(tmp); + while (mAttr.find(off)) { //System.err.println("ANAME: " + mAttr.group(1)); //System.err.println("ATEXT: " + mAttr.group(2)); @@ -251,6 +255,9 @@ public class XML { } void nextTag() { + /* hack: work around Android bug */ + mTag.reset(seq); + /* can't deal with comments or directives */ if (!mTag.find(offset)) { tag.adjust(0,0);