tmf: Use the class name if no ID is specified for analysis modules
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 8 Sep 2014 22:47:52 +0000 (18:47 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 9 Sep 2014 20:21:34 +0000 (16:21 -0400)
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>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAbstractAnalysisModule.java

index 4747c733e16f5409214e491d31dc83d8095e945c..ad65810ab3bdc8713b1ba63f626f68d648cbe1ed 100644 (file)
@@ -47,8 +47,6 @@ import org.eclipse.osgi.util.NLS;
  */
 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;
@@ -90,8 +88,8 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
     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;
     }
This page took 0.026865 seconds and 5 git commands to generate.