Skip to content

Commit

Permalink
refactor: change result type of ParselyAPIConnection to Void
Browse files Browse the repository at this point in the history
There's no need to return `HttpURLConnection`. This change simplifies implementation.
  • Loading branch information
wzieba committed Oct 20, 2023
1 parent 8756b27 commit c8795c0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.net.URL;
import java.net.HttpURLConnection;

class ParselyAPIConnection extends AsyncTask<String, Exception, HttpURLConnection> {
class ParselyAPIConnection extends AsyncTask<String, Exception, Void> {

@NonNull
private final ParselyTracker tracker;
Expand All @@ -35,7 +35,7 @@ class ParselyAPIConnection extends AsyncTask<String, Exception, HttpURLConnectio
}

@Override
protected HttpURLConnection doInBackground(String... data) {
protected Void doInBackground(String... data) {
HttpURLConnection connection = null;
try {
if (data.length == 1) { // non-batched (since no post data is included)
Expand All @@ -54,12 +54,12 @@ protected HttpURLConnection doInBackground(String... data) {

} catch (Exception ex) {
this.exception = ex;
return null;
}
return connection;
return null;
}

protected void onPostExecute(HttpURLConnection conn) {
@Override
protected void onPostExecute(Void result) {
if (this.exception != null) {
ParselyTracker.PLog("Pixel request exception");
ParselyTracker.PLog(this.exception.toString());
Expand Down

0 comments on commit c8795c0

Please sign in to comment.