From: Alexandre Montplaisir Date: Fri, 18 Mar 2016 06:42:16 +0000 (-0400) Subject: ss: Mark ITmfStateSystem#queryOngoingState as @NonNull X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=6d0db5b118dc92d412bd69fe22ba5ece03d30421;p=deliverable%2Ftracecompass.git ss: Mark ITmfStateSystem#queryOngoingState as @NonNull Just like querySingleState, an ongoing state cannot be null if the passed attribute is valid. At worst the value can be a NullStateValue. Change-Id: I138ce6d0d62a0cb45706117fd4d0e4bdf8e8fc58 Signed-off-by: Alexandre Montplaisir Reviewed-on: https://git.eclipse.org/r/68815 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle Tested-by: Marc-Andre Laperle --- diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/ITmfStateSystem.java b/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/ITmfStateSystem.java index 8af7d09953..34a607b48f 100644 --- a/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/ITmfStateSystem.java +++ b/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/ITmfStateSystem.java @@ -345,7 +345,7 @@ public interface ITmfStateSystem { * @throws AttributeNotFoundException * If the requested attribute is invalid */ - ITmfStateValue queryOngoingState(int attributeQuark) + @NonNull ITmfStateValue queryOngoingState(int attributeQuark) throws AttributeNotFoundException; /** diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlCondition.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlCondition.java index 29ea73f9f5..efef34bcc3 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlCondition.java +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlCondition.java @@ -270,9 +270,6 @@ public class TmfXmlCondition { * found in the event */ ITmfStateValue valueState = (quark != IXmlStateSystemContainer.ROOT_QUARK) ? ss.queryOngoingState(quark) : filter.getEventFieldValue(event); - if (valueState == null) { - throw new IllegalStateException("TmfXmlCondition : The state value does not exist in the state system"); //$NON-NLS-1$ - } /* Get the value to compare to from the XML file */ ITmfStateValue valueXML; diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/readwrite/TmfXmlReadWriteStateValue.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/readwrite/TmfXmlReadWriteStateValue.java index 2f89efcfde..06e590662d 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/readwrite/TmfXmlReadWriteStateValue.java +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/readwrite/TmfXmlReadWriteStateValue.java @@ -379,9 +379,6 @@ public class TmfXmlReadWriteStateValue extends TmfXmlStateValue { */ if (quarkQuery != IXmlStateSystemContainer.ERROR_QUARK) { value = ss.queryOngoingState(quarkQuery); - if (value == null) { - throw new IllegalStateException(); - } } return value; }