diff --git a/pkg/analyzer/lib/source/line_info.dart b/pkg/analyzer/lib/source/line_info.dart index 41ce1acdac3..fb794c1d163 100644 --- a/pkg/analyzer/lib/source/line_info.dart +++ b/pkg/analyzer/lib/source/line_info.dart @@ -15,10 +15,10 @@ class CharacterLocation { CharacterLocation(this.lineNumber, this.columnNumber); @override - bool operator ==(Object object) => - object is CharacterLocation && - lineNumber == object.lineNumber && - columnNumber == object.columnNumber; + bool operator ==(Object other) => + other is CharacterLocation && + lineNumber == other.lineNumber && + columnNumber == other.columnNumber; @override String toString() => '$lineNumber:$columnNumber'; diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart index b033bbe885e..8d19a4a70fa 100644 --- a/pkg/analyzer/lib/src/dart/ast/ast.dart +++ b/pkg/analyzer/lib/src/dart/ast/ast.dart @@ -58,8 +58,8 @@ class AdjacentStringsImpl extends StringLiteralImpl implements AdjacentStrings { E? accept(AstVisitor visitor) => visitor.visitAdjacentStrings(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitAdjacentStrings(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitAdjacentStrings(this, contextType: contextType); } @override @@ -460,8 +460,8 @@ class AsExpressionImpl extends ExpressionImpl implements AsExpression { E? accept(AstVisitor visitor) => visitor.visitAsExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitAsExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitAsExpression(this, contextType: contextType); } @override @@ -710,8 +710,8 @@ class AssignmentExpressionImpl extends ExpressionImpl visitor.visitAssignmentExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitAssignmentExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitAssignmentExpression(this, contextType: contextType); } @override @@ -721,8 +721,8 @@ class AssignmentExpressionImpl extends ExpressionImpl } @override - bool _extendsNullShorting(Expression child) => - identical(child, _leftHandSide); + bool _extendsNullShorting(Expression descendant) => + identical(descendant, _leftHandSide); } /// A node in the AST structure for a Dart program. @@ -889,8 +889,8 @@ class AwaitExpressionImpl extends ExpressionImpl implements AwaitExpression { E? accept(AstVisitor visitor) => visitor.visitAwaitExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitAwaitExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitAwaitExpression(this, contextType: contextType); } @override @@ -962,8 +962,8 @@ class BinaryExpressionImpl extends ExpressionImpl implements BinaryExpression { E? accept(AstVisitor visitor) => visitor.visitBinaryExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitBinaryExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitBinaryExpression(this, contextType: contextType); } @override @@ -1124,8 +1124,8 @@ class BooleanLiteralImpl extends LiteralImpl implements BooleanLiteral { E? accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitBooleanLiteral(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitBooleanLiteral(this, contextType: contextType); } @override @@ -1260,8 +1260,8 @@ class CascadeExpressionImpl extends ExpressionImpl E? accept(AstVisitor visitor) => visitor.visitCascadeExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitCascadeExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitCascadeExpression(this, contextType: contextType); } @override @@ -2339,8 +2339,8 @@ class ConditionalExpressionImpl extends ExpressionImpl visitor.visitConditionalExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitConditionalExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitConditionalExpression(this, contextType: contextType); } @override @@ -2846,8 +2846,8 @@ class ConstructorReferenceImpl extends CommentReferableExpressionImpl visitor.visitConstructorReference(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitConstructorReference(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitConstructorReference(this, contextType: contextType); } @override @@ -3336,8 +3336,8 @@ class DoubleLiteralImpl extends LiteralImpl implements DoubleLiteral { E? accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitDoubleLiteral(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitDoubleLiteral(this, contextType: contextType); } @override @@ -5332,8 +5332,8 @@ class FunctionExpressionImpl extends ExpressionImpl E? accept(AstVisitor visitor) => visitor.visitFunctionExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitFunctionExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitFunctionExpression(this, contextType: contextType); } @override @@ -5399,8 +5399,8 @@ class FunctionExpressionInvocationImpl extends InvocationExpressionImpl visitor.visitFunctionExpressionInvocation(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitFunctionExpressionInvocation(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitFunctionExpressionInvocation(this, contextType: contextType); } @override @@ -5411,7 +5411,8 @@ class FunctionExpressionInvocationImpl extends InvocationExpressionImpl } @override - bool _extendsNullShorting(Expression child) => identical(child, _function); + bool _extendsNullShorting(Expression descendant) => + identical(descendant, _function); } /// An expression representing a reference to a function, possibly with type @@ -5464,8 +5465,8 @@ class FunctionReferenceImpl extends CommentReferableExpressionImpl E? accept(AstVisitor visitor) => visitor.visitFunctionReference(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitFunctionReference(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitFunctionReference(this, contextType: contextType); } @override @@ -6526,8 +6527,8 @@ class IndexExpressionImpl extends ExpressionImpl } @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitIndexExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitIndexExpression(this, contextType: contextType); } @override @@ -6537,7 +6538,8 @@ class IndexExpressionImpl extends ExpressionImpl } @override - bool _extendsNullShorting(Expression child) => identical(child, _target); + bool _extendsNullShorting(Expression descendant) => + identical(descendant, _target); } /// An instance creation expression. @@ -6639,8 +6641,8 @@ class InstanceCreationExpressionImpl extends ExpressionImpl visitor.visitInstanceCreationExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitInstanceCreationExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitInstanceCreationExpression(this, contextType: contextType); } @override @@ -6701,8 +6703,8 @@ class IntegerLiteralImpl extends LiteralImpl implements IntegerLiteral { E? accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitIntegerLiteral(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitIntegerLiteral(this, contextType: contextType); } @override @@ -6977,8 +6979,8 @@ class IsExpressionImpl extends ExpressionImpl implements IsExpression { E? accept(AstVisitor visitor) => visitor.visitIsExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitIsExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitIsExpression(this, contextType: contextType); } @override @@ -7276,8 +7278,8 @@ class ListLiteralImpl extends TypedLiteralImpl implements ListLiteral { E? accept(AstVisitor visitor) => visitor.visitListLiteral(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitListLiteral(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitListLiteral(this, contextType: contextType); } @override @@ -7696,8 +7698,8 @@ class MethodInvocationImpl extends InvocationExpressionImpl E? accept(AstVisitor visitor) => visitor.visitMethodInvocation(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitMethodInvocation(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitMethodInvocation(this, contextType: contextType); } @override @@ -7709,7 +7711,8 @@ class MethodInvocationImpl extends InvocationExpressionImpl } @override - bool _extendsNullShorting(Expression child) => identical(child, _target); + bool _extendsNullShorting(Expression descendant) => + identical(descendant, _target); } /// The declaration of a mixin. @@ -8205,13 +8208,13 @@ class NodeListImpl with ListMixin implements NodeList { } @override - void add(E node) { - insert(length, node); + void add(E element) { + insert(length, element); } @override - void addAll(Iterable nodes) { - for (E node in nodes) { + void addAll(Iterable iterable) { + for (E node in iterable) { _elements.add(node); _owner._becomeParentOf(node as AstNodeImpl); } @@ -8223,9 +8226,9 @@ class NodeListImpl with ListMixin implements NodeList { } @override - void insert(int index, E node) { - _elements.insert(index, node); - _owner._becomeParentOf(node as AstNodeImpl); + void insert(int index, E element) { + _elements.insert(index, element); + _owner._becomeParentOf(element as AstNodeImpl); } @override @@ -8389,8 +8392,8 @@ class NullLiteralImpl extends LiteralImpl implements NullLiteral { E? accept(AstVisitor visitor) => visitor.visitNullLiteral(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitNullLiteral(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitNullLiteral(this, contextType: contextType); } @override @@ -8531,8 +8534,8 @@ class ParenthesizedExpressionImpl extends ExpressionImpl visitor.visitParenthesizedExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitParenthesizedExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitParenthesizedExpression(this, contextType: contextType); } @override @@ -8734,8 +8737,8 @@ class PostfixExpressionImpl extends ExpressionImpl E? accept(AstVisitor visitor) => visitor.visitPostfixExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitPostfixExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitPostfixExpression(this, contextType: contextType); } @override @@ -8744,7 +8747,8 @@ class PostfixExpressionImpl extends ExpressionImpl } @override - bool _extendsNullShorting(Expression child) => identical(child, operand); + bool _extendsNullShorting(Expression descendant) => + identical(descendant, operand); } /// An identifier that is prefixed or an access to an object property where the @@ -8825,8 +8829,8 @@ class PrefixedIdentifierImpl extends IdentifierImpl E? accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitPrefixedIdentifier(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitPrefixedIdentifier(this, contextType: contextType); } @override @@ -8904,8 +8908,8 @@ class PrefixExpressionImpl extends ExpressionImpl E? accept(AstVisitor visitor) => visitor.visitPrefixExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitPrefixExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitPrefixExpression(this, contextType: contextType); } @override @@ -8914,8 +8918,8 @@ class PrefixExpressionImpl extends ExpressionImpl } @override - bool _extendsNullShorting(Expression child) => - identical(child, operand) && operator.type.isIncrementOperator; + bool _extendsNullShorting(Expression descendant) => + identical(descendant, operand) && operator.type.isIncrementOperator; } /// The access of a property of an object. @@ -9023,8 +9027,8 @@ class PropertyAccessImpl extends CommentReferableExpressionImpl E? accept(AstVisitor visitor) => visitor.visitPropertyAccess(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitPropertyAccess(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitPropertyAccess(this, contextType: contextType); } @override @@ -9034,7 +9038,8 @@ class PropertyAccessImpl extends CommentReferableExpressionImpl } @override - bool _extendsNullShorting(Expression child) => identical(child, _target); + bool _extendsNullShorting(Expression descendant) => + identical(descendant, _target); } /// The invocation of a constructor in the same class from within a @@ -9144,8 +9149,8 @@ class RethrowExpressionImpl extends ExpressionImpl E? accept(AstVisitor visitor) => visitor.visitRethrowExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitRethrowExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitRethrowExpression(this, contextType: contextType); } @override @@ -9748,8 +9753,8 @@ class SimpleIdentifierImpl extends IdentifierImpl implements SimpleIdentifier { } @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitSimpleIdentifier(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitSimpleIdentifier(this, contextType: contextType); } @override @@ -9827,8 +9832,8 @@ class SimpleStringLiteralImpl extends SingleStringLiteralImpl E? accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitSimpleStringLiteral(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitSimpleStringLiteral(this, contextType: contextType); } @override @@ -10238,8 +10243,8 @@ class SuperExpressionImpl extends ExpressionImpl implements SuperExpression { E? accept(AstVisitor visitor) => visitor.visitSuperExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitSuperExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitSuperExpression(this, contextType: contextType); } @override @@ -10622,8 +10627,8 @@ class SymbolLiteralImpl extends LiteralImpl implements SymbolLiteral { E? accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitSymbolLiteral(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitSymbolLiteral(this, contextType: contextType); } @override @@ -10661,8 +10666,8 @@ class ThisExpressionImpl extends ExpressionImpl implements ThisExpression { E? accept(AstVisitor visitor) => visitor.visitThisExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitThisExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitThisExpression(this, contextType: contextType); } @override @@ -10715,8 +10720,8 @@ class ThrowExpressionImpl extends ExpressionImpl implements ThrowExpression { E? accept(AstVisitor visitor) => visitor.visitThrowExpression(this); @override - void resolveExpression(ResolverVisitor visitor, DartType? contextType) { - visitor.visitThrowExpression(this, contextType: contextType); + void resolveExpression(ResolverVisitor resolver, DartType? contextType) { + resolver.visitThrowExpression(this, contextType: contextType); } @override diff --git a/pkg/analyzer/lib/src/dart/constant/value.dart b/pkg/analyzer/lib/src/dart/constant/value.dart index 92ea903d0bb..04506a40609 100644 --- a/pkg/analyzer/lib/src/dart/constant/value.dart +++ b/pkg/analyzer/lib/src/dart/constant/value.dart @@ -48,8 +48,8 @@ class BoolState extends InstanceState { String get typeName => "bool"; @override - bool operator ==(Object object) => - object is BoolState && identical(value, object.value); + bool operator ==(Object other) => + other is BoolState && identical(value, other.value); @override BoolState convertToBool() => this; @@ -211,10 +211,10 @@ class DartObjectImpl implements DartObject { List? get typeArguments => (_state as FunctionState)._typeArguments; @override - bool operator ==(Object object) { - if (object is DartObjectImpl) { - return _typeSystem.runtimeTypesEqual(type, object.type) && - _state == object._state; + bool operator ==(Object other) { + if (other is DartObjectImpl) { + return _typeSystem.runtimeTypesEqual(type, other.type) && + _state == other._state; } return false; } @@ -979,8 +979,8 @@ class DoubleState extends NumState { String get typeName => "double"; @override - bool operator ==(Object object) => - object is DoubleState && (value == object.value); + bool operator ==(Object other) => + other is DoubleState && (value == other.value); @override NumState add(InstanceState rightOperand) { @@ -1289,22 +1289,22 @@ class FunctionState extends InstanceState { String get typeName => "Function"; @override - bool operator ==(Object object) { - if (object is! FunctionState) { + bool operator ==(Object other) { + if (other is! FunctionState) { return false; } - if (_element != object._element) { + if (_element != other._element) { return false; } var typeArguments = _typeArguments; - var otherTypeArguments = object._typeArguments; + var otherTypeArguments = other._typeArguments; if (typeArguments == null || otherTypeArguments == null) { return typeArguments == null && otherTypeArguments == null; } if (typeArguments.length != otherTypeArguments.length) { return false; } - if (_viaTypeAlias != object._viaTypeAlias) { + if (_viaTypeAlias != other._viaTypeAlias) { return false; } for (var i = 0; i < typeArguments.length; i++) { @@ -1412,18 +1412,18 @@ class GenericState extends InstanceState { String get typeName => "user defined type"; @override - bool operator ==(Object object) { - if (object is GenericState) { + bool operator ==(Object other) { + if (other is GenericState) { HashSet otherFields = - HashSet.from(object._fieldMap.keys.toSet()); + HashSet.from(other._fieldMap.keys.toSet()); for (String fieldName in _fieldMap.keys.toSet()) { - if (_fieldMap[fieldName] != object._fieldMap[fieldName]) { + if (_fieldMap[fieldName] != other._fieldMap[fieldName]) { return false; } otherFields.remove(fieldName); } for (String fieldName in otherFields) { - if (object._fieldMap[fieldName] != _fieldMap[fieldName]) { + if (other._fieldMap[fieldName] != _fieldMap[fieldName]) { return false; } } @@ -1897,8 +1897,7 @@ class IntState extends NumState { String get typeName => "int"; @override - bool operator ==(Object object) => - object is IntState && (value == object.value); + bool operator ==(Object other) => other is IntState && (value == other.value); @override NumState add(InstanceState rightOperand) { @@ -2322,9 +2321,9 @@ class ListState extends InstanceState { String get typeName => "List"; @override - bool operator ==(Object object) { - if (object is ListState) { - List otherElements = object._elements; + bool operator ==(Object other) { + if (other is ListState) { + List otherElements = other._elements; int count = _elements.length; if (otherElements.length != count) { return false; @@ -2395,9 +2394,9 @@ class MapState extends InstanceState { String get typeName => "Map"; @override - bool operator ==(Object object) { - if (object is MapState) { - Map otherElements = object._entries; + bool operator ==(Object other) { + if (other is MapState) { + Map otherElements = other._entries; int count = _entries.length; if (otherElements.length != count) { return false; @@ -2468,7 +2467,7 @@ class NullState extends InstanceState { String get typeName => "Null"; @override - bool operator ==(Object object) => object is NullState; + bool operator ==(Object other) => other is NullState; @override BoolState convertToBool() { @@ -2532,10 +2531,10 @@ class SetState extends InstanceState { String get typeName => "Set"; @override - bool operator ==(Object object) { - if (object is SetState) { + bool operator ==(Object other) { + if (other is SetState) { List elements = _elements.toList(); - List otherElements = object._elements.toList(); + List otherElements = other._elements.toList(); int count = elements.length; if (otherElements.length != count) { return false; @@ -2608,8 +2607,8 @@ class StringState extends InstanceState { String get typeName => "String"; @override - bool operator ==(Object object) => - object is StringState && (value == object.value); + bool operator ==(Object other) => + other is StringState && (value == other.value); @override StringState concatenate(InstanceState rightOperand) { @@ -2677,8 +2676,8 @@ class SymbolState extends InstanceState { String get typeName => "Symbol"; @override - bool operator ==(Object object) => - object is SymbolState && (value == object.value); + bool operator ==(Object other) => + other is SymbolState && (value == other.value); @override StringState convertToString() { @@ -2728,8 +2727,8 @@ class TypeState extends InstanceState { String get typeName => "Type"; @override - bool operator ==(Object object) => - object is TypeState && (_type == object._type); + bool operator ==(Object other) => + other is TypeState && (_type == other._type); @override StringState convertToString() { diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart index f6e75f8a5e0..8a9ab33d15a 100644 --- a/pkg/analyzer/lib/src/dart/element/element.dart +++ b/pkg/analyzer/lib/src/dart/element/element.dart @@ -1189,8 +1189,8 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl } @override - bool operator ==(Object object) => - object is CompilationUnitElementImpl && source == object.source; + bool operator ==(Object other) => + other is CompilationUnitElementImpl && source == other.source; @override T? accept(ElementVisitor visitor) => @@ -2416,13 +2416,11 @@ abstract class ElementImpl implements Element { } @override - bool operator ==(Object object) { - if (identical(this, object)) { + bool operator ==(Object other) { + if (identical(this, other)) { return true; } - return object is Element && - object.kind == kind && - object.location == location; + return other is Element && other.kind == kind && other.location == location; } /// Append a textual representation of this element to the given [builder]. @@ -2622,12 +2620,12 @@ class ElementLocationImpl implements ElementLocation { int get hashCode => Object.hashAll(_components); @override - bool operator ==(Object object) { - if (identical(this, object)) { + bool operator ==(Object other) { + if (identical(this, other)) { return true; } - if (object is ElementLocationImpl) { - List otherComponents = object._components; + if (other is ElementLocationImpl) { + List otherComponents = other._components; int length = _components.length; if (otherComponents.length != length) { return false; diff --git a/pkg/analyzer/lib/src/dart/element/least_greatest_closure.dart b/pkg/analyzer/lib/src/dart/element/least_greatest_closure.dart index 0d4ee9ab401..d96fd080b3d 100644 --- a/pkg/analyzer/lib/src/dart/element/least_greatest_closure.dart +++ b/pkg/analyzer/lib/src/dart/element/least_greatest_closure.dart @@ -81,16 +81,16 @@ class LeastGreatestClosureHelper extends ReplacementVisitor { } @override - DartType? visitTypeParameterType(TypeParameterType node) { - if (eliminationTargets.contains(node.element)) { + DartType? visitTypeParameterType(TypeParameterType type) { + if (eliminationTargets.contains(type.element)) { var replacement = _typeParameterReplacement as TypeImpl; return replacement.withNullability( uniteNullabilities( replacement.nullabilitySuffix, - node.nullabilitySuffix, + type.nullabilitySuffix, ), ); } - return super.visitTypeParameterType(node); + return super.visitTypeParameterType(type); } } diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart index b931d1153cf..dcef43da91c 100644 --- a/pkg/analyzer/lib/src/dart/element/type.dart +++ b/pkg/analyzer/lib/src/dart/element/type.dart @@ -40,7 +40,7 @@ class DynamicTypeImpl extends TypeImpl implements DynamicType { NullabilitySuffix get nullabilitySuffix => NullabilitySuffix.none; @override - bool operator ==(Object object) => identical(object, this); + bool operator ==(Object other) => identical(other, this); @override R accept(TypeVisitor visitor) { @@ -918,7 +918,7 @@ class NeverTypeImpl extends TypeImpl implements NeverType { String get name => 'Never'; @override - bool operator ==(Object object) => identical(object, this); + bool operator ==(Object other) => identical(other, this); @override R accept(TypeVisitor visitor) { @@ -1043,7 +1043,7 @@ abstract class TypeImpl implements DartType { void appendTo(ElementDisplayStringBuilder builder); @override - InterfaceType? asInstanceOf(ClassElement element) => null; + InterfaceType? asInstanceOf(ClassElement targetElement) => null; @override String getDisplayString({ @@ -1192,8 +1192,8 @@ class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType { } @override - InterfaceType? asInstanceOf(ClassElement element) { - return bound.asInstanceOf(element); + InterfaceType? asInstanceOf(ClassElement targetElement) { + return bound.asInstanceOf(targetElement); } @override @@ -1261,7 +1261,7 @@ class VoidTypeImpl extends TypeImpl implements VoidType { NullabilitySuffix get nullabilitySuffix => NullabilitySuffix.none; @override - bool operator ==(Object object) => identical(object, this); + bool operator ==(Object other) => identical(other, this); @override R accept(TypeVisitor visitor) { diff --git a/pkg/analyzer/lib/src/dart/element/type_schema.dart b/pkg/analyzer/lib/src/dart/element/type_schema.dart index f65f66c6584..267ba374712 100644 --- a/pkg/analyzer/lib/src/dart/element/type_schema.dart +++ b/pkg/analyzer/lib/src/dart/element/type_schema.dart @@ -35,7 +35,7 @@ class UnknownInferredType extends TypeImpl { NullabilitySuffix get nullabilitySuffix => NullabilitySuffix.star; @override - bool operator ==(Object object) => identical(object, this); + bool operator ==(Object other) => identical(other, this); @override R accept(TypeVisitor visitor) { diff --git a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart index 8ba7ab1f3e4..fe811733c23 100644 --- a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart +++ b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart @@ -51,11 +51,11 @@ class CiderSearchMatch { CiderSearchMatch(this.path, this.startPositions); @override - bool operator ==(Object object) => - object is CiderSearchMatch && - path == object.path && + bool operator ==(Object other) => + other is CiderSearchMatch && + path == other.path && const ListEquality() - .equals(startPositions, object.startPositions); + .equals(startPositions, other.startPositions); @override String toString() { diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart index 20996faf8d5..f6e73c7efb4 100644 --- a/pkg/analyzer/lib/src/fasta/ast_builder.dart +++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart @@ -84,6 +84,11 @@ import 'package:analyzer/src/summary2/ast_binary_tokens.dart'; import 'package:collection/collection.dart'; import 'package:pub_semver/pub_semver.dart'; +// Many of the super-types in this file come from 'package:_fe_analyzer_shared' +// and we've chosen more specific / meaningful parameter names. Leaving these as +// they are for now. +// ignore_for_file: avoid_renaming_method_parameters + const _invalidCollectionElement = _InvalidCollectionElement._(); /// A parser listener that builds the analyzer's AST structure. diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart index 77865a99002..48a0c91a09b 100644 --- a/pkg/analyzer/lib/src/generated/source.dart +++ b/pkg/analyzer/lib/src/generated/source.dart @@ -37,7 +37,7 @@ abstract class BasicSource extends Source { String get shortName => pathos.basename(fullName); @override - bool operator ==(Object object) => object is Source && object.uri == uri; + bool operator ==(Object other) => other is Source && other.uri == uri; } /// Instances of the class `DartUriResolver` resolve `dart` URI's. @@ -241,7 +241,7 @@ abstract class Source { /// source code as this source /// See [Object.==]. @override - bool operator ==(Object object); + bool operator ==(Object other); /// Return `true` if this source exists. /// diff --git a/pkg/analyzer/lib/src/generated/utilities_general.dart b/pkg/analyzer/lib/src/generated/utilities_general.dart index d9e674295a8..c24cb69b284 100644 --- a/pkg/analyzer/lib/src/generated/utilities_general.dart +++ b/pkg/analyzer/lib/src/generated/utilities_general.dart @@ -50,8 +50,8 @@ class LimitedQueue extends ListQueue { LimitedQueue(this.limit); @override - void add(E o) { - super.add(o); + void add(E value) { + super.add(value); while (length > limit) { remove(first); } diff --git a/pkg/analyzer/lib/src/source/source_resource.dart b/pkg/analyzer/lib/src/source/source_resource.dart index 8ff9ef19115..275165babbd 100644 --- a/pkg/analyzer/lib/src/source/source_resource.dart +++ b/pkg/analyzer/lib/src/source/source_resource.dart @@ -99,11 +99,11 @@ class FileSource extends Source { UriKind get uriKind => UriKind.fromScheme(uri.scheme); @override - bool operator ==(Object object) { - if (object is FileSource) { - return id == object.id; - } else if (object is Source) { - return uri == object.uri; + bool operator ==(Object other) { + if (other is FileSource) { + return id == other.id; + } else if (other is Source) { + return uri == other.uri; } return false; } diff --git a/pkg/analyzer/lib/src/summary/flat_buffers.dart b/pkg/analyzer/lib/src/summary/flat_buffers.dart index 80ba07c88a2..1624f4c0dc5 100644 --- a/pkg/analyzer/lib/src/summary/flat_buffers.dart +++ b/pkg/analyzer/lib/src/summary/flat_buffers.dart @@ -627,9 +627,9 @@ abstract class TableReader extends Reader { T createObject(BufferContext bc, int offset); @override - T read(BufferContext bp, int offset) { - int objectOffset = bp.derefObject(offset); - return createObject(bp, objectOffset); + T read(BufferContext bc, int offset) { + int objectOffset = bc.derefObject(offset); + return createObject(bc, objectOffset); } } diff --git a/pkg/analyzer/lib/src/workspace/gn.dart b/pkg/analyzer/lib/src/workspace/gn.dart index 8826a1aeaa2..3bc7b3ef6ab 100644 --- a/pkg/analyzer/lib/src/workspace/gn.dart +++ b/pkg/analyzer/lib/src/workspace/gn.dart @@ -75,8 +75,8 @@ class GnWorkspace extends Workspace { } @override - WorkspacePackage? findPackageFor(String path) { - var startFolder = provider.getFolder(path); + WorkspacePackage? findPackageFor(String filePath) { + var startFolder = provider.getFolder(filePath); for (var folder in startFolder.withAncestors) { if (folder.path.length < root.length) { // We've walked up outside of [root], so [path] is definitely not diff --git a/pkg/analyzer/lib/src/workspace/package_build.dart b/pkg/analyzer/lib/src/workspace/package_build.dart index 81587ca5fc4..a43ef0af3fa 100644 --- a/pkg/analyzer/lib/src/workspace/package_build.dart +++ b/pkg/analyzer/lib/src/workspace/package_build.dart @@ -268,17 +268,17 @@ class PackageBuildWorkspace extends Workspace implements PubWorkspace { } @override - PackageBuildWorkspacePackage? findPackageFor(String path) { + PackageBuildWorkspacePackage? findPackageFor(String filePath) { var pathContext = provider.pathContext; // Must be in this workspace. - if (!pathContext.isWithin(root, path)) { + if (!pathContext.isWithin(root, filePath)) { return null; } // If generated, must be for this package. - if (pathContext.isWithin(generatedRootPath, path)) { - if (!pathContext.isWithin(generatedThisPath, path)) { + if (pathContext.isWithin(generatedRootPath, filePath)) { + if (!pathContext.isWithin(generatedThisPath, filePath)) { return null; } } diff --git a/pkg/analyzer/lib/src/workspace/workspace.dart b/pkg/analyzer/lib/src/workspace/workspace.dart index 035744b0219..58c019a23e8 100644 --- a/pkg/analyzer/lib/src/workspace/workspace.dart +++ b/pkg/analyzer/lib/src/workspace/workspace.dart @@ -41,12 +41,12 @@ abstract class Workspace { SourceFactory createSourceFactory( DartSdk? sdk, SummaryDataStore? summaryData); - /// Find the [WorkspacePackage] where the library at [path] is defined. + /// Find the [WorkspacePackage] where the library at [filePath] is defined. /// /// Separate from [Packages] or [packageMap], this method is designed to find /// the package, by its root, in which a library at an arbitrary path is /// defined. - WorkspacePackage? findPackageFor(String path); + WorkspacePackage? findPackageFor(String filePath); } /// Abstract superclass of classes that provide information about a package