Skip to content

Commit 2096efe

Browse files
committed
inandout: Use config separator in analysis id and output id
When a configuration is applied, use the CONFIG_SEPARATOR '+' before the configId in the analysisId and outputId. Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
1 parent ff3687b commit 2096efe

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

analyses/org.eclipse.tracecompass.incubator.inandout.core.tests/src/org/eclipse/tracecompass/incubator/inandout/core/tests/analysis/InAndOutDataProviderFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class InAndOutDataProviderFactoryTest {
6060
private static final String CONFIG_NAME = "An InAndOut Analysis"; //$NON-NLS-1$
6161

6262
private static final String CUSTOM_IN_AND_OUT_ANALYSIS_NAME = "InAndOut Analysis (" + CONFIG_NAME + ")"; //$NON-NLS-1$
63-
private static final String CUSTOM_IN_AND_OUT_ANALYSIS_DESCRIPTION = "Custom InAndOut analysis configured by \" " + CONFIG_NAME + "\""; //$NON-NLS-1$
63+
private static final String CUSTOM_IN_AND_OUT_ANALYSIS_DESCRIPTION = "Custom InAndOut analysis configured by '" + CONFIG_NAME + "'"; //$NON-NLS-1$
6464

6565
private static final String XML_TRACE = "testfiles/stub_xml_traces/valid/analysis_dependency.xml";
6666
private static ITmfTrace sfTestTrace;

analyses/org.eclipse.tracecompass.incubator.inandout.core/src/org/eclipse/tracecompass/incubator/internal/inandout/core/analysis/InAndOutAnalysisModule.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2022 Ericsson
2+
* Copyright (c) 2022, 2025 Ericsson
33
*
44
* All rights reserved. This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0 which
@@ -30,6 +30,7 @@
3030
import org.eclipse.tracecompass.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis;
3131
import org.eclipse.tracecompass.incubator.internal.inandout.core.Activator;
3232
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
33+
import org.eclipse.tracecompass.tmf.core.component.DataProviderConstants;
3334
import org.eclipse.tracecompass.tmf.core.config.ITmfConfiguration;
3435
import org.eclipse.tracecompass.tmf.core.config.TmfConfiguration;
3536
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
@@ -106,7 +107,7 @@ public void setConfiguration(ITmfConfiguration configuration) throws TmfConfigur
106107
if (config == null || fSpecifiers == null) {
107108
return ID;
108109
}
109-
return ID + config.getId();
110+
return ID + DataProviderConstants.CONFIG_SEPARATOR + config.getId();
110111
}
111112

112113
@Override
@@ -245,7 +246,7 @@ public static void remove(ITmfConfiguration config, @NonNull ITmfTrace trace) th
245246

246247
// Remove and clear persistent data
247248
try {
248-
IAnalysisModule module = trace.removeAnalysisModule(ID + config.getId());
249+
IAnalysisModule module = trace.removeAnalysisModule(ID + DataProviderConstants.CONFIG_SEPARATOR + config.getId());
249250
if (module != null) {
250251
module.dispose();
251252
module.clearPersistentData();

analyses/org.eclipse.tracecompass.incubator.inandout.core/src/org/eclipse/tracecompass/incubator/internal/inandout/core/analysis/InAndOutDataProviderFactory.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.eclipse.jdt.annotation.Nullable;
2929
import org.eclipse.osgi.util.NLS;
3030
import org.eclipse.tracecompass.incubator.internal.inandout.core.Activator;
31+
import org.eclipse.tracecompass.tmf.core.component.DataProviderConstants;
3132
import org.eclipse.tracecompass.tmf.core.config.ITmfConfiguration;
3233
import org.eclipse.tracecompass.tmf.core.config.ITmfConfigurationSourceType;
3334
import org.eclipse.tracecompass.tmf.core.config.ITmfDataProviderConfigurator;
@@ -71,7 +72,7 @@ public class InAndOutDataProviderFactory implements IDataProviderFactory, ITmfDa
7172
private static final String CONFIGURATOR_DESCRIPTION = "Configure custom InAndOut analysis"; //$NON-NLS-1$
7273

7374
private static final String CUSTOM_IN_AND_OUT_ANALYSIS_NAME = "InAndOut Analysis ({0})"; //$NON-NLS-1$
74-
private static final String CUSTOM_IN_AND_OUT_ANALYSIS_DESCRIPTION = "Custom InAndOut analysis configured by \" {0}\""; //$NON-NLS-1$
75+
private static final String CUSTOM_IN_AND_OUT_ANALYSIS_DESCRIPTION = "Custom InAndOut analysis configured by \'\'{0}\'\'"; //$NON-NLS-1$
7576

7677
private Table<String, ITmfTrace, ITmfConfiguration> fTmfConfigurationTable = HashBasedTable.create();
7778

@@ -158,7 +159,7 @@ public Collection<IDataProviderDescriptor> getDescriptors(ITmfTrace trace) {
158159

159160
applyConfiguration(trace, config, true);
160161
if (fTmfConfigurationTable.contains(config.getId(), trace)) {
161-
throw new TmfConfigurationException("Configuration already existis with label: " + config.getName()); //$NON-NLS-1$
162+
throw new TmfConfigurationException("Configuration already exists with label: " + config.getName()); //$NON-NLS-1$
162163
}
163164
fTmfConfigurationTable.put(config.getId(), trace, config);
164165
return getDescriptorFromConfig(config);
@@ -261,7 +262,7 @@ private void removeConfiguration(ITmfTrace trace, ITmfConfiguration config) thro
261262
private static IDataProviderDescriptor getDescriptorFromConfig(ITmfConfiguration config) {
262263
return new DataProviderDescriptor.Builder()
263264
.setParentId(ID)
264-
.setId(InAndOutAnalysisModule.ID + config.getId())
265+
.setId(InAndOutAnalysisModule.ID + DataProviderConstants.CONFIG_SEPARATOR + config.getId())
265266
.setName(NLS.bind(CUSTOM_IN_AND_OUT_ANALYSIS_NAME, config.getName()))
266267
.setDescription(NLS.bind(CUSTOM_IN_AND_OUT_ANALYSIS_DESCRIPTION, config.getName()))
267268
.setProviderType(ProviderType.NONE)

0 commit comments

Comments
 (0)