Skip to content

is_target_method_a_constructor introduced but never used in JavaSitter.get_calling_lines #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rangeetpan opened this issue Feb 20, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rangeetpan
Copy link
Collaborator

rangeetpan commented Feb 20, 2025

Description

The JavaSitter.get_calling_lines method contains an unused variable, is_target_method_a_constructor, which was introduced in a previous PR but is never used in the implementation.

Steps to Reproduce
After doing pip install git+https://github.com/codellm-devkit/python-sdk.git I was running into the following error
image

I made changes to pyproject.toml by changing the versions to the ones mentioned in the error, I removed cldk from pyproject.toml :

image

I also installed `brew install llvm` to resolve another library error.

Cldk version:

(summarize-py3.11) ashitasaxena@Ashitas-MacBook-Pro wca-summarization % pip freeze | grep cldk 
cldk @ git+https://github.com/codellm-devkit/python-sdk.git@90d4dc0c02059272384ef36c9e4f79236b6a298c
  1. I removed previous analysis.json and tried this command:

summarize application --project-root /Users/ashitasaxena/Documents/git_repos/modresorts --metadata-folder /Users/ashitasaxena/Documents/git_repos/wca-summarization/example/test_output/ModResort --vela-url "https://wca4j-dmf-73-zircon-vllm-wca-core-training.apps.dmf.dipc.res.ibm.com/v1/completions" --model-name /modeling/models/g20b-73-dmf-zircon-exp/step1250 --use-source-analysis

I see that analysis.json is getting generated. I'm getting the following error:

(summarize-py3.11) ashitasaxena@Ashitas-MacBook-Pro wca-summarization % summarize application --project-root /Users/ashitasaxena/Documents/git_repos/modresorts --metadata-folder /Users/ashitasaxena/Documents/git_repos/wca-summarization/example/test_output/ModResort --vela-url "https://wca4j-dmf-73-zircon-vllm-wca-core-training.apps.dmf.dipc.res.ibm.com/v1/completions" --model-name  /modeling/models/g20b-73-dmf-zircon-exp/step1250 --use-source-analysis
analysis_level:  symbol table
Generating Summary...All calls finished
All calls finished
All calls finished
All calls finished
Traceback (most recent call last):
  File "/Users/ashitasaxena/Documents/git_repos/wca-summarization/summarize/cli.py", line 294, in application
    status, output_dict = generate_application_summary(ns, wca_token, use_source_analysis=use_source_analysis,model_id=model_name, 
model_url=wca_url, proj_name=proj_name, vela_url=vela_url)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ashitasaxena/Documents/git_repos/wca-summarization/summarize/application/application_summary.py", line 307, in 
generate_application_summary
    method_summary_list = gen_app_summary_app_entry_batch_par(app_summ_inp_list, use_source_analysis)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ashitasaxena/Documents/git_repos/wca-summarization/summarize/application/application_summary.py", line 365, in 
gen_app_summary_app_entry_batch_par
    method_summary_list = pool.map(gen_app_summary_app_entry, app_entry_inp_list)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 
367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 
774, in get
    raise self._value
  File "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 
125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 48,
in mapstar
    return list(map(*args))
           ^^^^^^^^^^^^^^^^
  File "/Users/ashitasaxena/Documents/git_repos/wca-summarization/summarize/application/application_summary.py", line 425, in 
gen_app_summary_app_entry
    status, prompt_list, sdg_info_dict = get_prompt_dict_list(inp.app_entry_method_name, inp.class_name, inp.ns, inp.use_source_analysis)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ashitasaxena/Documents/git_repos/wca-summarization/summarize/application/application_summary.py", line 116, in 
get_prompt_dict_list
    callees = ns.get_callees(candidate_class_name, prompt_dict["method_signature"], use_source_analysis)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ashitasaxena/Documents/git_repos/wca-summarization/.venv/lib/python3.11/site-packages/cldk/analysis/java/java_analysis.py", 
line 263, in get_callees
    return self.backend.get_all_callees(source_class_name, source_method_declaration, using_symbol_table)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/ashitasaxena/Documents/git_repos/wca-summarization/.venv/lib/python3.11/site-packages/cldk/analysis/java/codeanalyzer/codeanalyzer.py
", line 426, in get_all_callees
    call_graph = self.__call_graph_using_symbol_table(qualified_class_name=source_class_name, method_signature=source_method_signature)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/ashitasaxena/Documents/git_repos/wca-summarization/.venv/lib/python3.11/site-packages/cldk/analysis/java/codeanalyzer/codeanalyzer.py
", line 677, in __call_graph_using_symbol_table
    edge_list = [
                ^
  File 
"/Users/ashitasaxena/Documents/git_repos/wca-summarization/.venv/lib/python3.11/site-packages/cldk/analysis/java/codeanalyzer/codeanalyzer.py
", line 684, in <listcomp>
    "calling_lines": tsu.get_calling_lines(jge.source.method.code, jge.target.method.signature),
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: JavaSitter.get_calling_lines() missing 1 required positional argument: 'is_target_method_a_constructor'

Suggested Fix

  • Remove is_target_method_a_constructor from the method signature.

Additional Context

  • Ensure that any associated documentation or function calls and test cases are updated accordingly.
@rangeetpan rangeetpan added the bug Something isn't working label Feb 20, 2025
@rahlk rahlk closed this as completed Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants