| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java
|
| index dbe078bed4a7d78689e47d62054c142224221951..f0e02c8b4e7879df25c9f9f86a922518f7cdce71 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/Annotation.java
|
| @@ -61,6 +61,12 @@ public class Annotation extends ASTNode {
|
| private ArgumentList arguments;
|
|
|
| /**
|
| + * The element associated with this annotation, or {@code null} if the AST structure has not been
|
| + * resolved or if this annotation could not be resolved.
|
| + */
|
| + private Element element;
|
| +
|
| + /**
|
| * Initialize a newly created annotation.
|
| *
|
| * @param atSign the at sign that introduced the annotation
|
| @@ -128,9 +134,10 @@ public class Annotation extends ASTNode {
|
| * @return the element associated with this annotation
|
| */
|
| public Element getElement() {
|
| - if (constructorName != null) {
|
| - return constructorName.getElement();
|
| - } else if (name != null) {
|
| + if (element != null) {
|
| + return element;
|
| + }
|
| + if (name != null) {
|
| return name.getElement();
|
| }
|
| return null;
|
| @@ -194,6 +201,15 @@ public class Annotation extends ASTNode {
|
| }
|
|
|
| /**
|
| + * Set the element associated with this annotation based.
|
| + *
|
| + * @param element the element to be associated with this identifier
|
| + */
|
| + public void setElement(Element element) {
|
| + this.element = element;
|
| + }
|
| +
|
| + /**
|
| * Set the name of the class defining the constructor that is being invoked or the name of the
|
| * field that is being referenced to the given name.
|
| *
|
|
|