aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgeopoint.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2011-12-04 07:52:00 +0100
committerBananeweizen <bananeweizen@gmx.de>2011-12-04 07:52:00 +0100
commit8a89f929f181289e7b62b8ae7ad27801c8fd9d31 (patch)
tree19bdbb4b2250460dc5fe7aa7a5c80eba6a2be1ec /main/src/cgeo/geocaching/cgeopoint.java
parent7e04fb8a7d057abaae17a812e4461d3f50e2ef7b (diff)
downloadcgeo-8a89f929f181289e7b62b8ae7ad27801c8fd9d31.zip
cgeo-8a89f929f181289e7b62b8ae7ad27801c8fd9d31.tar.gz
cgeo-8a89f929f181289e7b62b8ae7ad27801c8fd9d31.tar.bz2
refactoring: more boxing/unboxing cleanup
Diffstat (limited to 'main/src/cgeo/geocaching/cgeopoint.java')
-rw-r--r--main/src/cgeo/geocaching/cgeopoint.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/cgeopoint.java b/main/src/cgeo/geocaching/cgeopoint.java
index 9b8d1bb..a7906bf 100644
--- a/main/src/cgeo/geocaching/cgeopoint.java
+++ b/main/src/cgeo/geocaching/cgeopoint.java
@@ -522,13 +522,10 @@ public class cgeopoint extends AbstractActivity {
if (StringUtils.isNotBlank(bearingText) && StringUtils.isNotBlank(distanceText)) {
// bearing & distance
- Double bearing = null;
+ double bearing = 0;
try {
- bearing = new Double(bearingText);
- } catch (Exception e) {
- // probably not a number
- }
- if (bearing == null) {
+ bearing = Double.parseDouble(bearingText);
+ } catch (NumberFormatException e) {
helpDialog(res.getString(R.string.err_point_bear_and_dist_title), res.getString(R.string.err_point_bear_and_dist));
return null;
}