diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-01-06 19:55:41 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-01-06 19:55:41 +0100 |
| commit | a1db955beb5d0675161311eb80ba7d3cd4783bd0 (patch) | |
| tree | 46594005f0718dccde475938d503e3aefc384af9 /main/src/cgeo/geocaching/connector/oc/OCXMLClient.java | |
| parent | 55447b57ab4c34c28e8af900c2ec8f74918f111c (diff) | |
| download | cgeo-a1db955beb5d0675161311eb80ba7d3cd4783bd0.zip cgeo-a1db955beb5d0675161311eb80ba7d3cd4783bd0.tar.gz cgeo-a1db955beb5d0675161311eb80ba7d3cd4783bd0.tar.bz2 | |
fix: OC connector didn't set timestamp of cache
* lead to "updated 15000 days ago"
Diffstat (limited to 'main/src/cgeo/geocaching/connector/oc/OCXMLClient.java')
| -rw-r--r-- | main/src/cgeo/geocaching/connector/oc/OCXMLClient.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/main/src/cgeo/geocaching/connector/oc/OCXMLClient.java b/main/src/cgeo/geocaching/connector/oc/OCXMLClient.java index 26b42e3..88ba5a1 100644 --- a/main/src/cgeo/geocaching/connector/oc/OCXMLClient.java +++ b/main/src/cgeo/geocaching/connector/oc/OCXMLClient.java @@ -13,12 +13,12 @@ import cgeo.geocaching.utils.Log; import ch.boye.httpclientandroidlib.HttpResponse; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.io.IOException; import java.io.InputStream; import java.util.Collection; +import java.util.Collections; import java.util.Locale; import java.util.zip.GZIPInputStream; @@ -42,18 +42,16 @@ public class OCXMLClient { Collection<cgCache> caches = OC11XMLParser.parseCaches(new GZIPInputStream(data)); if (caches.iterator().hasNext()) { cgCache cache = caches.iterator().next(); - cache.setDetailed(true); cgData.saveCache(cache, LoadFlags.SAVE_ALL); return cache; } return null; } catch (IOException e) { - Log.e("Error parsing cache '" + geoCode + "': " + e.toString()); + Log.e("Error parsing cache '" + geoCode + "'", e); return null; } } - @SuppressWarnings("unchecked") public static Collection<cgCache> getCachesAround(final Geopoint center, final double distance) { try { final Parameters params = getOCXmlQueryParameters(false, false); @@ -63,13 +61,13 @@ public class OCXMLClient { final InputStream data = request(ConnectorFactory.getConnector("OCXXX"), SERVICE_CACHE, params); if (data == null) { - return CollectionUtils.EMPTY_COLLECTION; + return Collections.emptyList(); } return OC11XMLParser.parseCaches(new GZIPInputStream(data)); } catch (IOException e) { - Log.e("Error parsing nearby search result: " + e.toString()); - return CollectionUtils.EMPTY_COLLECTION; + Log.e("Error parsing nearby search result", e); + return Collections.emptyList(); } } |
