tmf: Make TmfEvent immutable
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Fri, 1 Feb 2013 22:21:19 +0000 (17:21 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 5 Feb 2013 23:07:07 +0000 (18:07 -0500)
commitbd54d363b79ab554de3036a01c59c40aff78c1a9
tree0f68638550c36d96d5052ddfbb8c505fc1b47dc1
parent6083d3fbff9efd56727ba09a7e21bc31d6ffe56f
tmf: Make TmfEvent immutable

The immediate benefit of immutable events is that we can avoid
doing copies in many places in the framework (for indexing,
checkpoints, et al.). It also alleviates many potential
concurrency issues.

For specific sub-classes that need to have mutable (non-final)
fields, the recommended - hopefully transitional - approach is to
re-define the fields in question and override the getters to make
sure the extended class's versions are used.

This was done for CustomEvent in this patch.

Change-Id: I6a9ec635eaa68b03d1c5a6875f60ece7d47cb024
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/10123
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
IP-Clean: Patrick Tasse <patrick.tasse@gmail.com>
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/TmfExperimentContext.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEvent.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEvent.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfLostEvent.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfCheckpointIndexer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsCache.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java
This page took 0.029991 seconds and 5 git commands to generate.