X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tmf%2Forg.eclipse.tracecompass.tmf.analysis.xml.core%2Fsrc%2Forg%2Feclipse%2Ftracecompass%2Ftmf%2Fanalysis%2Fxml%2Fcore%2Fmodel%2Freadwrite%2FTmfXmlReadWriteStateValue.java;h=42f40755892d9ca883275ef50fbbba90b9ac0e8a;hb=a194b17a541b7389cd960ff4d5ee6d04440ee4b7;hp=d92d20d74f5245eb8eb3a1045c9df890cc2c86ea;hpb=42f8feff1c760791ebc9224ca1625238d787bfac;p=deliverable%2Ftracecompass.git 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 d92d20d74f..42f4075589 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 @@ -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);