rendered paste body protected void removeTask(Runnable r) { synchronized (assignedTasks) { assignedTasks.remove(r); //TODO !! Remove doesn't work correct. objects with e.compareto(o) == 0 are deleted!! taskQueue.remove(r); } if (r instanceof Task) { Task task = (Task) r; if (!task.getChildren().isEmpty()) logger.info("Task \"" + task + "\" has finished before its child tasks: " + task.getChildren()); if (task.isVisible()) fireTaskDone(task); if (logger.isDebugEnabled()) logger.debug("Removed task \"" + task + "\""); } else { logger.info("Runnable object \"" + r + "\" does not implement interface Task. "); throw new Error("Runnable object \"" + r + "\" does not implement interface Task. "); } startNextTasks(); }