Skip to content

Commit

Permalink
tmf: Use TmfTraceType.instantiateExperiment() in TmfExperimentElement
Browse files Browse the repository at this point in the history
This reduces code duplication.

[Changed] Reuse utility TmfTraceType.instantiateExperiment()

Change-Id: Ib0709f8829dbe8663ac70454946864f0e95a33a2
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/202661
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
bhufmann committed Jun 22, 2023
1 parent a0e1e12 commit 525d178
Showing 1 changed file with 3 additions and 8 deletions.
Expand Up @@ -538,14 +538,9 @@ public TmfExperiment instantiateTrace() {
// make sure that supplementary folder exists
refreshSupplementaryFolder();

if (getTraceType() != null) {

IConfigurationElement ce = TRACE_TYPE_ATTRIBUTES.get(getTraceType());
if (ce == null) {
return null;
}
TmfExperiment experiment = (TmfExperiment) ce.createExecutableExtension(TmfTraceType.EXPERIMENT_TYPE_ATTR);
return experiment;
String typeID = getTraceType();
if (typeID != null) {
return TmfTraceType.instantiateExperiment(typeID);
}
} catch (CoreException e) {
Activator.getDefault().logError(NLS.bind(Messages.TmfExperimentElement_ErrorInstantiatingTrace, getName()), e);
Expand Down

0 comments on commit 525d178

Please sign in to comment.