Remove unnecessary data class overrides
They are no longer necessary since we're not using arrays in the constructor of data classes anymore.
Bug: 311642700
Test: atest FlickerLibTest FlickerLibUtilTests FlickerLibE2eTest
Change-Id: Ib79d12ef609a8b98cc9e6a905f821f05a18f9e63
diff --git a/libraries/flicker/src/android/tools/common/flicker/assertions/AssertionResultImpl.kt b/libraries/flicker/src/android/tools/common/flicker/assertions/AssertionResultImpl.kt
index 2a326db..b06be2d 100644
--- a/libraries/flicker/src/android/tools/common/flicker/assertions/AssertionResultImpl.kt
+++ b/libraries/flicker/src/android/tools/common/flicker/assertions/AssertionResultImpl.kt
@@ -25,26 +25,4 @@
override val assertionData: Collection<AssertionData>,
override val assertionErrors: Collection<FlickerAssertionError>,
override val stabilityGroup: AssertionInvocationGroup
-) : AssertionResult {
- // Overriding equals because of use of Array
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is AssertionResultImpl) return false
-
- if (name != other.name) return false
- if (assertionData != other.assertionData) return false
- if (assertionErrors != other.assertionErrors) return false
- if (stabilityGroup != other.stabilityGroup) return false
-
- return true
- }
-
- // Overriding hashCode because of use of Array
- override fun hashCode(): Int {
- var result = name.hashCode()
- result = 31 * result + assertionData.hashCode()
- result = 31 * result + assertionErrors.hashCode()
- result = 31 * result + stabilityGroup.hashCode()
- return result
- }
-}
+) : AssertionResult
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/ImeClientTrace.kt b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/ImeClientTrace.kt
index d9c4672..a50b7e4 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/ImeClientTrace.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/ImeClientTrace.kt
@@ -33,17 +33,6 @@
return "ImeClientTrace(Start: ${entries.firstOrNull()}, " + "End: ${entries.lastOrNull()})"
}
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is ImeClientTrace) return false
- if (entries != other.entries) return false
- return true
- }
-
- override fun hashCode(): Int {
- return entries.hashCode()
- }
-
/**
* Split the trace by the start and end timestamp.
*
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodManager.kt b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodManager.kt
index 9ccba05..2567ccf 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodManager.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodManager.kt
@@ -27,27 +27,4 @@
val displayId: Int,
val active: Boolean,
val servedConnecting: Boolean,
-) {
- override fun toString(): String {
- return "${this::class.simpleName}: {$curId, fullscreenMode: $fullscreenMode, " +
- "displayId: $displayId, active: $active, servedConnecting: $servedConnecting}"
- }
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is InputMethodManager) return false
- if (curId != other.curId) return false
- if (fullscreenMode != other.fullscreenMode) return false
- if (displayId != other.displayId) return false
- if (active != other.active) return false
- if (servedConnecting != other.servedConnecting) return false
- return true
- }
- override fun hashCode(): Int {
- var result = curId.hashCode()
- result = 31 * result + fullscreenMode.hashCode()
- result = 31 * result + displayId
- result = 31 * result + active.hashCode()
- result = 31 * result + servedConnecting.hashCode()
- return result
- }
-}
+)
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodManagerServiceTrace.kt b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodManagerServiceTrace.kt
index 5359303..4af4188 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodManagerServiceTrace.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodManagerServiceTrace.kt
@@ -36,19 +36,6 @@
"End: ${entries.lastOrNull()})"
}
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is InputMethodManagerServiceTrace) return false
-
- if (entries != other.entries) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- return entries.hashCode()
- }
-
/**
* Split the trace by the start and end timestamp.
*
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodServiceTrace.kt b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodServiceTrace.kt
index e8c4991..8ab080b 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodServiceTrace.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/InputMethodServiceTrace.kt
@@ -35,19 +35,6 @@
"End: ${entries.lastOrNull()})"
}
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is InputMethodServiceTrace) return false
-
- if (entries != other.entries) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- return entries.hashCode()
- }
-
/**
* Split the trace by the start and end timestamp.
*
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/ViewRootImpl.kt b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/ViewRootImpl.kt
index c94ca1e..d6c0e37 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/ViewRootImpl.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/inputmethod/ViewRootImpl.kt
@@ -43,52 +43,4 @@
val curScrollY: Int,
val removed: Boolean,
val windowAttributes: WindowLayoutParams,
-) {
- override fun toString(): String {
- return "${this::class.simpleName}: {$view, displayId: $displayId," +
- "appVisible: $appVisible, visibleRect: $visibleRect," +
- "isAnimating: $isAnimating, isDrawing: $isDrawing, softInputMode: $softInputMode}"
- }
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is ViewRootImpl) return false
- if (view != other.view) return false
- if (displayId != other.displayId) return false
- if (appVisible != other.appVisible) return false
- if (width != other.width) return false
- if (height != other.height) return false
- if (isAnimating != other.isAnimating) return false
- if (visibleRect != other.visibleRect) return false
- if (isDrawing != other.isDrawing) return false
- if (added != other.added) return false
- if (winFrame != other.winFrame) return false
- if (pendingDisplayCutout != other.pendingDisplayCutout) return false
- if (lastWindowInsets != other.lastWindowInsets) return false
- if (softInputMode != other.softInputMode) return false
- if (scrollY != other.scrollY) return false
- if (curScrollY != other.curScrollY) return false
- if (removed != other.removed) return false
- if (windowAttributes != other.windowAttributes) return false
- return true
- }
- override fun hashCode(): Int {
- var result = view.hashCode()
- result = 31 * result + displayId
- result = 31 * result + appVisible.hashCode()
- result = 31 * result + width
- result = 31 * result + height
- result = 31 * result + isAnimating.hashCode()
- result = 31 * result + visibleRect.hashCode()
- result = 31 * result + isDrawing.hashCode()
- result = 31 * result + added.hashCode()
- result = 31 * result + winFrame.hashCode()
- result = 31 * result + pendingDisplayCutout.hashCode()
- result = 31 * result + lastWindowInsets.hashCode()
- result = 31 * result + softInputMode.hashCode()
- result = 31 * result + scrollY
- result = 31 * result + curScrollY
- result = 31 * result + removed.hashCode()
- result = 31 * result + windowAttributes.hashCode()
- return result
- }
-}
+)
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/region/RegionTrace.kt b/libraries/flicker/utils/src/android/tools/common/traces/region/RegionTrace.kt
index 318948a..cb1dd7c 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/region/RegionTrace.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/region/RegionTrace.kt
@@ -32,21 +32,6 @@
val components: IComponentMatcher?,
override val entries: Collection<RegionEntry>
) : Trace<RegionEntry> {
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is RegionTrace) return false
-
- if (components != other.components) return false
- if (entries != other.entries) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- var result = components.hashCode()
- result = 31 * result + entries.hashCode()
- return result
- }
override fun slice(startTimestamp: Timestamp, endTimestamp: Timestamp): Trace<RegionEntry> {
return RegionTrace(
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/surfaceflinger/LayersTrace.kt b/libraries/flicker/utils/src/android/tools/common/traces/surfaceflinger/LayersTrace.kt
index ffec176..edc0c85 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/surfaceflinger/LayersTrace.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/surfaceflinger/LayersTrace.kt
@@ -32,19 +32,6 @@
return "LayersTrace(Start: ${entries.firstOrNull()}, " + "End: ${entries.lastOrNull()})"
}
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is LayersTrace) return false
-
- if (entries != other.entries) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- return entries.hashCode()
- }
-
fun vSyncSlice(from: Int, to: Int): LayersTrace {
return LayersTrace(
this.entries.dropWhile { it.vSyncId < from }.dropLastWhile { it.vSyncId > to }
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/view/ViewTrace.kt b/libraries/flicker/utils/src/android/tools/common/traces/view/ViewTrace.kt
index 9d2873a..721d816 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/view/ViewTrace.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/view/ViewTrace.kt
@@ -40,18 +40,4 @@
override fun toString(): String {
return "ViewTrace(Start: ${entries.firstOrNull()}, " + "End: ${entries.lastOrNull()})"
}
-
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is ViewTrace) return false
-
- if (windowTitle != other.windowTitle) return false
- if (entries != other.entries) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- return entries.hashCode()
- }
}
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/wm/TransitionsTrace.kt b/libraries/flicker/utils/src/android/tools/common/traces/wm/TransitionsTrace.kt
index 88c2fcd..6cb8a47 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/wm/TransitionsTrace.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/wm/TransitionsTrace.kt
@@ -24,19 +24,6 @@
@JsExport
data class TransitionsTrace(override val entries: Collection<Transition>) : Trace<Transition> {
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is TransitionsTrace) return false
-
- if (entries != other.entries) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- return entries.hashCode()
- }
-
@JsName("prettyPrint")
fun prettyPrint(): String {
val sb = StringBuilder("TransitionTrace(")
diff --git a/libraries/flicker/utils/src/android/tools/common/traces/wm/WindowManagerTrace.kt b/libraries/flicker/utils/src/android/tools/common/traces/wm/WindowManagerTrace.kt
index 6a75287..ca93d55 100644
--- a/libraries/flicker/utils/src/android/tools/common/traces/wm/WindowManagerTrace.kt
+++ b/libraries/flicker/utils/src/android/tools/common/traces/wm/WindowManagerTrace.kt
@@ -40,19 +40,6 @@
"End: ${entries.lastOrNull()})"
}
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is WindowManagerTrace) return false
-
- if (entries != other.entries) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- return entries.hashCode()
- }
-
/** Get the initial rotation */
fun getInitialRotation(): Rotation {
if (entries.isEmpty()) {