From 84dbc788ab15d65a09e70c3f84d8cd6dfd7b372b Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Fri, 6 Feb 2015 11:07:41 +0100 Subject: [PATCH] Clear warnings about unused variables and methods. --- .../schildbach/pte/AbstractEfaProvider.java | 2 +- .../schildbach/pte/AbstractHafasProvider.java | 35 +++---------------- .../schildbach/pte/AbstractTsiProvider.java | 4 --- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/enabler/src/de/schildbach/pte/AbstractEfaProvider.java b/enabler/src/de/schildbach/pte/AbstractEfaProvider.java index b3ed2551..509c9c6e 100644 --- a/enabler/src/de/schildbach/pte/AbstractEfaProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractEfaProvider.java @@ -1679,7 +1679,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider // misc /* final String stationName = */normalizeLocationName(XmlPullUtil.valueTag(pp, "n")); - final boolean isRealtime = XmlPullUtil.valueTag(pp, "realtime").equals("1"); + /* final boolean isRealtime = */XmlPullUtil.valueTag(pp, "realtime").equals("1"); XmlPullUtil.optSkip(pp, "dt"); diff --git a/enabler/src/de/schildbach/pte/AbstractHafasProvider.java b/enabler/src/de/schildbach/pte/AbstractHafasProvider.java index be55a76c..701e59c6 100644 --- a/enabler/src/de/schildbach/pte/AbstractHafasProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractHafasProvider.java @@ -324,20 +324,6 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider throw new IllegalStateException("cannot handle: " + type); } - private final Location parseReqLoc(final XmlPullParser pp) - { - final String type = pp.getName(); - if ("ReqLoc".equals(type)) - { - XmlPullUtil.requireAttr(pp, "type", "ADR"); - final String name = XmlPullUtil.attr(pp, "output"); - - final String[] placeAndName = splitAddress(name); - return new Location(LocationType.ADDRESS, null, placeAndName[0], placeAndName[1]); - } - throw new IllegalStateException("cannot handle: " + type); - } - private final Position parsePlatform(final XmlPullParser pp) throws XmlPullParserException, IOException { XmlPullUtil.enter(pp, "Platform"); @@ -1063,7 +1049,6 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider String name = null; String category = null; String shortCategory = null; - String longCategory = null; while (XmlPullUtil.test(pp, "JourneyAttribute")) { XmlPullUtil.enter(pp, "JourneyAttribute"); @@ -1087,7 +1072,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider { shortCategory = attributeVariants.get("SHORT"); category = attributeVariants.get("NORMAL"); - longCategory = attributeVariants.get("LONG"); + // longCategory = attributeVariants.get("LONG"); } else if ("DIRECTION".equals(attrName)) { @@ -1256,7 +1241,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider private final Location parseLocation(final XmlPullParser pp) throws XmlPullParserException, IOException { - Location location; + final Location location; if (pp.getName().equals("Station")) location = parseStation(pp); else if (pp.getName().equals("Poi")) @@ -1314,17 +1299,6 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider calendar.add(Calendar.DAY_OF_MONTH, Integer.parseInt(m.group(1))); } - private static final Pattern P_DURATION = Pattern.compile("(\\d+):(\\d{2})"); - - private static final int parseDuration(final CharSequence str) - { - final Matcher m = P_DURATION.matcher(str); - if (m.matches()) - return Integer.parseInt(m.group(1)) * 60 + Integer.parseInt(m.group(2)); - else - throw new IllegalArgumentException("cannot parse duration: '" + str + "'"); - } - private static final String locationXml(final Location location) { if (location.type == LocationType.STATION && location.hasId()) @@ -1801,7 +1775,6 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider String directionStr = null; int lineClass = 0; String lineCategory = null; - String lineOperator = null; String routingType = null; while (true) { @@ -1814,8 +1787,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider lineClass = Integer.parseInt(strings.read(is)); else if (key.equals("Category")) lineCategory = strings.read(is); - else if (key.equals("Operator")) - lineOperator = strings.read(is); + // else if (key.equals("Operator")) + // lineOperator = strings.read(is); else if (key.equals("GisRoutingType")) routingType = strings.read(is); else diff --git a/enabler/src/de/schildbach/pte/AbstractTsiProvider.java b/enabler/src/de/schildbach/pte/AbstractTsiProvider.java index 1b34c070..39da44fb 100644 --- a/enabler/src/de/schildbach/pte/AbstractTsiProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractTsiProvider.java @@ -66,9 +66,7 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider { private static final long serialVersionUID = -6847355540229473013L; - public final Accessibility accessibility; public final Location from; - public final Set