Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Chouinard2012-07-12 09:43:47 -0400
committerFrancois Chouinard2012-07-12 09:46:17 -0400
commit22423b68dfd4bf7dbb32f6b9702b46a45ea31381 (patch)
treeb1ab1b61d3ec885c2b8fd325811710718e022aae
parenta5048c7c867f43ed704315a5fb4729079f0001e9 (diff)
downloadorg.eclipse.linuxtools-22423b68dfd4bf7dbb32f6b9702b46a45ea31381.tar.gz
org.eclipse.linuxtools-22423b68dfd4bf7dbb32f6b9702b46a45ea31381.tar.xz
org.eclipse.linuxtools-22423b68dfd4bf7dbb32f6b9702b46a45ea31381.zip
Fix for Bug384878 - Add ending separator to folders in trace comparison
Signed-off-by: Francois Chouinard <fchouinard@gmail.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java
index 219605786f..91c0dd17e5 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java
@@ -19,6 +19,7 @@ import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
@@ -870,7 +871,14 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
if (ok && traceTypeOK && !traceType.equals("")) { //$NON-NLS-1$
// Tag the selected traces with their type
List<String> files = new ArrayList<String>(fileSystemObjects.keySet());
- Collections.sort(files);
+ Collections.sort(files, new Comparator<String>() {
+ @Override
+ public int compare(String o1, String o2) {
+ String v1 = o1 + File.separatorChar;
+ String v2 = o2 + File.separatorChar;
+ return v1.compareTo(v2);
+ }
+ });
// After sorting, traces correspond to the unique prefixes
String prefix = null;
for (int i = 0; i < files.size(); i++) {
@@ -913,8 +921,14 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
for (Entry<String, File> entry : fileSystemObjects.entrySet()) {
fileList.add(entry.getValue());
}
- Collections.sort(fileList);
-
+ Collections.sort(fileList, new Comparator<File>() {
+ @Override
+ public int compare(File o1, File o2) {
+ String v1 = o1.getAbsolutePath() + File.separatorChar;
+ String v2 = o2.getAbsolutePath() + File.separatorChar;
+ return v1.compareTo(v2);
+ }
+ });
// Perform a distinct import operation for everything that has the same prefix
// (distinct prefixes correspond to traces - we don't want to re-create parent structures)

Back to the top