From 4b79360ad1f3207cd2dfe3bc97b0c6d94bddc3b5 Mon Sep 17 00:00:00 2001 From: Thodoris1999 Date: Tue, 11 Sep 2018 19:33:01 +0300 Subject: [PATCH] fix variable and method scopes --- .../thmmy/mthmmy/utils/parsing/ExternalAsyncTask.java | 6 +++--- .../gr/thmmy/mthmmy/utils/parsing/NetworkTask.java | 10 +++++----- .../gr/thmmy/mthmmy/utils/parsing/NewParseTask.java | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ExternalAsyncTask.java b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ExternalAsyncTask.java index 6f5814e0..93bc4224 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ExternalAsyncTask.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ExternalAsyncTask.java @@ -4,9 +4,9 @@ import android.os.AsyncTask; public abstract class ExternalAsyncTask extends AsyncTask { - private OnParseTaskStartedListener onParseTaskStartedListener; - private OnParseTaskCancelledListener onParseTaskCancelledListener; - private OnParseTaskFinishedListener onParseTaskFinishedListener; + protected OnParseTaskStartedListener onParseTaskStartedListener; + protected OnParseTaskCancelledListener onParseTaskCancelledListener; + protected OnParseTaskFinishedListener onParseTaskFinishedListener; @Override protected void onPreExecute() { diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NetworkTask.java b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NetworkTask.java index cfceb904..a137ebdb 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NetworkTask.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NetworkTask.java @@ -13,7 +13,7 @@ import timber.log.Timber; public abstract class NetworkTask extends ExternalAsyncTask> { - private OnParseTaskFinishedListener onParseTaskFinishedListener; + protected OnParseTaskFinishedListener onParseTaskFinishedListener; public NetworkTask(OnParseTaskStartedListener onParseTaskStartedListener, OnParseTaskCancelledListener onParseTaskCancelledListener, OnParseTaskFinishedListener onParseTaskFinishedListener) { @@ -60,13 +60,13 @@ public abstract class NetworkTask extends ExternalAsyncTask super.onPostExecute(tParcel); } - abstract Request createRequest(String... input); + protected abstract Request createRequest(String... input); - abstract Response getResponse(Request request, OkHttpClient client); + protected abstract Response getResponse(Request request, OkHttpClient client); - abstract T performTask(Document document) throws ParseException; + protected abstract T performTask(Document document) throws ParseException; - abstract int getResultCode(Response response, T data); + protected abstract int getResultCode(Response response, T data); public void setOnParseTaskFinishedListener(OnParseTaskFinishedListener onParseTaskFinishedListener) { this.onParseTaskFinishedListener = onParseTaskFinishedListener; diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java index 0a0591de..98449b64 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/NewParseTask.java @@ -16,7 +16,7 @@ public abstract class NewParseTask extends NetworkTask { public NewParseTask() {} @Override - final T performTask(Document document) throws ParseException { + protected final T performTask(Document document) throws ParseException { try { return parse(document); } catch (Exception e) { @@ -24,5 +24,5 @@ public abstract class NewParseTask extends NetworkTask { } } - abstract T parse (Document document); + protected abstract T parse (Document document); }