Skip to content

Commit

Permalink
fixes coding sytle to make it comply with java7 standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericliu001 committed Apr 16, 2017
1 parent 4f0e507 commit 1af9010
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/main/java/com/android/volley/RequestQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public interface RequestFinishedListener<T> {
* </ul>
*/
private final Map<String, Queue<Request<?>>> mWaitingRequests =
new HashMap<String, Queue<Request<?>>>();
new HashMap<>();

/**
* The set of all requests currently being processed by this RequestQueue. A Request
Expand All @@ -70,11 +70,11 @@ public interface RequestFinishedListener<T> {

/** The cache triage queue. */
private final PriorityBlockingQueue<Request<?>> mCacheQueue =
new PriorityBlockingQueue<Request<?>>();
new PriorityBlockingQueue<>();

/** The queue of requests that are actually going out to the network. */
private final PriorityBlockingQueue<Request<?>> mNetworkQueue =
new PriorityBlockingQueue<Request<?>>();
new PriorityBlockingQueue<>();

/** Number of network request dispatcher threads to start. */
private static final int DEFAULT_NETWORK_THREAD_POOL_SIZE = 4;
Expand All @@ -95,7 +95,7 @@ public interface RequestFinishedListener<T> {
private CacheDispatcher mCacheDispatcher;

private final List<RequestFinishedListener> mFinishedListeners =
new ArrayList<RequestFinishedListener>();
new ArrayList<>();

/**
* Creates the worker pool. Processing will not begin until {@link #start()} is called.
Expand Down Expand Up @@ -160,9 +160,9 @@ public void stop() {
if (mCacheDispatcher != null) {
mCacheDispatcher.quit();
}
for (int i = 0; i < mDispatchers.length; i++) {
if (mDispatchers[i] != null) {
mDispatchers[i].quit();
for (final NetworkDispatcher mDispatcher : mDispatchers) {
if (mDispatcher != null) {
mDispatcher.quit();
}
}
}
Expand Down Expand Up @@ -248,7 +248,7 @@ public <T> Request<T> add(Request<T> request) {
// There is already a request in flight. Queue up.
Queue<Request<?>> stagedRequests = mWaitingRequests.get(cacheKey);
if (stagedRequests == null) {
stagedRequests = new LinkedList<Request<?>>();
stagedRequests = new LinkedList<>();
}
stagedRequests.add(request);
mWaitingRequests.put(cacheKey, stagedRequests);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/android/volley/toolbox/BasicNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private byte[] entityToBytes(HttpEntity entity) throws IOException, ServerError
} catch (IOException e) {
// This can happen if there was an exception above that left the entity in
// an invalid state.
VolleyLog.v("Error occured when calling consumingContent");
VolleyLog.v("Error occurred when calling consumingContent");
}
mPool.returnBuf(buffer);
bytes.close();
Expand Down

0 comments on commit 1af9010

Please sign in to comment.