]> git.efficios.com Git - deliverable/tracecompass.git/commitdiff
analysis: fix Loose Coupling and int division to double conversion
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 6 Jan 2016 15:05:48 +0000 (10:05 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 6 Jan 2016 18:59:42 +0000 (13:59 -0500)
AbstractSegmentStoreDensityViewer is fixed and made more portable.

Change-Id: Ic7ca60aefb308eaa4a00c914cb7dff6b274c4bb7
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/63646
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/density/AbstractSegmentStoreDensityViewer.java

index e5d7913d56e07390d56de16604bf91fab89c7c3c..542a5dccfb8441752b26be925432781fac902240 100644 (file)
@@ -141,8 +141,9 @@ public abstract class AbstractSegmentStoreDensityViewer extends TmfViewer {
             yOrigSeries[(int) xBox]++;
             minX = Math.min(minX, segment.getLength());
         }
+        double timeWidth = (double) maxLength / (double) width;
         for (int i = 0; i < width; i++) {
-            xOrigSeries[i] = i * maxLength / width;
+            xOrigSeries[i] = i * timeWidth;
         }
         double maxY = Double.MIN_VALUE;
         for (int i = 0; i < width; i++) {
@@ -203,7 +204,7 @@ public abstract class AbstractSegmentStoreDensityViewer extends TmfViewer {
         return CompletableFuture.supplyAsync(() -> computeData(timeRange, durationRange));
     }
 
-    private @Nullable ArrayList<ISegment> computeData(final TmfTimeRange timeRange, final Range durationRange) {
+    private @Nullable List<ISegment> computeData(final TmfTimeRange timeRange, final Range durationRange) {
         final AbstractSegmentStoreAnalysisModule analysisModule = fAnalysisModule;
         if (analysisModule == null) {
             return null;
This page took 0.029226 seconds and 5 git commands to generate.