aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-05-01 13:18:51 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-05-01 13:18:51 +0200
commit410304e78e04a6c3c4518ef0d330995efceb62bc (patch)
treea036f055a90fd31bf82f6398181b21816ad53acf
parent878efd5db1801390858d2f859fce2f6d9eeee272 (diff)
downloadcgeo-410304e78e04a6c3c4518ef0d330995efceb62bc.zip
cgeo-410304e78e04a6c3c4518ef0d330995efceb62bc.tar.gz
cgeo-410304e78e04a6c3c4518ef0d330995efceb62bc.tar.bz2
Remove useless fields, and introduce local variables as needed
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java3
-rw-r--r--main/src/cgeo/geocaching/maps/CachesOverlay.java3
-rw-r--r--main/src/cgeo/geocaching/maps/PositionOverlay.java5
-rw-r--r--main/src/cgeo/geocaching/ui/CacheListAdapter.java2
4 files changed, 4 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index 3e4cca3..4414277 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -117,7 +117,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
private static final String BUNDLE_MAP_STATE = "mapState";
private Resources res = null;
- private MapProvider mapProvider = null;
private MapItemFactory mapItemFactory = null;
private Activity activity = null;
private MapViewImpl mapView = null;
@@ -356,7 +355,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
res = this.getResources();
activity = this.getActivity();
app = (cgeoapplication) activity.getApplication();
- mapProvider = Settings.getMapProvider();
+ final MapProvider mapProvider = Settings.getMapProvider();
mapItemFactory = mapProvider.getMapItemFactory();
diff --git a/main/src/cgeo/geocaching/maps/CachesOverlay.java b/main/src/cgeo/geocaching/maps/CachesOverlay.java
index 923c5e4..9ca206e 100644
--- a/main/src/cgeo/geocaching/maps/CachesOverlay.java
+++ b/main/src/cgeo/geocaching/maps/CachesOverlay.java
@@ -39,7 +39,6 @@ public class CachesOverlay extends AbstractItemizedOverlay {
private Paint blockedCircle = null;
private PaintFlagsDrawFilter setFilter = null;
private PaintFlagsDrawFilter removeFilter = null;
- private MapProvider mapProvider = null;
private MapItemFactory mapItemFactory = null;
public CachesOverlay(ItemizedOverlayImpl ovlImpl, Context contextIn) {
@@ -49,7 +48,7 @@ public class CachesOverlay extends AbstractItemizedOverlay {
context = contextIn;
- mapProvider = Settings.getMapProvider();
+ final MapProvider mapProvider = Settings.getMapProvider();
mapItemFactory = mapProvider.getMapItemFactory();
}
diff --git a/main/src/cgeo/geocaching/maps/PositionOverlay.java b/main/src/cgeo/geocaching/maps/PositionOverlay.java
index 5c88f08..c32061d 100644
--- a/main/src/cgeo/geocaching/maps/PositionOverlay.java
+++ b/main/src/cgeo/geocaching/maps/PositionOverlay.java
@@ -7,7 +7,6 @@ import cgeo.geocaching.maps.interfaces.GeneralOverlay;
import cgeo.geocaching.maps.interfaces.GeoPointImpl;
import cgeo.geocaching.maps.interfaces.MapItemFactory;
import cgeo.geocaching.maps.interfaces.MapProjectionImpl;
-import cgeo.geocaching.maps.interfaces.MapProvider;
import cgeo.geocaching.maps.interfaces.MapViewImpl;
import cgeo.geocaching.maps.interfaces.OverlayImpl;
@@ -44,14 +43,12 @@ public class PositionOverlay implements GeneralOverlay {
private Point historyPointN = new Point();
private Point historyPointP = new Point();
private Activity activity;
- private MapProvider mapProvider = null;
private MapItemFactory mapItemFactory = null;
private OverlayImpl ovlImpl = null;
public PositionOverlay(Activity activity, OverlayImpl ovlImpl) {
this.activity = activity;
- this.mapProvider = Settings.getMapProvider();
- this.mapItemFactory = this.mapProvider.getMapItemFactory();
+ this.mapItemFactory = Settings.getMapProvider().getMapItemFactory();
this.ovlImpl = ovlImpl;
}
diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
index 99263e7..55ac16a 100644
--- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java
+++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
@@ -47,7 +47,6 @@ import java.util.Set;
public class CacheListAdapter extends ArrayAdapter<cgCache> {
- private CacheListView holder = null;
private LayoutInflater inflater = null;
private CacheComparator cacheComparator = null;
private Geopoint coords = null;
@@ -296,6 +295,7 @@ public class CacheListAdapter extends ArrayAdapter<cgCache> {
View v = rowView;
+ CacheListView holder;
if (v == null) {
v = inflater.inflate(R.layout.caches_item, null);