Avoid multiple seek to the same location.
authorEtienne Bergeron <etienne.bergeron@gmail.com>
Tue, 19 Nov 2013 02:14:46 +0000 (21:14 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Sat, 23 Nov 2013 08:37:18 +0000 (03:37 -0500)
commit92d542ebcb6125adff4c3e1d2b80d62b35e552f3
tree737210ba192cd5dd06ee05059ec8e91cd448eb8c
parent0f89d4ba475bc15b04925c714a819098dc40ea23
Avoid multiple seek to the same location.

There is multiple instance of seeking to the same location twice.
To solve this issue the seek method check if the current location is the same.
Here is the explanation:
[CtfTmfContext.java]
    public void setLocation(ITmfLocation location) {
        curLocation = (CtfLocation) location;
        if (curLocation != null) {
            getIterator().seek(curLocation.getLocationInfo());
        }
    }
GetIterator  --> will force a seek to curLocation
.seek        --> force an other seek to curLocation
Here are the called method:
    private CtfIterator getIterator() {
        return CtfIteratorManager.getIterator(fTrace, this);
    }
    public static synchronized CtfIterator getIterator(final CtfTmfTrace trace,
            final CtfTmfContext ctx) {
        return map.get(trace).getIterator(ctx);
    }
    public CtfIterator getIterator(final CtfTmfContext context) {
            [...]
            if (context.getLocation() != null) {
                final CtfLocationInfo location = (CtfLocationInfo) context.getLocation().getLocationInfo();
                retVal.seek(location);   /// FORCE SEEK!!!!!!!!!!!!
            }
Change-Id: Ib5ad6d05eb47045660c7ab5076930a30e829c7a0
Signed-off-by: Etienne Bergeron <etienne.bergeron@gmail.com>
Reviewed-on: https://git.eclipse.org/r/18461
Reviewed-by: François Doray <fdoray.eclipse@gmail.com>
Tested-by: Hudson CI
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
IP-Clean: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java
This page took 0.026606 seconds and 5 git commands to generate.