diff options
Diffstat (limited to 'lttng/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java')
-rw-r--r-- | lttng/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java b/lttng/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java index 36ed9454cb..da556ba029 100644 --- a/lttng/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java +++ b/lttng/org.eclipse.linuxtools.tmf.tests/stubs/org/eclipse/linuxtools/tmf/trace/TmfTraceStub.java @@ -47,9 +47,7 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> { * @throws FileNotFoundException */ public TmfTraceStub(String filename) throws FileNotFoundException { - super("TmfTraceStub", TmfEvent.class, filename); - fTrace = new RandomAccessFile(filename, "r"); - fParser = new TmfEventParserStub(); + this(filename, DEFAULT_INDEX_PAGE_SIZE, false); } /** @@ -67,7 +65,7 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> { * @throws FileNotFoundException */ public TmfTraceStub(String filename, boolean waitForCompletion) throws FileNotFoundException { - this(filename, DEFAULT_CACHE_SIZE, waitForCompletion); + this(filename, DEFAULT_INDEX_PAGE_SIZE, waitForCompletion); } /** @@ -82,13 +80,6 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> { fParser = new TmfEventParserStub(); } -// /** -// * @param other -// */ -// public TmfTraceStub(TmfTraceStub other) { -// this(filename, DEFAULT_CACHE_SIZE, waitForCompletion); -// } - /** */ @Override @@ -96,7 +87,7 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> { TmfTraceStub clone = null; try { clone = (TmfTraceStub) super.clone(); - clone.fTrace = new RandomAccessFile(getName(), "r"); + clone.fTrace = new RandomAccessFile(getPath(), "r"); clone.fParser = new TmfEventParserStub(); } catch (CloneNotSupportedException e) { } catch (FileNotFoundException e) { @@ -106,12 +97,7 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> { public ITmfTrace createTraceCopy() { ITmfTrace returnedValue = null; - try { - returnedValue = new TmfTraceStub(this.getName()); - } - catch (FileNotFoundException e) { -// e.printStackTrace(); - } + returnedValue = clone(); return returnedValue; } @@ -165,8 +151,8 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> { @Override public TmfEvent parseEvent(TmfContext context) { try { - // paserNextEvent updates the context - TmfEvent event = fParser.parseNextEvent(this, context); + // parseNextEvent will update the context + TmfEvent event = fParser.parseNextEvent(this, context.clone()); return event; } catch (IOException e) { |