1919package com .loopj .android .http .sample ;
2020
2121import android .util .Log ;
22+
2223import com .loopj .android .http .AsyncHttpClient ;
2324import com .loopj .android .http .RequestHandle ;
2425import com .loopj .android .http .RequestParams ;
2526import com .loopj .android .http .ResponseHandlerInterface ;
26- import java .util .Iterator ;
2727
2828import org .apache .http .Header ;
2929import org .apache .http .HttpEntity ;
3030import org .json .JSONException ;
3131import org .json .JSONObject ;
3232
33+ import java .util .Iterator ;
34+
3335/**
3436 * This sample demonstrates how to upload JSON data using streams, resulting
3537 * in a low-memory footprint even with extremely large data.
@@ -52,10 +54,10 @@ public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[]
5254 JSONObject body ;
5355 if (isRequestBodyAllowed () && (body = getBodyTextAsJSON ()) != null ) {
5456 try {
55- Iterator < String > keys = body .keys ();
57+ Iterator keys = body .keys ();
5658 Log .d (LOG_TAG , "JSON data:" );
5759 while (keys .hasNext ()) {
58- String key = keys .next ();
60+ String key = ( String ) keys .next ();
5961 Log .d (LOG_TAG , " " + key + ": " + body .get (key ));
6062 params .put (key , body .get (key ).toString ());
6163 }
@@ -64,7 +66,7 @@ public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[]
6466 }
6567 }
6668 return client .post (this , URL , headers , params ,
67- RequestParams .APPLICATION_JSON , responseHandler );
69+ RequestParams .APPLICATION_JSON , responseHandler );
6870 }
6971
7072 @ Override
@@ -88,7 +90,7 @@ protected JSONObject getBodyTextAsJSON() {
8890 if (bodyText != null ) {
8991 try {
9092 return new JSONObject (bodyText );
91- } catch (JSONException e ) {
93+ } catch (JSONException e ) {
9294 Log .e (LOG_TAG , "User's data is not a valid JSON object" , e );
9395 }
9496 }
0 commit comments