Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e36e62e9
Unverified
Commit
e36e62e9
authored
Jun 30, 2021
by
Dan Field
Committed by
GitHub
Jun 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Revert "Audit hashCode overrides outside of packages/flutter (#85370)" (#85451)" (#85567)
This reverts commit
2be0d57f
.
parent
ae2442c8
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
30 additions
and
68 deletions
+30
-68
analyze.dart
dev/bots/analyze.dart
+1
-1
running_processes.dart
dev/devicelab/lib/framework/running_processes.dart
+1
-14
adb_test.dart
dev/devicelab/test/adb_test.dart
+8
-9
common.dart
...ation_tests/android_semantics_testing/lib/src/common.dart
+2
-3
localizations_utils.dart
dev/tools/localization/localizations_utils.dart
+1
-3
vitool.dart
dev/tools/vitool/lib/vitool.dart
+3
-3
about.dart
packages/flutter/lib/src/material/about.dart
+1
-1
driver.dart
packages/flutter_driver/lib/src/driver/driver.dart
+1
-1
asset.dart
packages/flutter_tools/lib/src/asset.dart
+1
-5
fingerprint.dart
packages/flutter_tools/lib/src/base/fingerprint.dart
+1
-4
version.dart
packages/flutter_tools/lib/src/base/version.dart
+1
-1
doctor_validator.dart
packages/flutter_tools/lib/src/doctor_validator.dart
+1
-1
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+1
-1
localizations_utils.dart
...tter_tools/lib/src/localizations/localizations_utils.dart
+1
-3
custom_dimensions.dart
...es/flutter_tools/lib/src/reporting/custom_dimensions.dart
+1
-6
usage.dart
packages/flutter_tools/lib/src/reporting/usage.dart
+3
-10
vscode.dart
packages/flutter_tools/lib/src/vscode/vscode.dart
+1
-1
clean_test.dart
...lutter_tools/test/commands.shard/hermetic/clean_test.dart
+1
-1
No files found.
dev/bots/analyze.dart
View file @
e36e62e9
...
@@ -610,7 +610,7 @@ class Hash256 {
...
@@ -610,7 +610,7 @@ class Hash256 {
}
}
@override
@override
int get hashCode =>
a ^ b ^ c ^ d
;
int get hashCode =>
Object.hash(a, b, c, d)
;
}
}
// DO NOT ADD ANY ENTRIES TO THIS LIST.
// DO NOT ADD ANY ENTRIES TO THIS LIST.
...
...
dev/devicelab/lib/framework/running_processes.dart
View file @
e36e62e9
...
@@ -28,20 +28,7 @@ class RunningProcessInfo {
...
@@ -28,20 +28,7 @@ class RunningProcessInfo {
}
}
@override
@override
int
get
hashCode
{
int
get
hashCode
=>
Object
.
hash
(
pid
,
commandLine
,
creationDate
);
// TODO(dnfield): Replace this when Object.hashValues lands, https://github.com/dart-lang/sdk/issues/11617
int
hash
=
17
;
if
(
pid
!=
null
)
{
hash
=
hash
*
23
+
pid
.
hashCode
;
}
if
(
commandLine
!=
null
)
{
hash
=
hash
*
23
+
commandLine
.
hashCode
;
}
if
(
creationDate
!=
null
)
{
hash
=
hash
*
23
+
creationDate
.
hashCode
;
}
return
hash
;
}
@override
@override
String
toString
()
{
String
toString
()
{
...
...
dev/devicelab/test/adb_test.dart
View file @
e36e62e9
...
@@ -166,15 +166,14 @@ class CommandArgs {
...
@@ -166,15 +166,14 @@ class CommandArgs {
}
}
@override
@override
int
get
hashCode
=>
17
*
(
17
*
command
.
hashCode
+
_hashArguments
)
+
_hashEnvironment
;
int
get
hashCode
{
return
Object
.
hash
(
int
get
_hashArguments
=>
arguments
!=
null
command
,
?
const
ListEquality
<
String
>().
hash
(
arguments
)
Object
.
hashAll
(
arguments
??
const
<
String
>[]),
:
null
.
hashCode
;
Object
.
hashAllUnordered
(
environment
?.
keys
??
const
<
String
>[]),
Object
.
hashAllUnordered
(
environment
?.
values
??
const
<
String
>[]),
int
get
_hashEnvironment
=>
environment
!=
null
);
?
const
MapEquality
<
String
,
String
>().
hash
(
environment
)
}
:
null
.
hashCode
;
}
}
class
FakeDevice
extends
AndroidDevice
{
class
FakeDevice
extends
AndroidDevice
{
...
...
dev/integration_tests/android_semantics_testing/lib/src/common.dart
View file @
e36e62e9
...
@@ -183,8 +183,7 @@ class Rect {
...
@@ -183,8 +183,7 @@ class Rect {
final
double
bottom
;
final
double
bottom
;
@override
@override
int
get
hashCode
=>
int
get
hashCode
=>
Object
.
hash
(
top
,
left
,
right
,
bottom
);
top
.
hashCode
^
left
.
hashCode
^
right
.
hashCode
^
bottom
.
hashCode
;
@override
@override
bool
operator
==(
Object
other
)
{
bool
operator
==(
Object
other
)
{
...
@@ -216,7 +215,7 @@ class Size {
...
@@ -216,7 +215,7 @@ class Size {
final
double
height
;
final
double
height
;
@override
@override
int
get
hashCode
=>
width
.
hashCode
^
height
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
width
,
height
)
;
@override
@override
bool
operator
==(
Object
other
)
{
bool
operator
==(
Object
other
)
{
...
...
dev/tools/localization/localizations_utils.dart
View file @
e36e62e9
...
@@ -128,9 +128,7 @@ class LocaleInfo implements Comparable<LocaleInfo> {
...
@@ -128,9 +128,7 @@ class LocaleInfo implements Comparable<LocaleInfo> {
}
}
@override
@override
int
get
hashCode
{
int
get
hashCode
=>
originalString
.
hashCode
;
return
originalString
.
hashCode
;
}
@override
@override
String
toString
()
{
String
toString
()
{
...
...
dev/tools/vitool/lib/vitool.dart
View file @
e36e62e9
...
@@ -274,7 +274,7 @@ class FrameData {
...
@@ -274,7 +274,7 @@ class FrameData {
}
}
@override
@override
int
get
hashCode
=>
size
.
hashCode
^
paths
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
size
,
Object
.
hashAll
(
paths
))
;
@override
@override
String
toString
()
{
String
toString
()
{
...
@@ -328,7 +328,7 @@ class SvgPath {
...
@@ -328,7 +328,7 @@ class SvgPath {
}
}
@override
@override
int
get
hashCode
=>
id
.
hashCode
^
commands
.
hashCode
^
opacity
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
id
,
Object
.
hashAll
(
commands
),
opacity
)
;
@override
@override
String
toString
()
{
String
toString
()
{
...
@@ -377,7 +377,7 @@ class SvgPathCommand {
...
@@ -377,7 +377,7 @@ class SvgPathCommand {
}
}
@override
@override
int
get
hashCode
=>
type
.
hashCode
^
points
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
type
,
Object
.
hashAll
(
points
))
;
@override
@override
String
toString
()
{
String
toString
()
{
...
...
packages/flutter/lib/src/material/about.dart
View file @
e36e62e9
...
@@ -798,7 +798,7 @@ class _DetailArguments {
...
@@ -798,7 +798,7 @@ class _DetailArguments {
}
}
@override
@override
int
get
hashCode
=>
packageName
.
hashCode
;
// Good enough.
int
get
hashCode
=>
hashValues
(
packageName
,
hashList
(
licenseEntries
));
}
}
class
_PackageLicensePage
extends
StatefulWidget
{
class
_PackageLicensePage
extends
StatefulWidget
{
...
...
packages/flutter_driver/lib/src/driver/driver.dart
View file @
e36e62e9
...
@@ -814,5 +814,5 @@ class DriverOffset {
...
@@ -814,5 +814,5 @@ class DriverOffset {
}
}
@override
@override
int
get
hashCode
=>
dx
.
hashCode
^
dy
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
dx
,
dy
)
;
}
}
packages/flutter_tools/lib/src/asset.dart
View file @
e36e62e9
...
@@ -911,11 +911,7 @@ class _Asset {
...
@@ -911,11 +911,7 @@ class _Asset {
}
}
@override
@override
int
get
hashCode
{
int
get
hashCode
=>
Object
.
hash
(
baseDir
,
relativeUri
,
entryUri
.
hashCode
);
return
baseDir
.
hashCode
^
relativeUri
.
hashCode
^
entryUri
.
hashCode
;
}
}
}
// Given an assets directory like this:
// Given an assets directory like this:
...
...
packages/flutter_tools/lib/src/base/fingerprint.dart
View file @
e36e62e9
...
@@ -128,10 +128,7 @@ class Fingerprint {
...
@@ -128,10 +128,7 @@ class Fingerprint {
}
}
@override
@override
// Ignore map entries here to avoid becoming inconsistent with equals
int
get
hashCode
=>
Object
.
hash
(
Object
.
hashAllUnordered
(
_checksums
.
keys
),
Object
.
hashAllUnordered
(
_checksums
.
values
));
// due to differences in map entry order. This is a really bad hash
// function and should eventually be deprecated and removed.
int
get
hashCode
=>
_checksums
.
length
.
hashCode
;
@override
@override
String
toString
()
=>
'{checksums:
$_checksums
}'
;
String
toString
()
=>
'{checksums:
$_checksums
}'
;
...
...
packages/flutter_tools/lib/src/base/version.dart
View file @
e36e62e9
...
@@ -98,7 +98,7 @@ class Version implements Comparable<Version> {
...
@@ -98,7 +98,7 @@ class Version implements Comparable<Version> {
}
}
@override
@override
int
get
hashCode
=>
major
^
minor
^
patch
;
int
get
hashCode
=>
Object
.
hash
(
major
,
minor
,
patch
)
;
bool
operator
<(
Version
other
)
=>
compareTo
(
other
)
<
0
;
bool
operator
<(
Version
other
)
=>
compareTo
(
other
)
<
0
;
bool
operator
>(
Version
other
)
=>
compareTo
(
other
)
>
0
;
bool
operator
>(
Version
other
)
=>
compareTo
(
other
)
>
0
;
...
...
packages/flutter_tools/lib/src/doctor_validator.dart
View file @
e36e62e9
...
@@ -278,7 +278,7 @@ class ValidationMessage {
...
@@ -278,7 +278,7 @@ class ValidationMessage {
}
}
@override
@override
int
get
hashCode
=>
type
.
hashCode
^
message
.
hashCode
^
contextUrl
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
type
,
message
,
contextUrl
)
;
}
}
class
NoIdeValidator
extends
DoctorValidator
{
class
NoIdeValidator
extends
DoctorValidator
{
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
e36e62e9
...
@@ -302,7 +302,7 @@ class XcodeProjectBuildContext {
...
@@ -302,7 +302,7 @@ class XcodeProjectBuildContext {
final
EnvironmentType
environmentType
;
final
EnvironmentType
environmentType
;
@override
@override
int
get
hashCode
=>
scheme
.
hashCode
^
configuration
.
hashCode
^
environmentType
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
scheme
,
configuration
,
environmentType
)
;
@override
@override
bool
operator
==(
Object
other
)
{
bool
operator
==(
Object
other
)
{
...
...
packages/flutter_tools/lib/src/localizations/localizations_utils.dart
View file @
e36e62e9
...
@@ -129,9 +129,7 @@ class LocaleInfo implements Comparable<LocaleInfo> {
...
@@ -129,9 +129,7 @@ class LocaleInfo implements Comparable<LocaleInfo> {
}
}
@override
@override
int
get
hashCode
{
int
get
hashCode
=>
originalString
.
hashCode
;
return
originalString
.
hashCode
;
}
@override
@override
String
toString
()
{
String
toString
()
{
...
...
packages/flutter_tools/lib/src/reporting/custom_dimensions.dart
View file @
e36e62e9
...
@@ -326,12 +326,7 @@ class CustomDimensions {
...
@@ -326,12 +326,7 @@ class CustomDimensions {
}
}
@override
@override
int
get
hashCode
=>
int
get
hashCode
=>
Object
.
hashAll
(
toMap
().
values
);
toMap
()
.
values
.
where
((
String
element
)
=>
element
!=
null
)
.
fold
(
Object
().
hashCode
,
(
int
value
,
String
element
)
=>
value
^
element
.
hashCode
);
}
}
/// List of all fields used in CustomDimensions.
/// List of all fields used in CustomDimensions.
...
...
packages/flutter_tools/lib/src/reporting/usage.dart
View file @
e36e62e9
...
@@ -486,7 +486,7 @@ class TestUsageCommand {
...
@@ -486,7 +486,7 @@ class TestUsageCommand {
}
}
@override
@override
int
get
hashCode
=>
command
.
hashCode
^
parameters
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
command
,
parameters
)
;
@override
@override
String
toString
()
=>
'TestUsageCommand(
$command
, parameters:
$parameters
)'
;
String
toString
()
=>
'TestUsageCommand(
$command
, parameters:
$parameters
)'
;
...
@@ -514,11 +514,7 @@ class TestUsageEvent {
...
@@ -514,11 +514,7 @@ class TestUsageEvent {
}
}
@override
@override
int
get
hashCode
=>
category
.
hashCode
^
int
get
hashCode
=>
Object
.
hash
(
category
,
parameter
,
label
,
value
,
parameters
);
parameter
.
hashCode
^
label
.
hashCode
^
value
.
hashCode
^
parameters
.
hashCode
;
@override
@override
String
toString
()
=>
'TestUsageEvent(
$category
,
$parameter
, label:
$label
, value:
$value
, parameters:
$parameters
)'
;
String
toString
()
=>
'TestUsageEvent(
$category
,
$parameter
, label:
$label
, value:
$value
, parameters:
$parameters
)'
;
...
@@ -544,10 +540,7 @@ class TestTimingEvent {
...
@@ -544,10 +540,7 @@ class TestTimingEvent {
}
}
@override
@override
int
get
hashCode
=>
category
.
hashCode
^
int
get
hashCode
=>
Object
.
hash
(
category
,
variableName
,
duration
,
label
);
variableName
.
hashCode
^
duration
.
hashCode
^
label
.
hashCode
;
@override
@override
String
toString
()
=>
'TestTimingEvent(
$category
,
$variableName
,
$duration
, label:
$label
)'
;
String
toString
()
=>
'TestTimingEvent(
$category
,
$variableName
,
$duration
, label:
$label
)'
;
...
...
packages/flutter_tools/lib/src/vscode/vscode.dart
View file @
e36e62e9
...
@@ -326,5 +326,5 @@ class VsCodeInstallLocation {
...
@@ -326,5 +326,5 @@ class VsCodeInstallLocation {
@override
@override
// Lowest bit is for isInsiders boolean.
// Lowest bit is for isInsiders boolean.
int
get
hashCode
=>
installPath
.
hashCode
^
extensionsFolder
.
hashCode
^
edition
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
installPath
,
extensionsFolder
,
edition
)
;
}
}
packages/flutter_tools/test/commands.shard/hermetic/clean_test.dart
View file @
e36e62e9
...
@@ -219,7 +219,7 @@ class CleanWorkspaceCall {
...
@@ -219,7 +219,7 @@ class CleanWorkspaceCall {
verbose
==
other
.
verbose
;
verbose
==
other
.
verbose
;
@override
@override
int
get
hashCode
=>
workspacePath
.
hashCode
;
int
get
hashCode
=>
Object
.
hash
(
workspacePath
,
scheme
,
verbose
)
;
@override
@override
String
toString
()
=>
'{
$workspacePath
,
$scheme
,
$verbose
}'
;
String
toString
()
=>
'{
$workspacePath
,
$scheme
,
$verbose
}'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment