Index: /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCSimplifiedLogParser.java
===================================================================
--- /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCSimplifiedLogParser.java	(revision 1859)
+++ /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCSimplifiedLogParser.java	(revision 1860)
@@ -145,4 +145,19 @@
     /**
      * <p>
+     * maps the hashes of GUI elements stored in the logs to unique ids of GUI elements.
+     * This is required, as the same hash may be used for several GUI elements in the log files.
+     * </p>
+     */
+    private Map<Long, Long> hashToGuiElementIdMapping = new HashMap<>();
+
+    /**
+     * <p>
+     * counter to get unique GUI element ids
+     * </p>
+     */
+    private long nextGuiElementId = 0;
+    
+    /**
+     * <p>
      * internal handle to the parsed GUI structure, stored in a GUIElementTree
      * </p>
@@ -326,6 +341,7 @@
         if (qName.equals("sessions")) {
             currentSequence = new LinkedList<Event>();
-            if (currentGUIElementTree == null)
+            if (currentGUIElementTree == null) {
                 currentGUIElementTree = new GUIElementTree<Long>();
+            }
         }
         if (qName.equals("newsession")) {
@@ -350,8 +366,9 @@
         }
         else if (qName.equals("componentNameChange")) {
-            long sourceHash = Long.parseLong(atts.getValue("hash"), 16);
+            Long sourceHash = Long.parseLong(atts.getValue("hash"), 16);
             String newName = atts.getValue("newName");
             // int titleSource = Integer.parseInt(atts.getValue("titleSource"));
-            JFCGUIElement sourceElement = (JFCGUIElement) currentGUIElementTree.find(sourceHash);
+            Long guiElementId = hashToGuiElementIdMapping.get(sourceHash);
+            JFCGUIElement sourceElement = (JFCGUIElement) currentGUIElementTree.find(guiElementId);
             JFCGUIElementSpec sourceSpec = (JFCGUIElementSpec) sourceElement.getSpecification();
             sourceSpec.setName(newName);
@@ -411,7 +428,11 @@
         }
         else if (qName.equals("component") && currentGUIElementHash != null) {
+            Long guiElementId = nextGuiElementId++;
+            Long parentGuiElementId = hashToGuiElementIdMapping.get(currentParentHash);
+            
             try {
-                currentGUIElementTree.add(currentGUIElementHash, currentParentHash,
-                                          currentGuiElementSpec);
+                // store a mapping of the hash to a unique id and use this id for the GUI element
+                hashToGuiElementIdMapping.put(currentGUIElementHash, guiElementId);
+                currentGUIElementTree.add(guiElementId, parentGuiElementId, currentGuiElementSpec);
             }
             catch (GUIModelException e) {
@@ -419,8 +440,8 @@
                                        currentGUIElementHash + ": " + e.getMessage(), e);
             }
+            
             List<Event> unhandledEvents = eventsWithoutTargets.get(currentGUIElementHash);
             if (unhandledEvents != null) {
-                JFCGUIElement guiElement =
-                    (JFCGUIElement) currentGUIElementTree.find(currentGUIElementHash);
+                JFCGUIElement guiElement = (JFCGUIElement) currentGUIElementTree.find(guiElementId);
                 for (Event event : unhandledEvents) {
                     event.setTarget(guiElement);
@@ -429,4 +450,5 @@
                 eventsWithoutTargets.remove(currentGUIElementHash);
             }
+            
             currentGUIElementHash = null;
             currentParentHash = null;
@@ -435,25 +457,36 @@
         else if (currentEventId != null) {
             if (qName.equals("event")) {
-
-                IGUIElement currentGUIElement;
-                currentGUIElement = currentGUIElementTree.find(currentEventSource);
+                
+                IGUIElement currentGUIElement = null;
+                
+                if (hashToGuiElementIdMapping.containsKey(currentEventSource)) {
+                    long guiElementId = hashToGuiElementIdMapping.get(currentEventSource);
+                    currentGUIElement = currentGUIElementTree.find(guiElementId);
+                }
+                
                 Event event;
                 // in some rare cases the target GUI element of the event is not
                 // known yet
                 if (currentGUIElement == null) {
-                    event = new Event(instantiateInteraction(currentEventId, currentEventParameters));
+                    event = new Event
+                        (instantiateInteraction(currentEventId, currentEventParameters));
+                    
                     List<Event> eventList = eventsWithoutTargets.get(currentEventSource);
+                    
                     if (eventList == null) {
                         eventList = new ArrayList<Event>();
                         eventsWithoutTargets.put(currentEventSource, eventList);
                     }
+                    
                     eventList.add(event);
                 }
                 else {
                     event = new Event(instantiateInteraction(currentEventId, currentEventParameters),
-                                  currentGUIElement);
+                                      currentGUIElement);
+                    
                     JFCGUIElement currentEventTarget = (JFCGUIElement) event.getTarget();
                     currentEventTarget.markUsed();
                 }
+                
                 event.setTimestamp(currentEventTimestamp);
                 currentSequence.add(event);
