diff options
| author | Michael Keppler <bananeweizen@gmx.de> | 2013-12-23 17:43:57 +0100 |
|---|---|---|
| committer | Michael Keppler <bananeweizen@gmx.de> | 2013-12-23 17:43:57 +0100 |
| commit | 3652910d49777fa5b2303acce347255d56842044 (patch) | |
| tree | 56111b307a01b0652eb0cd7913afe49e9a984c88 /main/src | |
| parent | 460dba542114fab474f79bc01799247be7f81442 (diff) | |
| download | cgeo-3652910d49777fa5b2303acce347255d56842044.zip cgeo-3652910d49777fa5b2303acce347255d56842044.tar.gz cgeo-3652910d49777fa5b2303acce347255d56842044.tar.bz2 | |
fix some findbugs findings
Diffstat (limited to 'main/src')
4 files changed, 8 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index 241f180..6262792 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -1722,10 +1722,10 @@ public class Geocache implements ICache, IWaypoint { final MatcherWrapper matcher = new MatcherWrapper(pattern, getDescription()); while (matcher.find()) { try { - final int hours = Integer.valueOf(matcher.group(1)); + final int hours = Integer.parseInt(matcher.group(1)); int minutes = 0; if (matcher.groupCount() >= 2) { - minutes = Integer.valueOf(matcher.group(2)); + minutes = Integer.parseInt(matcher.group(2)); } if (hours >= 0 && hours < 24 && minutes >= 0 && minutes < 60) { return String.valueOf(hours * 60 + minutes); diff --git a/main/src/cgeo/geocaching/connector/trackable/GeokretyParser.java b/main/src/cgeo/geocaching/connector/trackable/GeokretyParser.java index 67180b3..9cb5dc5 100644 --- a/main/src/cgeo/geocaching/connector/trackable/GeokretyParser.java +++ b/main/src/cgeo/geocaching/connector/trackable/GeokretyParser.java @@ -37,15 +37,15 @@ public class GeokretyParser { try { final int indexId = attributes.getIndex("id"); if (indexId > -1) { - trackable.setGeocode(geocode(Integer.valueOf(attributes.getValue("id")))); + trackable.setGeocode(geocode(Integer.parseInt(attributes.getValue("id")))); } final int indexDist = attributes.getIndex("dist"); if (indexDist > -1) { - trackable.setDistance(Float.valueOf(attributes.getValue("dist"))); + trackable.setDistance(Float.parseFloat(attributes.getValue("dist"))); } final int indexType = attributes.getIndex("type"); if (indexType > -1) { - trackable.setType(getType(Integer.valueOf(attributes.getValue("type")))); + trackable.setType(getType(Integer.parseInt(attributes.getValue("type")))); } final int indexWaypoint = attributes.getIndex("waypoint"); if (indexWaypoint > -1) { diff --git a/main/src/cgeo/geocaching/settings/SettingsActivity.java b/main/src/cgeo/geocaching/settings/SettingsActivity.java index 2cb9547..cd9296e 100644 --- a/main/src/cgeo/geocaching/settings/SettingsActivity.java +++ b/main/src/cgeo/geocaching/settings/SettingsActivity.java @@ -473,7 +473,7 @@ public class SettingsActivity extends PreferenceActivity { // reset the cached map source MapSource mapSource; try { - final int mapSourceId = Integer.valueOf(stringValue); + final int mapSourceId = Integer.parseInt(stringValue); mapSource = MapProviderFactory.getMapSource(mapSourceId); } catch (final NumberFormatException e) { Log.e("SettingsActivity.onPreferenceChange: bad source id '" + stringValue + "'"); diff --git a/main/src/cgeo/geocaching/ui/AddressListAdapter.java b/main/src/cgeo/geocaching/ui/AddressListAdapter.java index 0d5fba7..8134235 100644 --- a/main/src/cgeo/geocaching/ui/AddressListAdapter.java +++ b/main/src/cgeo/geocaching/ui/AddressListAdapter.java @@ -11,7 +11,6 @@ import cgeo.geocaching.geopoint.Units; import org.apache.commons.lang3.StringUtils; import android.app.Activity; -import android.content.Context; import android.location.Address; import android.view.LayoutInflater; import android.view.View; @@ -35,9 +34,9 @@ public class AddressListAdapter extends ArrayAdapter<Address> { } } - public AddressListAdapter(final Context context) { + public AddressListAdapter(final Activity context) { super(context, 0); - inflater = ((Activity) context).getLayoutInflater(); + inflater = context.getLayoutInflater(); location = CgeoApplication.getInstance().currentGeo().getCoords(); } |
