Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343287 )

Change subject: Hygiene: remove unused SavedPage methods and infer nullity
......................................................................

Hygiene: remove unused SavedPage methods and infer nullity

Bug: T156917
Change-Id: I39226f321d59e793237220d8dcb2fb06a57cd51e
---
M app/src/main/java/org/wikipedia/savedpages/SavedPage.java
1 file changed, 12 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/87/343287/1

diff --git a/app/src/main/java/org/wikipedia/savedpages/SavedPage.java 
b/app/src/main/java/org/wikipedia/savedpages/SavedPage.java
index 8671563..42fdf7b 100644
--- a/app/src/main/java/org/wikipedia/savedpages/SavedPage.java
+++ b/app/src/main/java/org/wikipedia/savedpages/SavedPage.java
@@ -2,6 +2,7 @@
 
 import android.os.Parcel;
 import android.os.Parcelable;
+import android.support.annotation.NonNull;
 
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -13,28 +14,28 @@
 
 import static org.wikipedia.util.FileUtil.getSavedPageDirFor;
 import static org.wikipedia.util.FileUtil.readJSONFile;
-import static org.wikipedia.util.FileUtil.writeToFile;
 
+// todo: remove class
 public class SavedPage implements Parcelable {
     public static final SavedPageDatabaseTable DATABASE_TABLE = new 
SavedPageDatabaseTable();
 
-    private final PageTitle title;
-    private final Date timestamp;
-
-    public SavedPage(PageTitle title, Date timestamp) {
-        this.title = title;
-        this.timestamp = timestamp;
-    }
+    @NonNull private final PageTitle title;
+    @NonNull private final Date timestamp;
 
     public SavedPage(PageTitle title) {
         this(title, new Date());
     }
 
-    public PageTitle getTitle() {
+    public SavedPage(@NonNull PageTitle title, @NonNull Date timestamp) {
+        this.title = title;
+        this.timestamp = timestamp;
+    }
+
+    @NonNull public PageTitle getTitle() {
         return title;
     }
 
-    public Date getTimestamp() {
+    @NonNull public Date getTimestamp() {
         return timestamp;
     }
 
@@ -76,8 +77,7 @@
         this.timestamp = new Date(in.readLong());
     }
 
-    public static final Creator<SavedPage> CREATOR
-            = new Creator<SavedPage>() {
+    public static final Creator<SavedPage> CREATOR = new Creator<SavedPage>() {
         @Override
         public SavedPage createFromParcel(Parcel in) {
             return new SavedPage(in);
@@ -90,28 +90,11 @@
     };
 
     /**
-     * Gets a File object that represents the JSON contents of this page.
-     * @return File object used for reading/writing page contents.
-     */
-    private File getContentsFile() {
-        return new File(getSavedPageDirFor(title) + "/content.json");
-    }
-
-    /**
      * Gets the file that has the URL mappings in JSON of this page.
      * @return File object used for reading/writing page contents.
      */
     private File getUrlMapFile() {
         return new File(getSavedPageDirFor(title) + "/urls.json");
-    }
-
-    /**
-     * Writes a map of all URL mappings to a file inside the saved page 
directory.
-     * @param jsonObject contains mapping of URLs (originals to file paths)
-     * @throws IOException
-     */
-    public void writeUrlMap(JSONObject jsonObject) throws IOException {
-        writeToFile(getUrlMapFile(), jsonObject);
     }
 
     public JSONObject readUrlMapFromFileSystem() throws IOException, 
JSONException {

-- 
To view, visit https://gerrit.wikimedia.org/r/343287
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39226f321d59e793237220d8dcb2fb06a57cd51e
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: Sniedzielski <sniedziel...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to