From 972da9bd2e02eebbad84048d213545d889cc3410 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Tue, 4 Jul 2023 10:20:59 +0200 Subject: [PATCH] JAL-4199 Make all TaskEventListener methods default --- src/jalview/ws2/actions/api/TaskEventListener.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/jalview/ws2/actions/api/TaskEventListener.java b/src/jalview/ws2/actions/api/TaskEventListener.java index f48272a..4bc79d0 100644 --- a/src/jalview/ws2/actions/api/TaskEventListener.java +++ b/src/jalview/ws2/actions/api/TaskEventListener.java @@ -29,7 +29,7 @@ public interface TaskEventListener * @param subJobs * list of sub-jobs for this run */ - void taskStarted(TaskI source, List subJobs); + default void taskStarted(TaskI source, List subJobs) {}; /** * Invoked when the global task status has changed. @@ -39,7 +39,7 @@ public interface TaskEventListener * @param status * new task status */ - void taskStatusChanged(TaskI source, JobStatus status); + default void taskStatusChanged(TaskI source, JobStatus status) {}; /** * Invoked when the task has completed. If the task completed with a result, @@ -51,7 +51,7 @@ public interface TaskEventListener * @param result * computation result or null if result not present */ - void taskCompleted(TaskI source, T result); + default void taskCompleted(TaskI source, T result) {}; /** * Invoked when an unhandled exception has occurred during task execution. @@ -61,8 +61,7 @@ public interface TaskEventListener * @param e * exception */ - void taskException(TaskI source, Exception e); - + default void taskException(TaskI source, Exception e) {}; /** * Invoked when the status of a sub-job has changed. @@ -74,7 +73,7 @@ public interface TaskEventListener * @param status * new job status */ - void subJobStatusChanged(TaskI source, JobI job, JobStatus status); + default void subJobStatusChanged(TaskI source, JobI job, JobStatus status) {}; /** * Invoked when a log string of the sub-job has changed. @@ -86,7 +85,7 @@ public interface TaskEventListener * @param log * new log string */ - void subJobLogChanged(TaskI source, JobI job, String log); + default void subJobLogChanged(TaskI source, JobI job, String log) {}; /** * Invoked when an error log string of the sub-job has changed. @@ -98,5 +97,5 @@ public interface TaskEventListener * @param log * new log string */ - void subJobErrorLogChanged(TaskI source, JobI job, String log); + default void subJobErrorLogChanged(TaskI source, JobI job, String log) {}; } -- 1.7.10.2