1818
1919package com .loopj .android .http ;
2020
21- import android .os .Message ;
21+ import java .io .IOException ;
22+
2223import org .apache .http .Header ;
2324import org .apache .http .HttpEntity ;
2425import org .apache .http .HttpResponse ;
2728import org .apache .http .entity .BufferedHttpEntity ;
2829import org .apache .http .util .EntityUtils ;
2930
30- import java . io . IOException ;
31+ import android . os . Message ;
3132
3233/**
3334 * Used to intercept and handle the responses from requests made using
@@ -102,6 +103,7 @@ public void onSuccess(int statusCode, byte[] binaryData) {
102103 * @param binaryData the response body, if any
103104 * @deprecated
104105 */
106+ @ Deprecated
105107 public void onFailure (Throwable error , byte [] binaryData ) {
106108 // By default, call the deprecated onFailure(Throwable) for compatibility
107109 onFailure (error );
@@ -116,6 +118,7 @@ protected void sendSuccessMessage(int statusCode, byte[] responseBody) {
116118 sendMessage (obtainMessage (SUCCESS_MESSAGE , new Object []{statusCode , responseBody }));
117119 }
118120
121+ @ Override
119122 protected void sendFailureMessage (Throwable e , byte [] responseBody ) {
120123 sendMessage (obtainMessage (FAILURE_MESSAGE , new Object []{e , responseBody }));
121124 }
@@ -133,6 +136,7 @@ protected void handleFailureMessage(Throwable e, byte[] responseBody) {
133136 }
134137
135138 // Methods which emulate android's Handler and Message methods
139+ @ Override
136140 protected void handleMessage (Message msg ) {
137141 Object [] response ;
138142 switch (msg .what ) {
@@ -151,6 +155,7 @@ protected void handleMessage(Message msg) {
151155 }
152156
153157 // Interface to AsyncHttpRequest
158+ @ Override
154159 void sendResponseMessage (HttpResponse response ) {
155160 StatusLine status = response .getStatusLine ();
156161 Header [] contentTypeHeaders = response .getHeaders ("Content-Type" );
0 commit comments