ctf: remove StructDeclaration#getFields()
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 12 Jan 2016 03:42:01 +0000 (22:42 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 27 Jan 2016 22:39:22 +0000 (17:39 -0500)
this exposes an internal map and can be dangerous

Change-Id: Icc1d5ecbd7d5dc5eab472b314669312ffe26a8a6
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/64118
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/metadata/tsdl/TypeSpecifierListParser.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/metadata/tsdl/trace/TraceDeclarationParser.java

index 733bd22ef0e704aa30f9627f7fcc9c3a7444b82b..83fb2e2198dc0515334da7399e43cf2661de2683 100644 (file)
@@ -92,15 +92,6 @@ public class StructDeclaration extends Declaration {
         return fFieldMap.containsKey(name);
     }
 
-    /**
-     * Get the fields of the struct as a map.
-     *
-     * @return a Map of the fields (key is the name)
-     */
-    public Map<String, IDeclaration> getFields() {
-        return fFieldMap;
-    }
-
     /**
      * Get the field declaration corresponding to a field name.
      *
index 29712309d85233e2ee555fefc356a9385891e9b6..b21ab57bea661db7270a80bee2f705e12c5b171c 100644 (file)
@@ -127,7 +127,7 @@ public final class TypeSpecifierListParser extends AbstractScopedCommonTreeParse
         case CTFParser.STRUCT:
             declaration = StructParser.INSTANCE.parse(firstChild, new StructParser.Param(trace, identifier, scope));
             StructDeclaration structDeclaration = (StructDeclaration) declaration;
-            IDeclaration idEnumDecl = structDeclaration.getFields().get("id"); //$NON-NLS-1$
+            IDeclaration idEnumDecl = structDeclaration.getField("id"); //$NON-NLS-1$
             if (idEnumDecl instanceof EnumDeclaration) {
                 EnumDeclaration enumDeclaration = (EnumDeclaration) idEnumDecl;
                 ByteOrder bo = enumDeclaration.getContainerType().getByteOrder();
index c9a8b0e650117eaedc992a92c1e38aeb0fb54dc9..cce4a194233eb44ec2fb56805ff26f9ae3cc6966 100644 (file)
@@ -274,7 +274,7 @@ public final class TraceDeclarationParser extends AbstractScopedCommonTreeParser
                             decl.isSigned(), decl.getBase(), byteOrder,
                             decl.getEncoding(), decl.getClock(),
                             decl.getAlignment());
-                    sd.getFields().put(s, newI);
+                    sd.addField(s, newI);
                 }
             }
         }
This page took 0.028581 seconds and 5 git commands to generate.