| Chunk |
|---|
| Conflicting content |
|---|
postRunnable(new Runnable() {
@Override
public void run() {
<<<<<<< HEAD
if (jsonResponse instanceof JSONObject) {
onSuccess(statusCode, headers, (JSONObject) jsonResponse);
} else if (jsonResponse instanceof JSONArray) {
onSuccess(statusCode, headers, (JSONArray) jsonResponse);
} else if (jsonResponse instanceof String) {
onSuccess(statusCode, headers, (String) jsonResponse);
} else {
onFailure(new JSONException("Unexpected type " + jsonResponse.getClass().getName()), (JSONObject) null);
}
}
});
} catch (final JSONException ex) {
postRunnable(new Runnable() {
@Override
public void run() {
onFailure(ex, (JSONObject) null);
=======
sendMessage(obtainMessage(SUCCESS_JSON_MESSAGE, new Object[]{statusCode, headers, jsonResponse}));
}
});
} catch (final JSONException e) {
postRunnable(new Runnable() {
@Override
public void run() {
sendFailureMessage(statusCode, headers, e, responseBody);
>>>>>>> c1541be6adc2f8f81d169ca579d4de5ebf8aeb33
}
});
} |
| Solution content |
|---|
postRunnable(new Runnable() {
@Override
public void run() {
if (jsonResponse instanceof JSONObject) {
onSuccess(statusCode, headers, (JSONObject) jsonResponse);
} else if (jsonResponse instanceof JSONArray) {
onSuccess(statusCode, headers, (JSONArray) jsonResponse);
} else if (jsonResponse instanceof String) {
onSuccess(statusCode, headers, (String) jsonResponse);
} else {
onFailure(new JSONException("Unexpected type " + jsonResponse.getClass().getName()), (JSONObject) null);
}
}
});
} catch (final JSONException ex) {
postRunnable(new Runnable() {
@Override
public void run() {
onFailure(ex, (JSONObject) null);
}
});
} |
| File |
|---|
| JsonHttpResponseHandler.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Catch clause |
| If statement |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
}
return result;
}
<<<<<<< HEAD
=======
@Override
protected void handleFailureMessage(final int statusCode, final Header[] headers, final Throwable e, final String responseBody) {
if (responseBody != null) {
new Thread(new Runnable() {
@Override
public void run() {
try {
final Object jsonResponse = parseResponse(responseBody);
postRunnable(new Runnable() {
@Override
public void run() {
if (jsonResponse instanceof JSONObject) {
onFailure(statusCode, headers, e, (JSONObject) jsonResponse);
} else if (jsonResponse instanceof JSONArray) {
onFailure(statusCode, headers, e, (JSONArray) jsonResponse);
} else if (jsonResponse instanceof String) {
onFailure(statusCode, headers, e, (String) jsonResponse);
} else {
onFailure(statusCode, headers, e, responseBody);
}
}
});
} catch (JSONException ex) {
postRunnable(new Runnable() {
@Override
public void run() {
onFailure(statusCode, headers, e, responseBody);
}
});
}
}
}).start();
} else {
onFailure(e, "");
}
}
>>>>>>> c1541be6adc2f8f81d169ca579d4de5ebf8aeb33
} |
| Solution content |
|---|
}
return result;
}
} |
| File |
|---|
| JsonHttpResponseHandler.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Annotation |
| Method declaration |