aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorMichael Keppler <michael.keppler@gmx.de>2014-04-19 10:03:35 +0200
committerMichael Keppler <michael.keppler@gmx.de>2014-04-19 10:03:35 +0200
commit6297ba5eece1982ce8b24ad470372c9faee8e957 (patch)
tree8697a79b175b49cbc081ce2e46fd0f080b56261c /main/src
parent856133fddb826e616a994bae0c32169a5f2f781c (diff)
downloadcgeo-6297ba5eece1982ce8b24ad470372c9faee8e957.zip
cgeo-6297ba5eece1982ce8b24ad470372c9faee8e957.tar.gz
cgeo-6297ba5eece1982ce8b24ad470372c9faee8e957.tar.bz2
fix remaining warnings or document them
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/files/AbstractFileListActivity.java1
-rw-r--r--main/src/cgeo/geocaching/list/StoredList.java4
-rw-r--r--main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java5
-rw-r--r--main/src/cgeo/geocaching/ui/CacheListAdapter.java4
4 files changed, 9 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/files/AbstractFileListActivity.java b/main/src/cgeo/geocaching/files/AbstractFileListActivity.java
index 35e6265..07b4fb4 100644
--- a/main/src/cgeo/geocaching/files/AbstractFileListActivity.java
+++ b/main/src/cgeo/geocaching/files/AbstractFileListActivity.java
@@ -121,6 +121,7 @@ public abstract class AbstractFileListActivity<T extends ArrayAdapter<File>> ext
}
+ @SuppressWarnings("static-method")
protected boolean requireFiles() {
return true;
}
diff --git a/main/src/cgeo/geocaching/list/StoredList.java b/main/src/cgeo/geocaching/list/StoredList.java
index 7e2a83c..6aa1975 100644
--- a/main/src/cgeo/geocaching/list/StoredList.java
+++ b/main/src/cgeo/geocaching/list/StoredList.java
@@ -150,7 +150,9 @@ public final class StoredList extends AbstractList {
@Override
public void call(final String listName) {
final int newId = DataStore.createList(listName);
- new StoredList(newId, listName, 0);
+
+ // We need to update the list cache by creating a new object here.
+ @SuppressWarnings("unused") StoredList list = new StoredList(newId, listName, 0);
if (newId >= DataStore.customListIdOffset) {
ActivityMixin.showToast(activity, res.getString(R.string.list_dialog_create_ok));
diff --git a/main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java b/main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java
index 2b171b4..968dce5 100644
--- a/main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java
+++ b/main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java
@@ -34,12 +34,13 @@ public abstract class AbstractCacheComparator implements CacheComparator {
/**
* Check necessary preconditions (like missing fields) before running the comparison itself.
* Caches not filling the conditions will be placed last, sorted by Geocode.
- *
+ *
* The default returns <code>true</code> and can be overridden if needed in child classes.
- *
+ *
* @param cache
* @return <code>true</code> if the cache holds the necessary data to be compared meaningfully
*/
+ @SuppressWarnings("static-method")
protected boolean canCompare(final Geocache cache) {
return true;
}
diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
index d827e3e..0d90d9f 100644
--- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java
+++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
@@ -377,7 +377,7 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> {
final boolean lightSkin = Settings.isLightSkin();
- final TouchListener touchListener = new TouchListener(cache, v);
+ final TouchListener touchListener = new TouchListener(cache);
v.setOnClickListener(touchListener);
v.setOnLongClickListener(touchListener);
v.setOnTouchListener(touchListener);
@@ -541,7 +541,7 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> {
private final Geocache cache;
private final GestureDetector gestureDetector;
- public TouchListener(final Geocache cache, final View view) {
+ public TouchListener(final Geocache cache) {
this.cache = cache;
gestureDetector = new GestureDetector(getContext(), new FlingGesture(cache));
}