JAL - 3690 AlignCalc rebuilt - FutureTask-based manager
[jalview.git] / src / jalview / workers / ColumnCounterSetWorker.java
index 74695fe..a711f2b 100644 (file)
@@ -70,44 +70,22 @@ class ColumnCounterSetWorker extends AlignCalcWorker
   public void run()
   {
     boolean annotationAdded = false;
-    try
+    if (alignViewport.isClosed())
     {
-      calcMan.notifyStart(this);
+      abortAndDestroy();
+      return;
+    }
 
-      while (!calcMan.notifyWorking(this))
+    if (alignViewport.getAlignment() != null)
+    {
+      try
       {
-        try
-        {
-          Thread.sleep(200);
-        } catch (InterruptedException ex)
-        {
-          ex.printStackTrace();
-        }
-      }
-      if (alignViewport.isClosed())
+        annotationAdded = computeAnnotations();
+      } catch (IndexOutOfBoundsException x)
       {
-        abortAndDestroy();
+        // probable race condition. just finish and return without any fuss.
         return;
       }
-
-      if (alignViewport.getAlignment() != null)
-      {
-        try
-        {
-          annotationAdded = computeAnnotations();
-        } catch (IndexOutOfBoundsException x)
-        {
-          // probable race condition. just finish and return without any fuss.
-          return;
-        }
-      }
-    } catch (OutOfMemoryError error)
-    {
-      ap.raiseOOMWarning("calculating feature counts", error);
-      calcMan.disableWorker(this);
-    } finally
-    {
-      calcMan.workerComplete(this);
     }
 
     if (ap != null)