diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2012-04-21 18:07:04 +0200 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2012-04-21 18:25:57 +0200 |
commit | 2dbaee334b97ea1123d8a245bc247d918ba2c6fb (patch) | |
tree | b8801f2a24cad81c23fc0e101a7d84b0f622744d /main/src/cgeo/geocaching/connector | |
parent | 1d1bcd7661e11ef079d8b23f9c531397e835ba3b (diff) | |
download | cgeo-2dbaee334b97ea1123d8a245bc247d918ba2c6fb.zip cgeo-2dbaee334b97ea1123d8a245bc247d918ba2c6fb.tar.gz cgeo-2dbaee334b97ea1123d8a245bc247d918ba2c6fb.tar.bz2 |
Refactoring: keep GeopointParser private to its package
Geopoint exposes everything GeopointParser can do. By calling a Geopoint
constructor instead of a GeopointParser method returning a Geopoint,
Eclipse can do more null checks for free (a constuctor can never return
a null object).
Diffstat (limited to 'main/src/cgeo/geocaching/connector')
-rw-r--r-- | main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java b/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java index 4e4d9f7..80ad58e 100644 --- a/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java +++ b/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java @@ -1,8 +1,8 @@ package cgeo.geocaching.connector.opencaching; +import cgeo.geocaching.LogEntry; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgImage; -import cgeo.geocaching.LogEntry; import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.connector.ConnectorFactory; import cgeo.geocaching.connector.IConnector; @@ -12,7 +12,6 @@ import cgeo.geocaching.enumerations.LoadFlags.SaveFlag; import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.geopoint.GeopointFormatter; -import cgeo.geocaching.geopoint.GeopointParser; import cgeo.geocaching.network.Network; import cgeo.geocaching.network.Parameters; import cgeo.geocaching.utils.Log; @@ -248,7 +247,7 @@ final public class OkapiClient { final String latitude = StringUtils.substringBefore(location, "|"); final String longitude = StringUtils.substringAfter(location, "|"); // FIXME: the next line should be a setter at cgCache - cache.setCoords(GeopointParser.parse(latitude, longitude)); + cache.setCoords(new Geopoint(latitude, longitude)); } private static CacheSize getCacheSize(final JSONObject response) { |