From 0a77d3391f68b46a701ff0779766b34dfbf97e8d Mon Sep 17 00:00:00 2001 From: "andreas.schildbach" Date: Fri, 5 Nov 2010 21:50:10 +0000 Subject: [PATCH] workaround zebra mechanism is currently broken on service git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@344 0924bc21-9374-b0fa-ee44-9ff1593b38f0 --- src/de/schildbach/pte/SbbProvider.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/de/schildbach/pte/SbbProvider.java b/src/de/schildbach/pte/SbbProvider.java index 7666478e..13a72234 100644 --- a/src/de/schildbach/pte/SbbProvider.java +++ b/src/de/schildbach/pte/SbbProvider.java @@ -108,7 +108,8 @@ public class SbbProvider extends AbstractHafasProvider public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException { - final CharSequence page = ParserUtils.scrape(departuresQueryUri(stationId, maxDepartures)); + final String uri = departuresQueryUri(stationId, maxDepartures); + final CharSequence page = ParserUtils.scrape(uri); // parse page final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page); @@ -131,16 +132,17 @@ public class SbbProvider extends AbstractHafasProvider .parseTime(mHeadFine.group(2))); final int locationId = Integer.parseInt(mHeadFine.group(4)); final List departures = new ArrayList(8); - String oldZebra = null; + // String oldZebra = null; final Matcher mDepCoarse = P_DEPARTURES_COARSE.matcher(mHeadCoarse.group(2)); while (mDepCoarse.find()) { - final String zebra = mDepCoarse.group(1); - if (oldZebra != null && zebra.equals(oldZebra)) - throw new IllegalArgumentException("missed row? last:" + zebra); - else - oldZebra = zebra; + // zebra mechanism is currently broken on service + // final String zebra = mDepCoarse.group(1); + // if (oldZebra != null && zebra.equals(oldZebra)) + // throw new IllegalArgumentException("missed row? last:" + zebra); + // else + // oldZebra = zebra; final Matcher mDepFine = P_DEPARTURES_FINE.matcher(mDepCoarse.group(2)); if (mDepFine.matches())