And some more of those where required.
Change-Id: I369b0c5a0a2db8b3fccc6f6b97a2ba272b14fb28
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/35752
Tested-by: Hudson CI
26 files changed:
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
import org.eclipse.tracecompass.tmf.core.tests.shared.TmfTestHelper;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
import org.eclipse.tracecompass.tmf.core.tests.shared.TmfTestHelper;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTrace;
import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTrace;
import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
@Test
public void testAnalysisExecution() {
fKernelAnalysisModule.setId("test");
@Test
public void testAnalysisExecution() {
fKernelAnalysisModule.setId("test");
+ ITmfTrace trace = fTrace;
+ assertNotNull(trace);
- fKernelAnalysisModule.setTrace(fTrace);
+ fKernelAnalysisModule.setTrace(trace);
} catch (TmfAnalysisException e) {
fail(e.getMessage());
}
} catch (TmfAnalysisException e) {
fail(e.getMessage());
}
@Override
protected boolean executeAnalysis(IProgressMonitor monitor) {
@Override
protected boolean executeAnalysis(IProgressMonitor monitor) {
+ ITmfTrace trace = getTrace();
+ if (trace == null) {
+ throw new IllegalStateException();
+ }
/*
* This analysis depends on the LTTng kernel analysis, so we'll start
* that build at the same time
*/
/*
* This analysis depends on the LTTng kernel analysis, so we'll start
* that build at the same time
*/
- LttngKernelAnalysis module = getTrace().getAnalysisModuleOfClass(LttngKernelAnalysis.class, LttngKernelAnalysis.ID);
+ LttngKernelAnalysis module = trace.getAnalysisModuleOfClass(LttngKernelAnalysis.class, LttngKernelAnalysis.ID);
if (module != null) {
module.schedule();
}
if (module != null) {
module.schedule();
}
);
/** The requirements as an immutable set */
);
/** The requirements as an immutable set */
- private static final ImmutableSet<TmfAnalysisRequirement> REQUIREMENTS;
+ private static final @NonNull ImmutableSet<TmfAnalysisRequirement> REQUIREMENTS;
static {
/* initialize the requirement: domain and events */
static {
/* initialize the requirement: domain and events */
TmfAnalysisRequirement eventReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, REQUIRED_EVENTS, ValuePriorityLevel.MANDATORY);
eventReq.addValues(OPTIONAL_EVENTS, ValuePriorityLevel.OPTIONAL);
TmfAnalysisRequirement eventReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, REQUIRED_EVENTS, ValuePriorityLevel.MANDATORY);
eventReq.addValues(OPTIONAL_EVENTS, ValuePriorityLevel.OPTIONAL);
- REQUIREMENTS = ImmutableSet.of(domainReq, eventReq);
+
+ @SuppressWarnings("null")
+ @NonNull ImmutableSet<TmfAnalysisRequirement> reqSet = ImmutableSet.of(domainReq, eventReq);
+ REQUIREMENTS = reqSet;
@Override
protected String getFullHelpText() {
@Override
protected String getFullHelpText() {
- return Messages.LttngKernelAnalysisModule_Help;
+ @SuppressWarnings("null")
+ @NonNull String helpText = Messages.LttngKernelAnalysisModule_Help;
+ return helpText;
public void setUp() {
CtfTmfTestTrace testTrace = getTestTrace();
public void setUp() {
CtfTmfTestTrace testTrace = getTestTrace();
- fTrace = testTrace.getTrace();
+ CtfTmfTrace trace = testTrace.getTrace();
+ fTrace = trace;
fModule = new TestLttngCallStackModule();
try {
fModule = new TestLttngCallStackModule();
try {
- fModule.setTrace(fTrace);
+ fModule.setTrace(trace);
} catch (TmfAnalysisException e) {
fail();
}
} catch (TmfAnalysisException e) {
fail();
}
package org.eclipse.tracecompass.lttng2.ust.core.analysis.memory;
package org.eclipse.tracecompass.lttng2.ust.core.analysis.memory;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.internal.lttng2.ust.core.memoryusage.MemoryUsageStateProvider;
import org.eclipse.tracecompass.internal.lttng2.ust.core.memoryusage.UstMemoryStrings;
import org.eclipse.tracecompass.lttng2.control.core.session.SessionConfigStrings;
import org.eclipse.tracecompass.internal.lttng2.ust.core.memoryusage.MemoryUsageStateProvider;
import org.eclipse.tracecompass.internal.lttng2.ust.core.memoryusage.UstMemoryStrings;
import org.eclipse.tracecompass.lttng2.control.core.session.SessionConfigStrings;
);
/** The requirements as an immutable set */
);
/** The requirements as an immutable set */
- private static final ImmutableSet<TmfAnalysisRequirement> REQUIREMENTS;
+ private static final @NonNull ImmutableSet<TmfAnalysisRequirement> REQUIREMENTS;
static {
/* Initialize the requirements for the analysis: domain and events */
static {
/* Initialize the requirements for the analysis: domain and events */
TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN);
domainReq.addValue(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST, ValuePriorityLevel.MANDATORY);
TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN);
domainReq.addValue(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST, ValuePriorityLevel.MANDATORY);
- REQUIREMENTS = ImmutableSet.of(domainReq, eventsReq);
+ @SuppressWarnings("null")
+ @NonNull ImmutableSet<TmfAnalysisRequirement> reqSet = ImmutableSet.of(domainReq, eventsReq);
+ REQUIREMENTS = reqSet;
Element node = (Element) stateproviderNodes.item(0);
fModule = new XmlStateSystemModule();
String moduleId = node.getAttribute(TmfXmlStrings.ID);
Element node = (Element) stateproviderNodes.item(0);
fModule = new XmlStateSystemModule();
String moduleId = node.getAttribute(TmfXmlStrings.ID);
+ assertNotNull(moduleId);
fModule.setId(moduleId);
assertEquals(ANALYSIS_ID, fModule.getId());
fModule.setId(moduleId);
assertEquals(ANALYSIS_ID, fModule.getId());
Element node = (Element) stateproviderNodes.item(0);
fModule = new XmlStateSystemModule();
String moduleId = node.getAttribute(TmfXmlStrings.ID);
Element node = (Element) stateproviderNodes.item(0);
fModule = new XmlStateSystemModule();
String moduleId = node.getAttribute(TmfXmlStrings.ID);
+ assertNotNull(moduleId);
fModule.setId(moduleId);
fModule.setXmlFile(new Path(TmfXmlTestFiles.VALID_FILE.getFile().getAbsolutePath()));
fModule.setId(moduleId);
fModule.setXmlFile(new Path(TmfXmlTestFiles.VALID_FILE.getFile().getAbsolutePath()));
public void setupTest() {
/* Initialize the trace */
assumeTrue(CtfTmfTestTrace.KERNEL.exists());
public void setupTest() {
/* Initialize the trace */
assumeTrue(CtfTmfTestTrace.KERNEL.exists());
- fTrace = CtfTmfTestTrace.KERNEL.getTrace();
+ ITmfTrace trace = CtfTmfTestTrace.KERNEL.getTrace();
+ fTrace = trace;
/* Initialize the state provider module */
Document doc = null;
/* Initialize the state provider module */
Document doc = null;
Element node = (Element) stateproviderNodes.item(0);
fModule = new XmlStateSystemModule();
String moduleId = node.getAttribute(TmfXmlStrings.ID);
Element node = (Element) stateproviderNodes.item(0);
fModule = new XmlStateSystemModule();
String moduleId = node.getAttribute(TmfXmlStrings.ID);
+ assertNotNull(moduleId);
fModule.setId(moduleId);
fModule.setXmlFile(new Path(TmfXmlTestFiles.VALID_FILE.getFile().getAbsolutePath()));
try {
fModule.setId(moduleId);
fModule.setXmlFile(new Path(TmfXmlTestFiles.VALID_FILE.getFile().getAbsolutePath()));
try {
- fModule.setTrace(fTrace);
+ fModule.setTrace(trace);
fModule.schedule();
} catch (TmfAnalysisException e) {
fail("Cannot set trace " + e.getMessage());
fModule.schedule();
} catch (TmfAnalysisException e) {
fail("Cannot set trace " + e.getMessage());
*/
@After
public void cleanupTest() {
*/
@After
public void cleanupTest() {
- CtfTmfTestTrace.KERNEL.dispose();
@Override
public String getId() {
@Override
public String getId() {
- return fSourceElement.getAttribute(TmfXmlStrings.ID);
+ /*
+ * The attribute ID cannot be null because the XML has been validated
+ * and it is mandatory
+ */
+ @SuppressWarnings("null")
+ @NonNull String id = fSourceElement.getAttribute(TmfXmlStrings.ID);
+ return id;
package org.eclipse.tracecompass.tmf.core.tests.analysis;
import static org.junit.Assert.assertFalse;
package org.eclipse.tracecompass.tmf.core.tests.analysis;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.Map;
import static org.junit.Assert.assertTrue;
import java.util.Map;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleHelper;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleSource;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisManager;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleHelper;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleSource;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisManager;
public class AnalysisManagerTest {
/** Id of analysis module with parameter */
public class AnalysisManagerTest {
/** Id of analysis module with parameter */
- public static final String MODULE_PARAM = "org.eclipse.linuxtools.tmf.core.tests.analysis.test";
+ public static final @NonNull String MODULE_PARAM = "org.eclipse.linuxtools.tmf.core.tests.analysis.test";
/** ID of analysis module with parameter and default value */
/** ID of analysis module with parameter and default value */
- public static final String MODULE_PARAM_DEFAULT = "org.eclipse.linuxtools.tmf.core.tests.analysis.test2";
+ public static final @NonNull String MODULE_PARAM_DEFAULT = "org.eclipse.linuxtools.tmf.core.tests.analysis.test2";
/** ID of analysis module for trace 2 classes only */
/** ID of analysis module for trace 2 classes only */
- public static final String MODULE_SECOND = "org.eclipse.linuxtools.tmf.core.tests.analysis.testother";
+ public static final @NonNull String MODULE_SECOND = "org.eclipse.linuxtools.tmf.core.tests.analysis.testother";
/** Id of analysis module with requirements */
/** Id of analysis module with requirements */
- public static final String MODULE_REQ = "org.eclipse.linuxtools.tmf.core.tests.analysis.reqtest";
+ public static final @NonNull String MODULE_REQ = "org.eclipse.linuxtools.tmf.core.tests.analysis.reqtest";
private ITmfTrace fTrace;
private ITmfTrace fTrace;
public void testListForTraces() {
/* Generic TmfTrace */
ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace();
public void testListForTraces() {
/* Generic TmfTrace */
ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace();
- Map<String, IAnalysisModuleHelper> map = TmfAnalysisManager.getAnalysisModules(trace.getClass());
+ Class<? extends ITmfTrace> traceClass = trace.getClass();
+ assertNotNull(traceClass);
+ Map<String, IAnalysisModuleHelper> map = TmfAnalysisManager.getAnalysisModules(traceClass);
assertTrue(map.containsKey(MODULE_PARAM));
assertTrue(map.containsKey(MODULE_PARAM_DEFAULT));
assertFalse(map.containsKey(MODULE_SECOND));
/* TmfTraceStub2 class */
assertTrue(map.containsKey(MODULE_PARAM));
assertTrue(map.containsKey(MODULE_PARAM_DEFAULT));
assertFalse(map.containsKey(MODULE_SECOND));
/* TmfTraceStub2 class */
- map = TmfAnalysisManager.getAnalysisModules(fTrace.getClass());
+ traceClass = fTrace.getClass();
+ assertNotNull(traceClass);
+ map = TmfAnalysisManager.getAnalysisModules(traceClass);
assertTrue(map.containsKey(MODULE_PARAM));
assertTrue(map.containsKey(MODULE_PARAM_DEFAULT));
assertTrue(map.containsKey(MODULE_PARAM));
assertTrue(map.containsKey(MODULE_PARAM_DEFAULT));
/* Make sure that modules in the new source are not in the list already */
/* Generic TmfTrace */
ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace();
/* Make sure that modules in the new source are not in the list already */
/* Generic TmfTrace */
ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace();
- Map<String, IAnalysisModuleHelper> map = TmfAnalysisManager.getAnalysisModules(trace.getClass());
+ Class<? extends ITmfTrace> traceClass = trace.getClass();
+ assertNotNull(traceClass);
+ Map<String, IAnalysisModuleHelper> map = TmfAnalysisManager.getAnalysisModules(traceClass);
assertFalse(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST.name()));
/* TmfTraceStub2 class */
assertFalse(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST.name()));
/* TmfTraceStub2 class */
- map = TmfAnalysisManager.getAnalysisModules(fTrace.getClass());
+ Class<? extends ITmfTrace> ftraceClass = fTrace.getClass();
+ assertNotNull(ftraceClass);
+ map = TmfAnalysisManager.getAnalysisModules(ftraceClass);
assertFalse(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST2.name()));
assertFalse(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST2.name()));
TmfAnalysisManager.registerModuleSource(new AnalysisModuleSourceStub());
/* Now make sure the modules are present */
TmfAnalysisManager.registerModuleSource(new AnalysisModuleSourceStub());
/* Now make sure the modules are present */
- map = TmfAnalysisManager.getAnalysisModules(trace.getClass());
+ map = TmfAnalysisManager.getAnalysisModules(traceClass);
assertTrue(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST.name()));
assertTrue(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST.name()));
- map = TmfAnalysisManager.getAnalysisModules(fTrace.getClass());
+ map = TmfAnalysisManager.getAnalysisModules(ftraceClass);
assertTrue(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST2.name()));
}
assertTrue(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST2.name()));
}
/* TestAnalysis2 module with a TraceStub2 */
exception = null;
/* TestAnalysis2 module with a TraceStub2 */
exception = null;
+ ITmfTrace trace = fTrace;
+ assertNotNull(trace);
- module = fModuleOther.newModule(fTrace);
+ module = fModuleOther.newModule(trace);
assertNotNull(module);
assertTrue(module instanceof TestAnalysis2);
} catch (TmfAnalysisException e) {
assertNotNull(module);
assertTrue(module instanceof TestAnalysis2);
} catch (TmfAnalysisException e) {
* able to set the parameter
*/
IAnalysisModuleHelper helper = TmfAnalysisManager.getAnalysisModule(AnalysisManagerTest.MODULE_PARAM);
* able to set the parameter
*/
IAnalysisModuleHelper helper = TmfAnalysisManager.getAnalysisModule(AnalysisManagerTest.MODULE_PARAM);
IAnalysisModule module = null;
try {
module = helper.newModule(trace);
IAnalysisModule module = null;
try {
module = helper.newModule(trace);
/* This module has a parameter with default value */
helper = TmfAnalysisManager.getAnalysisModule(AnalysisManagerTest.MODULE_PARAM_DEFAULT);
/* This module has a parameter with default value */
helper = TmfAnalysisManager.getAnalysisModule(AnalysisManagerTest.MODULE_PARAM_DEFAULT);
try {
module = helper.newModule(trace);
assertEquals(3, module.getParameter(TestAnalysis.PARAM_TEST));
try {
module = helper.newModule(trace);
assertEquals(3, module.getParameter(TestAnalysis.PARAM_TEST));
* error
*/
helper = TmfAnalysisManager.getAnalysisModule(AnalysisManagerTest.MODULE_SECOND);
* error
*/
helper = TmfAnalysisManager.getAnalysisModule(AnalysisManagerTest.MODULE_SECOND);
Exception exception = null;
Exception exception = null;
+ trace = fTrace;
+ assertNotNull(trace);
- module = helper.newModule(fTrace);
+ module = helper.newModule(trace);
assertNull(module.getParameter(TestAnalysis.PARAM_TEST));
try {
assertNull(module.getParameter(TestAnalysis.PARAM_TEST));
try {
package org.eclipse.tracecompass.tmf.core.tests.analysis;
import static org.junit.Assert.assertEquals;
package org.eclipse.tracecompass.tmf.core.tests.analysis;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.util.List;
import static org.junit.Assert.fail;
import java.util.List;
ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace();
/* Make sure the value is set to null */
IAnalysisModuleHelper helper = TmfAnalysisManager.getAnalysisModule(AnalysisManagerTest.MODULE_PARAM);
ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace();
/* Make sure the value is set to null */
IAnalysisModuleHelper helper = TmfAnalysisManager.getAnalysisModule(AnalysisManagerTest.MODULE_PARAM);
IAnalysisModule module = null;
try {
module = helper.newModule(trace);
IAnalysisModule module = null;
try {
module = helper.newModule(trace);
@Override
public String getId() {
@Override
public String getId() {
}
@Override
public String getName() {
}
@Override
public String getName() {
+ @SuppressWarnings("null")
+ @NonNull String name = fModule.name();
+ return name;
package org.eclipse.tracecompass.tmf.tests.stubs.analysis;
import org.eclipse.core.runtime.IProgressMonitor;
package org.eclipse.tracecompass.tmf.tests.stubs.analysis;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
*/
public class TestAnalysis extends TmfAbstractAnalysisModule {
*/
public class TestAnalysis extends TmfAbstractAnalysisModule {
- private int output = 0;
-
/**
* Test parameter. If set, simulate cancellation
*/
/**
* Test parameter. If set, simulate cancellation
*/
- public static final String PARAM_TEST = "test";
+ public static final @NonNull String PARAM_TEST = "test";
+
+ private int fOutput = 0;
}
/* If PARAM_TEST is set to 0, simulate cancellation */
if ((Integer) getParameter(PARAM_TEST) == 0) {
}
/* If PARAM_TEST is set to 0, simulate cancellation */
if ((Integer) getParameter(PARAM_TEST) == 0) {
return false;
} else if ((Integer) getParameter(PARAM_TEST) == 999) {
/* just stay in an infinite loop until cancellation */
return false;
} else if ((Integer) getParameter(PARAM_TEST) == 999) {
/* just stay in an infinite loop until cancellation */
}
return !monitor.isCanceled();
}
}
return !monitor.isCanceled();
}
- output = (Integer) getParameter(PARAM_TEST);
+ Object obj = getParameter(PARAM_TEST);
+ if (obj == null) {
+ throw new IllegalStateException();
+ }
+ fOutput = (Integer) obj;
return true;
}
@Override
protected void canceling() {
return true;
}
@Override
protected void canceling() {
* @return The analysis output
*/
public int getAnalysisOutput() {
* @return The analysis output
*/
public int getAnalysisOutput() {
package org.eclipse.tracecompass.tmf.tests.stubs.analysis;
package org.eclipse.tracecompass.tmf.tests.stubs.analysis;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel;
requirements.get(FIELD_TYPE).addValue(PID, ValuePriorityLevel.MANDATORY);
requirements.get(FIELD_TYPE).addValue(TID, ValuePriorityLevel.MANDATORY);
requirements.get(FIELD_TYPE).addValue(PID, ValuePriorityLevel.MANDATORY);
requirements.get(FIELD_TYPE).addValue(TID, ValuePriorityLevel.MANDATORY);
- return requirements.values();
+ @SuppressWarnings("null")
+ @NonNull Collection<TmfAnalysisRequirement> values = requirements.values();
+ return values;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.tmf.core.component.ITmfComponent;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.core.component.ITmfComponent;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
* @param name
* name of the module
*/
* @param name
* name of the module
*/
- void setName(String name);
+ void setName(@NonNull String name);
/**
* Sets the id of the module
/**
* Sets the id of the module
* @param id
* id of the module
*/
* @param id
* id of the module
*/
+ void setId(@NonNull String id);
/**
* Gets the id of the analysis module
*
* @return The id of the module
*/
/**
* Gets the id of the analysis module
*
* @return The id of the module
*/
- @NonNull
- String getId();
+ @NonNull String getId();
/**
* Sets whether this analysis should be run automatically at trace opening
/**
* Sets whether this analysis should be run automatically at trace opening
* The trace to run the analysis on
* @throws TmfAnalysisException
*/
* The trace to run the analysis on
* @throws TmfAnalysisException
*/
- void setTrace(ITmfTrace trace) throws TmfAnalysisException;
+ void setTrace(@NonNull ITmfTrace trace) throws TmfAnalysisException;
/**
* Add a parameter to this module
/**
* Add a parameter to this module
* @param name
* Name of the parameter
*/
* @param name
* Name of the parameter
*/
- void addParameter(String name);
+ void addParameter(@NonNull String name);
/**
* Sets the value of a parameter
/**
* Sets the value of a parameter
* The value (subclasses may type-check it)
* @throws RuntimeException
*/
* The value (subclasses may type-check it)
* @throws RuntimeException
*/
- void setParameter(String name, Object value);
+ void setParameter(@NonNull String name, @Nullable Object value);
/**
* Gets the value of a parameter
/**
* Gets the value of a parameter
* Name of the parameter
* @return The value of a parameter
*/
* Name of the parameter
* @return The value of a parameter
*/
- Object getParameter(String name);
+ @Nullable Object getParameter(@NonNull String name);
// -----------------------------------------------------
// Functionalities
// -----------------------------------------------------
// Functionalities
* @return An IStatus indicating if the execution of the analysis could be
* scheduled successfully or not.
*/
* @return An IStatus indicating if the execution of the analysis could be
* scheduled successfully or not.
*/
+ @NonNull IStatus schedule();
/**
* Gets a list of outputs
*
* @return The list of {@link IAnalysisOutput}
*/
/**
* Gets a list of outputs
*
* @return The list of {@link IAnalysisOutput}
*/
- Iterable<IAnalysisOutput> getOutputs();
+ @NonNull Iterable<IAnalysisOutput> getOutputs();
/**
* Registers an output for this analysis
/**
* Registers an output for this analysis
* @param output
* The {@link IAnalysisOutput} object
*/
* @param output
* The {@link IAnalysisOutput} object
*/
- void registerOutput(IAnalysisOutput output);
+ void registerOutput(@NonNull IAnalysisOutput output);
/**
* Block the calling thread until this analysis has completed (or has been
/**
* Block the calling thread until this analysis has completed (or has been
* scheduled to run at all. In all cases, the quality or
* availability of the output(s) and results is not guaranteed.
*/
* scheduled to run at all. In all cases, the quality or
* availability of the output(s) and results is not guaranteed.
*/
- boolean waitForCompletion(IProgressMonitor monitor);
+ boolean waitForCompletion(@NonNull IProgressMonitor monitor);
/**
* Cancels the current analysis
/**
* Cancels the current analysis
*
* @return The generic help text
*/
*
* @return The generic help text
*/
+ @NonNull String getHelpText();
/**
* Gets a help text specific for a given trace
/**
* Gets a help text specific for a given trace
* The trace to analyze
* @return A help text with information on a specific trace
*/
* The trace to analyze
* @return A help text with information on a specific trace
*/
- String getHelpText(ITmfTrace trace);
+ @NonNull String getHelpText(@NonNull ITmfTrace trace);
/**
* Notify the module that the value of a parameter has changed
/**
* Notify the module that the value of a parameter has changed
* @param name
* The of the parameter that changed
*/
* @param name
* The of the parameter that changed
*/
- void notifyParameterChanged(String name);
+ void notifyParameterChanged(@NonNull String name);
*
* @return The id of the module
*/
*
* @return The id of the module
*/
+ @NonNull String getId();
/**
* Gets the name of the analysis module
*
* @return The id of the module
*/
/**
* Gets the name of the analysis module
*
* @return The id of the module
*/
+ @NonNull String getName();
/**
* Gets whether the analysis should be run automatically at trace opening
/**
* Gets whether the analysis should be run automatically at trace opening
* @throws TmfAnalysisException
* Exceptions that occurred when setting trace
*/
* @throws TmfAnalysisException
* Exceptions that occurred when setting trace
*/
- IAnalysisModule newModule(ITmfTrace trace) throws TmfAnalysisException;
+ IAnalysisModule newModule(@NonNull ITmfTrace trace) throws TmfAnalysisException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel;
* @author Geneviève Bastien
* @since 3.0
*/
* @author Geneviève Bastien
* @since 3.0
*/
public abstract class TmfAbstractAnalysisModule extends TmfComponent implements IAnalysisModule {
public abstract class TmfAbstractAnalysisModule extends TmfComponent implements IAnalysisModule {
- private String fName, fId;
+ private @Nullable String fId;
private boolean fAutomatic = false, fStarted = false;
private boolean fAutomatic = false, fStarted = false;
- private volatile ITmfTrace fTrace;
+ private volatile @Nullable ITmfTrace fTrace;
private final Map<String, Object> fParameters = new HashMap<>();
private final List<String> fParameterNames = new ArrayList<>();
private final List<IAnalysisOutput> fOutputs = new ArrayList<>();
private List<IAnalysisParameterProvider> fParameterProviders = new ArrayList<>();
private final Map<String, Object> fParameters = new HashMap<>();
private final List<String> fParameterNames = new ArrayList<>();
private final List<IAnalysisOutput> fOutputs = new ArrayList<>();
private List<IAnalysisParameterProvider> fParameterProviders = new ArrayList<>();
- private Job fJob = null;
+ private @Nullable Job fJob = null;
private final Object syncObj = new Object();
private final Object syncObj = new Object();
@Override
public String getName() {
@Override
public String getName() {
- String name = fName;
- if (name == null) {
- return ""; //$NON-NLS-1$
- }
- return name;
+ return super.getName();
}
@Override
public void setName(String name) {
}
@Override
public void setName(String name) {
public String getId() {
String id = fId;
if (id == null) {
public String getId() {
String id = fId;
if (id == null) {
@Override
public void setTrace(ITmfTrace trace) throws TmfAnalysisException {
@Override
public void setTrace(ITmfTrace trace) throws TmfAnalysisException {
- if (trace == null) {
- throw new TmfAnalysisException(Messages.TmfAbstractAnalysisModule_NullTrace);
- }
if (fTrace != null) {
throw new TmfAnalysisException(NLS.bind(Messages.TmfAbstractAnalysisModule_TraceSetMoreThanOnce, getName()));
}
if (fTrace != null) {
throw new TmfAnalysisException(NLS.bind(Messages.TmfAbstractAnalysisModule_TraceSetMoreThanOnce, getName()));
}
- protected ITmfTrace getTrace() {
+ protected @Nullable ITmfTrace getTrace() {
- public synchronized void setParameter(String name, Object value) {
+ public synchronized void setParameter(String name, @Nullable Object value) {
if (!fParameterNames.contains(name)) {
throw new RuntimeException(NLS.bind(Messages.TmfAbstractAnalysisModule_InvalidParameter, name, getName()));
}
if (!fParameterNames.contains(name)) {
throw new RuntimeException(NLS.bind(Messages.TmfAbstractAnalysisModule_InvalidParameter, name, getName()));
}
- public Object getParameter(String name) {
+ public @Nullable Object getParameter(String name) {
Object paramValue = fParameters.get(name);
/* The parameter is not set, maybe it can be provided by someone else */
if ((paramValue == null) && (fTrace != null)) {
Object paramValue = fParameters.get(name);
/* The parameter is not set, maybe it can be provided by someone else */
if ((paramValue == null) && (fTrace != null)) {
- public boolean canExecute(@NonNull ITmfTrace trace) {
+ public boolean canExecute(ITmfTrace trace) {
for (TmfAnalysisRequirement requirement : getAnalysisRequirements()) {
if (!requirement.isFulfilled(trace)) {
return false;
for (TmfAnalysisRequirement requirement : getAnalysisRequirements()) {
if (!requirement.isFulfilled(trace)) {
return false;
- private void execute(@NonNull final ITmfTrace trace) {
+ private void execute(final ITmfTrace trace) {
/*
* TODO: The analysis in a job should be done at the analysis manager
/*
* TODO: The analysis in a job should be done at the analysis manager
/*
* Actual analysis will be run on a separate thread
*/
/*
* Actual analysis will be run on a separate thread
*/
- fJob = new Job(NLS.bind(Messages.TmfAbstractAnalysisModule_RunningAnalysis, getName())) {
+ @SuppressWarnings("null")
+ @NonNull String jobName = NLS.bind(Messages.TmfAbstractAnalysisModule_RunningAnalysis, getName());
+ fJob = new Job(jobName) {
- protected IStatus run(final IProgressMonitor monitor) {
+ protected @Nullable IStatus run(final @Nullable IProgressMonitor monitor) {
+ IProgressMonitor mon = monitor;
+ if (mon == null) {
+ mon = new NullProgressMonitor();
+ }
- monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+ mon.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
broadcast(new TmfStartAnalysisSignal(TmfAbstractAnalysisModule.this, TmfAbstractAnalysisModule.this));
broadcast(new TmfStartAnalysisSignal(TmfAbstractAnalysisModule.this, TmfAbstractAnalysisModule.this));
- fAnalysisCancelled = !executeAnalysis(monitor);
+ fAnalysisCancelled = !executeAnalysis(mon);
} catch (TmfAnalysisException e) {
Activator.logError("Error executing analysis with trace " + trace.getName(), e); //$NON-NLS-1$
} finally {
synchronized (syncObj) {
} catch (TmfAnalysisException e) {
Activator.logError("Error executing analysis with trace " + trace.getName(), e); //$NON-NLS-1$
} finally {
synchronized (syncObj) {
setAnalysisCompleted();
}
TmfTraceManager.refreshSupplementaryFiles(trace);
setAnalysisCompleted();
}
TmfTraceManager.refreshSupplementaryFiles(trace);
- return Status.OK_STATUS;
+ @SuppressWarnings("null")
+ @NonNull IStatus status = Status.OK_STATUS;
+ return status;
* @return Full help text for the module
*/
protected String getFullHelpText() {
* @return Full help text for the module
*/
protected String getFullHelpText() {
- return NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisModule, getName());
+ @SuppressWarnings("null")
+ @NonNull String text = NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisModule, getName());
+ return text;
* @return Short help text describing the module
*/
protected String getShortHelpText(ITmfTrace trace) {
* @return Short help text describing the module
*/
protected String getShortHelpText(ITmfTrace trace) {
- return NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisForTrace, getName(), trace.getName());
+ @SuppressWarnings("null")
+ @NonNull String text = NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisForTrace, getName(), trace.getName());
+ return text;
* The trace to apply the analysis to
* @return Help text
*/
* The trace to apply the analysis to
* @return Help text
*/
- protected String getTraceCannotExecuteHelpText(@NonNull ITmfTrace trace) {
+ protected String getTraceCannotExecuteHelpText(ITmfTrace trace) {
StringBuilder builder = new StringBuilder();
builder.append(NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisCannotExecute, getName()));
for (TmfAnalysisRequirement requirement : getAnalysisRequirements()) {
StringBuilder builder = new StringBuilder();
builder.append(NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisCannotExecute, getName()));
for (TmfAnalysisRequirement requirement : getAnalysisRequirements()) {
- return builder.toString();
+ @SuppressWarnings("null")
+ @NonNull String helpText = builder.toString();
+ return helpText;
@Override
public String getHelpText(ITmfTrace trace) {
@Override
public String getHelpText(ITmfTrace trace) {
- if (trace == null) {
- return getHelpText();
- }
String text = getShortHelpText(trace);
if (!canExecute(trace)) {
text = text + "\n\n" + getTraceCannotExecuteHelpText(trace); //$NON-NLS-1$
String text = getShortHelpText(trace);
if (!canExecute(trace)) {
text = text + "\n\n" + getTraceCannotExecuteHelpText(trace); //$NON-NLS-1$
@Override
public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() {
@Override
public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() {
- return Collections.EMPTY_SET;
+ @SuppressWarnings("null")
+ @NonNull Iterable<TmfAnalysisRequirement> emptySet = Collections.EMPTY_SET;
+ return emptySet;
* Name of the modified parameter
*/
protected void notifyParameterChanged(String name) {
* Name of the modified parameter
*/
protected void notifyParameterChanged(String name) {
- if (fModule != null) {
- fModule.notifyParameterChanged(name);
+ IAnalysisModule module = fModule;
+ if (module != null && name != null) {
+ module.notifyParameterChanged(name);
import java.util.List;
import java.util.Map;
import java.util.List;
import java.util.Map;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.internal.tmf.core.analysis.TmfAnalysisModuleSources;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.internal.tmf.core.analysis.TmfAnalysisModuleSources;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
* @author Geneviève Bastien
* @since 3.0
*/
* @author Geneviève Bastien
* @since 3.0
*/
public class TmfAnalysisManager {
private static final Map<String, IAnalysisModuleHelper> fAnalysisModules = new HashMap<>();
public class TmfAnalysisManager {
private static final Map<String, IAnalysisModuleHelper> fAnalysisModules = new HashMap<>();
- return Collections.unmodifiableMap(fAnalysisModules);
+ @SuppressWarnings("null")
+ @NonNull Map<String, IAnalysisModuleHelper> map = Collections.unmodifiableMap(fAnalysisModules);
+ return map;
map.put(module.getId(), module);
}
}
map.put(module.getId(), module);
}
}
- return Collections.unmodifiableMap(map);
+ @SuppressWarnings("null")
+ @NonNull Map<String, IAnalysisModuleHelper> retMap = Collections.unmodifiableMap(map);
+ return retMap;
* Id of the analysis module to get
* @return The {@link IAnalysisModuleHelper}
*/
* Id of the analysis module to get
* @return The {@link IAnalysisModuleHelper}
*/
- public static IAnalysisModuleHelper getAnalysisModule(String id) {
+ public static @Nullable IAnalysisModuleHelper getAnalysisModule(String id) {
Map<String, IAnalysisModuleHelper> map = getAnalysisModules();
return map.get(id);
}
Map<String, IAnalysisModuleHelper> map = getAnalysisModules();
return map.get(id);
}
@Override
public String getId() {
@Override
public String getId() {
- return fCe.getAttribute(TmfAnalysisModuleSourceConfigElement.ID_ATTR);
+ String id = fCe.getAttribute(TmfAnalysisModuleSourceConfigElement.ID_ATTR);
+ if (id == null) {
+ throw new IllegalStateException();
+ }
+ return id;
}
@Override
public String getName() {
}
@Override
public String getName() {
- return fCe.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR);
+ String name = fCe.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR);
+ if (name == null) {
+ throw new IllegalStateException();
+ }
+ return name;
/* Get the module's parameters */
final IConfigurationElement[] parametersCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.PARAMETER_ELEM);
for (IConfigurationElement element : parametersCE) {
/* Get the module's parameters */
final IConfigurationElement[] parametersCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.PARAMETER_ELEM);
for (IConfigurationElement element : parametersCE) {
- module.addParameter(element.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR));
+ String paramName = element.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR);
+ if (paramName == null) {
+ continue;
+ }
+ module.addParameter(paramName);
String defaultValue = element.getAttribute(TmfAnalysisModuleSourceConfigElement.DEFAULT_VALUE_ATTR);
if (defaultValue != null) {
String defaultValue = element.getAttribute(TmfAnalysisModuleSourceConfigElement.DEFAULT_VALUE_ATTR);
if (defaultValue != null) {
- module.setParameter(element.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR), defaultValue);
+ module.setParameter(paramName, defaultValue);
}
}
module.setTrace(trace);
}
}
module.setTrace(trace);
if (elementName.equals(OUTPUT_ELEM)) {
try {
IAnalysisOutput output = (IAnalysisOutput) ce.createExecutableExtension(CLASS_ATTR);
if (elementName.equals(OUTPUT_ELEM)) {
try {
IAnalysisOutput output = (IAnalysisOutput) ce.createExecutableExtension(CLASS_ATTR);
+ if (output == null) {
+ Activator.logWarning("An output could not be created"); //$NON-NLS-1$
+ continue;
+ }
ITmfNewAnalysisModuleListener listener = null;
for (IConfigurationElement childCe : ce.getChildren()) {
if (childCe.getName().equals(ANALYSIS_ID_ELEM)) {
ITmfNewAnalysisModuleListener listener = null;
for (IConfigurationElement childCe : ce.getChildren()) {
if (childCe.getName().equals(ANALYSIS_ID_ELEM)) {
package org.eclipse.tracecompass.tmf.core.analysis;
package org.eclipse.tracecompass.tmf.core.analysis;
+import org.eclipse.jdt.annotation.NonNull;
+
/**
* This class listens when new analysis modules are created and registers an
* output if the module corresponds to the output specifications
/**
* This class listens when new analysis modules are created and registers an
* output if the module corresponds to the output specifications
private final String fAnalysisId;
private final Class<? extends IAnalysisModule> fAnalysisModuleClass;
private final String fAnalysisId;
private final Class<? extends IAnalysisModule> fAnalysisModuleClass;
- private final IAnalysisOutput fOutput;
+ private final @NonNull IAnalysisOutput fOutput;
* @param moduleClass
* The module class this output applies to
*/
* @param moduleClass
* The module class this output applies to
*/
- public TmfNewAnalysisOutputListener(IAnalysisOutput output, String analysisId, Class<? extends IAnalysisModule> moduleClass) {
+ public TmfNewAnalysisOutputListener(@NonNull IAnalysisOutput output, String analysisId, Class<? extends IAnalysisModule> moduleClass) {
fOutput = output;
fAnalysisId = analysisId;
fAnalysisModuleClass = moduleClass;
fOutput = output;
fAnalysisId = analysisId;
fAnalysisModuleClass = moduleClass;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleHelper;
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleHelper;
*/
protected IStatus executeAnalysis() {
MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null);
*/
protected IStatus executeAnalysis() {
MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null);
- Map<String, IAnalysisModuleHelper> modules = TmfAnalysisManager.getAnalysisModules(this.getClass());
+
+ @SuppressWarnings("null")
+ @NonNull Class<? extends TmfTrace> className = this.getClass();
+ Map<String, IAnalysisModuleHelper> modules = TmfAnalysisManager.getAnalysisModules(className);
for (IAnalysisModuleHelper helper : modules.values()) {
try {
IAnalysisModule module = helper.newModule(this);
for (IAnalysisModuleHelper helper : modules.values()) {
try {
IAnalysisModule module = helper.newModule(this);
*/
@Before
public void setUp() {
*/
@Before
public void setUp() {
- fTrace = lostEventsTrace.getTrace();
+ ITmfTrace trace = lostEventsTrace.getTrace();
+ fTrace = trace;
/* Prepare the two analysis-backed state systems */
fTotalsMod = new TmfStatisticsTotalsModule();
fEventTypesMod = new TmfStatisticsEventTypesModule();
try {
/* Prepare the two analysis-backed state systems */
fTotalsMod = new TmfStatisticsTotalsModule();
fEventTypesMod = new TmfStatisticsEventTypesModule();
try {
- fTotalsMod.setTrace(fTrace);
- fEventTypesMod.setTrace(fTrace);
+ fTotalsMod.setTrace(trace);
+ fEventTypesMod.setTrace(trace);
} catch (TmfAnalysisException e) {
fail();
}
} catch (TmfAnalysisException e) {
fail();
}
*/
@Before
public void setUp() {
*/
@Before
public void setUp() {
- fTrace = testTrace.getTrace();
+ ITmfTrace trace = testTrace.getTrace();
+ fTrace = trace;
/* Prepare the two analysis-backed state systems */
fTotalsMod = new TmfStatisticsTotalsModule();
fEventTypesMod = new TmfStatisticsEventTypesModule();
try {
/* Prepare the two analysis-backed state systems */
fTotalsMod = new TmfStatisticsTotalsModule();
fEventTypesMod = new TmfStatisticsEventTypesModule();
try {
- fTotalsMod.setTrace(fTrace);
- fEventTypesMod.setTrace(fTrace);
+ fTotalsMod.setTrace(trace);
+ fEventTypesMod.setTrace(trace);
} catch (TmfAnalysisException e) {
fail();
}
} catch (TmfAnalysisException e) {
fail();
}
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.swt.graphics.TextStyle;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.swt.graphics.TextStyle;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
- private final String fAnalysisId;
+ private final @NonNull String fAnalysisId;
private boolean fCanExecute = true;
/**
private boolean fCanExecute = true;
/**
* @param id
* The analysis module id
*/
* @param id
* The analysis module id
*/
- protected TmfAnalysisElement(String name, IResource resource, ITmfProjectModelElement parent, String id) {
+ protected TmfAnalysisElement(String name, IResource resource, ITmfProjectModelElement parent, @NonNull String id) {
super(name, resource, parent);
fAnalysisId = id;
parent.addChild(this);
super(name, resource, parent);
fAnalysisId = id;
parent.addChild(this);