Deprecate isProxy / isOrInheritsProxy in ClassElement.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ied4011961d4dece33d527888d274893985d85f93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141767
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analysis_server/lib/src/status/element_writer.dart b/pkg/analysis_server/lib/src/status/element_writer.dart
index 8c092f0..929313a 100644
--- a/pkg/analysis_server/lib/src/status/element_writer.dart
+++ b/pkg/analysis_server/lib/src/status/element_writer.dart
@@ -45,8 +45,6 @@
       properties['isAbstract'] = element.isAbstract;
       properties['isEnum'] = element.isEnum;
       properties['isMixinApplication'] = element.isMixinApplication;
-      properties['isOrInheritsProxy'] = element.isOrInheritsProxy;
-      properties['isProxy'] = element.isProxy;
       properties['isValidMixin'] = element.isValidMixin;
       properties['mixins'] = element.mixins;
       properties['superclassConstraints'] = element.superclassConstraints;
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 4cba348..4841b13 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -119,9 +119,15 @@
 
   /// Return `true` if this class [isProxy], or if it inherits the proxy
   /// annotation from a supertype.
+  @Deprecated(
+    'The @proxy annotation is deprecated in the langauge, and will be removed',
+  )
   bool get isOrInheritsProxy;
 
   /// Return `true` if this element has an annotation of the form '@proxy'.
+  @Deprecated(
+    'The @proxy annotation is deprecated in the langauge, and will be removed',
+  )
   bool get isProxy;
 
   /// Return `true` if this class can validly be used as a mixin when defining
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index b525ca8..5422092 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -759,18 +759,10 @@
   }
 
   @override
-  bool get isOrInheritsProxy =>
-      _safeIsOrInheritsProxy(this, HashSet<ClassElement>());
+  bool get isOrInheritsProxy => false;
 
   @override
-  bool get isProxy {
-    for (ElementAnnotation annotation in metadata) {
-      if (annotation.isProxy) {
-        return true;
-      }
-    }
-    return false;
-  }
+  bool get isProxy => false;
 
   @override
   bool get isSimplyBounded {
@@ -1184,33 +1176,6 @@
         !type.isDartCoreFunction;
   }
 
-  bool _safeIsOrInheritsProxy(
-      ClassElement element, HashSet<ClassElement> visited) {
-    if (visited.contains(element)) {
-      return false;
-    }
-    visited.add(element);
-    if (element.isProxy) {
-      return true;
-    } else if (element.supertype != null &&
-        _safeIsOrInheritsProxy(element.supertype.element, visited)) {
-      return true;
-    }
-    List<InterfaceType> supertypes = element.interfaces;
-    for (int i = 0; i < supertypes.length; i++) {
-      if (_safeIsOrInheritsProxy(supertypes[i].element, visited)) {
-        return true;
-      }
-    }
-    supertypes = element.mixins;
-    for (int i = 0; i < supertypes.length; i++) {
-      if (_safeIsOrInheritsProxy(supertypes[i].element, visited)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
   static void collectAllSupertypes(List<InterfaceType> supertypes,
       InterfaceType startingType, InterfaceType excludeType) {
     List<InterfaceType> typesToVisit = <InterfaceType>[];