Refactor TmfTrace and dependencies - remove indexTrace()
authorFrancois Chouinard <fchouinard@gmail.com>
Wed, 18 Apr 2012 21:52:54 +0000 (17:52 -0400)
committerFrancois Chouinard <fchouinard@gmail.com>
Wed, 18 Apr 2012 21:52:54 +0000 (17:52 -0400)
15 files changed:
org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTextTrace.java
org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java
org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng/stubs/LTTngTraceStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfTraceStub.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenExperimentHandler.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenTraceHandler.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/editors/EventsViewEditor.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/editors/TmfEventsEditor.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java

index 82f4c60281de06d497be6eb3084aee15a25ea36d..12ee63d01298e9692bc218545b5b7812e50c9581 100644 (file)
@@ -57,7 +57,8 @@ public class LTTngTextTrace extends TmfTrace<LttngEvent> {
     }
 
     public LTTngTextTrace(final IResource resource, final String path, final boolean skipIndexing) throws Exception {
-        super(null, LttngEvent.class, path, 1, !skipIndexing);
+        //      super(null, LttngEvent.class, path, 1, !skipIndexing);
+        super(null, LttngEvent.class, path, 1);
 
         tracepath = path;
         traceTypes      = new HashMap<String, LttngEventType>();
index bef92c2c7029fce2874a55001010e61fa3365b76..83d48c55892622d22f81be80231c0a7d4913d70e 100644 (file)
@@ -116,7 +116,13 @@ public class LTTngTrace extends TmfTrace<LttngEvent> {
     @Override
     public synchronized void initTrace(final IResource resource, final String path, final Class<LttngEvent> eventType)
             throws FileNotFoundException {
-        super.initTrace(resource, path, eventType);
+        super.initialize(resource, path, eventType);
+        initialize(resource, path, eventType);
+    }
+
+    @Override
+    protected synchronized void initialize(final IResource resource, final String path, final Class<LttngEvent> eventType)
+            throws FileNotFoundException {
         try {
             currentJniTrace = JniTraceFactory.getJniTrace(path, traceLibPath, SHOW_LTT_DEBUG_DEFAULT);
         } catch (final Exception e) {
@@ -288,8 +294,9 @@ public class LTTngTrace extends TmfTrace<LttngEvent> {
     public LTTngTrace(final IResource resource, final String path, final String traceLibPath, final boolean waitForCompletion,
             final boolean bypassIndexing)
                     throws Exception {
-        super(resource, LttngEvent.class, path, CHECKPOINT_PAGE_SIZE, false);
-        initTrace(resource, path, LttngEvent.class);
+        //        super(resource, LttngEvent.class, path, CHECKPOINT_PAGE_SIZE, false);
+        super(resource, LttngEvent.class, path, CHECKPOINT_PAGE_SIZE);
+        initialize(resource, path, LttngEvent.class);
         if (!bypassIndexing)
             indexTrace(false);
         this.traceLibPath = traceLibPath;
index c6cd728554a6e02f3450560b031ca7d57325cb05..be33a23094a66a8f609658f25d04c5c50ff58a45 100644 (file)
@@ -64,10 +64,11 @@ public class LTTngTraceStub extends TmfTrace<LttngEvent> {
      * @throws FileNotFoundException
      */
     public LTTngTraceStub(final IResource resource, final int cacheSize) throws FileNotFoundException {
-        super(resource, LttngEvent.class, resource.getName(), cacheSize, true);
+        //      super(resource, LttngEvent.class, resource.getName(), cacheSize, true);
+        super(resource, LttngEvent.class, resource.getName(), cacheSize);
         fTrace = new RandomAccessFile(resource.getName(), "r");
         fParser = new LTTngEventParserStub();
-        //     indexTrace(true);
+        indexTrace(true);
     }
 
     // ========================================================================
index b1e62ac2cd17fb1fd8d310a087f4282f0cdddb0b..c28cbe01d89f72ab9a2bce6ad9e278ee21b950d0 100644 (file)
@@ -86,7 +86,8 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> {
      * @throws FileNotFoundException
      */
     public TmfTraceStub(final String path, final int cacheSize, final boolean waitForCompletion) throws FileNotFoundException {
-        super(null, TmfEvent.class, path, cacheSize, false);
+        //      super(null, TmfEvent.class, path, cacheSize, false);
+        super(null, TmfEvent.class, path, cacheSize);
         fTrace = new RandomAccessFile(path, "r");
         fParser = new TmfEventParserStub();
     }
@@ -100,7 +101,8 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> {
      * @throws FileNotFoundException
      */
     public TmfTraceStub(final String path, final int cacheSize, final boolean waitForCompletion, final ITmfEventParser<TmfEvent> parser) throws FileNotFoundException {
-        super(null, TmfEvent.class, path, cacheSize, false);
+        //        super(null, TmfEvent.class, path, cacheSize, false);
+        super(null, TmfEvent.class, path, cacheSize);
         fTrace = new RandomAccessFile(path, "r");
         fParser = parser;
     }
@@ -109,7 +111,8 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> {
      * Copy constructor
      */
     public TmfTraceStub(final TmfTraceStub trace) throws FileNotFoundException {
-        super(trace.getResource(), TmfEvent.class, trace.getPath(), trace.getIndexPageSize(), false);
+        //        super(trace.getResource(), TmfEvent.class, trace.getPath(), trace.getIndexPageSize(), false);
+        super(trace.getResource(), TmfEvent.class, trace.getPath(), trace.getIndexPageSize());
         fTrace = new RandomAccessFile(getPath(), "r");
         fParser = new TmfEventParserStub();
         // This is really not pretty (the object is not constructed yet...)
@@ -145,23 +148,29 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> {
     @Override
     @SuppressWarnings("unchecked")
     public TmfContext seekLocation(final ITmfLocation<?> location) {
-        fLock.lock();
         try {
-            if (fTrace != null) {
-                // Position the trace at the requested location and
-                // returns the corresponding context
-                long loc  = 0;
-                long rank = 0;
-                if (location != null) {
-                    loc = ((TmfLocation<Long>) location).getLocation();
-                    rank = ITmfContext.UNKNOWN_RANK;
+            fLock.lock();
+            try {
+                if (fTrace != null) {
+                    // Position the trace at the requested location and
+                    // returns the corresponding context
+                    long loc  = 0;
+                    long rank = 0;
+                    if (location != null) {
+                        loc = ((TmfLocation<Long>) location).getLocation();
+                        rank = ITmfContext.UNKNOWN_RANK;
+                    }
+                    if (loc != fTrace.getFilePointer())
+                        fTrace.seek(loc);
+                    final TmfContext context = new TmfContext(getCurrentLocation(), rank);
+                    return context;
                 }
-                if (loc != fTrace.getFilePointer())
-                    fTrace.seek(loc);
-                final TmfContext context = new TmfContext(getCurrentLocation(), rank);
-                return context;
+            } catch (final IOException e) {
+                e.printStackTrace();
+            } catch (final NullPointerException e) {
+                e.printStackTrace();
             }
-        } catch (final IOException e) {
+        } catch (final NullPointerException e) {
             e.printStackTrace();
         }
         finally{
index 15adda286c7d35cef7e0d0bd128935a1762cc102..bfcd90e6e0ca4d2273e54acdfc0c559eb34345c2 100644 (file)
@@ -82,11 +82,6 @@ public class CtfTmfTrace extends TmfEventProvider<CtfTmfEvent> implements ITmfTr
         // this.fEndTime.clone()));
     }
 
-    @Override
-    public void indexTrace(final boolean waitForCompletion) {
-        // do nothing
-    }
-
     @Override
     public void dispose() {
         TmfSignalManager.deregister(this);
index 3af5ebf15e3a73f7918f3fa92fb25082a0bb3d88..bdb48815ae6730fdcba9765e80986501662bf9b0 100644 (file)
@@ -750,12 +750,6 @@ public class TmfExperiment<T extends ITmfEvent> extends TmfEventProvider<T> impl
         }
     }
 
-    @Override
-    public void indexTrace(final boolean waitForCompletion) {
-        if (waitForCompletion)
-            initializeStreamingMonitor();
-    }
-
     @SuppressWarnings("unchecked")
     private void indexExperiment(final boolean waitForCompletion, final int index, final TmfTimeRange timeRange) {
 
index 490a8ccbebb7ea1d7cf98abc10f669492fef3602..c1ee9be3e72268aa70e197c7da4b23fb1d4434e9 100644 (file)
@@ -190,7 +190,7 @@ public interface ITmfTrace<T extends ITmfEvent> extends ITmfDataProvider<T> {
     /**
      * Position the trace at the event located at the specified ratio in the
      * trace file.
-     * 
+     * <p>
      * The notion of ratio (0.0 <= r <= 1.0) is trace specific and left
      * voluntarily vague. Typically, it would refer to the event proportional
      * rank (arguably more intuitive) or timestamp in the trace file.
@@ -203,7 +203,13 @@ public interface ITmfTrace<T extends ITmfEvent> extends ITmfDataProvider<T> {
     /**
      * Position the trace at the first event with the specified timestamp. If
      * there is no event with the requested timestamp, a context pointing to
-     * the chronologically next event is returned.
+     * the next chronological event is returned.
+     * <p>
+     * A null timestamp is interpreted as seeking for the first event of the
+     * trace.
+     * <p>
+     * If the requested timestamp is beyond the last trace event, the context
+     * returned will yield a null event if used in a subsequent read.
      * 
      * @param timestamp the timestamp of desired event
      * @return a context which can later be used to read the corresponding event
@@ -212,6 +218,9 @@ public interface ITmfTrace<T extends ITmfEvent> extends ITmfDataProvider<T> {
 
     /**
      * Position the trace at the 'rank'th event in the trace.
+     * <p>
+     * If the requested rank is beyond the last trace event, the context
+     * returned will yield a null event if used in a subsequent read.
      * 
      * @param rank the event rank
      * @return a context which can later be used to read the corresponding event
@@ -240,19 +249,6 @@ public interface ITmfTrace<T extends ITmfEvent> extends ITmfDataProvider<T> {
      */
     public ITmfEvent parseEvent(ITmfContext context);
 
-    // ------------------------------------------------------------------------
-    // Indexing
-    // ------------------------------------------------------------------------
-
-    /**
-     * Start the trace indexing, optionally wait for the index to be fully
-     * built before returning.
-     *
-     * @param waitForCompletion true for synchronous indexing
-     */
-    public void indexTrace(boolean waitForCompletion);
-
-
     // ------------------------------------------------------------------------
     // ------------------------------------------------------------------------
 
index 8c3b04550640ac5443630ffe7c46cdef4c0c9a9c..200ac7ae6391cb7017f9ac546a27e9f3dc376451 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2010 Ericsson
+ * Copyright (c) 2009, 2010, 2012 Ericsson
  * 
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -39,9 +39,11 @@ import org.eclipse.linuxtools.tmf.core.signal.TmfTraceUpdatedSignal;
 /**
  * <b><u>TmfTrace</u></b>
  * <p>
- * Abstract implementation of ITmfTrace. It should be sufficient to extend this class and provide implementation for
- * <code>getCurrentLocation()</code> and <code>seekLocation()</code>, as well as a proper parser, to have a working
- * concrete implementation.
+ * Abstract implementation of ITmfTrace.
+ * <p>
+ * It should be sufficient to extend this class and provide implementations for
+ * <code>getCurrentLocation()</code> and <code>seekLocation()</code>, as well
+ * as a proper parser, to have a working concrete implementation.
  */
 public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T> implements ITmfTrace<T> {
 
@@ -58,6 +60,9 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
     // Attributes
     // ------------------------------------------------------------------------
 
+    // The resource used for persistent properties for this trace
+    private IResource fResource;
+
     // The trace path
     private String fPath;
 
@@ -81,9 +86,6 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
      */
     protected long fStreamingInterval = 0;
 
-    // The resource used for persistent properties for this trace
-    private IResource fResource;
-
     // ------------------------------------------------------------------------
     // Construction
     // ------------------------------------------------------------------------
@@ -102,12 +104,10 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
      * @param type the trace event type
      * @param path the trace path
      * @param pageSize the trace index page size
-     * @param indexTrace whether to start indexing the trace or not
      * @throws FileNotFoundException
      */
-    protected TmfTrace(final IResource resource, final Class<T> type, final String path, final int indexPageSize,
-            final boolean indexTrace) throws FileNotFoundException {
-        this(resource, type, path, 0, indexPageSize, indexTrace);
+    protected TmfTrace(final IResource resource, final Class<T> type, final String path, final int indexPageSize) throws FileNotFoundException {
+        this(resource, type, path, 0, indexPageSize);
     }
 
     /**
@@ -117,17 +117,14 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
      * @param type the trace event type
      * @param path the trace path
      * @param pageSize the trace index page size
-     * @param indexTrace whether to start indexing the trace or not
      * @throws FileNotFoundException
      */
-    protected TmfTrace(final IResource resource, final Class<T> type, final String path, final long interval,
-            final int indexPageSize, final boolean indexTrace) throws FileNotFoundException {
+    protected TmfTrace(final IResource resource, final Class<T> type, final String path, final long interval, final int indexPageSize) throws FileNotFoundException
+    {
         super();
-        initTrace(resource, path, type);
         fStreamingInterval = interval;
         fIndexPageSize = (indexPageSize > 0) ? indexPageSize : DEFAULT_INDEX_PAGE_SIZE;
-        if (indexTrace)
-            indexTrace(false);
+        initialize(resource, path, type);
     }
 
     /**
@@ -139,52 +136,23 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
         super();
         if (trace == null)
             throw new IllegalArgumentException();
-        initTrace(trace.getResource(), trace.getPath(), trace.getType());
         fStreamingInterval = getStreamingInterval();
         fIndexPageSize = getIndexPageSize();
+        initialize(trace.getResource(), trace.getPath(), trace.getType());
         indexTrace(false);
     }
 
-    // //
-    // ------------------------------------------------------------------------
-    // // Cloneable
-    // //
-    // ------------------------------------------------------------------------
-    //
-    // /* (non-Javadoc)
-    // * @see java.lang.Object#clone()
-    // */
-    // @Override
-    // @SuppressWarnings("unchecked")
-    // public TmfTrace<T> clone() {
-    // TmfTrace<T> clone = null;
-    // try {
-    // clone = (TmfTrace<T>) super.clone();
-    // // clone.fTrace = fTrace;
-    // // clone.fRank = fRank;
-    // // clone.fTimestamp = fTimestamp != null ? fTimestamp.clone() : null;
-    // // clone.fSource = fSource;
-    // // clone.fType = fType != null ? fType.clone() : null;
-    // // clone.fContent = fContent != null ? fContent.clone() : null;
-    // // clone.fReference = fReference;
-    // } catch (final CloneNotSupportedException e) {
-    // }
-    // return clone;
-    // }
-
     // ------------------------------------------------------------------------
-    // ITmfTrace - initializers
+    // ITmfTrace - Initializers
     // ------------------------------------------------------------------------
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#initTrace(java.lang.String
-     * , java.lang.String, java.lang.Class)
+    /**
+     * @param resource
+     * @param path
+     * @param type
+     * @throws FileNotFoundException
      */
-    @Override
-    public void initTrace(final IResource resource, final String path, final Class<T> type) throws FileNotFoundException {
+    protected void initialize(final IResource resource, final String path, final Class<T> type) throws FileNotFoundException {
         fResource = resource;
         fPath = path;
         String traceName = (resource != null) ? resource.getName() : null;
@@ -193,17 +161,24 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
             if (path != null) {
                 final int sep = path.lastIndexOf(Path.SEPARATOR);
                 traceName = (sep >= 0) ? path.substring(sep + 1) : path;
-            } else
+            }
+            else {
                 traceName = ""; //$NON-NLS-1$
+            }
         super.init(traceName, type);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(org.eclipse.
-     * core.resources.IProject, java.lang.String)
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#initTrace(org.eclipse.core.resources.IResource, java.lang.String, java.lang.Class)
+     */
+    @Override
+    public void initTrace(final IResource resource, final String path, final Class<T> type) throws FileNotFoundException {
+        initialize(resource, path, type);
+        indexTrace(false);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(org.eclipse.core.resources.IProject, java.lang.String)
      */
     @Override
     public boolean validate(final IProject project, final String path) {
@@ -212,93 +187,209 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
     }
 
     // ------------------------------------------------------------------------
-    // ITmfTrace - accessors
+    // ITmfTrace - Basic getters
     // ------------------------------------------------------------------------
 
-    /**
-     * @return the trace path
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.component.TmfDataProvider#getType()
      */
     @Override
+    @SuppressWarnings("unchecked")
     public Class<T> getType() {
-        return fType;
+        return (Class<T>) super.getType();
     }
 
-    /**
-     * @return the trace path
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getResource()
      */
     @Override
-    public String getPath() {
-        return fPath;
+    public IResource getResource() {
+        return fResource;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getResource()
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getPath()
      */
     @Override
-    public IResource getResource() {
-        return fResource;
+    public String getPath() {
+        return fPath;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.linuxtools.tmf.stream.ITmfEventStream#getNbEvents()
+    // ------------------------------------------------------------------------
+    // ITmfTrace - Trace characteristics getters
+    // ------------------------------------------------------------------------
+
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNbEvents()
      */
     @Override
-    public synchronized long getNbEvents() {
+    public long getNbEvents() {
         return fNbEvents;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.linuxtools.tmf.stream.ITmfEventStream#getTimeRange()
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getTimeRange()
      */
     @Override
     public TmfTimeRange getTimeRange() {
         return new TmfTimeRange(fStartTime, fEndTime);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.linuxtools.tmf.trace.ITmfTrace#getStartTime()
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getStartTime()
      */
     @Override
     public ITmfTimestamp getStartTime() {
-        return fStartTime.clone();
+        return new TmfTimestamp(fStartTime);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.linuxtools.tmf.trace.ITmfTrace#getEndTime()
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getEndTime()
      */
     @Override
     public ITmfTimestamp getEndTime() {
-        return fEndTime.clone();
+        return new TmfTimestamp(fEndTime);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.linuxtools.tmf.trace.ITmfTrace#getStreamingInterval()
+    // ------------------------------------------------------------------------
+    // ITmfTrace - Seek operations (returning a reading context)
+    // ------------------------------------------------------------------------
+
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#seekEvent(org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp)
      */
     @Override
-    public long getStreamingInterval() {
-        return fStreamingInterval;
+    public ITmfContext seekEvent(final ITmfTimestamp timestamp) {
+
+        // A null timestamp indicates to seek the first event
+        if (timestamp == null)
+            return seekLocation(null);
+
+        // Find the checkpoint at or before the requested timestamp.
+        // In the very likely event that the timestamp is not at a checkpoint
+        // boundary, bsearch will return index = (- (insertion point + 1)).
+        // It is then trivial to compute the index of the previous checkpoint.
+        int index = Collections.binarySearch(fCheckpoints, new TmfCheckpoint(timestamp, null));
+        if (index < 0) {
+            index = Math.max(0, -(index + 2));
+        }
+
+        // Position the trace at the checkpoint
+        final ITmfContext context = seekCheckpoint(index);
+
+        // And locate the requested event context
+        final ITmfContext nextEventContext = context.clone(); // Must use clone() to get the right subtype...
+        ITmfEvent event = getNextEvent(nextEventContext);
+        while (event != null && event.getTimestamp().compareTo(timestamp, false) < 0) {
+            context.setLocation(nextEventContext.getLocation().clone());
+            context.increaseRank();
+            event = getNextEvent(nextEventContext);
+        }
+        return context;
     }
 
-    /*
-     * (non-Javadoc)
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#seekEvent(long)
+     */
+    @Override
+    public ITmfContext seekEvent(final long rank) {
+
+        // A rank <= 0 indicates to seek the first event
+        if (rank <= 0)
+            return seekLocation(null);
+
+        // Find the checkpoint at or before the requested rank.
+        final int index = (int) rank / fIndexPageSize;
+        final ITmfContext context = seekCheckpoint(index);
+
+        // And locate the requested event context
+        long pos = context.getRank();
+        if (pos < rank) {
+            ITmfEvent event = getNextEvent(context);
+            while (event != null && ++pos < rank) {
+                event = getNextEvent(context);
+            }
+        }
+        return context;
+    }
+
+
+    /**
+     * Position the trace at the given checkpoint
      * 
-     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getIndexPageSize()
+     * @param index the checkpoint index
+     * @return the corresponding context
+     */
+    private ITmfContext seekCheckpoint(int index) {
+        ITmfLocation<?> location;
+        synchronized (fCheckpoints) {
+            if (!fCheckpoints.isEmpty()) {
+                if (index >= fCheckpoints.size()) {
+                    index = fCheckpoints.size() - 1;
+                }
+                location = fCheckpoints.elementAt(index).getLocation();
+            } else {
+                location = null;
+            }
+        }
+        final ITmfContext context = seekLocation(location);
+        context.setRank(index * fIndexPageSize);
+        return context;
+    }
+
+    // ------------------------------------------------------------------------
+    // ITmfTrace - Read operations (returning an actual event)
+    // ------------------------------------------------------------------------
+
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNextEvent(org.eclipse.linuxtools.tmf.core.trace.ITmfContext)
      */
     @Override
-    public int getIndexPageSize() {
-        return fIndexPageSize;
+    public synchronized ITmfEvent getNextEvent(final ITmfContext context) {
+        // parseEvent() does not update the context
+        final ITmfEvent event = parseEvent(context);
+        if (event != null) {
+            updateIndex(context, context.getRank(), event.getTimestamp());
+            context.setLocation(getCurrentLocation());
+            context.increaseRank();
+            processEvent(event);
+        }
+        return event;
+    }
+
+    /**
+     * Hook for special processing by the concrete class (called by
+     * getNextEvent())
+     * 
+     * @param event
+     */
+    protected void processEvent(final ITmfEvent event) {
+        // Do nothing by default
+    }
+
+    protected synchronized void updateIndex(final ITmfContext context, final long rank, final ITmfTimestamp timestamp) {
+        if (fStartTime.compareTo(timestamp, false) > 0) {
+            fStartTime = timestamp;
+        }
+        if (fEndTime.compareTo(timestamp, false) < 0) {
+            fEndTime = timestamp;
+        }
+        if (context.hasValidRank()) {
+            if (fNbEvents <= rank) {
+                fNbEvents = rank + 1;
+            }
+            // Build the index as we go along
+            if ((rank % fIndexPageSize) == 0) {
+                // Determine the table position
+                final long position = rank / fIndexPageSize;
+                // Add new entry at proper location (if empty)
+                if (fCheckpoints.size() == position) {
+                    final ITmfLocation<?> location = context.getLocation().clone();
+                    fCheckpoints.add(new TmfCheckpoint(timestamp.clone(), location));
+                    // System.out.println(getName() + "[" + (fCheckpoints.size() + "] " + timestamp + ", " + location.toString());
+                }
+            }
+        }
     }
 
     // ------------------------------------------------------------------------
@@ -313,21 +404,21 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
      * fIndexPageSize holds the event interval (default INDEX_PAGE_SIZE).
      */
 
-    @Override
     @SuppressWarnings({ "unchecked" })
-    public void indexTrace(final boolean waitForCompletion) {
+    protected void indexTrace(final boolean waitForCompletion) {
 
         // The monitoring job
         final Job job = new Job("Indexing " + getName() + "...") { //$NON-NLS-1$ //$NON-NLS-2$
 
             @Override
             protected IStatus run(final IProgressMonitor monitor) {
-                while (!monitor.isCanceled())
+                while (!monitor.isCanceled()) {
                     try {
                         Thread.sleep(100);
                     } catch (final InterruptedException e) {
                         return Status.OK_STATUS;
                     }
+                }
                 monitor.done();
                 return Status.OK_STATUS;
             }
@@ -352,13 +443,15 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
                 super.handleData(event);
                 if (event != null) {
                     final ITmfTimestamp timestamp = event.getTimestamp();
-                    if (startTime == null)
+                    if (startTime == null) {
                         startTime = timestamp.clone();
+                    }
                     lastTime = timestamp.clone();
 
                     // Update the trace status at regular intervals
-                    if ((getNbRead() % fIndexPageSize) == 0)
+                    if ((getNbRead() % fIndexPageSize) == 0) {
                         updateTraceStatus();
+                    }
                 }
             }
 
@@ -386,110 +479,18 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
 
                 // Submit the request and wait for completion if required
                 sendRequest((ITmfDataRequest<T>) request);
-                if (waitForCompletion)
+                if (waitForCompletion) {
                     try {
                         request.waitForCompletion();
                     } catch (final InterruptedException e) {
                     }
+                }
     }
 
     private void notifyListeners() {
         broadcast(new TmfTraceUpdatedSignal(this, this, new TmfTimeRange(fStartTime, fEndTime)));
     }
 
-    // ------------------------------------------------------------------------
-    // ITmfTrace - seek operations
-    // ------------------------------------------------------------------------
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#seekEvent(org.eclipse
-     * .linuxtools.tmf.core.event.ITmfTimestamp)
-     */
-    @Override
-    public ITmfContext seekEvent(final ITmfTimestamp ts) {
-
-        ITmfTimestamp timestamp = ts;
-        if (timestamp == null)
-            timestamp = TmfTimestamp.BIG_BANG;
-
-        // First, find the right checkpoint
-        int index = Collections.binarySearch(fCheckpoints, new TmfCheckpoint(timestamp, null));
-
-        // In the very likely case that the checkpoint was not found, bsearch
-        // returns its negated would-be location (not an offset...). From that
-        // index, we can then position the stream and get the event.
-        if (index < 0)
-            index = Math.max(0, -(index + 2));
-
-        // Position the stream at the checkpoint
-        ITmfLocation<?> location;
-        synchronized (fCheckpoints) {
-            if (!fCheckpoints.isEmpty()) {
-                if (index >= fCheckpoints.size())
-                    index = fCheckpoints.size() - 1;
-                location = fCheckpoints.elementAt(index).getLocation();
-            } else
-                location = null;
-        }
-        final ITmfContext context = seekLocation(location);
-        context.setRank(index * fIndexPageSize);
-
-        // And locate the event
-        final ITmfContext nextEventContext = context.clone(); // Must use
-        // clone() to get
-        // the right
-        // subtype...
-        ITmfEvent event = getNextEvent(nextEventContext);
-        while (event != null && event.getTimestamp().compareTo(timestamp, false) < 0) {
-            context.setLocation(nextEventContext.getLocation().clone());
-            context.increaseRank();
-            event = getNextEvent(nextEventContext);
-        }
-
-        return context;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#seekEvent(long)
-     */
-    @Override
-    public ITmfContext seekEvent(final long rank) {
-
-        // Position the stream at the previous checkpoint
-        int index = (int) rank / fIndexPageSize;
-        ITmfLocation<?> location;
-        synchronized (fCheckpoints) {
-            if (fCheckpoints.isEmpty())
-                location = null;
-            else {
-                if (index >= fCheckpoints.size())
-                    index = fCheckpoints.size() - 1;
-                location = fCheckpoints.elementAt(index).getLocation();
-            }
-        }
-
-        final ITmfContext context = seekLocation(location);
-        long pos = index * fIndexPageSize;
-        context.setRank(pos);
-
-        if (pos < rank) {
-            ITmfEvent event = getNextEvent(context);
-            while (event != null && ++pos < rank)
-                event = getNextEvent(context);
-        }
-
-        return context;
-    }
-
-    // ------------------------------------------------------------------------
-    // Operations
-    // ------------------------------------------------------------------------
-
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -548,75 +549,40 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
         return null;
     }
 
+
     // ------------------------------------------------------------------------
-    // ITmfTrace
+    // toString
     // ------------------------------------------------------------------------
 
     /*
      * (non-Javadoc)
      * 
-     * @see org.eclipse.linuxtools.tmf.trace.ITmfTrace#getNextEvent(org.eclipse.
-     * linuxtools.tmf.trace.ITmfTrace.TraceContext)
+     * @see java.lang.Object#toString()
      */
     @Override
-    public synchronized ITmfEvent getNextEvent(final ITmfContext context) {
-        // parseEvent() does not update the context
-        final ITmfEvent event = parseEvent(context);
-        if (event != null) {
-            updateIndex(context, context.getRank(), event.getTimestamp());
-            context.setLocation(getCurrentLocation());
-            context.increaseRank();
-            processEvent(event);
-        }
-        return event;
+    @SuppressWarnings("nls")
+    public String toString() {
+        return "[TmfTrace (" + getName() + ")]";
     }
 
-    protected synchronized void updateIndex(final ITmfContext context, final long rank, final ITmfTimestamp timestamp) {
-        if (fStartTime.compareTo(timestamp, false) > 0)
-            fStartTime = timestamp;
-        if (fEndTime.compareTo(timestamp, false) < 0)
-            fEndTime = timestamp;
-        if (context.hasValidRank()) {
-            if (fNbEvents <= rank)
-                fNbEvents = rank + 1;
-            // Build the index as we go along
-            if ((rank % fIndexPageSize) == 0) {
-                // Determine the table position
-                final long position = rank / fIndexPageSize;
-                // Add new entry at proper location (if empty)
-                if (fCheckpoints.size() == position) {
-                    final ITmfLocation<?> location = context.getLocation().clone();
-                    fCheckpoints.add(new TmfCheckpoint(timestamp.clone(), location));
-                    // System.out.println(getName() + "[" + (fCheckpoints.size()
-                    // - 1) + "] " + timestamp + ", " + location.toString());
-                }
-            }
-        }
-    }
+    // ------------------------------------------------------------------------
+    // ITmfTrace - Trace TBD getters
+    // ------------------------------------------------------------------------
 
-    /**
-     * Hook for special processing by the concrete class (called by
-     * getNextEvent())
-     * 
-     * @param event
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getStreamingInterval()
      */
-    protected void processEvent(final ITmfEvent event) {
-        // Do nothing by default
+    @Override
+    public long getStreamingInterval() {
+        return fStreamingInterval;
     }
 
-    // ------------------------------------------------------------------------
-    // toString
-    // ------------------------------------------------------------------------
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see java.lang.Object#toString()
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getIndexPageSize()
      */
     @Override
-    @SuppressWarnings("nls")
-    public String toString() {
-        return "[TmfTrace (" + getName() + ")]";
+    public int getIndexPageSize() {
+        return fIndexPageSize;
     }
 
 }
index a18a564ec9a0d68710d73b5cb7ec336b0c80d013..3447e2444b69fb4ab16ed215e1c05d9cbcc27c09 100644 (file)
@@ -46,7 +46,7 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
     }\r
 \r
     public CustomTxtTrace(final IResource resource, final CustomTxtTraceDefinition definition, final String path, final int pageSize) throws FileNotFoundException {\r
-        super(resource, CustomTxtEvent.class, path, (pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE, true);\r
+        super(resource, CustomTxtEvent.class, path, (pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE);\r
         fDefinition = definition;\r
         fEventType = new CustomTxtEventType(fDefinition);\r
     }\r
@@ -64,8 +64,9 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
         BufferedRandomAccessFile raFile = null;\r
         try {\r
             raFile = new BufferedRandomAccessFile(getPath(), "r"); //$NON-NLS-1$\r
-            if (location != null && location.getLocation() instanceof Long)\r
+            if (location != null && location.getLocation() instanceof Long) {\r
                 raFile.seek((Long)location.getLocation());\r
+            }\r
             String line;\r
             long rawPos = raFile.getFilePointer();\r
             while ((line = raFile.getNextLine()) != null) {\r
@@ -91,11 +92,12 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
             e.printStackTrace();\r
             return context;\r
         } finally {\r
-            if (raFile != null)\r
+            if (raFile != null) {\r
                 try {\r
                     raFile.close();\r
                 } catch (final IOException e) {\r
                 }\r
+            }\r
         }\r
 \r
     }\r
@@ -108,7 +110,9 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
             long pos = (long) (ratio * raFile.length());\r
             while (pos > 0) {\r
                 raFile.seek(pos - 1);\r
-                if (raFile.read() == '\n') break;\r
+                if (raFile.read() == '\n') {\r
+                    break;\r
+                }\r
                 pos--;\r
             }\r
             final ITmfLocation<?> location = new TmfLocation<Long>(pos);\r
@@ -122,11 +126,12 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
             e.printStackTrace();\r
             return new CustomTxtTraceContext(NULL_LOCATION, ITmfContext.INITIAL_RANK);\r
         } finally {\r
-            if (raFile != null)\r
+            if (raFile != null) {\r
                 try {\r
                     raFile.close();\r
                 } catch (final IOException e) {\r
                 }\r
+            }\r
         }\r
     }\r
 \r
@@ -143,11 +148,12 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
         } catch (final IOException e) {\r
             e.printStackTrace();\r
         } finally {\r
-            if (raFile != null)\r
+            if (raFile != null) {\r
                 try {\r
                     raFile.close();\r
                 } catch (final IOException e) {\r
                 }\r
+            }\r
         }\r
         return 0;\r
     }\r
@@ -189,13 +195,14 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
 \r
         synchronized (context.raFile) {\r
             try {\r
-                if (context.raFile.getFilePointer() != context.nextLineLocation)\r
+                if (context.raFile.getFilePointer() != context.nextLineLocation) {\r
                     context.raFile.seek(context.nextLineLocation);\r
+                }\r
                 String line;\r
                 long rawPos = context.raFile.getFilePointer();\r
                 while ((line = context.raFile.getNextLine()) != null) {\r
                     boolean processed = false;\r
-                    if (currentInput == null)\r
+                    if (currentInput == null) {\r
                         for (final InputLine input : getFirstLines()) {\r
                             final Matcher matcher = input.getPattern().matcher(line);\r
                             if (matcher.find()) {\r
@@ -207,10 +214,10 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
                                 return event;\r
                             }\r
                         }\r
-                    else {\r
+                    else {\r
                         if (countMap.get(currentInput) >= currentInput.getMinCount()) {\r
                             final List<InputLine> nextInputs = currentInput.getNextInputs(countMap);\r
-                            if (nextInputs.size() == 0 || nextInputs.get(nextInputs.size() - 1).getMinCount() == 0)\r
+                            if (nextInputs.size() == 0 || nextInputs.get(nextInputs.size() - 1).getMinCount() == 0) {\r
                                 for (final InputLine input : getFirstLines()) {\r
                                     final Matcher matcher = input.getPattern().matcher(line);\r
                                     if (matcher.find()) {\r
@@ -222,20 +229,23 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
                                         return event;\r
                                     }\r
                                 }\r
+                            }\r
                             for (final InputLine input : nextInputs) {\r
                                 final Matcher matcher = input.getPattern().matcher(line);\r
                                 if (matcher.find()) {\r
                                     event.processGroups(input, matcher);\r
                                     currentInput = input;\r
-                                    if (countMap.get(currentInput) == null)\r
+                                    if (countMap.get(currentInput) == null) {\r
                                         countMap.put(currentInput, 1);\r
-                                    else\r
+                                    } else {\r
                                         countMap.put(currentInput, countMap.get(currentInput) + 1);\r
+                                    }\r
                                     Iterator<InputLine> iter = countMap.keySet().iterator();\r
                                     while (iter.hasNext()) {\r
                                         final InputLine inputLine = iter.next();\r
-                                        if (inputLine.level > currentInput.level)\r
+                                        if (inputLine.level > currentInput.level) {\r
                                             iter.remove();\r
+                                        }\r
                                     }\r
                                     if (currentInput.childrenInputs != null && currentInput.childrenInputs.size() > 0) {\r
                                         currentInput = currentInput.childrenInputs.get(0);\r
@@ -243,16 +253,19 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
                                     } else if (countMap.get(currentInput) >= currentInput.getMaxCount())\r
                                         if (currentInput.getNextInputs(countMap).size() > 0) {\r
                                             currentInput = currentInput.getNextInputs(countMap).get(0);\r
-                                            if (countMap.get(currentInput) == null)\r
+                                            if (countMap.get(currentInput) == null) {\r
                                                 countMap.put(currentInput, 0);\r
+                                            }\r
                                             iter = countMap.keySet().iterator();\r
                                             while (iter.hasNext()) {\r
                                                 final InputLine inputLine = iter.next();\r
-                                                if (inputLine.level > currentInput.level)\r
+                                                if (inputLine.level > currentInput.level) {\r
                                                     iter.remove();\r
+                                                }\r
                                             }\r
-                                        } else\r
+                                        } else {\r
                                             currentInput = null;\r
+                                        }\r
                                     processed = true;\r
                                     break;\r
                                 }\r
@@ -269,16 +282,19 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
                                 } else if (countMap.get(currentInput) >= currentInput.getMaxCount())\r
                                     if (currentInput.getNextInputs(countMap).size() > 0) {\r
                                         currentInput = currentInput.getNextInputs(countMap).get(0);\r
-                                        if (countMap.get(currentInput) == null)\r
+                                        if (countMap.get(currentInput) == null) {\r
                                             countMap.put(currentInput, 0);\r
+                                        }\r
                                         final Iterator<InputLine> iter = countMap.keySet().iterator();\r
                                         while (iter.hasNext()) {\r
                                             final InputLine inputLine = iter.next();\r
-                                            if (inputLine.level > currentInput.level)\r
+                                            if (inputLine.level > currentInput.level) {\r
                                                 iter.remove();\r
+                                            }\r
                                         }\r
-                                    } else\r
+                                    } else {\r
                                         currentInput = null;\r
+                                    }\r
                             }\r
                             ((StringBuffer) event.getContent().getValue()).append("\n").append(line); //$NON-NLS-1$\r
                         }\r
@@ -290,8 +306,9 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
             }\r
         }\r
         for(final Entry<InputLine, Integer> entry : countMap.entrySet())\r
-            if (entry.getValue() < entry.getKey().getMinCount())\r
+            if (entry.getValue() < entry.getKey().getMinCount()) {\r
                 event = null;\r
+            }\r
         context.setLocation(NULL_LOCATION);\r
         return event;\r
     }\r
index 5801281955d832b7f32c9aef30b20160b04d5801..9cf7ebb113e76270fda0b0347f2d9bd91b67918a 100644 (file)
@@ -59,7 +59,7 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
     }\r
 \r
     public CustomXmlTrace(final IResource resource, final CustomXmlTraceDefinition definition, final String path, final int pageSize) throws FileNotFoundException {\r
-        super(null, CustomXmlEvent.class, path, (pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE, true);\r
+        super(null, CustomXmlEvent.class, path, (pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE);\r
         fDefinition = definition;\r
         fEventType = new CustomXmlEventType(fDefinition);\r
         fRecordInputElement = getRecordInputElement(fDefinition.rootInputElement);\r
@@ -77,8 +77,9 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
             return context;\r
         try {\r
             context.raFile = new BufferedRandomAccessFile(getPath(), "r"); //$NON-NLS-1$\r
-            if (location != null && location.getLocation() instanceof Long)\r
+            if (location != null && location.getLocation() instanceof Long) {\r
                 context.raFile.seek((Long)location.getLocation());\r
+            }\r
 \r
             String line;\r
             final String recordElementStart = "<" + fRecordInputElement.elementName; //$NON-NLS-1$\r
@@ -111,7 +112,9 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
             long pos = (long) (ratio * raFile.length());\r
             while (pos > 0) {\r
                 raFile.seek(pos - 1);\r
-                if (raFile.read() == '\n') break;\r
+                if (raFile.read() == '\n') {\r
+                    break;\r
+                }\r
                 pos--;\r
             }\r
             final ITmfLocation<?> location = new TmfLocation<Long>(pos);\r
@@ -125,11 +128,12 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
             e.printStackTrace();\r
             return new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.INITIAL_RANK);\r
         } finally {\r
-            if (raFile != null)\r
+            if (raFile != null) {\r
                 try {\r
                     raFile.close();\r
                 } catch (final IOException e) {\r
                 }\r
+            }\r
         }\r
     }\r
 \r
@@ -146,11 +150,12 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
         } catch (final IOException e) {\r
             e.printStackTrace();\r
         } finally {\r
-            if (raFile != null)\r
+            if (raFile != null) {\r
                 try {\r
                     raFile.close();\r
                 } catch (final IOException e) {\r
                 }\r
+            }\r
         }\r
         return 0;\r
     }\r
@@ -185,7 +190,9 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
             CustomXmlEvent event = null;\r
             try {\r
                 if (context.raFile.getFilePointer() != (Long)context.getLocation().getLocation() + 1)\r
+                {\r
                     context.raFile.seek((Long)context.getLocation().getLocation() + 1); // +1 is for the <\r
+                }\r
                 final StringBuffer elementBuffer = new StringBuffer("<"); //$NON-NLS-1$\r
                 readElement(elementBuffer, context.raFile);\r
                 final Element element = parseElementBuffer(elementBuffer);\r
@@ -261,23 +268,25 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
                 numRead++;\r
                 final char c = (char)i;\r
                 buffer.append(c);\r
-                if (c == '"')\r
+                if (c == '"') {\r
                     readQuote(buffer, raFile, '"');\r
-                else if (c == '\'')\r
+                } else if (c == '\'') {\r
                     readQuote(buffer, raFile, '\'');\r
-                else if (c == '<')\r
+                } else if (c == '<') {\r
                     readElement(buffer, raFile);\r
-                else if (c == '/' && numRead == 1)\r
+                } else if (c == '/' && numRead == 1) {\r
                     break; // found "</"\r
-                else if (c == '-' && numRead == 3 && buffer.substring(buffer.length() - 3, buffer.length() - 1).equals("!-")) //$NON-NLS-1$\r
+                } else if (c == '-' && numRead == 3 && buffer.substring(buffer.length() - 3, buffer.length() - 1).equals("!-")) {\r
                     readComment(buffer, raFile); // found "<!--"\r
-                else if (i == '>')\r
-                    if (buffer.charAt(buffer.length() - 2) == '/')\r
+                else if (i == '>')\r
+                    if (buffer.charAt(buffer.length() - 2) == '/') {\r
                         break; // found "/>"\r
-                    else if (startTagClosed)\r
+                    } else if (startTagClosed) {\r
                         break; // found "<...>...</...>"\r
-                    else\r
+                    }\r
+                    else {\r
                         startTagClosed = true; // found "<...>"\r
+                    }\r
             }\r
             return;\r
         } catch (final IOException e) {\r
@@ -292,7 +301,9 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
                 final char c = (char)i;\r
                 buffer.append(c);\r
                 if (c == eq)\r
+                {\r
                     break; // found matching end-quote\r
+                }\r
             }\r
             return;\r
         } catch (final IOException e) {\r
@@ -308,8 +319,10 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
                 numRead++;\r
                 final char c = (char)i;\r
                 buffer.append(c);\r
-                if (c == '>' && numRead >= 2 && buffer.substring(buffer.length() - 3, buffer.length() - 1).equals("--")) //$NON-NLS-1$\r
+                if (c == '>' && numRead >= 2 && buffer.substring(buffer.length() - 3, buffer.length() - 1).equals("--"))\r
+                {\r
                     break; // found "-->"\r
+                }\r
             }\r
             return;\r
         } catch (final IOException e) {\r
@@ -323,24 +336,26 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
         for (int i = 0; i < nodeList.getLength(); i++) {\r
             final Node node = nodeList.item(i);\r
             if (node.getNodeType() == Node.ELEMENT_NODE) {\r
-                if (separator == null)\r
+                if (separator == null) {\r
                     separator = " | "; //$NON-NLS-1$\r
-                else\r
+                } else {\r
                     buffer.append(separator);\r
+                }\r
                 final Element element = (Element) node;\r
-                if (element.hasChildNodes() == false)\r
+                if (element.hasChildNodes() == false) {\r
                     buffer.append(element.getNodeName());\r
-                else if (element.getChildNodes().getLength() == 1 && element.getFirstChild().getNodeType() == Node.TEXT_NODE)\r
+                } else if (element.getChildNodes().getLength() == 1 && element.getFirstChild().getNodeType() == Node.TEXT_NODE) {\r
                     buffer.append(element.getNodeName() + ":" + element.getFirstChild().getNodeValue().trim()); //$NON-NLS-1$\r
-                else {\r
+                else {\r
                     buffer.append(element.getNodeName());\r
                     buffer.append(" [ "); //$NON-NLS-1$\r
                     parseElement(element, buffer);\r
                     buffer.append(" ]"); //$NON-NLS-1$\r
                 }\r
             } else if (node.getNodeType() == Node.TEXT_NODE)\r
-                if (node.getNodeValue().trim().length() != 0)\r
+                if (node.getNodeValue().trim().length() != 0) {\r
                     buffer.append(node.getNodeValue().trim());\r
+                }\r
         }\r
         return buffer;\r
     }\r
@@ -348,12 +363,13 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
     public InputElement getRecordInputElement(final InputElement inputElement) {\r
         if (inputElement.logEntry)\r
             return inputElement;\r
-        else if (inputElement.childElements != null)\r
+        else if (inputElement.childElements != null) {\r
             for (final InputElement childInputElement : inputElement.childElements) {\r
                 final InputElement recordInputElement = getRecordInputElement(childInputElement);\r
                 if (recordInputElement != null)\r
                     return recordInputElement;\r
             }\r
+        }\r
         return null;\r
     }\r
 \r
@@ -365,22 +381,27 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
     }\r
 \r
     private void parseElement(final Element element, final CustomXmlEvent event, final InputElement inputElement) {\r
-        if (inputElement.inputName != null && !inputElement.inputName.equals(CustomXmlTraceDefinition.TAG_IGNORE))\r
+        if (inputElement.inputName != null && !inputElement.inputName.equals(CustomXmlTraceDefinition.TAG_IGNORE)) {\r
             event.parseInput(parseElement(element, new StringBuffer()).toString(), inputElement.inputName, inputElement.inputAction, inputElement.inputFormat);\r
-        if (inputElement.attributes != null)\r
-            for (final InputAttribute attribute : inputElement.attributes)\r
+        }\r
+        if (inputElement.attributes != null) {\r
+            for (final InputAttribute attribute : inputElement.attributes) {\r
                 event.parseInput(element.getAttribute(attribute.attributeName), attribute.inputName, attribute.inputAction, attribute.inputFormat);\r
+            }\r
+        }\r
         final NodeList childNodes = element.getChildNodes();\r
-        if (inputElement.childElements != null)\r
+        if (inputElement.childElements != null) {\r
             for (int i = 0; i < childNodes.getLength(); i++) {\r
                 final Node node = childNodes.item(i);\r
-                if (node instanceof Element)\r
+                if (node instanceof Element) {\r
                     for (final InputElement child : inputElement.childElements)\r
                         if (node.getNodeName().equals(child.elementName)) {\r
                             parseElement((Element) node, event, child);\r
                             break;\r
                         }\r
+                }\r
             }\r
+        }\r
         return;\r
     }\r
 \r
index cf867e1bfc4bdd6d94ea26d39be3e44856318c18..ef0a53e96d2fc74d49c4aedf867d9ff937c35326 100644 (file)
@@ -172,7 +172,6 @@ public class OpenExperimentHandler extends AbstractHandler {
                 } else
                     activePage.openEditor(editorInput, editorId);
                 experiment.initTrace(null, null, null);
-                experiment.indexTrace(true);
                 IDE.setDefaultEditor(file, editorId);
                 // editor should dispose the experiment on close
             } else {
index bc73cb2cec264ddbcb45c78a4e7ec5d2548deb8b..425dc2fe39b46c68bac030dff575f55af2b6fe0a 100644 (file)
@@ -136,8 +136,6 @@ public class OpenTraceHandler extends AbstractHandler {
 
         try {
             trace.initTrace(fTrace.getResource(), fTrace.getLocation().getPath(), traceEvent.getClass());
-            if (usesEditor)
-                trace.indexTrace(false);
         } catch (final FileNotFoundException e) {
             displayErrorMsg(Messages.OpenTraceHandler_NoTrace);
             return null;
index a0576c9066a06613e7cdec866cd8b8782869f4cc..f145e550b9c6690a404c8a2fbf6e6f483d9506a7 100644 (file)
@@ -188,7 +188,6 @@ public class EventsViewEditor extends TmfEditor {
                                 throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
                             try {
                                 trace.initTrace(traceElement.getResource(), traceElement.getLocation().getPath(), traceEvent.getClass());
-                                trace.indexTrace(false);
                             } catch (final FileNotFoundException e) {
                             }
                             final ITmfTrace[] traces = new ITmfTrace[] { trace };
index 497b53f5214bdc99cc806b135f3b4254025b3c7b..da21b9d8415fe0a108cc27add1672cedab7c807d 100644 (file)
@@ -137,7 +137,6 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                             experiment.setBookmarksFile(fFile);\r
                             fTrace = experiment;\r
                             experiment.initTrace(null, null, null);\r
-                            experiment.indexTrace(true);\r
                             break;\r
                         }\r
                     }\r
@@ -157,7 +156,6 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                                 throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);\r
                             try {\r
                                 trace.initTrace(traceElement.getResource(), traceElement.getLocation().getPath(), traceEvent.getClass());\r
-                                trace.indexTrace(false);\r
                             } catch (final FileNotFoundException e) {\r
                             }\r
                             fTrace = trace;\r
@@ -178,7 +176,6 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                                 throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);\r
                             try {\r
                                 trace.initTrace(traceElement.getResource(), traceElement.getLocation().getPath(), traceEvent.getClass());\r
-                                trace.indexTrace(false);\r
                             } catch (final FileNotFoundException e) {\r
                             }\r
                             fTrace = trace;\r
@@ -463,7 +460,6 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                             final TmfEvent event = (TmfEvent) ce.createExecutableExtension(TmfTraceType.EVENT_TYPE_ATTR);\r
                             final String path = fFile.getLocationURI().getPath();\r
                             fTrace.initTrace(null, path, event.getClass());\r
-                            fTrace.indexTrace(false);\r
                             break;\r
                         }\r
             } catch (final InvalidRegistryObjectException e) {\r
index 76a1fc71b810b87c06cab56e8cd174597200dc9e..0398916fb7de2d2a3c0d957cbb84cdad9f6b23dd 100644 (file)
@@ -85,7 +85,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
     // Timestamp scale (nanosecond)
     public static final byte TIME_SCALE = -9;
-    
+
     public static final int HISTOGRAM_BAR_WIDTH = 1;
 
     // ------------------------------------------------------------------------
@@ -114,7 +114,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     // Construction
     // ------------------------------------------------------------------------
 
-    public Histogram(TmfView view, Composite parent) {
+    public Histogram(final TmfView view, final Composite parent) {
         fParentView = view;
 
         createWidget(parent);
@@ -134,7 +134,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
         fDataModel.removeHistogramListener(this);
     }
 
-    private void createWidget(Composite parent) {
+    private void createWidget(final Composite parent) {
 
         final Color labelColor = parent.getBackground();
         final Font fFont = adjustFont(parent);
@@ -145,7 +145,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
         // Define the histogram
         // --------------------------------------------------------------------
 
-        GridLayout gridLayout = new GridLayout();
+        final GridLayout gridLayout = new GridLayout();
         gridLayout.numColumns = 3;
         gridLayout.marginHeight = 0;
         gridLayout.marginWidth = 0;
@@ -154,7 +154,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
         gridLayout.verticalSpacing = 0;
         gridLayout.marginLeft = 0;
         gridLayout.marginRight = 0;
-        Composite composite = new Composite(parent, SWT.FILL);
+        final Composite composite = new Composite(parent, SWT.FILL);
         composite.setLayout(gridLayout);
 
         // Use all the horizontal space
@@ -200,7 +200,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
         gridData = new GridData(initalWidth, SWT.DEFAULT);
         gridData.horizontalAlignment = SWT.RIGHT;
         gridData.verticalAlignment = SWT.BOTTOM;
-        Text dummyText = new Text(composite, SWT.READ_ONLY);
+        final Text dummyText = new Text(composite, SWT.READ_ONLY);
         dummyText.setFont(fFont);
         dummyText.setBackground(labelColor);
         dummyText.setEditable(false);
@@ -228,11 +228,11 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
         fTimeRangeEndText.setLayoutData(gridData);
     }
 
-    private Font adjustFont(Composite composite) {
+    private Font adjustFont(final Composite composite) {
         // Reduce font size for a more pleasing rendering
-        int fontSizeAdjustment = -2;
-        Font font = composite.getFont();
-        FontData fontData = font.getFontData()[0];
+        final int fontSizeAdjustment = -2;
+        final Font font = composite.getFont();
+        final FontData fontData = font.getFontData()[0];
         return new Font(font.getDevice(), fontData.getName(), fontData.getHeight() + fontSizeAdjustment, fontData.getStyle());
     }
 
@@ -251,7 +251,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     public long getTimeLimit() {
         return fDataModel.getTimeLimit();
     }
-    
+
     public HistogramDataModel getDataModel() {
         return fDataModel;
     }
@@ -274,7 +274,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      * 
      * @param timestamp
      */
-    public void countEvent(long eventCount, long timestamp) {
+    public void countEvent(final long eventCount, final long timestamp) {
         fDataModel.countEvent(eventCount, timestamp);
     }
 
@@ -283,7 +283,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      * 
      * @param timestamp
      */
-    public void setCurrentEvent(long timestamp) {
+    public void setCurrentEvent(final long timestamp) {
         fCurrentEventTime = (timestamp > 0) ? timestamp : 0;
         fDataModel.setCurrentEventNotifyListeners(timestamp);
     }
@@ -294,11 +294,11 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      * @param offset offset from the left on the histogram
      * @return the start timestamp of the corresponding bucket
      */
-    public synchronized long getTimestamp(int offset) {
+    public synchronized long getTimestamp(final int offset) {
         assert offset > 0 && offset < fScaledData.fWidth;
         try {
             return fDataModel.getFirstBucketTime() + fScaledData.fBucketDuration * offset;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             return 0; // TODO: Fix that racing condition (NPE)
         }
     }
@@ -309,7 +309,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      * @param timestamp the timestamp
      * @return the offset of the corresponding bucket (-1 if invalid)
      */
-    public synchronized int getOffset(long timestamp) {
+    public synchronized int getOffset(final long timestamp) {
         if (timestamp < fDataModel.getFirstBucketTime() || timestamp > fDataModel.getEndTime())
             return -1;
         return (int) ((timestamp - fDataModel.getFirstBucketTime()) / fScaledData.fBucketDuration);
@@ -320,7 +320,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      * 
      * @param keyCode the SWT key code
      */
-    protected void moveCursor(int keyCode) {
+    protected void moveCursor(final int keyCode) {
 
         if (fScaledData.fCurrentBucket == HistogramScaledData.OUT_OF_RANGE_BUCKET)
             return;
@@ -372,29 +372,30 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      */
     @Override
     public void modelUpdated() {
-        if (!fCanvas.isDisposed() && fCanvas.getDisplay() != null) {
+        if (!fCanvas.isDisposed() && fCanvas.getDisplay() != null)
             fCanvas.getDisplay().asyncExec(new Runnable() {
                 @Override
                 public void run() {
                     if (!fCanvas.isDisposed()) {
                         // Retrieve and normalize the data
-                        int canvasWidth = fCanvas.getBounds().width;
-                        int canvasHeight = fCanvas.getBounds().height;
+                        final int canvasWidth = fCanvas.getBounds().width;
+                        final int canvasHeight = fCanvas.getBounds().height;
                         if (canvasWidth <= 0 || canvasHeight <= 0)
                             return;
                         fDataModel.setCurrentEvent(fCurrentEventTime);
                         fScaledData = fDataModel.scaleTo(canvasWidth, canvasHeight, HISTOGRAM_BAR_WIDTH);
-                        fCanvas.redraw();
-                        // Display histogram and update X-,Y-axis labels
-                        fTimeRangeStartText.setText(HistogramUtils.nanosecondsToString(fDataModel.getFirstBucketTime()));
-                        fTimeRangeEndText.setText(HistogramUtils.nanosecondsToString(fDataModel.getEndTime()));
-                        fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
-                        // The Y-axis area might need to be re-sized
-                        fMaxNbEventsText.getParent().layout();
+                        if (fScaledData != null) {
+                            fCanvas.redraw();
+                            // Display histogram and update X-,Y-axis labels
+                            fTimeRangeStartText.setText(HistogramUtils.nanosecondsToString(fDataModel.getFirstBucketTime()));
+                            fTimeRangeEndText.setText(HistogramUtils.nanosecondsToString(fDataModel.getEndTime()));
+                            fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
+                            // The Y-axis area might need to be re-sized
+                            fMaxNbEventsText.getParent().layout();
+                        }
                     }
                 }
             });
-        }
     }
 
     // ------------------------------------------------------------------------
@@ -402,7 +403,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     // ------------------------------------------------------------------------
 
     private void updateCurrentEventTime() {
-        long bucketStartTime = getTimestamp(fScaledData.fCurrentBucket);
+        final long bucketStartTime = getTimestamp(fScaledData.fCurrentBucket);
         ((HistogramView) fParentView).updateCurrentEventTime(bucketStartTime);
     }
 
@@ -413,11 +414,11 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     protected final String IMAGE_KEY = "double-buffer-image"; //$NON-NLS-1$
 
     @Override
-    public void paintControl(PaintEvent event) {
+    public void paintControl(final PaintEvent event) {
 
         // Get the geometry
-        int canvasWidth = fCanvas.getBounds().width;
-        int canvasHeight = fCanvas.getBounds().height;
+        final int canvasWidth = fCanvas.getBounds().width;
+        final int canvasHeight = fCanvas.getBounds().height;
 
         // Make sure we have something to draw upon
         if (canvasWidth <= 0 || canvasHeight <= 0)
@@ -431,23 +432,23 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
         }
 
         // Draw the histogram on its canvas
-        GC imageGC = new GC(image);
+        final GC imageGC = new GC(image);
         formatImage(imageGC, image);
         event.gc.drawImage(image, 0, 0);
         imageGC.dispose();
     }
 
-    private void formatImage(GC imageGC, Image image) {
+    private void formatImage(final GC imageGC, final Image image) {
 
         if (fScaledData == null)
             return;
 
-        HistogramScaledData scaledData = new HistogramScaledData(fScaledData);
+        final HistogramScaledData scaledData = new HistogramScaledData(fScaledData);
 
         try {
             // Get drawing boundaries
-            int width = image.getBounds().width;
-            int height = image.getBounds().height;
+            final int width = image.getBounds().width;
+            final int height = image.getBounds().height;
 
             // Clear the drawing area
             imageGC.setBackground(fBackgroundColor);
@@ -455,17 +456,16 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
             // Draw the histogram bars
             imageGC.setBackground(fHistoBarColor);
-            int limit = width < scaledData.fWidth ? width : scaledData.fWidth;
+            final int limit = width < scaledData.fWidth ? width : scaledData.fWidth;
             for (int i = 1; i < limit; i++) {
-                int value = (int) (scaledData.fData[i] * scaledData.fScalingFactor);
+                final int value = (int) (scaledData.fData[i] * scaledData.fScalingFactor);
                 imageGC.fillRectangle(i, height - value, 1, value);
             }
 
             // Draw the current event bar
-            int currentBucket = scaledData.fCurrentBucket;
-            if (currentBucket >= 0 && currentBucket < limit) {
+            final int currentBucket = scaledData.fCurrentBucket;
+            if (currentBucket >= 0 && currentBucket < limit)
                 drawDelimiter(imageGC, fCurrentEventColor, height, currentBucket);
-            }
 
             // Add a dashed line as a delimiter (at the right of the last bar)
             int lastEventIndex = limit - 1;
@@ -473,14 +473,14 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
                 lastEventIndex--;
             lastEventIndex += (lastEventIndex < limit - 1) ? 1 : 0;
             drawDelimiter(imageGC, fLastEventColor, height, lastEventIndex);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             // Do nothing
         }
     }
 
-    private void drawDelimiter(GC imageGC, Color color, int height, int index) {
+    private void drawDelimiter(final GC imageGC, final Color color, final int height, final int index) {
         imageGC.setBackground(color);
-        int dash = height / 4;
+        final int dash = height / 4;
         imageGC.fillRectangle(index, 0 * dash, 1, dash - 1);
         imageGC.fillRectangle(index, 1 * dash, 1, dash - 1);
         imageGC.fillRectangle(index, 2 * dash, 1, dash - 1);
@@ -492,12 +492,12 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     // ------------------------------------------------------------------------
 
     @Override
-    public void keyPressed(KeyEvent event) {
+    public void keyPressed(final KeyEvent event) {
         moveCursor(event.keyCode);
     }
 
     @Override
-    public void keyReleased(KeyEvent event) {
+    public void keyReleased(final KeyEvent event) {
     }
 
     // ------------------------------------------------------------------------
@@ -505,11 +505,11 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     // ------------------------------------------------------------------------
 
     @Override
-    public void mouseDoubleClick(MouseEvent event) {
+    public void mouseDoubleClick(final MouseEvent event) {
     }
 
     @Override
-    public void mouseDown(MouseEvent event) {
+    public void mouseDown(final MouseEvent event) {
         if (fDataModel.getNbEvents() > 0 && fScaledData.fLastBucket >= event.x) {
             fScaledData.fCurrentBucket = event.x;
             updateCurrentEventTime();
@@ -517,7 +517,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     }
 
     @Override
-    public void mouseUp(MouseEvent event) {
+    public void mouseUp(final MouseEvent event) {
     }
 
     // ------------------------------------------------------------------------
@@ -525,31 +525,30 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     // ------------------------------------------------------------------------
 
     @Override
-    public void mouseEnter(MouseEvent event) {
+    public void mouseEnter(final MouseEvent event) {
     }
 
     @Override
-    public void mouseExit(MouseEvent event) {
+    public void mouseExit(final MouseEvent event) {
     }
 
     @Override
-    public void mouseHover(MouseEvent event) {
+    public void mouseHover(final MouseEvent event) {
         if (fDataModel.getNbEvents() > 0 && fScaledData != null && fScaledData.fLastBucket >= event.x) {
-            String tooltip = formatToolTipLabel(event.x);
+            final String tooltip = formatToolTipLabel(event.x);
             fCanvas.setToolTipText(tooltip);
         }
     }
 
-    private String formatToolTipLabel(int index) {
+    private String formatToolTipLabel(final int index) {
         long startTime = fScaledData.getBucketStartTime(fScaledData.fCurrentBucket);
-        // negative values are possible if time values came into the model in decreasing order 
-        if (startTime < 0) {
+        // negative values are possible if time values came into the model in decreasing order
+        if (startTime < 0)
             startTime = 0;
-        }
-        long endTime = fScaledData.getBucketEndTime(fScaledData.fCurrentBucket);
-        int nbEvents = (index >= 0) ? fScaledData.fData[index] : 0;
+        final long endTime = fScaledData.getBucketEndTime(fScaledData.fCurrentBucket);
+        final int nbEvents = (index >= 0) ? fScaledData.fData[index] : 0;
 
-        StringBuffer buffer = new StringBuffer();
+        final StringBuffer buffer = new StringBuffer();
         buffer.append("Range = ["); //$NON-NLS-1$
         buffer.append(HistogramUtils.nanosecondsToString(startTime));
         buffer.append(","); //$NON-NLS-1$
@@ -565,12 +564,12 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     // ------------------------------------------------------------------------
 
     @Override
-    public void controlMoved(ControlEvent event) {
+    public void controlMoved(final ControlEvent event) {
         fDataModel.complete();
     }
 
     @Override
-    public void controlResized(ControlEvent event) {
+    public void controlResized(final ControlEvent event) {
         fDataModel.complete();
     }
 }
This page took 0.051862 seconds and 5 git commands to generate.