xml analysis: internalize strings.
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.analysis.xml.core / src / org / eclipse / tracecompass / tmf / analysis / xml / core / model / TmfXmlStateAttribute.java
index 6e9e6caad9d44949828f5828fb5b120e8fa01a3e..bae5c4e1fae25ff3c3affff8e0dc853d9de0833e 100644 (file)
@@ -94,15 +94,15 @@ public abstract class TmfXmlStateAttribute implements ITmfXmlStateAttribute {
         switch (attribute.getAttribute(TmfXmlStrings.TYPE)) {
         case TmfXmlStrings.TYPE_CONSTANT:
             fType = StateAttributeType.CONSTANT;
-            fName = fContainer.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE));
+            fName = getAttributeName(attribute);
             break;
         case TmfXmlStrings.EVENT_FIELD:
             fType = StateAttributeType.EVENTFIELD;
-            fName = fContainer.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE));
+            fName = getAttributeName(attribute);
             break;
         case TmfXmlStrings.TYPE_LOCATION:
             fType = StateAttributeType.LOCATION;
-            fName = fContainer.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE));
+            fName = getAttributeName(attribute);
             break;
         case TmfXmlStrings.TYPE_QUERY:
             List<@Nullable Element> childElements = XmlUtils.getChildElements(attribute);
@@ -118,7 +118,7 @@ public abstract class TmfXmlStateAttribute implements ITmfXmlStateAttribute {
             break;
         case TmfXmlStrings.TYPE_EVENT_NAME:
             fType = StateAttributeType.EVENTNAME;
-            fName = fContainer.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE));
+            fName = getAttributeName(attribute);
             break;
         case TmfXmlStrings.NULL:
             fType = StateAttributeType.NONE;
@@ -133,6 +133,10 @@ public abstract class TmfXmlStateAttribute implements ITmfXmlStateAttribute {
         }
     }
 
+    private String getAttributeName(Element attribute) {
+        return fContainer.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE)).intern();
+    }
+
     /**
      * @since 2.0
      */
This page took 0.024587 seconds and 5 git commands to generate.