| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/ClassDeclaration.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/ClassDeclaration.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/ClassDeclaration.java
|
| index 43b0d35d65b0d2cf5ecb41ab4e212e2c8e296bae..9c05e0550edbd1f2e79678d1b21f9aa4a2056ca2 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/ClassDeclaration.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/ClassDeclaration.java
|
| @@ -166,6 +166,28 @@ public class ClassDeclaration extends CompilationUnitMember {
|
| }
|
|
|
| /**
|
| + * Return the field declared in the class with the given name.
|
| + *
|
| + * @param name the name of the field to find
|
| + * @return the found field or {@code null} if not found
|
| + */
|
| + public VariableDeclaration getField(String name) {
|
| + for (ClassMember classMember : members) {
|
| + if (classMember instanceof FieldDeclaration) {
|
| + FieldDeclaration fieldDeclaration = (FieldDeclaration) classMember;
|
| + NodeList<VariableDeclaration> fields = fieldDeclaration.getFields().getVariables();
|
| + for (VariableDeclaration field : fields) {
|
| + SimpleIdentifier fieldName = field.getName();
|
| + if (fieldName != null && name.equals(fieldName.getName())) {
|
| + return field;
|
| + }
|
| + }
|
| + }
|
| + }
|
| + return null;
|
| + }
|
| +
|
| + /**
|
| * Return the implements clause for the class, or {@code null} if the class does not implement any
|
| * interfaces.
|
| *
|
|
|