Index: /trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/Event.java
===================================================================
--- /trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/Event.java	(revision 374)
+++ /trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/Event.java	(revision 375)
@@ -227,7 +227,5 @@
 			hash = multiplier * hash + type.hashCode();
 		}
-		if (target != null) {
-			hash = multiplier * hash + target.hashCode();
-		}
+		hash = multiplier * hash + targetHashCode();
 
 		return hash;
@@ -296,5 +294,7 @@
 	 * 
 	 * @param otherTarget
-	 * @return
+	 *            other target string to which the target if this event is
+	 *            compared to
+	 * @return true if the targets are equals; false otherwise
 	 */
 	protected boolean targetEquals(String otherTarget) {
@@ -307,3 +307,21 @@
 		return retVal;
 	}
+
+	/**
+	 * <p>
+	 * This function is used by {@link #hashCode()} to determine how the hash of
+	 * the {@link #target}. It has to be overridden by subclasses that implement
+	 * {@link #targetEquals(String)}, to ensure that the equals/hashCode
+	 * contract remains valid.
+	 * </p>
+	 * 
+	 * @return hash of the target
+	 */
+	protected int targetHashCode() {
+		if (target != null) {
+			return target.hashCode();
+		} else {
+			return 0;
+		}
+	}
 }
