Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: dart/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java (revision 29808)
+++ dart/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java (working copy)
@@ -16,11 +16,13 @@
import com.google.dart.engine.ast.Identifier;
import com.google.dart.engine.context.AnalysisContext;
import com.google.dart.engine.context.AnalysisException;
+import com.google.dart.engine.element.ConstructorElement;
import com.google.dart.engine.element.Element;
import com.google.dart.engine.element.ElementAnnotation;
import com.google.dart.engine.element.ElementLocation;
import com.google.dart.engine.element.ElementVisitor;
import com.google.dart.engine.element.LibraryElement;
+import com.google.dart.engine.element.PropertyAccessorElement;
import com.google.dart.engine.source.Source;
import com.google.dart.engine.utilities.collection.BooleanArray;
import com.google.dart.engine.utilities.general.StringUtilities;
@@ -197,6 +199,28 @@
}
@Override
+ public boolean isDeprecated() {
+ for (ElementAnnotation annotation : metadata) {
+ Element element = annotation.getElement();
+ if (element != null) {
+ LibraryElement lib = element.getLibrary();
+ if (lib != null && lib.isDartCore()) {
+ if (element instanceof ConstructorElement) {
+ ConstructorElement constructorElement = (ConstructorElement) element;
+ if (constructorElement.getEnclosingElement().getName().equals("Deprecated")) {
+ return true;
+ }
+ } else if (element instanceof PropertyAccessorElement
+ && element.getName().equals("deprecated")) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
public boolean isSynthetic() {
return hasModifier(Modifier.SYNTHETIC);
}

Powered by Google App Engine
This is Rietveld 408576698