From c6a026e03de34d8cc24acb26456b62802d62b16c Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Wed, 11 Sep 2013 15:31:47 -0400 Subject: [PATCH] Bug 417036 - [TMF] Legacy import: Trace type is not set after importing custom trace Change-Id: I1db889718bf5985b6b0e3ae6395dd958a399ef6e Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/16342 Tested-by: Hudson CI Reviewed-by: Alexandre Montplaisir IP-Clean: Alexandre Montplaisir Tested-by: Alexandre Montplaisir --- .../wizards/importtrace/ImportTraceWizardPage.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java index fe1ba34482..116035d6b5 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java @@ -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; -- 2.34.1