tmf: Make TmfEvent immutable
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / ctfadaptor / CtfTmfEvent.java
index a42de95f296bf8ad683645e94ff204aa0ee0cb77..c7a2129d743b6ec1bee0f9226caacb077d359c01 100644 (file)
@@ -20,7 +20,6 @@ import java.util.List;
 import java.util.Map.Entry;
 import java.util.Set;
 
-import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.linuxtools.ctf.core.event.CTFCallsite;
 import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
 import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
@@ -43,7 +42,7 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * @author Alexandre Montplaisir
  * @since 2.0
  */
-public final class CtfTmfEvent implements ITmfEvent, IAdaptable, Cloneable {
+public final class CtfTmfEvent implements ITmfEvent, Cloneable {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -186,12 +185,8 @@ public final class CtfTmfEvent implements ITmfEvent, IAdaptable, Cloneable {
         /* There is only one reference to the trace, so we can shallow-copy it */
         this.fTrace = other.getTrace();
 
-        /*
-         * Copy the timestamp
-         * FIXME This can be switched to a shallow-copy once timestamps are
-         * made immutable.
-         */
-        this.fTimestamp = new CtfTmfTimestamp(other.fTimestamp.getValue());
+        /* Copy the timestamp (immutable) */
+        this.fTimestamp = other.fTimestamp;
 
         /* Primitives, those will be copied by value */
         this.sourceCPU = other.sourceCPU;
@@ -201,8 +196,8 @@ public final class CtfTmfEvent implements ITmfEvent, IAdaptable, Cloneable {
         this.eventName = other.eventName;
         this.fileName = other.fileName;
 
-        /* Copy the fields over */
-        this.fContent = other.fContent.clone();
+        /* Copy the fields over (immutable) */
+        this.fContent = other.fContent;
 
         /*
          * Copy the reference to the custom attributes (should be the same
This page took 0.025336 seconds and 5 git commands to generate.