From: Mateusz Warowny Date: Fri, 7 Jul 2023 09:08:28 +0000 (+0200) Subject: JAL-4199 Implement toString in BaseTask X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a383ac8b4ae52bb8aec472d8505aada43c0a9cef;p=jalview.git JAL-4199 Implement toString in BaseTask --- diff --git a/src/jalview/ws2/actions/BaseTask.java b/src/jalview/ws2/actions/BaseTask.java index 40f96b5..803df3c 100644 --- a/src/jalview/ws2/actions/BaseTask.java +++ b/src/jalview/ws2/actions/BaseTask.java @@ -300,4 +300,11 @@ public abstract class BaseTask implements TaskI Objects.requireNonNull(action); this.cancelAction = action; } + + @Override + public String toString() + { + var statusName = status != null ? status.name() : "UNSET"; + return String.format("%s(%x, %s)", getClass().getSimpleName(), uid, statusName); + } } diff --git a/src/jalview/ws2/actions/annotation/AnnotationTask.java b/src/jalview/ws2/actions/annotation/AnnotationTask.java index 8a3b091..0aaff23 100644 --- a/src/jalview/ws2/actions/annotation/AnnotationTask.java +++ b/src/jalview/ws2/actions/annotation/AnnotationTask.java @@ -207,11 +207,4 @@ public class AnnotationTask extends BaseTask } while (++col <= end); return ranges; } - - @Override - public String toString() - { - var status = taskStatus != null ? taskStatus.name() : "UNSET"; - return String.format("%s(%x, %s)", getClass().getSimpleName(), uid, status); - } }