Since there is no abstract method or other compile-time check, we can't
expect all modules to know they have to specify an ID. If they don't, we'll
infer one from the full class name instead of filling the log with errors.
Change-Id: Id1f83dcb782573aa87b2128a3864a85c4cdcffd3
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/33084
Tested-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
*/
public abstract class TmfAbstractAnalysisModule extends TmfComponent implements IAnalysisModule {
- @NonNull private static final String UNDEFINED_ID = "undefined"; //$NON-NLS-1$
-
private String fName, fId;
private boolean fAutomatic = false, fStarted = false;
private ITmfTrace fTrace;
public String getId() {
String id = fId;
if (id == null) {
- Activator.logError("Analysis module getId(): the id should not be null in class " + this.getClass().getSimpleName()); //$NON-NLS-1$
- return UNDEFINED_ID;
+ id = new String(this.getClass().getCanonicalName());
+ fId = id;
}
return id;
}