diff options
13 files changed, 47 insertions, 31 deletions
diff --git a/main/res/values/changelog_master.xml b/main/res/values/changelog_master.xml index 1e3c3d4..cff468e 100644 --- a/main/res/values/changelog_master.xml +++ b/main/res/values/changelog_master.xml @@ -2,5 +2,11 @@ <resources> <!-- changelog for the master branch --> <string name="changelog_master" translatable="false"> + <b>Next feature release:</b>\n + <b>New features:</b>\n + \n + <b>Bugfixing:</b>\n + \n + \n </string> </resources> diff --git a/main/src/cgeo/geocaching/AbstractPopupActivity.java b/main/src/cgeo/geocaching/AbstractPopupActivity.java index 683579f..01e714d 100644 --- a/main/src/cgeo/geocaching/AbstractPopupActivity.java +++ b/main/src/cgeo/geocaching/AbstractPopupActivity.java @@ -17,6 +17,7 @@ import cgeo.geocaching.utils.Log; import cgeo.geocaching.utils.RxUtils; import org.apache.commons.lang3.StringUtils; + import rx.Observable; import rx.functions.Action1; import rx.functions.Func0; @@ -255,7 +256,7 @@ public abstract class AbstractPopupActivity extends AbstractActivity implements * @param view * unused here but needed since this method is referenced from XML layout */ - public final void goDefaultNavigation(@SuppressWarnings("unused") View view) { + public final void goDefaultNavigation(View view) { navigateTo(); finish(); } diff --git a/main/src/cgeo/geocaching/CacheListActivity.java b/main/src/cgeo/geocaching/CacheListActivity.java index b2404d9..0aec119 100644 --- a/main/src/cgeo/geocaching/CacheListActivity.java +++ b/main/src/cgeo/geocaching/CacheListActivity.java @@ -1384,7 +1384,7 @@ public class CacheListActivity extends AbstractListActivity implements FilteredA * @param view * unused here but needed since this method is referenced from XML layout */ - public void goMap(@SuppressWarnings("unused") View view) { + public void goMap(View view) { if (!cacheToShow()) { return; } diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index a224e4e..fa25576 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -34,12 +34,14 @@ import cgeo.geocaching.utils.MatcherWrapper; import cgeo.geocaching.utils.UncertainProperty; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.Predicate; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.eclipse.jdt.annotation.Nullable; + import rx.Scheduler; import rx.Scheduler.Inner; import rx.Subscription; @@ -177,7 +179,7 @@ public class Geocache implements ICache, IWaypoint { * * @param gpxParser */ - public Geocache(@SuppressWarnings("unused") GPXParser gpxParser) { + public Geocache(GPXParser gpxParser) { setReliableLatLon(true); setAttributes(Collections.<String> emptyList()); setWaypoints(Collections.<Waypoint> emptyList(), false); diff --git a/main/src/cgeo/geocaching/MainActivity.java b/main/src/cgeo/geocaching/MainActivity.java index b82614b..373f32a 100644 --- a/main/src/cgeo/geocaching/MainActivity.java +++ b/main/src/cgeo/geocaching/MainActivity.java @@ -26,7 +26,9 @@ import cgeo.geocaching.utils.Version; import com.google.zxing.integration.android.IntentIntegrator; import com.google.zxing.integration.android.IntentResult; + import org.apache.commons.lang3.StringUtils; + import rx.Observable; import rx.Observable.OnSubscribe; import rx.Subscriber; @@ -569,7 +571,7 @@ public class MainActivity extends AbstractActivity { * @param v * unused here but needed since this method is referenced from XML layout */ - public void cgeoFindOnMap(@SuppressWarnings("unused") final View v) { + public void cgeoFindOnMap(final View v) { findOnMap.setPressed(true); CGeoMap.startActivityLiveMap(this); } @@ -578,7 +580,7 @@ public class MainActivity extends AbstractActivity { * @param v * unused here but needed since this method is referenced from XML layout */ - public void cgeoFindNearest(@SuppressWarnings("unused") final View v) { + public void cgeoFindNearest(final View v) { if (app.currentGeo().getCoords() == null) { return; } @@ -591,7 +593,7 @@ public class MainActivity extends AbstractActivity { * @param v * unused here but needed since this method is referenced from XML layout */ - public void cgeoFindByOffline(@SuppressWarnings("unused") final View v) { + public void cgeoFindByOffline(final View v) { findByOffline.setPressed(true); CacheListActivity.startActivityOffline(this); } @@ -600,7 +602,7 @@ public class MainActivity extends AbstractActivity { * @param v * unused here but needed since this method is referenced from XML layout */ - public void cgeoSearch(@SuppressWarnings("unused") final View v) { + public void cgeoSearch(final View v) { advanced.setPressed(true); startActivity(new Intent(this, SearchActivity.class)); } @@ -609,7 +611,7 @@ public class MainActivity extends AbstractActivity { * @param v * unused here but needed since this method is referenced from XML layout */ - public void cgeoPoint(@SuppressWarnings("unused") final View v) { + public void cgeoPoint(final View v) { any.setPressed(true); startActivity(new Intent(this, NavigateAnyPointActivity.class)); } @@ -618,7 +620,7 @@ public class MainActivity extends AbstractActivity { * @param v * unused here but needed since this method is referenced from XML layout */ - public void cgeoFilter(@SuppressWarnings("unused") final View v) { + public void cgeoFilter(final View v) { filter.setPressed(true); filter.performClick(); } @@ -627,7 +629,7 @@ public class MainActivity extends AbstractActivity { * @param v * unused here but needed since this method is referenced from XML layout */ - public void cgeoNavSettings(@SuppressWarnings("unused") final View v) { + public void cgeoNavSettings(final View v) { startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS)); } @@ -708,7 +710,7 @@ public class MainActivity extends AbstractActivity { * @param view * unused here but needed since this method is referenced from XML layout */ - public void showAbout(@SuppressWarnings("unused") final View view) { + public void showAbout(final View view) { startActivity(new Intent(this, AboutActivity.class)); } @@ -716,7 +718,7 @@ public class MainActivity extends AbstractActivity { * @param view * unused here but needed since this method is referenced from XML layout */ - public void goSearch(@SuppressWarnings("unused") final View view) { + public void goSearch(final View view) { onSearchRequested(); } 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..e557fc8 100644 --- a/main/src/cgeo/geocaching/list/StoredList.java +++ b/main/src/cgeo/geocaching/list/StoredList.java @@ -147,6 +147,8 @@ public final class StoredList extends AbstractList { public void promptForListCreation(@NonNull final Action1<Integer> runAfterwards, String newListName) { handleListNameInput(newListName, R.string.list_dialog_create_title, R.string.list_dialog_create, new Action1<String>() { + // We need to update the list cache by creating a new StoredList object here. + @SuppressWarnings("unused") @Override public void call(final String listName) { final int newId = DataStore.createList(listName); diff --git a/main/src/cgeo/geocaching/sensors/GeoDirHandler.java b/main/src/cgeo/geocaching/sensors/GeoDirHandler.java index c10cb48..0f30142 100644 --- a/main/src/cgeo/geocaching/sensors/GeoDirHandler.java +++ b/main/src/cgeo/geocaching/sensors/GeoDirHandler.java @@ -4,6 +4,7 @@ import cgeo.geocaching.CgeoApplication; import cgeo.geocaching.settings.Settings; import org.apache.commons.lang3.tuple.ImmutablePair; + import rx.Observable; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; @@ -37,7 +38,7 @@ public abstract class GeoDirHandler { * * @param geoData the new geographical data */ - public void updateGeoData(@SuppressWarnings("unused") final IGeoData geoData) { + public void updateGeoData(final IGeoData geoData) { } /** @@ -46,7 +47,7 @@ public abstract class GeoDirHandler { * * @param direction the new direction */ - public void updateDirection(@SuppressWarnings("unused") final float direction) { + public void updateDirection(final float direction) { } /** @@ -59,7 +60,7 @@ public abstract class GeoDirHandler { * If the device goes fast enough, or if the compass use is not enabled in the settings, * the GPS direction information will be used instead of the compass one. */ - public void updateGeoDir(@SuppressWarnings("unused") final IGeoData geoData, @SuppressWarnings("unused") final float direction) { + public void updateGeoDir(final IGeoData geoData, final float direction) { } private static Observable<Float> fixedDirection() { 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)); } diff --git a/main/src/cgeo/geocaching/utils/ImageUtils.java b/main/src/cgeo/geocaching/utils/ImageUtils.java index e226703..ffb7bf3 100644 --- a/main/src/cgeo/geocaching/utils/ImageUtils.java +++ b/main/src/cgeo/geocaching/utils/ImageUtils.java @@ -273,9 +273,11 @@ public final class ImageUtils { /** * Decode a base64-encoded string and save the result into a stream. - * - * @param inString the encoded string - * @param outFile the file to save the decoded result into + * + * @param inString + * the encoded string + * @param out + * the stream to save the decoded result into */ public static void decodeBase64ToStream(final String inString, final OutputStream out) throws IOException { Base64InputStream in = null; diff --git a/tests/src/cgeo/geocaching/sensors/SensorsTest.java b/tests/src/cgeo/geocaching/sensors/SensorsTest.java index 87ff1de..2d75465 100644 --- a/tests/src/cgeo/geocaching/sensors/SensorsTest.java +++ b/tests/src/cgeo/geocaching/sensors/SensorsTest.java @@ -2,13 +2,11 @@ package cgeo.geocaching.sensors; import cgeo.geocaching.MainActivity; -import junit.framework.Assert; - import android.test.ActivityInstrumentationTestCase2; -public class SensorsTest extends ActivityInstrumentationTestCase2<MainActivity> { +import junit.framework.Assert; - private MainActivity activity; +public class SensorsTest extends ActivityInstrumentationTestCase2<MainActivity> { public SensorsTest() { super(MainActivity.class); @@ -17,10 +15,9 @@ public class SensorsTest extends ActivityInstrumentationTestCase2<MainActivity> @Override protected void setUp() throws Exception { super.setUp(); - activity = getActivity(); } - public void testGetDirectionNow() { + public static void testGetDirectionNow() { final float angle = DirectionProvider.getDirectionNow(1.0f); Assert.assertTrue(angle == 1.0f || angle == 91.0f || angle == 181.0f || angle == 271.0f); } diff --git a/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java b/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java index 2ee99c4..1a3804b 100644 --- a/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java +++ b/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java @@ -1,14 +1,15 @@ package cgeo.geocaching.utils; -import junit.framework.TestCase; - import java.util.LinkedList; import java.util.List; +import junit.framework.TestCase; + public class MiscUtilsTest extends TestCase { public static void testBufferEmpty() { - for (final List<String> s: MiscUtils.buffer(new LinkedList<String>(), 10)) { + for (@SuppressWarnings("unused") + final List<String> s : MiscUtils.buffer(new LinkedList<String>(), 10)) { fail("empty collection should not iterate"); } } |
