Remove Location.toDebugString(), use toString() instead.

This commit is contained in:
Andreas Schildbach 2014-05-14 12:37:31 +02:00
parent f2b0467f6b
commit 1b987a6b72
29 changed files with 31 additions and 36 deletions

View file

@ -1464,7 +1464,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
return "<Address type=\"WGS84\" x=\"" + location.lon + "\" y=\"" + location.lat + "\" name=\""
+ (location.place != null ? location.place + ", " : "") + location.name + "\" />";
else
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
protected final String locationId(final Location location)

View file

@ -152,7 +152,7 @@ public final class BahnProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -252,7 +252,7 @@ public final class BvgProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -131,7 +131,7 @@ public class DsbProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: '" + location.toDebugString());
throw new IllegalArgumentException("cannot handle: '" + location);
}
}

View file

@ -113,7 +113,7 @@ public class EireannProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -109,7 +109,7 @@ public class InvgProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -132,7 +132,7 @@ public class JetProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -133,7 +133,7 @@ public class LuProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -154,7 +154,7 @@ public class NasaProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -149,7 +149,7 @@ public class NriProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -124,7 +124,7 @@ public class NsProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -175,7 +175,7 @@ public class NvvProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -164,7 +164,7 @@ public class OebbProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -150,7 +150,7 @@ public class PlProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -118,7 +118,7 @@ public class RtProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -115,7 +115,7 @@ public class SbbProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -172,7 +172,7 @@ public class SeProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -132,7 +132,7 @@ public class SeptaProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -127,7 +127,7 @@ public class ShProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -144,7 +144,7 @@ public class SncbProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -161,7 +161,7 @@ public class StockholmProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -169,7 +169,7 @@ public class VbbProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: '" + location.toDebugString());
throw new IllegalArgumentException("cannot handle: '" + location);
}
}

View file

@ -137,7 +137,7 @@ public class VbnProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -140,7 +140,7 @@ public class VgsProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -180,7 +180,7 @@ public class ZvvProvider extends AbstractHafasProvider
}
else
{
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
throw new IllegalArgumentException("cannot handle: " + location);
}
}

View file

@ -126,12 +126,7 @@ public final class Location implements Serializable
@Override
public String toString()
{
return name; // invoked by AutoCompleteTextView in landscape orientation
}
public String toDebugString()
{
return "[" + type + " " + id + " " + lat + "/" + lon + " " + (place != null ? "'" + place + "'" : "null") + " '" + name + "']";
return "[" + type + " " + id + " " + lat + "/" + lon + " " + (place != null ? "\"" + place + "\"" : "null") + " \"" + name + "\"]";
}
@Override

View file

@ -42,7 +42,7 @@ public final class StationDepartures implements Serializable
final StringBuilder builder = new StringBuilder(getClass().getName());
builder.append("[");
if (location != null)
builder.append(location.toDebugString());
builder.append(location);
if (departures != null)
builder.append(" ").append(departures.size()).append(" departures");
builder.append("]");

View file

@ -301,7 +301,7 @@ public final class Trip implements Serializable
if (destination != null)
{
builder.append(",");
builder.append("destination=").append(destination.toDebugString());
builder.append("destination=").append(destination);
}
builder.append(",");
builder.append("departure=").append(departureStop);
@ -339,9 +339,9 @@ public final class Trip implements Serializable
final StringBuilder builder = new StringBuilder(getClass().getName() + "[");
builder.append("type=").append(type);
builder.append(",");
builder.append("departure=").append(departure.toDebugString());
builder.append("departure=").append(departure);
builder.append(",");
builder.append("arrival=").append(arrival.toDebugString());
builder.append("arrival=").append(arrival);
builder.append(",");
builder.append("distance=").append(distance);
builder.append(",");

View file

@ -63,7 +63,7 @@ public abstract class AbstractProviderLiveTest
{
System.out.print(autocompletes.size() + " ");
for (final Location autocomplete : autocompletes)
System.out.print(autocomplete.toDebugString() + " ");
System.out.print(autocomplete + " ");
System.out.println();
}