Bug 709845 - Tab.java: fix checkstyle warnings about extra imports, missing access modifiers, trailing whitespace. r=dougt a=dougt
authorChris Peterson <cpeterson@mozilla.com>
Tue, 17 Jan 2012 10:26:58 -0800
changeset 84753 339d1d51af7a14302fdd49e1e6f94ca6387de91e
parent 84752 d27ddb7ad0322f1a2bb866092532bd2f3b764e40
child 84754 46328da0936d021a130e6fea17f051db8eb3eb39
push id21873
push usermlamouri@mozilla.com
push dateWed, 18 Jan 2012 10:29:07 +0000
treeherdermozilla-central@7538f4d4697c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt, dougt
bugs709845
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 709845 - Tab.java: fix checkstyle warnings about extra imports, missing access modifiers, trailing whitespace. r=dougt a=dougt
mobile/android/base/Tab.java
--- a/mobile/android/base/Tab.java
+++ b/mobile/android/base/Tab.java
@@ -33,41 +33,38 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 package org.mozilla.gecko;
 
 import android.content.ContentResolver;
-import android.graphics.drawable.Drawable;
+import android.graphics.Bitmap;
 import android.graphics.drawable.BitmapDrawable;
-import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
 import android.os.AsyncTask;
 import android.util.DisplayMetrics;
 import android.util.Log;
-import android.graphics.Bitmap;
 
 import org.json.JSONException;
 import org.json.JSONObject;
+import org.mozilla.gecko.db.BrowserDB;
 
-import java.io.ByteArrayOutputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
-import org.mozilla.gecko.db.BrowserDB;
-
-public class Tab {
+public final class Tab {
     private static final String LOGTAG = "GeckoTab";
     private static final int kThumbnailWidth = 120;
     private static final int kThumbnailHeight = 80;
 
-    static int sMinDim = 0;
-    static float sDensity = 1;
+    private static int sMinDim = 0;
+    private static float sDensity = 1;
     private int mId;
     private String mUrl;
     private String mTitle;
     private Drawable mFavicon;
     private String mFaviconUrl;
     private String mSecurityMode;
     private Drawable mThumbnail;
     private List<HistoryEntry> mHistory;
@@ -77,17 +74,17 @@ public class Tab {
     private boolean mLoading;
     private boolean mBookmark;
     private HashMap<String, DoorHanger> mDoorHangers;
     private long mFaviconLoadId;
     private CheckBookmarkTask mCheckBookmarkTask;
     private String mDocumentURI;
     private String mContentType;
 
-    static class HistoryEntry {
+    public static final class HistoryEntry {
         public String mUri;         // must never be null
         public String mTitle;       // must never be null
 
         public HistoryEntry(String uri, String title) {
             mUri = uri;
             mTitle = title;
         }
     }
@@ -333,43 +330,43 @@ public class Tab {
         }
         GeckoEvent e = new GeckoEvent("Session:Forward", "");
         GeckoAppShell.sendEventToGecko(e);
         return true;
     }
 
     public void addDoorHanger(String value, DoorHanger dh) {
         mDoorHangers.put(value, dh);
-    } 
+    }
 
     public void removeDoorHanger(String value) {
         mDoorHangers.remove(value);
     }
 
     public void removeAllDoorHangers() {
         mDoorHangers = new HashMap<String, DoorHanger>();
     }
 
     public void removeTransientDoorHangers() {
         for (String value : mDoorHangers.keySet()) {
             DoorHanger dh = mDoorHangers.get(value);
             if (dh.shouldRemove())
                 mDoorHangers.remove(value);
-        }   
+        }
     }
 
     public DoorHanger getDoorHanger(String value) {
         if (mDoorHangers == null)
             return null;
 
         if (mDoorHangers.containsKey(value))
             return mDoorHangers.get(value);
 
         return null;
-    } 
+    }
 
     public HashMap<String, DoorHanger> getDoorHangers() {
         return mDoorHangers;
     }
 
     void handleSessionHistoryMessage(String event, JSONObject message) throws JSONException {
         if (event.equals("New")) {
             final String uri = message.getString("uri");
@@ -404,17 +401,17 @@ public class Tab {
             }
             mHistoryIndex = index;
         } else if (event.equals("Purge")) {
             mHistory.clear();
             mHistoryIndex = -1;
         }
     }
 
-    private class CheckBookmarkTask extends AsyncTask<Void, Void, Boolean> {
+    private final class CheckBookmarkTask extends AsyncTask<Void, Void, Boolean> {
         private final String mUrl;
 
         public CheckBookmarkTask(String url) {
             mUrl = url;
         }
 
         @Override
         protected Boolean doInBackground(Void... unused) {
@@ -439,17 +436,17 @@ public class Tab {
                         return;
 
                     setBookmark(isBookmark.booleanValue());
                 }
             });
         }
     }
 
-    private class AddBookmarkTask extends GeckoAsyncTask<Void, Void, Void> {
+    private final class AddBookmarkTask extends GeckoAsyncTask<Void, Void, Void> {
         @Override
         protected Void doInBackground(Void... unused) {
             ContentResolver resolver = Tabs.getInstance().getContentResolver();
             BrowserDB.addBookmark(resolver, getTitle(), getURL());
             return null;
         }
 
         @Override
@@ -462,17 +459,17 @@ public class Tab {
         try {
             ContentResolver resolver = Tabs.getInstance().getContentResolver();
             BrowserDB.updateThumbnailForUrl(resolver, getURL(), thumbnail);
         } catch (Exception e) {
             // ignore
         }
     }
 
-    private class RemoveBookmarkTask extends GeckoAsyncTask<Void, Void, Void> {
+    private final class RemoveBookmarkTask extends GeckoAsyncTask<Void, Void, Void> {
         @Override
         protected Void doInBackground(Void... unused) {
             ContentResolver resolver = Tabs.getInstance().getContentResolver();
             BrowserDB.removeBookmark(resolver, getURL());
             return null;
         }
 
         @Override