From: Alexandre Montplaisir Date: Thu, 17 May 2012 18:54:00 +0000 (-0400) Subject: tmf: Correctly store null state values in the backend X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=6a4fd49261a53b42a252b27feb2c9f09af18ec89;p=deliverable%2Ftracecompass.git tmf: Correctly store null state values in the backend Signed-off-by: Alexandre Montplaisir --- diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/backend/historytree/HTInterval.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/backend/historytree/HTInterval.java index 677d6517df..f8fc536abe 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/backend/historytree/HTInterval.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/backend/historytree/HTInterval.java @@ -171,19 +171,16 @@ final class HTInterval implements ITmfStateInterval, Comparable { byteArrayToWrite = sv.toByteArray(); if (byteArrayToWrite == null) { - /* We write the 'valueOffset' field as a straight value */ - if (sv.isNull()) { - buffer.putInt(0); - } else { - try { - buffer.putInt(sv.unboxInt()); - } catch (StateValueTypeException e) { - /* - * This should not happen, since the value told us it was of - * type Integer (corrupted value?) - */ - e.printStackTrace(); - } + /* We write the 'valueOffset' field as a straight value. In the case + * of a null value, it will be unboxed as -1 */ + try { + buffer.putInt(sv.unboxInt()); + } catch (StateValueTypeException e) { + /* + * This should not happen, since the value told us it was of + * type Null or Integer (corrupted value?) + */ + e.printStackTrace(); } return 0; /* we didn't use a Strings section entry */