CTF : Handle traces with events without eventID
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / trace / Stream.java
index 774a95e8878a3b35fb1e0aacfac914effba7a447..4482aecb22556ea2d05d793d35aa62abefde5e7b 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Set;
 
 import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
+import org.eclipse.linuxtools.internal.ctf.core.event.EventDeclaration;
 import org.eclipse.linuxtools.internal.ctf.core.event.metadata.exceptions.ParseException;
 
 /**
@@ -243,9 +244,12 @@ public class Stream {
         if (events.get(event.getId()) != null) {
             throw new ParseException("Event id already exists"); //$NON-NLS-1$
         }
-
-        /* Put the event in the map */
-        events.put(event.getId(), event);
+        if (event.getId() == null) {
+            events.put(EventDeclaration.UNSET_EVENT_ID, event);
+        } else {
+            /* Put the event in the map */
+            events.put(event.getId(), event);
+        }
     }
 
     /**
This page took 0.025302 seconds and 5 git commands to generate.