@@ -3066,25 +3066,6 @@ abstract class ElementImpl implements Element {
30663066 object.location == location;
30673067 }
30683068
3069- /// Append to the given [buffer] a comma-separated list of the names of the
3070- /// types of this element and every enclosing element.
3071- void appendPathTo (StringBuffer buffer) {
3072- Element element = this ;
3073- while (element != null ) {
3074- if (element != this ) {
3075- buffer.write (', ' );
3076- }
3077- buffer.write (element.runtimeType);
3078- String name = element.name;
3079- if (name != null ) {
3080- buffer.write (' (' );
3081- buffer.write (name);
3082- buffer.write (')' );
3083- }
3084- element = element.enclosingElement;
3085- }
3086- }
3087-
30883069 /// Append a textual representation of this element to the given [buffer] .
30893070 void appendTo (StringBuffer buffer) {
30903071 if (_name == null ) {
@@ -3110,7 +3091,11 @@ abstract class ElementImpl implements Element {
31103091
31113092 @override
31123093 E getAncestor <E extends Element >(Predicate <Element > predicate) {
3113- return getAncestorStatic <E >(_enclosingElement, predicate);
3094+ var ancestor = _enclosingElement;
3095+ while (ancestor != null && ! predicate (ancestor)) {
3096+ ancestor = ancestor.enclosingElement;
3097+ }
3098+ return ancestor as E ;
31143099 }
31153100
31163101 /// Return the child of this element that is uniquely identified by the given
@@ -3214,25 +3199,6 @@ abstract class ElementImpl implements Element {
32143199 element.accept (visitor);
32153200 }
32163201 }
3217-
3218- static int findElementIndexUsingIdentical (List items, Object item) {
3219- int length = items.length;
3220- for (int i = 0 ; i < length; i++ ) {
3221- if (identical (items[i], item)) {
3222- return i;
3223- }
3224- }
3225- throw new StateError ('Unable to find $item in $items ' );
3226- }
3227-
3228- static E getAncestorStatic <E extends Element >(
3229- Element startingPoint, Predicate <Element > predicate) {
3230- Element ancestor = startingPoint;
3231- while (ancestor != null && ! predicate (ancestor)) {
3232- ancestor = ancestor.enclosingElement;
3233- }
3234- return ancestor as E ;
3235- }
32363202}
32373203
32383204/// A concrete implementation of an [ElementLocation] .
0 commit comments