tmf: Fix NPE for persitent experiment index when using text traces
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Tue, 4 Mar 2014 12:25:45 +0000 (07:25 -0500)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Tue, 4 Mar 2014 19:57:06 +0000 (14:57 -0500)
For text traces the end of a trace is indicated by a NULL_LOCATION.
The NULL_LOCATION has a null pointer for the location info object
(=TmfLongLocation). In an experiment some traces are finished being
read before other traces. When a checkpoint needs to be created
with a NULL_LOCATION for some of the traces an NullPointerExeption
is generated when serializing a checkpoint to the persistent index.

Change-Id: I16aa3afd1d7ab633b53916f7f3a01aefa9094560
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/22846
Tested-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
IP-Clean: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/parsers/custom/CustomTxtTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/parsers/custom/CustomXmlTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTrace.java

index 731f7f9986d97b590c0cf634211fd13e1ac0863e..59dcf3b07cd43b2b82f9adefc2ac6cc1d85f0648 100644 (file)
@@ -53,7 +53,7 @@ import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
  */
 public class CustomTxtTrace extends TmfTrace implements ITmfEventParser, ITmfPersistentlyIndexable {
 
-    private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation((Long) null);
+    private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation(-1L);
     private static final int DEFAULT_CACHE_SIZE = 100;
     private static final int MAX_LINES = 100;
     private static final int MAX_CONFIDENCE = 100;
index 066735eab83e18a37f5bbb8e5cad9563d8299be5..e300a79e89089a5bbd2c34a727492169f5997122 100644 (file)
@@ -63,7 +63,7 @@ import org.xml.sax.SAXParseException;
  */
 public class CustomXmlTrace extends TmfTrace implements ITmfEventParser, ITmfPersistentlyIndexable {
 
-    private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation((Long) null);
+    private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation(-1L);
     private static final int DEFAULT_CACHE_SIZE = 100;
     private static final int MAX_LINES = 100;
     private static final int CONFIDENCE = 100;
index a10c858fe89fa12378d88a82132e5db77ed97418..7e1f066a3176f9ee1d726daa9de6c493912cb2f8 100644 (file)
@@ -55,7 +55,7 @@ import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
  */
 public abstract class TextTrace<T extends TmfEvent> extends TmfTrace implements ITmfEventParser, ITmfPersistentlyIndexable {
 
-    private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation((Long) null);
+    private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation(-1L);
     private static final int MAX_LINES = 100;
     private static final int MAX_CONFIDENCE = 100;
 
This page took 0.026799 seconds and 5 git commands to generate.