Merge branch 'master' into lttng-kepler
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / parsers / custom / CustomTxtTrace.java
index 9e06206c094687aec92de470adbd4d19e4cb6103..f216591bfb746ce2594be5bfd5b2ad01991ab6f8 100644 (file)
@@ -125,7 +125,7 @@ public class CustomTxtTrace extends TmfTrace implements ITmfEventParser {
             return new CustomTxtTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);
         }
         try {
-            long pos = (long) (ratio * fFile.length());
+            long pos = Math.round(ratio * fFile.length());
             while (pos > 0) {
                 fFile.seek(pos - 1);
                 if (fFile.read() == '\n') {
@@ -172,7 +172,7 @@ public class CustomTxtTrace extends TmfTrace implements ITmfEventParser {
 
     @Override
     public synchronized CustomTxtEvent getNext(final ITmfContext context) {
-        final ITmfContext savedContext = context.clone();
+        final ITmfContext savedContext = new TmfContext(context.getLocation(), context.getRank());
         final CustomTxtEvent event = parse(context);
         if (event != null) {
             updateAttributes(savedContext, event.getTimestamp());
This page took 0.023802 seconds and 5 git commands to generate.