From dcd042b9d5d03bafd5ccb187c8e14ecbba35c872 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Tue, 26 Jan 2016 20:32:35 -0500 Subject: [PATCH] Annotate method parameters, lint fixes --- .../acr/browser/lightning/database/HistoryDatabase.java | 6 ++++-- .../java/acr/browser/lightning/object/SearchAdapter.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/acr/browser/lightning/database/HistoryDatabase.java b/app/src/main/java/acr/browser/lightning/database/HistoryDatabase.java index bc1895d..9676cac 100644 --- a/app/src/main/java/acr/browser/lightning/database/HistoryDatabase.java +++ b/app/src/main/java/acr/browser/lightning/database/HistoryDatabase.java @@ -89,7 +89,7 @@ public class HistoryDatabase extends SQLiteOpenHelper { } } - public synchronized void deleteHistoryItem(String url) { + public synchronized void deleteHistoryItem(@NonNull String url) { openIfNecessary(); mDatabase.delete(TABLE_HISTORY, KEY_URL + " = ?", new String[]{url}); } @@ -118,7 +118,7 @@ public class HistoryDatabase extends SQLiteOpenHelper { mDatabase.insert(TABLE_HISTORY, null, values); } - synchronized String getHistoryItem(String url) { + synchronized String getHistoryItem(@NonNull String url) { openIfNecessary(); Cursor cursor = mDatabase.query(TABLE_HISTORY, new String[]{KEY_ID, KEY_URL, KEY_TITLE}, KEY_URL + " = ?", new String[]{url}, null, null, null, null); @@ -158,6 +158,7 @@ public class HistoryDatabase extends SQLiteOpenHelper { return itemList; } + @NonNull public synchronized List getLastHundredItems() { openIfNecessary(); List itemList = new ArrayList<>(100); @@ -180,6 +181,7 @@ public class HistoryDatabase extends SQLiteOpenHelper { return itemList; } + @NonNull public synchronized List getAllHistoryItems() { openIfNecessary(); List itemList = new ArrayList<>(); diff --git a/app/src/main/java/acr/browser/lightning/object/SearchAdapter.java b/app/src/main/java/acr/browser/lightning/object/SearchAdapter.java index 6c93bc5..316f7e2 100644 --- a/app/src/main/java/acr/browser/lightning/object/SearchAdapter.java +++ b/app/src/main/java/acr/browser/lightning/object/SearchAdapter.java @@ -209,7 +209,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { private static class ClearCacheRunnable implements Runnable { - private Application app; + private final Application app; public ClearCacheRunnable(Application app) { this.app = app;