Use the NonNull utility methods where we can
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.analysis.xml.ui / src / org / eclipse / tracecompass / tmf / analysis / xml / ui / module / TmfAnalysisModuleHelperXml.java
index 527c944613ff646a35f69cd80b15b3fc30baa6a7..68a38298695facd1f0976b8dd5291267c626f976 100644 (file)
@@ -12,6 +12,8 @@
 
 package org.eclipse.tracecompass.tmf.analysis.xml.ui.module;
 
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
 import java.io.File;
 import java.util.Collections;
 import java.util.List;
@@ -70,7 +72,11 @@ public class TmfAnalysisModuleHelperXml implements IAnalysisModuleHelper {
 
     @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
+         */
+        return checkNotNull(fSourceElement.getAttribute(TmfXmlStrings.ID));
     }
 
     @Override
This page took 0.024635 seconds and 5 git commands to generate.