DESCRIPTION

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: Jordon Obrien xxx@xxx.xxx


COMMENTS

author: Jordon Obrien
date: 2013-11-17 04:35:00.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2013-11-17 05:21:19.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/3981/

-------------------------------------
author: Braxton Mccarthy
date: 2013-11-17 05:53:08.000000000

Patch Set 3: Code-Review-1

(1 comment)

Typically you should split typos/formatting changes and code changes into separate patches. It makes it easier to review, and if we ever have to revert a behavior change, we don't lose the updated formatting.

Line:128, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java -> any reason you use .compareTo() == 0 instead of .equals()?

-------------------------------------
author: Brenden Conley
date: 2013-11-17 06:04:11.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/3981/ : SUCCESS

-------------------------------------
author: Jordon Obrien
date: 2013-11-17 06:11:05.000000000

Patch Set 3:

(1 comment)

fixed

Line:128, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java -> no reason at all.
compare was the first comparator I found.

-------------------------------------
