tmf : Remove literals duplication in TmfXmlReadWriteStateValue
authorJean-Christian Kouame <jean-christian.kouame@ericsson.com>
Thu, 19 Nov 2015 21:29:21 +0000 (16:29 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Sat, 21 Nov 2015 01:41:43 +0000 (20:41 -0500)
Change-Id: I4b1a8f7323d6f47344565a0cb3a1f8d9854b4d41
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/60831
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/readwrite/TmfXmlReadWriteStateValue.java

index d92d20d74f5245eb8eb3a1045c9df890cc2c86ea..42f40755892d9ca883275ef50fbbba90b9ac0e8a 100644 (file)
@@ -44,6 +44,8 @@ import org.w3c.dom.Element;
  */
 public class TmfXmlReadWriteStateValue extends TmfXmlStateValue {
 
+    private static final String ILLEGAL_STATE_EXCEPTION_MESSAGE = "The state system hasn't been initialized yet"; //$NON-NLS-1$
+
     /**
      * Constructor where the path to the value is a list of state attributes
      *
@@ -175,7 +177,7 @@ public class TmfXmlReadWriteStateValue extends TmfXmlStateValue {
         protected void processValue(int quark, long timestamp, ITmfStateValue value) throws AttributeNotFoundException, TimeRangeException, StateValueTypeException {
             ITmfStateSystemBuilder ss = getStateSystem();
             if (ss == null) {
-                throw new IllegalStateException("The state system hasn't been initialized yet"); //$NON-NLS-1$
+                throw new IllegalStateException(ILLEGAL_STATE_EXCEPTION_MESSAGE);
             }
             switch (getStackType()) {
             case POP:
@@ -196,7 +198,7 @@ public class TmfXmlReadWriteStateValue extends TmfXmlStateValue {
         protected void incrementValue(ITmfEvent event, int quark, long timestamp) throws StateValueTypeException, TimeRangeException, AttributeNotFoundException {
             ITmfStateSystemBuilder ss = getStateSystem();
             if (ss == null) {
-                throw new IllegalStateException("The state system hasn't been initialized yet"); //$NON-NLS-1$
+                throw new IllegalStateException(ILLEGAL_STATE_EXCEPTION_MESSAGE);
             }
             ss.incrementAttribute(timestamp, quark);
         }
@@ -245,7 +247,7 @@ public class TmfXmlReadWriteStateValue extends TmfXmlStateValue {
         public void incrementValue(ITmfEvent event, int quark, long timestamp) throws StateValueTypeException, TimeRangeException, AttributeNotFoundException {
             ITmfStateSystem ss = getStateSystem();
             if (ss == null) {
-                throw new IllegalStateException("The state system hasn't been initialized yet"); //$NON-NLS-1$
+                throw new IllegalStateException(ILLEGAL_STATE_EXCEPTION_MESSAGE);
             }
             ITmfStateValue value = incrementByType(quark, ss, fValue);
             if (value != null) {
@@ -279,7 +281,7 @@ public class TmfXmlReadWriteStateValue extends TmfXmlStateValue {
         public void incrementValue(ITmfEvent event, int quark, long timestamp) throws StateValueTypeException, TimeRangeException, AttributeNotFoundException {
             ITmfStateSystem ss = getSsContainer().getStateSystem();
             if (ss == null) {
-                throw new IllegalStateException("The state system hasn't been initialized yet"); //$NON-NLS-1$
+                throw new IllegalStateException(ILLEGAL_STATE_EXCEPTION_MESSAGE);
             }
             ITmfStateValue incrementValue = getValue(event);
             ITmfStateValue value = incrementByType(quark, ss, incrementValue);
@@ -341,7 +343,7 @@ public class TmfXmlReadWriteStateValue extends TmfXmlStateValue {
             int quarkQuery = IXmlStateSystemContainer.ROOT_QUARK;
             ITmfStateSystem ss = getStateSystem();
             if (ss == null) {
-                throw new IllegalStateException("The state system hasn't been initialized yet"); //$NON-NLS-1$
+                throw new IllegalStateException(ILLEGAL_STATE_EXCEPTION_MESSAGE);
             }
 
             for (ITmfXmlStateAttribute attribute : fQueryValue) {
@@ -368,7 +370,7 @@ public class TmfXmlReadWriteStateValue extends TmfXmlStateValue {
         public void incrementValue(ITmfEvent event, int quark, long timestamp) throws StateValueTypeException, TimeRangeException, AttributeNotFoundException {
             ITmfStateSystem ss = getStateSystem();
             if (ss == null) {
-                throw new IllegalStateException("The state system hasn't been initialized yet"); //$NON-NLS-1$
+                throw new IllegalStateException(ILLEGAL_STATE_EXCEPTION_MESSAGE);
             }
 
             ITmfStateValue incrementValue = getValue(event);
This page took 0.028106 seconds and 5 git commands to generate.