1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 01:29: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

@ -22,7 +22,7 @@ import java.io.StringReader;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.util.StringUtils;
import org.xmlpull.mxp1.MXParser;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlPullParser;
/**
@ -179,7 +179,7 @@ public class Macros extends IQ {
public MacroGroup parseMacroGroups(String macros) throws Exception {
MacroGroup group = null;
XmlPullParser parser = new MXParser();
XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
parser.setInput(new StringReader(macros));
int eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {