diff --git a/engine/src/flutter/ci/licenses_golden/tool_signature b/engine/src/flutter/ci/licenses_golden/tool_signature index 263452211d..38593438e6 100644 --- a/engine/src/flutter/ci/licenses_golden/tool_signature +++ b/engine/src/flutter/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: d87fdd028d9cc76587c43c73be9d6541 +Signature: 850d87bf990697506c74c39a473e4645 diff --git a/engine/src/flutter/lib/ui/geometry.dart b/engine/src/flutter/lib/ui/geometry.dart index 1911a9d864..2739048e70 100644 --- a/engine/src/flutter/lib/ui/geometry.dart +++ b/engine/src/flutter/lib/ui/geometry.dart @@ -84,7 +84,7 @@ abstract class OffsetBase { /// left-hand-side operand are equal to the horizontal and vertical values of /// the right-hand-side operand respectively. Returns false otherwise. @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is OffsetBase && other._dx == _dx && other._dy == _dy; @@ -334,7 +334,7 @@ class Offset extends OffsetBase { /// Compares two Offsets for equality. @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is Offset && other.dx == dx && other.dy == dy; @@ -606,7 +606,7 @@ class Size extends OffsetBase { /// Compares two Sizes for equality. // We don't compare the runtimeType because of _DebugSize in the framework. @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is Size && other._dx == _dx && other._dy == _dy; @@ -887,7 +887,7 @@ class Rect { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) @@ -1014,7 +1014,7 @@ class Radius { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) @@ -1615,7 +1615,7 @@ class RRect { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) diff --git a/engine/src/flutter/lib/ui/painting.dart b/engine/src/flutter/lib/ui/painting.dart index 2aaa5a08b6..5e704dfa32 100644 --- a/engine/src/flutter/lib/ui/painting.dart +++ b/engine/src/flutter/lib/ui/painting.dart @@ -324,7 +324,7 @@ class Color { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) @@ -2612,7 +2612,7 @@ class MaskFilter { static const int _TypeBlur = 1; // SkBlurMaskFilter @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is MaskFilter && other._style == _style && other._sigma == _sigma; @@ -2741,7 +2741,7 @@ class ColorFilter { static const int _TypeSrgbToLinearGamma = 4; // MakeSRGBToLinearGamma @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is ColorFilter && other._type == _type && _listEquals(other._matrix, _matrix) @@ -2886,7 +2886,7 @@ class ImageFilter { static const int _kTypeMatrix = 1; // MakeMatrixFilterRowMajor255 @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is ImageFilter && other._type == _type && _listEquals(other._data, _data) @@ -4398,7 +4398,7 @@ class Shadow { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is Shadow diff --git a/engine/src/flutter/lib/ui/plugins.dart b/engine/src/flutter/lib/ui/plugins.dart index 384f219eec..64eca6e04c 100644 --- a/engine/src/flutter/lib/ui/plugins.dart +++ b/engine/src/flutter/lib/ui/plugins.dart @@ -24,7 +24,7 @@ class CallbackHandle { int toRawHandle() => _handle; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (runtimeType != other.runtimeType) return false; return other is CallbackHandle diff --git a/engine/src/flutter/lib/ui/text.dart b/engine/src/flutter/lib/ui/text.dart index 00691fb1e4..8bdc0f05d2 100644 --- a/engine/src/flutter/lib/ui/text.dart +++ b/engine/src/flutter/lib/ui/text.dart @@ -298,7 +298,7 @@ class FontFeature { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) @@ -389,7 +389,7 @@ class TextDecoration { static const TextDecoration lineThrough = TextDecoration._(0x4); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is TextDecoration && other._mask == _mask; } @@ -496,7 +496,7 @@ class TextHeightBehavior { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is TextHeightBehavior @@ -767,7 +767,7 @@ class TextStyle { final List? _fontFeatures; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is TextStyle @@ -1007,7 +1007,7 @@ class ParagraphStyle { final Locale? _locale; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) @@ -1186,7 +1186,7 @@ class StrutStyle { @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) @@ -1350,7 +1350,7 @@ class TextBox { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) @@ -1462,7 +1462,7 @@ class TextPosition { final TextAffinity affinity; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is TextPosition @@ -1546,7 +1546,7 @@ class TextRange { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; return other is TextRange @@ -1598,7 +1598,7 @@ class ParagraphConstraints { final double width; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is ParagraphConstraints diff --git a/engine/src/flutter/lib/ui/window.dart b/engine/src/flutter/lib/ui/window.dart index d9edf7c793..815bee5a15 100644 --- a/engine/src/flutter/lib/ui/window.dart +++ b/engine/src/flutter/lib/ui/window.dart @@ -470,7 +470,7 @@ class Locale { }; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (other is! Locale) { @@ -1300,7 +1300,7 @@ class AccessibilityFeatures { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is AccessibilityFeatures diff --git a/engine/src/flutter/lib/web_ui/dev/utils.dart b/engine/src/flutter/lib/web_ui/dev/utils.dart index 96633acb76..798cc891fc 100644 --- a/engine/src/flutter/lib/web_ui/dev/utils.dart +++ b/engine/src/flutter/lib/web_ui/dev/utils.dart @@ -27,8 +27,9 @@ class FilePath { path.relative(_absolutePath, from: environment.webUiRootDir.path); @override - bool operator ==(dynamic other) { - return other is FilePath && _absolutePath == other._absolutePath; + bool operator ==(Object other) { + return other is FilePath + && other._absolutePath == _absolutePath; } @override diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/color_filter.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/color_filter.dart index 4f8c82b778..3bd62e1054 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/color_filter.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/color_filter.dart @@ -121,20 +121,12 @@ class EngineColorFilter implements ui.ColorFilter { static const int _TypeSrgbToLinearGamma = 4; // MakeSRGBToLinearGamma @override - bool operator ==(dynamic other) { - if (other is! EngineColorFilter) { - return false; - } - final EngineColorFilter typedOther = other; - - if (_type != typedOther._type) { - return false; - } - if (!_listEquals(_matrix, typedOther._matrix)) { - return false; - } - - return _color == typedOther._color && _blendMode == typedOther._blendMode; + bool operator ==(Object other) { + return other is EngineColorFilter + && other._type == _type + && _listEquals(other._matrix, _matrix) + && other._color == _color + && other._blendMode == _blendMode; } SkColorFilter? _toSkColorFilter() { diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/compositor/embedded_views.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/compositor/embedded_views.dart index 4725a8dce9..710f0fb296 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/compositor/embedded_views.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/compositor/embedded_views.dart @@ -398,18 +398,14 @@ class EmbeddedViewParams { final ui.Size size; final MutatorsStack mutators; - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } - if (other is! EmbeddedViewParams) { - return false; - } - - EmbeddedViewParams typedOther = other; - return offset == typedOther.offset && - size == typedOther.size && - mutators == typedOther.mutators; + return other is EmbeddedViewParams + && other.offset == offset + && other.size == size + && other.mutators == mutators; } int get hashCode => ui.hashValues(offset, size, mutators); @@ -459,7 +455,7 @@ class Mutator { double get alphaFloat => alpha! / 255.0; - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } @@ -524,26 +520,12 @@ class MutatorsStack extends Iterable { _mutators.removeLast(); } - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(other, this)) { return true; } - if (other is! MutatorsStack) { - return false; - } - - final MutatorsStack typedOther = other; - if (_mutators.length != typedOther._mutators.length) { - return false; - } - - for (int i = 0; i < _mutators.length; i++) { - if (_mutators[i] != typedOther._mutators[i]) { - return false; - } - } - - return true; + return other is MutatorsStack + && _listEquals(other._mutators, _mutators); } int get hashCode => ui.hashList(_mutators); diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/compositor/image_filter.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/compositor/image_filter.dart index 76aed376eb..af54713fec 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/compositor/image_filter.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/compositor/image_filter.dart @@ -32,12 +32,10 @@ class SkImageFilter extends ResurrectableSkiaObject implements ui.ImageFilter { ); @override - bool operator ==(dynamic other) { - if (other is! SkImageFilter) { - return false; - } - final SkImageFilter typedOther = other; - return _sigmaX == typedOther._sigmaX && _sigmaY == typedOther._sigmaY; + bool operator ==(Object other) { + return other is SkImageFilter + && other._sigmaX == _sigmaX + && other._sigmaY == _sigmaY; } @override diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/shader.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/shader.dart index cdce61daf2..82d2f5b828 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/shader.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/shader.dart @@ -278,12 +278,10 @@ class EngineImageFilter implements ui.ImageFilter { final double sigmaY; @override - bool operator ==(dynamic other) { - if (other is! EngineImageFilter) { - return false; - } - final EngineImageFilter typedOther = other; - return sigmaX == typedOther.sigmaX && sigmaY == typedOther.sigmaY; + bool operator ==(Object other) { + return other is EngineImageFilter + && other.sigmaX == sigmaX + && other.sigmaY == sigmaY; } @override diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/text/paragraph.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/text/paragraph.dart index 4903f330ea..a40ae99e93 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/text/paragraph.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/text/paragraph.dart @@ -103,27 +103,26 @@ class EngineLineMetrics implements ui.LineMetrics { ); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } - if (other.runtimeType != runtimeType) { return false; } - final EngineLineMetrics typedOther = other; - return displayText == typedOther.displayText && - startIndex == typedOther.startIndex && - endIndex == typedOther.endIndex && - hardBreak == typedOther.hardBreak && - ascent == typedOther.ascent && - descent == typedOther.descent && - unscaledAscent == typedOther.unscaledAscent && - height == typedOther.height && - width == typedOther.width && - left == typedOther.left && - baseline == typedOther.baseline && - lineNumber == typedOther.lineNumber; + return other is EngineLineMetrics + && other.displayText == displayText + && other.startIndex == startIndex + && other.endIndex == endIndex + && other.hardBreak == hardBreak + && other.ascent == ascent + && other.descent == descent + && other.unscaledAscent == unscaledAscent + && other.height == height + && other.width == width + && other.left == left + && other.baseline == baseline + && other.lineNumber == lineNumber; } @override @@ -687,25 +686,25 @@ class EngineParagraphStyle implements ui.ParagraphStyle { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other.runtimeType != runtimeType) { return false; } - final EngineParagraphStyle typedOther = other; - return _textAlign == typedOther._textAlign || - _textDirection == typedOther._textDirection || - _fontWeight == typedOther._fontWeight || - _fontStyle == typedOther._fontStyle || - _maxLines == typedOther._maxLines || - _fontFamily == typedOther._fontFamily || - _fontSize == typedOther._fontSize || - _height == typedOther._height || - _textHeightBehavior == typedOther._textHeightBehavior || - _ellipsis == typedOther._ellipsis || - _locale == typedOther._locale; + return other is EngineParagraphStyle + && other._textAlign == _textAlign + && other._textDirection == _textDirection + && other._fontWeight == _fontWeight + && other._fontStyle == _fontStyle + && other._maxLines == _maxLines + && other._fontFamily == _fontFamily + && other._fontSize == _fontSize + && other._height == _height + && other._textHeightBehavior == _textHeightBehavior + && other._ellipsis == _ellipsis + && other._locale == _locale; } @override @@ -830,32 +829,31 @@ class EngineTextStyle implements ui.TextStyle { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other.runtimeType != runtimeType) { return false; } - final EngineTextStyle typedOther = other; - return _color == typedOther._color && - _decoration == typedOther._decoration && - _decorationColor == typedOther._decorationColor && - _decorationStyle == typedOther._decorationStyle && - _fontWeight == typedOther._fontWeight && - _fontStyle == typedOther._fontStyle && - _textBaseline == typedOther._textBaseline && - _fontFamily == typedOther._fontFamily && - _fontSize == typedOther._fontSize && - _letterSpacing == typedOther._letterSpacing && - _wordSpacing == typedOther._wordSpacing && - _height == typedOther._height && - _locale == typedOther._locale && - _background == typedOther._background && - _foreground == typedOther._foreground && - _listEquals(_shadows, typedOther._shadows) && - _listEquals( - _fontFamilyFallback, typedOther._fontFamilyFallback); + return other is EngineTextStyle + && other._color == _color + && other._decoration == _decoration + && other._decorationColor == _decorationColor + && other._decorationStyle == _decorationStyle + && other._fontWeight == _fontWeight + && other._fontStyle == _fontStyle + && other._textBaseline == _textBaseline + && other._fontFamily == _fontFamily + && other._fontSize == _fontSize + && other._letterSpacing == _letterSpacing + && other._wordSpacing == _wordSpacing + && other._height == _height + && other._locale == _locale + && other._background == _background + && other._foreground == _foreground + && _listEquals(other._shadows, _shadows) + && _listEquals(other._fontFamilyFallback, _fontFamilyFallback); } @override @@ -975,23 +973,22 @@ class EngineStrutStyle implements ui.StrutStyle { final bool? _forceStrutHeight; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other.runtimeType != runtimeType) { return false; } - final EngineStrutStyle typedOther = other; - return _fontFamily == typedOther._fontFamily && - _fontSize == typedOther._fontSize && - _height == typedOther._height && - _leading == typedOther._leading && - _fontWeight == typedOther._fontWeight && - _fontStyle == typedOther._fontStyle && - _forceStrutHeight == typedOther._forceStrutHeight && - _listEquals( - _fontFamilyFallback, typedOther._fontFamilyFallback); + return other is EngineStrutStyle + && other._fontFamily == _fontFamily + && other._fontSize == _fontSize + && other._height == _height + && other._leading == _leading + && other._fontWeight == _fontWeight + && other._fontStyle == _fontStyle + && other._forceStrutHeight == _forceStrutHeight + && _listEquals(other._fontFamilyFallback, _fontFamilyFallback); } @override diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/text/ruler.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/text/ruler.dart index 74080b0659..6199168cc0 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/text/ruler.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/text/ruler.dart @@ -95,24 +95,24 @@ class ParagraphGeometricStyle { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other.runtimeType != runtimeType) { return false; } - final ParagraphGeometricStyle typedOther = other; - return fontWeight == typedOther.fontWeight && - fontStyle == typedOther.fontStyle && - fontFamily == typedOther.fontFamily && - fontSize == typedOther.fontSize && - lineHeight == typedOther.lineHeight && - maxLines == typedOther.maxLines && - letterSpacing == typedOther.letterSpacing && - wordSpacing == typedOther.wordSpacing && - decoration == typedOther.decoration && - ellipsis == typedOther.ellipsis; + return other is ParagraphGeometricStyle + && other.fontWeight == fontWeight + && other.fontStyle == fontStyle + && other.fontFamily == fontFamily + && other.fontSize == fontSize + && other.lineHeight == lineHeight + && other.maxLines == maxLines + && other.letterSpacing == letterSpacing + && other.wordSpacing == wordSpacing + && other.decoration == decoration + && other.ellipsis == ellipsis; } @override diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/text_editing/text_editing.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/text_editing/text_editing.dart index abc9f4c502..44474731d9 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/text_editing/text_editing.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/text_editing/text_editing.dart @@ -345,17 +345,17 @@ class EditingState { int get hashCode => ui.hashValues(text, baseOffset, extentOffset); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (runtimeType != other.runtimeType) { return false; } - final EditingState typedOther = other; - return text == typedOther.text && - baseOffset == typedOther.baseOffset && - extentOffset == typedOther.extentOffset; + return other is EditingState + && other.text == text + && other.baseOffset == baseOffset + && other.extentOffset == extentOffset; } @override diff --git a/engine/src/flutter/lib/web_ui/lib/src/ui/geometry.dart b/engine/src/flutter/lib/web_ui/lib/src/ui/geometry.dart index 5e069c2a8b..904cec0658 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/ui/geometry.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/ui/geometry.dart @@ -83,7 +83,7 @@ abstract class OffsetBase { /// left-hand-side operand are equal to the horizontal and vertical values of /// the right-hand-side operand respectively. Returns false otherwise. @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is OffsetBase && other._dx == _dx && other._dy == _dy; @@ -333,7 +333,7 @@ class Offset extends OffsetBase { /// Compares two Offsets for equality. @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is Offset && other.dx == dx && other.dy == dy; @@ -605,7 +605,7 @@ class Size extends OffsetBase { /// Compares two Sizes for equality. // We don't compare the runtimeType because of _DebugSize in the framework. @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is Size && other._dx == _dx && other._dy == _dy; @@ -883,7 +883,7 @@ class Rect { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) @@ -1010,7 +1010,7 @@ class Radius { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) @@ -1620,7 +1620,7 @@ class RRect { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) diff --git a/engine/src/flutter/lib/web_ui/lib/src/ui/painting.dart b/engine/src/flutter/lib/web_ui/lib/src/ui/painting.dart index 0facfaeee8..ce19fc8dee 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/ui/painting.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/ui/painting.dart @@ -239,15 +239,15 @@ class Color { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other.runtimeType != runtimeType) { return false; } - final Color typedOther = other; - return value == typedOther.value; + return other is Color + && other.value == value; } @override @@ -1382,12 +1382,10 @@ class MaskFilter { BlurStyle get webOnlyBlurStyle => _style; @override - bool operator ==(dynamic other) { - if (other is! MaskFilter) { - return false; - } - final MaskFilter typedOther = other; - return _style == typedOther._style && _sigma == typedOther._sigma; + bool operator ==(Object other) { + return other is MaskFilter + && other._style == _style + && other._sigma == _sigma; } @override @@ -1810,17 +1808,14 @@ class Shadow { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } - if (other is! Shadow) { - return false; - } - final Shadow typedOther = other; - return color == typedOther.color && - offset == typedOther.offset && - blurRadius == typedOther.blurRadius; + return other is Shadow + && other.color == color + && other.offset == offset + && other.blurRadius == blurRadius; } @override diff --git a/engine/src/flutter/lib/web_ui/lib/src/ui/text.dart b/engine/src/flutter/lib/web_ui/lib/src/ui/text.dart index 9fe24e7832..9800cd318e 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/ui/text.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/ui/text.dart @@ -280,15 +280,16 @@ class FontFeature { final int value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other.runtimeType != runtimeType) { return false; } - final FontFeature typedOther = other; - return feature == typedOther.feature && value == typedOther.value; + return other is FontFeature + && other.feature == feature + && other.value == value; } @override @@ -373,12 +374,9 @@ class TextDecoration { static const TextDecoration lineThrough = TextDecoration._(0x4); @override - bool operator ==(dynamic other) { - if (other is! TextDecoration) { - return false; - } - final TextDecoration typedOther = other; - return _mask == typedOther._mask; + bool operator ==(Object other) { + return other is TextDecoration + && other._mask == _mask; } @override @@ -486,7 +484,7 @@ class TextHeightBehavior { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is TextHeightBehavior @@ -907,19 +905,19 @@ class TextBox { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other.runtimeType != runtimeType) { return false; } - final TextBox typedOther = other; - return typedOther.left == left && - typedOther.top == top && - typedOther.right == right && - typedOther.bottom == bottom && - typedOther.direction == direction; + return other is TextBox + && other.left == left + && other.top == top + && other.right == right + && other.bottom == bottom + && other.direction == direction; } @override @@ -1023,12 +1021,13 @@ class TextPosition { final TextAffinity affinity; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } - final TextPosition typedOther = other; - return typedOther.offset == offset && typedOther.affinity == affinity; + return other is TextPosition + && other.offset == offset + && other.affinity == affinity; } @override @@ -1104,15 +1103,13 @@ class TextRange { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } - if (other is! TextRange) { - return false; - } - final TextRange typedOther = other; - return typedOther.start == start && typedOther.end == end; + return other is TextRange + && other.start == start + && other.end == end; } @override @@ -1159,12 +1156,12 @@ class ParagraphConstraints { final double width; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } - final ParagraphConstraints typedOther = other; - return typedOther.width == width; + return other is ParagraphConstraints + && other.width == width; } @override diff --git a/engine/src/flutter/lib/web_ui/lib/src/ui/window.dart b/engine/src/flutter/lib/web_ui/lib/src/ui/window.dart index aab9bdc6a1..557e6aa843 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/ui/window.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/ui/window.dart @@ -375,17 +375,14 @@ class Locale { }; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } - if (other is! Locale) { - return false; - } - final Locale typedOther = other; - return languageCode == typedOther.languageCode && - scriptCode == typedOther.scriptCode && - countryCode == typedOther.countryCode; + return other is Locale + && other.languageCode == languageCode + && other.scriptCode == scriptCode + && other.countryCode == countryCode; } @override @@ -926,12 +923,12 @@ class AccessibilityFeatures { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) { return false; } - final AccessibilityFeatures typedOther = other; - return _index == typedOther._index; + return other is AccessibilityFeatures + && other._index == _index; } @override diff --git a/engine/src/flutter/lib/web_ui/test/engine/profiler_test.dart b/engine/src/flutter/lib/web_ui/test/engine/profiler_test.dart index 04d580d2fa..0314ee9c8e 100644 --- a/engine/src/flutter/lib/web_ui/test/engine/profiler_test.dart +++ b/engine/src/flutter/lib/web_ui/test/engine/profiler_test.dart @@ -78,14 +78,16 @@ class BenchmarkDatapoint { int get hashCode => hashValues(name, value); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) { return true; } if (other.runtimeType != runtimeType) { return false; } - return name == other.name && value == other.value; + return other is BenchmarkDatapoint + && other.name == name + && other.value == value; } @override diff --git a/engine/src/flutter/lib/web_ui/test/text/line_breaker_test.dart b/engine/src/flutter/lib/web_ui/test/text/line_breaker_test.dart index 5025552dcd..073746925f 100644 --- a/engine/src/flutter/lib/web_ui/test/text/line_breaker_test.dart +++ b/engine/src/flutter/lib/web_ui/test/text/line_breaker_test.dart @@ -173,8 +173,10 @@ class Line { int get hashCode => hashValues(text, breakType); @override - bool operator ==(dynamic other) { - return other is Line && text == other.text && breakType == other.breakType; + bool operator ==(Object other) { + return other is Line + && other.text == text + && other.breakType == breakType; } String get escapedText { diff --git a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle.dart b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle.dart index 277afae0f7..99b18d7113 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle.dart +++ b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon/lib/src/handle.dart @@ -26,8 +26,10 @@ class Handle extends NativeFieldWrapperClass2 { String toString() => 'Handle($handle)'; @override - bool operator ==(Object other) => - (other is Handle) && (handle == other.handle); + bool operator ==(Object other) { + return other is Handle + && other.handle == handle; + } @override int get hashCode => handle.hashCode; diff --git a/engine/src/flutter/tools/licenses/lib/cache.dart b/engine/src/flutter/tools/licenses/lib/cache.dart index 62dcbeecf4..043158b662 100644 --- a/engine/src/flutter/tools/licenses/lib/cache.dart +++ b/engine/src/flutter/tools/licenses/lib/cache.dart @@ -25,13 +25,13 @@ abstract class Key { final dynamic _value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (identical(this, other)) return true; if (runtimeType != other.runtimeType) return false; - final Key typedOther = other; - return _value == typedOther._value; + return other is Key + && other._value == _value; } @override