From: Francois Chouinard Date: Thu, 4 Mar 2010 19:14:55 +0000 (+0000) Subject: [Bug304438] Improvement on ITmfLocation X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=452ad365ef4eefa84feb7314534d518f7639bfc1;p=deliverable%2Ftracecompass.git [Bug304438] Improvement on ITmfLocation --- diff --git a/org.eclipse.linuxtools.lttng.tests/src/org/eclipse/linuxtools/lttng/tests/trace/LTTngTextTraceTest.java b/org.eclipse.linuxtools.lttng.tests/src/org/eclipse/linuxtools/lttng/tests/trace/LTTngTextTraceTest.java index e2235a6f31..ae54f3486f 100644 --- a/org.eclipse.linuxtools.lttng.tests/src/org/eclipse/linuxtools/lttng/tests/trace/LTTngTextTraceTest.java +++ b/org.eclipse.linuxtools.lttng.tests/src/org/eclipse/linuxtools/lttng/tests/trace/LTTngTextTraceTest.java @@ -245,7 +245,7 @@ public class LTTngTextTraceTest extends TestCase { assertNotSame("tmpEvent is null after first event",null,tmpEvent ); assertTrue("tmpEvent has wrong reference after first event",((String)tmpEvent.getReference().getReference()).contains(firstEventReference) ); assertNotSame("tmpContext is null after first seekEvent()",null,testStream1.getCurrentLocation() ); - assertEquals("tmpContext has wrong timestamp after first seekEvent()",locationAfterFirstEvent, ((TmfLocation) testStream1.getCurrentLocation()).getValue()); + assertEquals("tmpContext has wrong timestamp after first seekEvent()",locationAfterFirstEvent, ((TmfLocation) testStream1.getCurrentLocation()).getLocation()); // Test CPU number of the trace assertSame("getCpuNumber() return wrong number of cpu",traceCpuNumber ,testStream1.getCpuNumber() ); } diff --git a/org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/lttng/stubs/LTTngTraceStub.java b/org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/lttng/stubs/LTTngTraceStub.java index 9bcc8a1862..5cbf5919e2 100644 --- a/org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/lttng/stubs/LTTngTraceStub.java +++ b/org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/lttng/stubs/LTTngTraceStub.java @@ -82,12 +82,13 @@ public class LTTngTraceStub extends TmfTrace { /* (non-Javadoc) * @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#seekLocation(java.lang.Object) */ + @Override @SuppressWarnings("unchecked") - public TmfContext seekLocation(ITmfLocation location) { + public TmfContext seekLocation(ITmfLocation location) { TmfContext context = null; try { synchronized(fTrace) { - fTrace.seek((location != null) ? ((TmfLocation) location).getValue() : 0); + fTrace.seek((location != null) ? ((TmfLocation) location).getLocation() : 0); context = new TmfContext(getCurrentLocation(), 0); // TmfTraceContext context2 = new TmfTraceContext(getCurrentLocation(), 0); // TmfEvent event = parseEvent(context2); @@ -104,7 +105,7 @@ public class LTTngTraceStub extends TmfTrace { * @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#getCurrentLocation() */ @Override - public ITmfLocation getCurrentLocation() { + public ITmfLocation getCurrentLocation() { try { return new TmfLocation(fTrace.getFilePointer()); } catch (IOException e) { diff --git a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/event/LttngLocation.java b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/event/LttngLocation.java index 592f56975c..840b0424fa 100644 --- a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/event/LttngLocation.java +++ b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/event/LttngLocation.java @@ -3,7 +3,7 @@ package org.eclipse.linuxtools.lttng.event; import org.eclipse.linuxtools.tmf.trace.ITmfLocation; -public class LttngLocation implements ITmfLocation { +public class LttngLocation implements ITmfLocation { private final static Long DEFAULT_LAST_TIME = -1L; private final static Long DEFAULT_CURR_TIME = 0L; @@ -88,5 +88,18 @@ public class LttngLocation implements ITmfLocation { public String toString() { return "\tLttngLocation[ Last : " + lastReadTime + " Current : " + currentTime + " ]"; } + + // ------------------------------------------------------------------------ + // ITmfLocation + // ------------------------------------------------------------------------ + + public void setLocation(Long[] location) { + lastReadTime = ((Long[]) location)[0]; + currentTime = ((Long[]) location)[1]; + } + + public Long[] getLocation() { + return new Long[] {lastReadTime, currentTime }; + } } diff --git a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/state/StateManager.java b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/state/StateManager.java index 7060521a7b..bb2c94de6c 100644 --- a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/state/StateManager.java +++ b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/state/StateManager.java @@ -339,7 +339,7 @@ public class StateManager extends Observable { } // Make sure eventCount stay consistent! - eventCount = location.getValue(); + eventCount = location.getLocation(); // Restore the stored traceState stateIn.setTraceStateModel(traceState); diff --git a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/trace/LTTngTextTrace.java b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/trace/LTTngTextTrace.java index 86b9659aa4..d15e6aeaf9 100644 --- a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/trace/LTTngTextTrace.java +++ b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/trace/LTTngTextTrace.java @@ -136,7 +136,7 @@ public class LTTngTextTrace extends TmfTrace implements ITmfTrace { private void skipToPosition(TmfLocation skip) { try { - long skipPosition = skip.getValue(); + long skipPosition = skip.getLocation(); if ( skipPosition < 0 ) { skipPosition = 0L; } @@ -156,14 +156,15 @@ public class LTTngTextTrace extends TmfTrace implements ITmfTrace { } } - @SuppressWarnings("unchecked") - public TmfContext seekLocation(ITmfLocation location) { + @Override + @SuppressWarnings("unchecked") + public TmfContext seekLocation(ITmfLocation location) { if (location == null) { location = new TmfLocation(0L); } - if (!((TmfLocation) location).getValue().equals(nbCharRead)) { + if (!((TmfLocation) location).getLocation().equals(nbCharRead)) { skipToPosition((TmfLocation) location); } @@ -398,7 +399,7 @@ public class LTTngTextTrace extends TmfTrace implements ITmfTrace { } @Override - public ITmfLocation getCurrentLocation() { + public ITmfLocation getCurrentLocation() { return new TmfLocation(nbCharRead); } diff --git a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/trace/LTTngTrace.java b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/trace/LTTngTrace.java index 2295b2c4d3..072ec315ec 100644 --- a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/trace/LTTngTrace.java +++ b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/trace/LTTngTrace.java @@ -449,11 +449,12 @@ public class LTTngTrace extends TmfTrace { } @Override - public ITmfLocation getCurrentLocation() { + public ITmfLocation getCurrentLocation() { return currentLocation; } - public synchronized TmfContext seekLocation(ITmfLocation location) { + @Override + public synchronized TmfContext seekLocation(ITmfLocation location) { if ( joie == true ) { System.out.println("seekLocation(location) location -> " + location); diff --git a/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfEventParserStub.java b/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfEventParserStub.java index ceb98993f0..259604aff4 100644 --- a/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfEventParserStub.java +++ b/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfEventParserStub.java @@ -75,7 +75,7 @@ public class TmfEventParserStub implements ITmfEventParser { synchronized(stream) { long location = 0; if (context != null) - location = ((TmfLocation) (context.getLocation())).getValue(); + location = ((TmfLocation) (context.getLocation())).getLocation(); stream.seek(location); try { diff --git a/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java b/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java index 8aa0d3afeb..aa69bef108 100644 --- a/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java +++ b/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java @@ -89,13 +89,14 @@ public class TmfTraceStub extends TmfTrace { // Operators // ------------------------------------------------------------------------ + @Override @SuppressWarnings("unchecked") - public TmfContext seekLocation(ITmfLocation location) { + public TmfContext seekLocation(ITmfLocation location) { try { synchronized(fTrace) { // Position the trace at the requested location and // returns the corresponding context - long loc = (location != null) ? ((TmfLocation) location).getValue() : 0; + long loc = (location != null) ? ((TmfLocation) location).getLocation() : 0; if (loc != fTrace.getFilePointer()) { fTrace.seek(loc); } diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperiment.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperiment.java index 52b1cd291e..e0396f5d7b 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperiment.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperiment.java @@ -281,10 +281,10 @@ public class TmfExperiment extends TmfProvider implements // Returns a brand new context based on the location provided // Arms the event queues // NOTE: This is a fine example of pathological coupling... - public TmfExperimentContext seekLocation(ITmfLocation location) { + public TmfExperimentContext seekLocation(ITmfLocation location) { if (location instanceof TmfExperimentLocation || location == null) { - ITmfLocation[] oldloc = (location != null) ? ((TmfExperimentLocation) location).getLocations() : new TmfExperimentLocation[fTraces.length]; - ITmfLocation[] newloc = new ITmfLocation[fTraces.length]; + ITmfLocation[] oldloc = (location != null) ? ((TmfExperimentLocation) location).getLocation() : new TmfExperimentLocation[fTraces.length]; + ITmfLocation[] newloc = new ITmfLocation[fTraces.length]; TmfContext[] contexts = new TmfContext[fTraces.length]; TmfExperimentContext context = new TmfExperimentContext(fTraces, contexts); @@ -321,7 +321,7 @@ public class TmfExperiment extends TmfProvider implements } // Position the experiment at the checkpoint - ITmfLocation location; + ITmfLocation location; synchronized (fCheckpoints) { if (fCheckpoints.size() > 0) { if (index >= fCheckpoints.size()) { @@ -448,7 +448,7 @@ public class TmfExperiment extends TmfProvider implements TmfContext trcloc = expContext.getContexts()[trace]; TmfEvent event = expContext.getTraces()[trace].parseEvent(trcloc); TmfExperimentLocation exploc = (TmfExperimentLocation) expContext.getLocation(); - exploc.getLocations()[trace] = trcloc.getLocation().clone(); + exploc.getLocation()[trace] = trcloc.getLocation().clone(); expContext.updateRank(1); expContext.getEvents()[trace] = expContext.getTraces()[trace].getNextEvent(trcloc); return event; diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperimentContext.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperimentContext.java index 128bc5412c..2f01d008c2 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperimentContext.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperimentContext.java @@ -38,7 +38,7 @@ public class TmfExperimentContext extends TmfContext { fContexts = contexts; fEvents = new TmfEvent[fTraces.length]; - ITmfLocation[] locations = new ITmfLocation[fTraces.length]; + ITmfLocation[] locations = new ITmfLocation[fTraces.length]; long rank = 0; for (int i = 0; i < fTraces.length; i++) { if (contexts[i] != null) { diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperimentLocation.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperimentLocation.java index 21b919c099..d24d809cf7 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperimentLocation.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/experiment/TmfExperimentLocation.java @@ -13,31 +13,27 @@ package org.eclipse.linuxtools.tmf.experiment; import org.eclipse.linuxtools.tmf.trace.ITmfLocation; +import org.eclipse.linuxtools.tmf.trace.TmfLocation; /** * TmfExperimentLocation *

* The experiment location is the set of its traces' locations. */ -public class TmfExperimentLocation implements ITmfLocation { +public class TmfExperimentLocation extends TmfLocation[]> { - private ITmfLocation[] fLocations; - - public TmfExperimentLocation(ITmfLocation[] locations) { - fLocations = locations; - } - - public ITmfLocation[] getLocations() { - return fLocations; + public TmfExperimentLocation(ITmfLocation[] locations) { + super(locations); } @Override public TmfExperimentLocation clone() { - ITmfLocation[] locations = new ITmfLocation[fLocations.length]; - for (int i = 0; i < fLocations.length; i++) { - locations[i] = fLocations[i].clone(); + ITmfLocation[] locations = (ITmfLocation[]) getLocation(); + ITmfLocation[] clones = new ITmfLocation[locations.length]; + for (int i = 0; i < locations.length; i++) { + clones[i] = locations[i].clone(); } - return new TmfExperimentLocation(locations); + return new TmfExperimentLocation(clones); } } diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfContext.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfContext.java index 72e96072d7..880f8c6e9f 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfContext.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfContext.java @@ -19,11 +19,11 @@ package org.eclipse.linuxtools.tmf.trace; */ public interface ITmfContext extends Cloneable { - public void setLocation(ITmfLocation location); - public ITmfLocation getLocation(); + public void setLocation(ITmfLocation location); + public ITmfLocation getLocation(); - public void setRank(long value); + public void setRank(long rank); public long getRank(); - public void updateRank(int value); + public void updateRank(int rank); } diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfLocation.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfLocation.java index bd3e816b6b..20b20caf5e 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfLocation.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfLocation.java @@ -15,10 +15,14 @@ package org.eclipse.linuxtools.tmf.trace; /** * ITmfLocation *

- * This is a place-holder for the context objects. + * This is a place-holder for the location objects. */ -public interface ITmfLocation extends Cloneable { - - public ITmfLocation clone(); +public interface ITmfLocation extends Cloneable { + + public void setLocation(L location); + + public L getLocation(); + + public ITmfLocation clone(); } diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfTrace.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfTrace.java index 50536c3b59..f803820730 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfTrace.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/ITmfTrace.java @@ -54,7 +54,7 @@ public interface ITmfTrace { * @param data.index * @return a context object for subsequent reads */ - public TmfContext seekLocation(ITmfLocation location); + public TmfContext seekLocation(ITmfLocation location); public TmfContext seekEvent(TmfTimestamp timestamp); public TmfContext seekEvent(long rank); diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfCheckpoint.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfCheckpoint.java index 264d637193..f37cb28d57 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfCheckpoint.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfCheckpoint.java @@ -26,7 +26,7 @@ public class TmfCheckpoint implements Comparable { // ------------------------------------------------------------------------ private final TmfTimestamp fTimestamp; - private final ITmfLocation fLocation; + private final ITmfLocation fLocation; // ------------------------------------------------------------------------ // Constructors @@ -36,7 +36,7 @@ public class TmfCheckpoint implements Comparable { * @param ts * @param location */ - public TmfCheckpoint(TmfTimestamp ts, ITmfLocation location) { + public TmfCheckpoint(TmfTimestamp ts, ITmfLocation location) { fTimestamp = ts; fLocation = location; } @@ -55,7 +55,7 @@ public class TmfCheckpoint implements Comparable { /** * @return the checkpoint event stream location */ - public ITmfLocation getLocation() { + public ITmfLocation getLocation() { return fLocation; } diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfContext.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfContext.java index 2df122285b..871421b380 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfContext.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfContext.java @@ -24,19 +24,19 @@ package org.eclipse.linuxtools.tmf.trace; */ public class TmfContext implements ITmfContext, Cloneable { - private ITmfLocation fLocation; + private ITmfLocation fLocation; private long fRank; // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ - public TmfContext(ITmfLocation loc, long rank) { + public TmfContext(ITmfLocation loc, long rank) { fLocation = loc; fRank = rank; } - public TmfContext(ITmfLocation location) { + public TmfContext(ITmfLocation location) { this(location, 0); } @@ -66,24 +66,24 @@ public class TmfContext implements ITmfContext, Cloneable { // ITmfContext // ------------------------------------------------------------------------ - public void setLocation(ITmfLocation loc) { - fLocation = loc; + public void setLocation(ITmfLocation location) { + fLocation = location; } - public ITmfLocation getLocation() { + public ITmfLocation getLocation() { return fLocation; } - public void setRank(long value) { - fRank = value; + public void setRank(long rank) { + fRank = rank; } public long getRank() { return fRank; } - public void updateRank(int value) { - fRank += value; + public void updateRank(int delta) { + fRank += delta; } } diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfLocation.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfLocation.java index c1996c6265..6851d9e1be 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfLocation.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfLocation.java @@ -15,32 +15,38 @@ package org.eclipse.linuxtools.tmf.trace; /** * TmfLocation *

- * Implement me. Please. + * A generic implementation of ITmfLocation */ -public class TmfLocation implements ITmfLocation { +public class TmfLocation implements ITmfLocation { - private T fLocation; + private L fLocation; - public TmfLocation(T location) { + public TmfLocation(L location) { fLocation = location; } - public void setValue(T location) { + public void setLocation(L location) { fLocation = location; } - public T getValue() { + public L getLocation() { return fLocation; } + @Override + public String toString() { + return fLocation.toString(); + } + @Override @SuppressWarnings("unchecked") - public TmfLocation clone() { + public TmfLocation clone() { try { - return (TmfLocation) super.clone(); + return (TmfLocation) super.clone(); } catch (CloneNotSupportedException e) { e.printStackTrace(); } return null; } + } diff --git a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfTrace.java b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfTrace.java index fdc5893cf0..55aafc84e8 100644 --- a/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfTrace.java +++ b/org.eclipse.linuxtools.tmf/src/org/eclipse/linuxtools/tmf/trace/TmfTrace.java @@ -225,7 +225,7 @@ public abstract class TmfTrace extends TmfProvider implem } // Position the stream at the checkpoint - ITmfLocation location; + ITmfLocation location; synchronized (fCheckpoints) { if (fCheckpoints.size() > 0) { if (index >= fCheckpoints.size()) { @@ -259,7 +259,7 @@ public abstract class TmfTrace extends TmfProvider implem // Position the stream at the previous checkpoint int index = (int) rank / fIndexPageSize; - ITmfLocation location; + ITmfLocation location; synchronized (fCheckpoints) { if (fCheckpoints.size() > 0) { if (index >= fCheckpoints.size()) { @@ -312,7 +312,8 @@ public abstract class TmfTrace extends TmfProvider implem /** * To be implemented by the concrete class */ - public abstract ITmfLocation getCurrentLocation(); + public abstract TmfContext seekLocation(ITmfLocation location); + public abstract ITmfLocation getCurrentLocation(); public abstract TmfEvent parseEvent(TmfContext context); // ------------------------------------------------------------------------ @@ -373,7 +374,6 @@ public abstract class TmfTrace extends TmfProvider implem /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ - @SuppressWarnings("rawtypes") @Override protected IStatus run(IProgressMonitor monitor) { @@ -389,7 +389,7 @@ public abstract class TmfTrace extends TmfProvider implem try { // Position the trace at the beginning TmfContext context = seekLocation(null); - TmfLocation location = (TmfLocation) context.getLocation(); + ITmfLocation location = context.getLocation(); // Get the first event TmfEvent event = getNextEvent(context); @@ -418,7 +418,7 @@ public abstract class TmfTrace extends TmfProvider implem // We will need this location at the next iteration if ((nbEvents % fIndexPageSize) == 0) { - location = (TmfLocation) context.getLocation(); + location = context.getLocation(); } event = getNextEvent(context);