package jpower.core.internal;

import jpower.core.Task;

import java.util.Collection;
import java.util.HashSet;

/**
 * TODO: Port this to use a lightweight system
 */
public class CancelStateTracker
{
   private static final Collection<Task> states = new HashSet<>();

   public static void setCanceled(Task task, boolean cancel)
   {
      if (cancel)
      {
         states.add(task);
      }
      else
      {
         states.remove(task);
      }
   }

   public static boolean isCanceled(Task task)
   {
      return states.contains(task);
   }
}

@@ -545,11 +545,67 @@
 k);%0A   %7D
+%0A%0A   static void clear()%0A   %7B%0A      states.clear();%0A   %7D
 %0A%7D%0A

Add clear() method for internal use.