AbstractEfaProvider: Replace a few XmlPullUtil.test() with require().

This commit is contained in:
Andreas Schildbach 2020-10-22 10:06:55 +02:00
parent 3d294186bd
commit 79db154891

View file

@ -659,8 +659,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
private String processItdOdv(final XmlPullParser pp, final String expectedUsage, private String processItdOdv(final XmlPullParser pp, final String expectedUsage,
final ProcessItdOdvCallback callback) throws XmlPullParserException, IOException { final ProcessItdOdvCallback callback) throws XmlPullParserException, IOException {
if (!XmlPullUtil.test(pp, "itdOdv")) XmlPullUtil.require(pp, "itdOdv");
throw new IllegalStateException("expecting <itdOdv />");
final String usage = XmlPullUtil.attr(pp, "usage"); final String usage = XmlPullUtil.attr(pp, "usage");
if (expectedUsage != null && !usage.equals(expectedUsage)) if (expectedUsage != null && !usage.equals(expectedUsage))
@ -725,8 +724,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
} }
private String processItdOdvPlace(final XmlPullParser pp) throws XmlPullParserException, IOException { private String processItdOdvPlace(final XmlPullParser pp) throws XmlPullParserException, IOException {
if (!XmlPullUtil.test(pp, "itdOdvPlace")) XmlPullUtil.require(pp, "itdOdvPlace");
throw new IllegalStateException("expecting <itdOdvPlace />");
final String placeState = XmlPullUtil.attr(pp, "state"); final String placeState = XmlPullUtil.attr(pp, "state");
@ -743,8 +741,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
private Location processOdvNameElem(final XmlPullParser pp, String type, final String defaultPlace) private Location processOdvNameElem(final XmlPullParser pp, String type, final String defaultPlace)
throws XmlPullParserException, IOException { throws XmlPullParserException, IOException {
if (!XmlPullUtil.test(pp, "odvNameElem")) XmlPullUtil.require(pp, "odvNameElem");
throw new IllegalStateException("expecting <odvNameElem />");
if ("any".equals(type)) if ("any".equals(type))
type = XmlPullUtil.attr(pp, "anyType"); type = XmlPullUtil.attr(pp, "anyType");