JAL-4199 Remove taskRestarted from task events
[jalview.git] / src / jalview / ws2 / gui / AlignmentServiceGuiHandler.java
index b484ccc..caa0573 100644 (file)
@@ -1,7 +1,5 @@
 package jalview.ws2.gui;
 
-import static java.util.Objects.requireNonNullElse;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
@@ -14,6 +12,7 @@ import javax.swing.JInternalFrame;
 import javax.swing.SwingUtilities;
 
 import jalview.bin.Cache;
+import jalview.bin.Console;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentOrder;
@@ -61,7 +60,7 @@ class AlignmentServiceGuiHandler
     String panelInfo = String.format("%s using service hosted at %s%n%s",
         service.getName(), service.getUrl(), service.getDescription());
     infoPanel = new WebserviceInfo(service.getName(), panelInfo, false);
-    String actionName = requireNonNullElse(action.getName(), "Alignment");
+    String actionName = action.getName() != null ? action.getName() : "Alignment";
     alnTitle = String.format("%s %s of %s", service.getName(), actionName,
         frame.getTitle());
   }
@@ -226,17 +225,11 @@ class AlignmentServiceGuiHandler
   @Override
   public void taskException(TaskI<AlignmentResult> source, Exception e)
   {
-    Cache.log.error(String.format("Service %s raised an exception.", service.getName()), e);
+    Console.error(String.format("Service %s raised an exception.", service.getName()), e);
     infoPanel.appendProgressText(e.getMessage());
   }
 
   @Override
-  public void taskRestarted(TaskI<AlignmentResult> source)
-  {
-    // alignment services are not restartable
-  }
-
-  @Override
   public void subJobStatusChanged(TaskI<AlignmentResult> source, JobI job, JobStatus status)
   {
     int i = ArrayUtils.indexOf(jobs, job);