Merge branch 'master' into lttng-kepler
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / parsers / custom / CustomXmlTrace.java
index 338c0315a6d7898f41980e6369bf903876fb1f85..a18cb4de8acd5ccaa0933de904cab436c9881126 100644 (file)
@@ -130,7 +130,7 @@ public class CustomXmlTrace 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') {
@@ -177,7 +177,7 @@ public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
 
     @Override
     public synchronized CustomXmlEvent getNext(final ITmfContext context) {
-        final ITmfContext savedContext = context.clone();
+        final ITmfContext savedContext = new TmfContext(context.getLocation(), context.getRank());
         final CustomXmlEvent event = parse(context);
         if (event != null) {
             updateAttributes(savedContext, event.getTimestamp());
This page took 0.024255 seconds and 5 git commands to generate.