diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-03-22 10:31:15 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-03-22 10:44:31 +0100 |
| commit | cf8245b3613546cbc20ba22b44135e3500c06f66 (patch) | |
| tree | b303d3cc8c1674751390e0e43812302df5f9ac68 /main/src/cgeo/geocaching/ui | |
| parent | 35aac9930fc3441fb2d0d627a077b9e9b7c73f80 (diff) | |
| download | cgeo-cf8245b3613546cbc20ba22b44135e3500c06f66.zip cgeo-cf8245b3613546cbc20ba22b44135e3500c06f66.tar.gz cgeo-cf8245b3613546cbc20ba22b44135e3500c06f66.tar.bz2 | |
Add more @NonNull annotations
Diffstat (limited to 'main/src/cgeo/geocaching/ui')
| -rw-r--r-- | main/src/cgeo/geocaching/ui/CacheListAdapter.java | 3 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/ui/CompassMiniView.java | 6 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/ui/DistanceView.java | 6 |
3 files changed, 10 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java index f30c0bd..9d9a32f 100644 --- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java +++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java @@ -24,6 +24,7 @@ import cgeo.geocaching.utils.Log; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.eclipse.jdt.annotation.NonNull; import android.app.Activity; import android.content.res.Resources; @@ -279,7 +280,7 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> { notifyDataSetChanged(); } - public void setActualCoordinates(final Geopoint coords) { + public void setActualCoordinates(@NonNull final Geopoint coords) { this.coords = coords; updateSortByDistance(); diff --git a/main/src/cgeo/geocaching/ui/CompassMiniView.java b/main/src/cgeo/geocaching/ui/CompassMiniView.java index 260c990..c9f5822 100644 --- a/main/src/cgeo/geocaching/ui/CompassMiniView.java +++ b/main/src/cgeo/geocaching/ui/CompassMiniView.java @@ -5,6 +5,8 @@ import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.settings.Settings; import cgeo.geocaching.utils.AngleUtils; +import org.eclipse.jdt.annotation.NonNull; + import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -107,8 +109,8 @@ final public class CompassMiniView extends View { updateDirection(); } - public void updateCurrentCoords(final Geopoint currentCoords) { - if (currentCoords == null || targetCoords == null) { + public void updateCurrentCoords(@NonNull final Geopoint currentCoords) { + if (targetCoords == null) { return; } diff --git a/main/src/cgeo/geocaching/ui/DistanceView.java b/main/src/cgeo/geocaching/ui/DistanceView.java index b36166d..a61fc4d 100644 --- a/main/src/cgeo/geocaching/ui/DistanceView.java +++ b/main/src/cgeo/geocaching/ui/DistanceView.java @@ -3,6 +3,8 @@ package cgeo.geocaching.ui; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.geopoint.Units; +import org.eclipse.jdt.annotation.NonNull; + import android.content.Context; import android.util.AttributeSet; import android.widget.TextView; @@ -26,8 +28,8 @@ public class DistanceView extends TextView { cacheCoords = cacheCoordsIn; } - public void update(final Geopoint coords) { - if (cacheCoords == null || coords == null) { + public void update(@NonNull final Geopoint coords) { + if (cacheCoords == null) { return; } setText(Units.getDistanceFromKilometers(coords.distanceTo(cacheCoords))); |
