tmf: Support default timestamp output format in custom parsers
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / parsers / custom / CustomTxtTraceDefinition.java
index 4364a23b3ee634b0714f6cb87e6d20eeb44217f8..20371425db4065c1f603e673edc61f819e00702a 100644 (file)
@@ -539,9 +539,11 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             definitionElement.setAttribute(CATEGORY_ATTRIBUTE, categoryName);
             definitionElement.setAttribute(NAME_ATTRIBUTE, definitionName);
 
-            Element formatElement = doc.createElement(TIME_STAMP_OUTPUT_FORMAT_ELEMENT);
-            definitionElement.appendChild(formatElement);
-            formatElement.appendChild(doc.createTextNode(timeStampOutputFormat));
+            if (timeStampOutputFormat != null && !timeStampOutputFormat.isEmpty()) {
+                Element formatElement = doc.createElement(TIME_STAMP_OUTPUT_FORMAT_ELEMENT);
+                definitionElement.appendChild(formatElement);
+                formatElement.appendChild(doc.createTextNode(timeStampOutputFormat));
+            }
 
             if (inputs != null) {
                 for (InputLine inputLine : inputs) {
This page took 0.024602 seconds and 5 git commands to generate.