Merge pull request #430 from DevFactory/release/the-members-of-an-interface-declaration-or-class-should-appear-in-a-pre-defined-order-fix-1

squid:S1213 - The members of an interface declaration or class should appear in a pre-defined order
This commit is contained in:
Moez Bhatti
2016-07-01 13:32:28 -04:00
committed by GitHub
4 changed files with 18 additions and 18 deletions
@@ -123,6 +123,11 @@ public class BlobCache implements Closeable {
private byte[] mBlobHeader = new byte[BLOB_HEADER_SIZE];
private Adler32 mAdler32 = new Adler32();
private int mSlotOffset;
private int mFileOffset;
private LookupRequest mLookupRequest = new LookupRequest();
// Creates the cache. Three files will be created:
// path + ".idx", path + ".0", and path + ".1"
// The ".0" file and the ".1" file each stores data for a region. Each of
@@ -431,7 +436,6 @@ public class BlobCache implements Closeable {
// This method is for one-off lookup. For repeated lookup, use the version
// accepting LookupRequest to avoid repeated memory allocation.
private LookupRequest mLookupRequest = new LookupRequest();
public byte[] lookup(long key) throws IOException {
mLookupRequest.key = key;
mLookupRequest.buffer = null;
@@ -555,8 +559,6 @@ public class BlobCache implements Closeable {
// insertion.
// If the lookup is successful, the file offset is also saved in
// mFileOffset.
private int mSlotOffset;
private int mFileOffset;
private boolean lookupInternal(long key, int hashStart) {
int slot = (int) (key % mMaxEntries);
if (slot < 0) slot += mMaxEntries;
@@ -35,6 +35,12 @@ package com.moez.QKSMS.common.google;
public class DraftCache {
private static final String TAG = "Mms/draft";
static final String[] DRAFT_PROJECTION = new String[] {
Conversations.THREAD_ID // 0
};
static final int COLUMN_DRAFT_THREAD_ID = 0;
private static DraftCache sInstance;
private final Context mContext;
@@ -61,12 +67,6 @@ public class DraftCache {
refresh();
}
static final String[] DRAFT_PROJECTION = new String[] {
Conversations.THREAD_ID // 0
};
static final int COLUMN_DRAFT_THREAD_ID = 0;
/** To be called whenever the draft state might have changed.
* Dispatches work to a thread and returns immediately.
*/
@@ -29,6 +29,8 @@ import java.util.LinkedHashMap;
* from Peter Balwin and books app.
*/
public class SimpleCache<K, V> {
private final SoftReferenceMap mSoftReferences;
private final HardReferenceMap mHardReferences;
/**
* A simple LRU cache to prevent the number of {@link java.util.Map.Entry} instances
@@ -66,13 +68,6 @@ public class SimpleCache<K, V> {
}
}
private static <V> V unwrap(SoftReference<V> ref) {
return ref != null ? ref.get() : null;
}
private final SoftReferenceMap mSoftReferences;
private final HardReferenceMap mHardReferences;
/**
* Constructor.
*
@@ -95,6 +90,10 @@ public class SimpleCache<K, V> {
}
}
private static <V> V unwrap(SoftReference<V> ref) {
return ref != null ? ref.get() : null;
}
/**
* See {@link java.util.Map#get(Object)}.
*/
@@ -47,6 +47,7 @@ import java.io.IOException;
import java.io.InputStream;
public class UriImage {
private static final int NUMBER_OF_RESIZE_ATTEMPTS = 4;
private static final String TAG = "Mms/image";
private static final boolean DEBUG = false;
private static final boolean LOCAL_LOGV = false;
@@ -259,8 +260,6 @@ public class UriImage {
return part;
}
private static final int NUMBER_OF_RESIZE_ATTEMPTS = 4;
/**
* Resize and recompress the image such that it fits the given limits. The resulting byte
* array contains an image in JPEG format, regardless of the original image's content type.