You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Description:** Class overrides `hashCode()`but not `equals()`, violating the hashCode/equals contract.
967
+
**Description:** Class now properly overrides both `hashCode()`and `equals()`, satisfying the contract.
968
968
969
-
**Impact:**Potential incorrect behavior when Doubleton objects are used in hash-based collections.
969
+
**Resolution:**The equals() method was added during Kotlin migration. Additionally, the incorrect `@Deprecated` annotation was removed after analysis showed that Doubleton has no equivalent in Kotlin's standard library. Kotlin's `Pair` is ordered (A,B ≠ B,A), while Doubleton is unordered (A,B = B,A) and supports associated values, making it essential for representing bidirectional graph edges.
970
970
971
-
**Workaround:** Doubleton class is marked `@Deprecated`. Avoid using in new code.
972
-
973
-
**Recommendation:** Replace Doubleton with modern alternatives (e.g., `Map.Entry`, records) in future modernization.
971
+
**Documentation:** Updated KDoc explains why Doubleton cannot be replaced with Kotlin's Pair.
974
972
975
973
### Design Limitations
976
974
@@ -1048,8 +1046,9 @@ The codebase has been analyzed for deprecated Java standard library APIs. This i
0 commit comments