equals
method always returns the same result KT-W1027The equals()
method is used to compare two objects for equality.
However, if the implementation of the method always returns a fixed value, such as true
or false
, it fails to accurately determine if the two objects are equal.
This can lead to incorrect equality comparisons and unexpected behavior in the code.
To fix this issue, the logic inside the equals
method should be modified to properly compare the two objects and determine their equality.
override fun equals(other: Any?): Boolean {
return true
}
override fun equals(other: Any?): Boolean {
return this === other
}
Any.equals(other: Any?)