mirror of
https://github.com/github/codeql.git
synced 2026-06-30 09:05:28 +02:00
Why this is needed: - library-tests/java-kotlin-collection-type-generic-methods/test.ql regressed with extra equals(Object) rows on generic collection/map/list declaration variants. - At the same time, java-interface-redeclares-tostring must still recover Object-method redeclarations for Java binary interfaces under K2. What changed: - In K2 ASM probing, treat classes with kotlin.Metadata as non-Java binaries for javaBinaryDeclaresMethod, so Java-redeclaration recovery does not fire on Kotlin binary classes. - Keep equals(Object) K2 Any/Any? compatibility handling, but constrain the workaround to non-generic parent classes and skip it when a concrete sibling declaration already exists. - Preserve the existing toString/hashCode redeclaration recovery path for affected Java binaries. Effect: - Removes the spurious equals(Object) rows in java-kotlin-collection-type-generic-methods while retaining expected Object-method extraction in java-interface-redeclares-tostring. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>