From a383ac8b4ae52bb8aec472d8505aada43c0a9cef Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 7 Jul 2023 11:08:28 +0200 Subject: [PATCH] JAL-4199 Implement toString in BaseTask --- src/jalview/ws2/actions/BaseTask.java | 7 +++++++ src/jalview/ws2/actions/annotation/AnnotationTask.java | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) 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); - } } -- 1.7.10.2