Bug 417036 - [TMF] Legacy import: Trace type is not set after importing custom trace
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 11 Sep 2013 19:31:47 +0000 (15:31 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Fri, 13 Sep 2013 19:08:08 +0000 (15:08 -0400)
Change-Id: I1db889718bf5985b6b0e3ae6395dd958a399ef6e
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/16342
Tested-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java

index fe1ba344824258b59b79b3b2f2ac01e8a61a61c8..116035d6b50abef7ed1f2ae5e1ca1f871ef1093e 100644 (file)
@@ -143,6 +143,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     // Target import directory ('Traces' folder)
     private IFolder fTargetFolder;
+    private static final String SEPARATOR = ":"; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -670,7 +671,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
         // Perform trace validation
         String traceTypeName = fTraceTypes.getText();
-        String tokens[] = traceTypeName.split(":", 2); //$NON-NLS-1$
+        String tokens[] = traceTypeName.split(SEPARATOR, 2);
         if (tokens.length >= 2) {
             String id = TmfTraceType.getInstance().getTraceTypeId(tokens[0], tokens[1]);
             if (!TmfTraceType.getInstance().validateTrace(id, getSelectedResources())) {
@@ -732,20 +733,20 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
             boolean traceTypeOK = false;
             if (traceType.startsWith(TmfTraceType.CUSTOM_TXT_CATEGORY)) {
                 for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
-                    if (traceType.equals(TmfTraceType.CUSTOM_TXT_CATEGORY + " : " + def.definitionName)) { //$NON-NLS-1$
+                    if (traceType.equals(TmfTraceType.CUSTOM_TXT_CATEGORY + SEPARATOR + def.definitionName)) {
                         traceTypeOK = true;
                         traceBundle = Activator.getDefault().getBundle().getSymbolicName();
-                        traceTypeId = CustomTxtTrace.class.getCanonicalName() + ":" + def.definitionName; //$NON-NLS-1$
+                        traceTypeId = CustomTxtTrace.class.getCanonicalName() + SEPARATOR + def.definitionName;
                         traceIcon = DEFAULT_TRACE_ICON_PATH;
                         break;
                     }
                 }
             } else if (traceType.startsWith(TmfTraceType.CUSTOM_XML_CATEGORY)) {
                 for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
-                    if (traceType.equals(TmfTraceType.CUSTOM_XML_CATEGORY + " : " + def.definitionName)) { //$NON-NLS-1$
+                    if (traceType.equals(TmfTraceType.CUSTOM_XML_CATEGORY + SEPARATOR + def.definitionName)) {
                         traceTypeOK = true;
                         traceBundle = Activator.getDefault().getBundle().getSymbolicName();
-                        traceTypeId = CustomXmlTrace.class.getCanonicalName() + ":" + def.definitionName; //$NON-NLS-1$
+                        traceTypeId = CustomXmlTrace.class.getCanonicalName() + SEPARATOR + def.definitionName;
                         traceIcon = DEFAULT_TRACE_ICON_PATH;
                         break;
                     }
@@ -753,7 +754,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
             } else {
                 if (!traceType.equals("")) { //$NON-NLS-1$
                     // Trace type was selected
-                    String temp[] = traceType.split(":", 2); //$NON-NLS-1$
+                    String temp[] = traceType.split(SEPARATOR, 2);
                     if (temp.length < 2) {
                         Activator.getDefault().logError("Error with trace type " + traceType); //$NON-NLS-1$
                         return false;
This page took 0.03318 seconds and 5 git commands to generate.