Skip to content

feat: Add inheritance support to Java call graph generation using symbol table#151

Open
sinha108 wants to merge 1 commit intomainfrom
inheritance-call-graph-symbol-table
Open

feat: Add inheritance support to Java call graph generation using symbol table#151
sinha108 wants to merge 1 commit intomainfrom
inheritance-call-graph-symbol-table

Conversation

@sinha108
Copy link
Copy Markdown
Collaborator

Motivation and Context

Previously, the Java call graph generation using symbol tables only detected methods declared directly in the receiver type's class. When a method was inherited from a parent class, it would not appear in the call graph, leading to incomplete analysis.

This change enhances JCodeanalyzer to recursively search the class hierarchy to find inherited method definitions. This ensures that the call graph contains edges for method calls on inherited methods.

How Has This Been Tested?

Created 8 tests in test_inheritance_call_graph.py covering single-level inheritance, concrete vs interface resolution,
and multi-level inheritance with parameters targeting JCodeanalyzer methods get_class_call_graph_using_symbol_table(), get_callees(), and get_callers().

Breaking Changes

This is a backward-compatible enhancement.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the Codellm-Devkit Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Interface methods without concrete implementations are not considered during the search.

…nalysis

using symbol table

Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
@sinha108 sinha108 requested review from rahlk and rangeetpan April 11, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants