Index: trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDCalculator.java
===================================================================
--- trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDCalculator.java	(revision 795)
+++ trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDCalculator.java	(revision 796)
@@ -1,9 +1,10 @@
 package de.ugoe.cs.quest.plugin.jfc;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Map;
-import java.util.Stack;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -50,56 +51,76 @@
          "javax.swing.JScrollPane$ScrollBar",
          "javax.swing.plaf.metal.MetalScrollButton");
-	
-	
-	/**
-	 * Calculates the replayID needed for compatibility with Guitar suite of a JFCEvent
+   
+   /**
+    * Calculates the replayID of a JFCEvent needed for compatibility with guitar suite
+    * @param List of {@link JFCGUIElementSpec}s that represent the component path of a event target
+    * for which the replayID should be calculated. 
+    * @return replayID
+    */
+	
+   public String calculateReplayID(List<JFCGUIElementSpec> guiElementPath){
+	   String replayID = "";
+	   long hashCode = 1;
+	 
+	   ListIterator<JFCGUIElementSpec> iterator = guiElementPath.listIterator();
+	   
+	   JFCGUIElementSpec currentSpec = iterator.next();
+	   String title = currentSpec.getName();
+	   String fuzzyTitle = getFuzzyTitle(title);
+	   long windowHashCode = fuzzyTitle.hashCode();
+	   windowHashCode = (windowHashCode * 2) & 0xffffffffL;
+
+	   long propagatedHashCode = windowHashCode;
+	   
+	   // construct looks complicated but avoids going back and force through path
+	   if (iterator.hasNext())
+		   currentSpec = iterator.next();
+	   else
+		   currentSpec = null;
+
+	   // walk through component path and calculate hashcode
+	   while(currentSpec != null){
+		   long localHashCode = getLocalHashCode(currentSpec);
+		   hashCode = propagatedHashCode * prime + localHashCode;
+		   hashCode = (hashCode * 2) & 0xffffffffL;
+
+		   if (iterator.hasNext()){
+			   currentSpec = iterator.next();
+			   Integer index = currentSpec.getIndex();
+			   propagatedHashCode = prime * propagatedHashCode
+					   + index.hashCode();
+		   }
+		   else
+			   currentSpec = null;
+			   
+	   }
+
+	   replayID = "e" + hashCode;
+
+	   return replayID;
+   }
+   
+   
+	/**
+	 * Calculates the replayID of a JFCEvent needed for compatibility with guitar suite 
 	 * @param event for which the ID should be calculated
 	 * @return replayID
 	 */
 	public String calculateReplayID(Event event){
-		String replayID = "";
-		long hashCode = 1;
-		Stack<JFCGUIElement> path = new Stack<JFCGUIElement>();
+		List<JFCGUIElementSpec> guiElementPath = new ArrayList<JFCGUIElementSpec>();
 		
 		IEventTarget target = event.getTarget();
 		JFCGUIElement jfcTarget = (JFCGUIElement) target;
 		
-		// extract target path
+		// extract element path
 		JFCGUIElement currentTarget = jfcTarget;
 		while (currentTarget != null){
-			path.push(currentTarget);
+			JFCGUIElementSpec currentSpec = (JFCGUIElementSpec) currentTarget.getSpecification();
+			guiElementPath.add(0, currentSpec);
 			currentTarget = (JFCGUIElement) currentTarget.getParent();
 		}
 		
-		// calculate window hashcode
-		currentTarget = path.pop();
-		
-		JFCGUIElementSpec currentSpec = (JFCGUIElementSpec) currentTarget.getSpecification();
-		String title = currentSpec.getName();
-		String fuzzyTitle = getFuzzyTitle(title);
-		long windowHashCode = fuzzyTitle.hashCode();
-		windowHashCode = (windowHashCode * 2) & 0xffffffffL;
-		
-		long propagatedHashCode = windowHashCode;
-		
-		// walk through component path and calculate hashcode
-		
-		while(!path.isEmpty()){
-			currentTarget = path.pop(); 
-			currentSpec = (JFCGUIElementSpec) currentTarget.getSpecification();
-			long localHashCode = getLocalHashCode(currentSpec);
-			hashCode = propagatedHashCode * prime + localHashCode;
-	        hashCode = (hashCode * 2) & 0xffffffffL;
-			
-	        if (!path.isEmpty()){
-	        	Integer index = ((JFCGUIElementSpec) path.lastElement().getSpecification()).getIndex();
-				propagatedHashCode = prime * propagatedHashCode
-				+ index.hashCode();
-	        }
-		}
-		
-		replayID = "e" + hashCode;
-		
-		return replayID;
+		// calculation is delegated to other calculateReplayID method
+		return this.calculateReplayID(guiElementPath);
 	}
 	
