Fail closed when call-graph heuristic lacks class info

Tighten CallGraphPathFinder heuristic matching to avoid cross-class linking when only method names are available and class ownership is unknown.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-13 21:24:08 +02:00
parent 308dac557e
commit c1085a2bd3

View File

@@ -388,8 +388,10 @@ public class CallGraphPathFinder {
if (simpleClassNeighbor.equals("this") || simpleClassNeighbor.equals("super")) return true;
return false;
}
return true;
// If we have no class ownership information for either side, we can't prove a match beyond the
// method name. Fail closed to avoid accidental cross-class linking.
return false;
}
private boolean isFullyQualifiedMethod(String methodFqn) {