ss: Mark ITmfStateSystem#queryOngoingState as @NonNull
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Fri, 18 Mar 2016 06:42:16 +0000 (02:42 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Wed, 30 Mar 2016 00:28:09 +0000 (20:28 -0400)
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 <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/68815
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/ITmfStateSystem.java
tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlCondition.java
tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/readwrite/TmfXmlReadWriteStateValue.java

index 8af7d09953ad3b693f64194d3e54b0dde11d9d72..34a607b48fc93baa4d01885788cb2cf70b9419fe 100644 (file)
@@ -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;
 
     /**
index 29ea73f9f5ecc59b7b5d32094c0f832c7300e40b..efef34bcc38747cc94db8616a23625545022430e 100644 (file)
@@ -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;
index 2f89efcfde40af695c34ecebe72b03cd5eb49d0e..06e590662d3ebe850d03b3e1ae7070f49a7fdf12 100644 (file)
@@ -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;
         }
This page took 0.028562 seconds and 5 git commands to generate.