From c19dbe09bb053e8b8d9378730d684511e60097d9 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Sun, 24 Jan 2016 17:00:46 -0500 Subject: [PATCH] Cleanup unused methods --- .../lightning/activity/TabsManager.java | 6 ++- .../lightning/database/BookmarkManager.java | 40 +------------------ 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/app/src/main/java/acr/browser/lightning/activity/TabsManager.java b/app/src/main/java/acr/browser/lightning/activity/TabsManager.java index f3998bb..ae3c21a 100644 --- a/app/src/main/java/acr/browser/lightning/activity/TabsManager.java +++ b/app/src/main/java/acr/browser/lightning/activity/TabsManager.java @@ -35,11 +35,12 @@ import acr.browser.lightning.view.LightningView; public class TabsManager { private static final String TAG = TabsManager.class.getSimpleName(); - private final List mTabList = new ArrayList<>(1); - private LightningView mCurrentTab; private static final String BUNDLE_KEY = "WEBVIEW_"; private static final String BUNDLE_STORAGE = "SAVED_TABS.parcel"; + private final List mTabList = new ArrayList<>(1); + private LightningView mCurrentTab; + @Inject PreferenceManager mPreferenceManager; @Inject Bus mEventBus; @Inject Application mApp; @@ -124,6 +125,7 @@ public class TabsManager { */ public synchronized void freeMemory() { for (LightningView tab : mTabList) { + //noinspection deprecation tab.freeMemory(); } } diff --git a/app/src/main/java/acr/browser/lightning/database/BookmarkManager.java b/app/src/main/java/acr/browser/lightning/database/BookmarkManager.java index 82655b4..0c3a328 100644 --- a/app/src/main/java/acr/browser/lightning/database/BookmarkManager.java +++ b/app/src/main/java/acr/browser/lightning/database/BookmarkManager.java @@ -55,7 +55,6 @@ public class BookmarkManager { private Map mBookmarksMap; private String mCurrentFolder = ""; private final ExecutorService mExecutor; - private boolean mReady = false; private final File mFilesDir; @Inject @@ -66,13 +65,6 @@ public class BookmarkManager { mExecutor.execute(new BookmarkInitializer(context)); } - /** - * @return true if the BookmarkManager was initialized, false otherwise - */ - public boolean isReady() { - return mReady; - } - /** * Look for bookmark using the url * @@ -135,7 +127,6 @@ public class BookmarkManager { Utils.close(inputStream); } mBookmarksMap = bookmarks; - mReady = true; } } @@ -180,6 +171,7 @@ public class BookmarkManager { if (success) { // Overwrite the bookmarks file by renaming the temp file + //noinspection ResultOfMethodCallIgnored tempFile.renameTo(bookmarksFile); } } @@ -417,20 +409,6 @@ public class BookmarkManager { return mCurrentFolder; } - /** - * Method is used internally for searching the bookmarks - * - * @return a sorted map of all bookmarks, useful for seeing if a bookmark exists - */ - private Set getBookmarkUrls(List list) { - Set set = new HashSet<>(); - for (HistoryItem item : mBookmarksMap.values()) { - if (!item.isFolder()) - set.add(item.getUrl()); - } - return set; - } - /** * This method returns a list of all folders. * Folders cannot be empty as they are generated from @@ -513,22 +491,6 @@ public class BookmarkManager { } } - /** - * find the index of a bookmark in a list using only its URL - * - * @param list the list to search - * @param url the url to compare - * @return returns the index of the bookmark or -1 if none was found - */ - public static int getIndexOfBookmark(final List list, final String url) { - for (int n = 0; n < list.size(); n++) { - if (list.get(n).getUrl().equals(url)) { - return n; - } - } - return -1; - } - /** * This class sorts bookmarks alphabetically, with folders coming after bookmarks */