Index: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRule.java
===================================================================
--- trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRule.java	(revision 1188)
+++ trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRule.java	(revision 1189)
@@ -15,4 +15,6 @@
 package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -74,13 +76,12 @@
      * </p>
      */
-    SequenceForTaskDetectionRule(TaskEqualityRuleManager taskEqualityRuleManager,
-                                 TaskEquality            minimalTaskEquality,
-                                 ITaskFactory            taskFactory,
-                                 ITaskBuilder            taskBuilder)
+    SequenceForTaskDetectionRule(TaskEquality minimalTaskEquality,
+                                 ITaskFactory taskFactory,
+                                 ITaskBuilder taskBuilder)
     {
         this.taskFactory = taskFactory;
         this.taskBuilder = taskBuilder;
         
-        this.taskComparator = new TaskComparator(taskEqualityRuleManager, minimalTaskEquality);
+        this.taskComparator = new TaskComparator(minimalTaskEquality);
     }
 
@@ -887,46 +888,26 @@
      */
     private static class TaskComparator implements SymbolComparator<ITaskInstance> {
-
+        
         /** */
-        private Comparer comparer;
+        private TaskEquality minimalNodeEquality;
 
         /** */
-        private Comparer lexicalComparer;
+        private transient Comparer comparer;
 
         /** */
-        private HashMap<Long, Boolean> equalityBuffer = new HashMap<Long, Boolean>();
+        private transient Comparer lexicalComparer;
 
         /** */
-        private HashMap<Long, Boolean> lexicalEqualityBuffer;
+        private transient HashMap<Long, Boolean> equalityBuffer = new HashMap<Long, Boolean>();
+
+        /** */
+        private transient HashMap<Long, Boolean> lexicalEqualityBuffer;
 
         /**
          *
          */
-        public TaskComparator(TaskEqualityRuleManager taskEqualityRuleManager,
-                              TaskEquality            minimalNodeEquality)
-        {
-            super();
-            
-            if (minimalNodeEquality == TaskEquality.LEXICALLY_EQUAL) {
-                comparer = new LexicalComparer(taskEqualityRuleManager);
-            }
-            else if (minimalNodeEquality == TaskEquality.SYNTACTICALLY_EQUAL) {
-                comparer = new SyntacticalComparer(taskEqualityRuleManager);
-            }
-            else if (minimalNodeEquality == TaskEquality.SEMANTICALLY_EQUAL) {
-                comparer = new SemanticalComparer(taskEqualityRuleManager);
-            }
-            else {
-                comparer = new DefaultComparer(taskEqualityRuleManager, minimalNodeEquality);
-            }
-            
-            if (minimalNodeEquality == TaskEquality.LEXICALLY_EQUAL) {
-                lexicalComparer = comparer;
-                lexicalEqualityBuffer = equalityBuffer;
-            }
-            else {
-                lexicalComparer = new LexicalComparer(taskEqualityRuleManager);
-                lexicalEqualityBuffer = new HashMap<Long, Boolean>();
-            }
+        public TaskComparator(TaskEquality minimalNodeEquality) {
+            this.minimalNodeEquality = minimalNodeEquality;
+            init();
         }
 
@@ -991,4 +972,41 @@
             return result;
         }
+        
+        /**
+         * 
+         */
+        private void init() {
+            if (minimalNodeEquality == TaskEquality.LEXICALLY_EQUAL) {
+                comparer = new LexicalComparer();
+            }
+            else if (minimalNodeEquality == TaskEquality.SYNTACTICALLY_EQUAL) {
+                comparer = new SyntacticalComparer();
+            }
+            else if (minimalNodeEquality == TaskEquality.SEMANTICALLY_EQUAL) {
+                comparer = new SemanticalComparer();
+            }
+            else {
+                comparer = new DefaultComparer(this.minimalNodeEquality);
+            }
+            
+            if (minimalNodeEquality == TaskEquality.LEXICALLY_EQUAL) {
+                lexicalComparer = comparer;
+                lexicalEqualityBuffer = equalityBuffer;
+            }
+            else {
+                lexicalComparer = new LexicalComparer();
+                lexicalEqualityBuffer = new HashMap<Long, Boolean>();
+            }
+        }
+        
+        /**
+         * <p>
+         * deserialize this object and reinitialize the buffers
+         * </p>
+         */
+        private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
+            in.defaultReadObject();
+            init();
+        }
     }
 
@@ -1010,22 +1028,8 @@
         
         /**
-         * <p>
-         * the task equality manager needed for comparing tasks with each other
-         * </p>
-         */
-        private TaskEqualityRuleManager taskEqualityRuleManager;
-        
-        /**
-         *
-         */
-        public LexicalComparer(TaskEqualityRuleManager taskEqualityRuleManager) {
-           this.taskEqualityRuleManager = taskEqualityRuleManager;
-        }
-        
-        /**
          * 
          */
         public boolean compare(ITask task1, ITask task2) {
-            return taskEqualityRuleManager.areLexicallyEqual(task1, task2);
+            return TaskEqualityRuleManager.getInstance().areLexicallyEqual(task1, task2);
         }
     }
@@ -1037,22 +1041,8 @@
         
         /**
-         * <p>
-         * the task equality manager needed for comparing tasks with each other
-         * </p>
-         */
-        private TaskEqualityRuleManager taskEqualityRuleManager;
-        
-        /**
-         *
-         */
-        public SyntacticalComparer(TaskEqualityRuleManager taskEqualityRuleManager) {
-           this.taskEqualityRuleManager = taskEqualityRuleManager;
-        }
-        
-        /**
          * 
          */
         public boolean compare(ITask task1, ITask task2) {
-            return taskEqualityRuleManager.areSyntacticallyEqual(task1, task2);
+            return TaskEqualityRuleManager.getInstance().areSyntacticallyEqual(task1, task2);
         }
     }
@@ -1064,22 +1054,8 @@
         
         /**
-         * <p>
-         * the task equality manager needed for comparing tasks with each other
-         * </p>
-         */
-        private TaskEqualityRuleManager taskEqualityRuleManager;
-        
-        /**
-         *
-         */
-        public SemanticalComparer(TaskEqualityRuleManager taskEqualityRuleManager) {
-           this.taskEqualityRuleManager = taskEqualityRuleManager;
-        }
-        
-        /**
          * 
          */
         public boolean compare(ITask task1, ITask task2) {
-            return taskEqualityRuleManager.areSemanticallyEqual(task1, task2);
+            return TaskEqualityRuleManager.getInstance().areSemanticallyEqual(task1, task2);
         }
     }
@@ -1090,11 +1066,4 @@
     private static class DefaultComparer implements Comparer {
         
-        /**
-         * <p>
-         * the task equality manager needed for comparing tasks with each other
-         * </p>
-         */
-        private TaskEqualityRuleManager taskEqualityRuleManager;
-
         /**
          * <p>
@@ -1107,8 +1076,5 @@
          *
          */
-        public DefaultComparer(TaskEqualityRuleManager taskEqualityRuleManager,
-                               TaskEquality            minimalNodeEquality)
-        {
-           this.taskEqualityRuleManager = taskEqualityRuleManager;
+        public DefaultComparer(TaskEquality minimalNodeEquality) {
            this.minimalNodeEquality = minimalNodeEquality;
         }
@@ -1118,5 +1084,6 @@
          */
         public boolean compare(ITask task1, ITask task2) {
-            return taskEqualityRuleManager.areAtLeastEqual(task1, task2, minimalNodeEquality);
+            return TaskEqualityRuleManager.getInstance().areAtLeastEqual
+                (task1, task2, minimalNodeEquality);
         }
     }
