From: Maria Guseva Date: Fri, 27 May 2016 12:17:19 +0000 (+0300) Subject: SRADA-511: Fix incorrect remove of start rows in FileApiListTable. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e57c6d1b390f6efc1540d1942244cea167b6efd;p=sdk%2Ftools%2Fdynamic-analyzer.git SRADA-511: Fix incorrect remove of start rows in FileApiListTable. Change-Id: I0dc97d42181c846ce663af515ec3fb9801d27de1 --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListTable.java index c1326f5..3487961 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListTable.java @@ -29,6 +29,7 @@ package org.tizen.dynamicanalyzer.ui.file; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -144,6 +145,7 @@ public class FileApiListTable extends DAApiListTableComposite { if (rs != null) { try { int i = -1; + int indexToRemove = 0; int index = 0; while (rs.next()) { i++; @@ -200,6 +202,9 @@ public class FileApiListTable extends DAApiListTableComposite { contentText.add("-");//$NON-NLS-1$ contentData.add("-");//$NON-NLS-1$ + // to remove start log from table + removeTableIndex.add(indexToRemove); + } else if (fdApiType == LogCenterConstants.FD_API_TYPE_READ_END || fdApiType == LogCenterConstants.FD_API_TYPE_WRITE_END || fdApiType == LogCenterConstants.FD_API_TYPE_LOCK_END) { @@ -227,8 +232,6 @@ public class FileApiListTable extends DAApiListTableComposite { contentText.add(elapsedTime); contentData.add(Long.toString(time - startTime)); - // to remove start log from table - removeTableIndex.add(startLogIndex); } else { // when having no start event(in case of running // process), do not show @@ -281,6 +284,7 @@ public class FileApiListTable extends DAApiListTableComposite { tableInput.setFailed(true); } input.add(tableInput); + indexToRemove++; if (time >= rangeStartTime && time <= rangeEndTime) { tableInput.setInRange(true); @@ -293,13 +297,10 @@ public class FileApiListTable extends DAApiListTableComposite { } } - int removeCount = 0; + Collections.sort(removeTableIndex, Collections.reverseOrder()); + for (int index : removeTableIndex) { - int removeIndex = index - removeCount; - if (removeIndex >= 0) { - input.remove(removeIndex); - removeCount++; - } + input.remove(index); } removeTableDataByFilterProperty(input, filterList);