Skip to content

Commit 10a2878

Browse files
committed
Merge pull request android-async-http#517 from orientalsensation/RemoveDiamonds
Diamond operator isn't supported in older IDE's.
2 parents 3a42acd + acd33c9 commit 10a2878

File tree

7 files changed

+18
-17
lines changed

7 files changed

+18
-17
lines changed

library/src/main/java/com/loopj/android/http/AsyncHttpClient.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ public AsyncHttpClient(SchemeRegistry schemeRegistry) {
218218
ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager(httpParams, schemeRegistry);
219219

220220
threadPool = Executors.newCachedThreadPool();
221-
requestMap = new WeakHashMap<>();
222-
clientHeaderMap = new HashMap<>();
221+
requestMap = new WeakHashMap();
222+
clientHeaderMap = new HashMap();
223223

224224
httpContext = new SyncBasicHttpContext(new BasicHttpContext());
225225
httpClient = new DefaultHttpClient(cm, httpParams);
@@ -263,6 +263,7 @@ public void process(HttpResponse response, HttpContext context) {
263263
});
264264

265265
httpClient.addRequestInterceptor(new HttpRequestInterceptor() {
266+
@Override
266267
public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException {
267268
AuthState authState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE);
268269
CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute(
@@ -1005,7 +1006,7 @@ protected RequestHandle sendRequest(DefaultHttpClient client, HttpContext httpCo
10051006
// Add request to request map
10061007
List<RequestHandle> requestList = requestMap.get(context);
10071008
if (requestList == null) {
1008-
requestList = new LinkedList<>();
1009+
requestList = new LinkedList();
10091010
requestMap.put(context, requestList);
10101011
}
10111012

library/src/main/java/com/loopj/android/http/JsonStreamerEntity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class JsonStreamerEntity implements HttpEntity {
7171
new BasicHeader("Content-Encoding", "gzip");
7272

7373
// JSON data and associated meta-data to be uploaded.
74-
private final Map<String, Object> jsonParams = new HashMap<>();
74+
private final Map<String, Object> jsonParams = new HashMap();
7575

7676
// Whether to use gzip compression while uploading
7777
private final Header contentEncoding;

library/src/main/java/com/loopj/android/http/PersistentCookieStore.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class PersistentCookieStore implements CookieStore {
6060
*/
6161
public PersistentCookieStore(Context context) {
6262
cookiePrefs = context.getSharedPreferences(COOKIE_PREFS, 0);
63-
cookies = new ConcurrentHashMap<>();
63+
cookies = new ConcurrentHashMap();
6464

6565
// Load any previously stored cookies into the store
6666
String storedCookieNames = cookiePrefs.getString(COOKIE_NAME_STORE, null);
@@ -146,7 +146,7 @@ public boolean clearExpired(Date date) {
146146

147147
@Override
148148
public List<Cookie> getCookies() {
149-
return new ArrayList<>(cookies.values());
149+
return new ArrayList(cookies.values());
150150
}
151151

152152
/**

library/src/main/java/com/loopj/android/http/RequestHandle.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class RequestHandle {
99
private final WeakReference<AsyncHttpRequest> request;
1010

1111
public RequestHandle(AsyncHttpRequest request) {
12-
this.request = new WeakReference<>(request);
12+
this.request = new WeakReference(request);
1313
}
1414

1515
/**

library/src/main/java/com/loopj/android/http/RequestParams.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
* params.put("like", set); // url params: "like=music&amp;like=art"
6565
*
6666
* List&lt;String&gt; list = new ArrayList&lt;String&gt;(); // Ordered collection
67-
* list.add("Java");
67+
* list.add("Java");<>
6868
* list.add("C");
6969
* params.put("languages", list); // url params: "languages[]=Java&amp;languages[]=C"
7070
*
@@ -96,10 +96,10 @@ public class RequestParams {
9696
protected boolean isRepeatable;
9797
protected boolean useJsonStreamer;
9898
protected boolean autoCloseInputStreams;
99-
protected final ConcurrentHashMap<String, String> urlParams = new ConcurrentHashMap<>();
100-
protected final ConcurrentHashMap<String, StreamWrapper> streamParams = new ConcurrentHashMap<>();
101-
protected final ConcurrentHashMap<String, FileWrapper> fileParams = new ConcurrentHashMap<>();
102-
protected final ConcurrentHashMap<String, Object> urlParamsWithObjects = new ConcurrentHashMap<>();
99+
protected final ConcurrentHashMap<String, String> urlParams = new ConcurrentHashMap();
100+
protected final ConcurrentHashMap<String, StreamWrapper> streamParams = new ConcurrentHashMap();
101+
protected final ConcurrentHashMap<String, FileWrapper> fileParams = new ConcurrentHashMap();
102+
protected final ConcurrentHashMap<String, Object> urlParamsWithObjects = new ConcurrentHashMap();
103103
protected String contentEncoding = HTTP.UTF_8;
104104

105105
/**
@@ -483,7 +483,7 @@ private HttpEntity createMultipartEntity(ResponseHandlerInterface progressHandle
483483
}
484484

485485
protected List<BasicNameValuePair> getParamsList() {
486-
List<BasicNameValuePair> lparams = new LinkedList<>();
486+
List<BasicNameValuePair> lparams = new LinkedList();
487487

488488
for (ConcurrentHashMap.Entry<String, String> entry : urlParams.entrySet()) {
489489
lparams.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
@@ -495,7 +495,7 @@ protected List<BasicNameValuePair> getParamsList() {
495495
}
496496

497497
private List<BasicNameValuePair> getParamsList(String key, Object value) {
498-
List<BasicNameValuePair> params = new LinkedList<>();
498+
List<BasicNameValuePair> params = new LinkedList();
499499
if (value instanceof Map) {
500500
Map map = (Map) value;
501501
List list = new ArrayList<Object>(map.keySet());

library/src/main/java/com/loopj/android/http/RetryHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
import javax.net.ssl.SSLException;
4141

4242
class RetryHandler implements HttpRequestRetryHandler {
43-
private final static HashSet<Class<?>> exceptionWhitelist = new HashSet<>();
44-
private final static HashSet<Class<?>> exceptionBlacklist = new HashSet<>();
43+
private final static HashSet<Class<?>> exceptionWhitelist = new HashSet();
44+
private final static HashSet<Class<?>> exceptionBlacklist = new HashSet();
4545

4646
static {
4747
// Retry if the server dropped connection on us

library/src/main/java/com/loopj/android/http/SimpleMultipartEntity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SimpleMultipartEntity implements HttpEntity {
5959
private final byte[] boundaryEnd;
6060
private boolean isRepeatable;
6161

62-
private final List<FilePart> fileParts = new ArrayList<>();
62+
private final List<FilePart> fileParts = new ArrayList();
6363

6464
// The buffer we use for building the message excluding files and the last
6565
// boundary

0 commit comments

Comments
 (0)