From e6f7585487ef3bc8d2e8e8157d7c962842448004 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Tue, 17 Dec 2013 10:41:07 +0100 Subject: fix findbugs issues --- .../cgeo/geocaching/connector/ec/ECConnector.java | 4 +++- .../cgeo/geocaching/files/SimpleDirChooser.java | 25 +++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'main/src') diff --git a/main/src/cgeo/geocaching/connector/ec/ECConnector.java b/main/src/cgeo/geocaching/connector/ec/ECConnector.java index 2aff7e9..2535c61 100644 --- a/main/src/cgeo/geocaching/connector/ec/ECConnector.java +++ b/main/src/cgeo/geocaching/connector/ec/ECConnector.java @@ -79,7 +79,9 @@ public class ECConnector extends AbstractConnector implements ISearchByGeocode, @Override public SearchResult searchByGeocode(final @Nullable String geocode, final @Nullable String guid, final CancellableHandler handler) { - + if (geocode == null) { + return null; + } CancellableHandler.sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_loadpage); final Geocache cache = ECApi.searchByGeoCode(geocode); diff --git a/main/src/cgeo/geocaching/files/SimpleDirChooser.java b/main/src/cgeo/geocaching/files/SimpleDirChooser.java index 3f6182c..3e09cc4 100644 --- a/main/src/cgeo/geocaching/files/SimpleDirChooser.java +++ b/main/src/cgeo/geocaching/files/SimpleDirChooser.java @@ -29,6 +29,7 @@ import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.List; /** @@ -141,7 +142,7 @@ public class SimpleDirChooser extends AbstractListActivity { } } catch (RuntimeException e) { } - Collections.sort(listDirs); + Collections.sort(listDirs, Option.NAME_COMPARATOR); if (dir.getParent() != null) { listDirs.add(0, new Option(PARENT_DIR, dir.getParent(), false)); } @@ -247,15 +248,21 @@ public class SimpleDirChooser extends AbstractListActivity { } } - /** - * Note: this class has a natural ordering that is inconsistent with equals. - */ - public static class Option implements Comparable