1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Substitute MXParser with a call to XmlPullParserFactory

This makes Smack more portable, as there are platforms that support the
XmlPullParser interface, but not MXParser (e.g. Android).

Also enable checkstyle check that MXParser is not used.
This commit is contained in:
Florian Schmaus 2014-02-20 13:38:12 +01:00
parent 4db0b101c2
commit 24b637876f
18 changed files with 40 additions and 35 deletions

View file

@ -23,7 +23,7 @@ import org.jivesoftware.smack.sasl.SASLMechanism.Challenge;
import org.jivesoftware.smack.sasl.SASLMechanism.Failure;
import org.jivesoftware.smack.sasl.SASLMechanism.Success;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.xmlpull.mxp1.MXParser;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlPullParser;
import org.igniterealtime.jbosh.AbstractBody;
import org.igniterealtime.jbosh.BOSHClientResponseListener;
@ -66,7 +66,7 @@ public class BOSHPacketReader implements BOSHClientResponseListener {
if (connection.authID == null) {
connection.authID = body.getAttribute(BodyQName.create(BOSHConnection.BOSH_URI, "authid"));
}
final XmlPullParser parser = new MXParser();
final XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES,
true);
parser.setInput(new StringReader(body.toXML()));