File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
analysis/java/codeanalyzer Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515################################################################################
16-
16+ from pdb import set_trace
1717import re
1818import json
1919import shlex
Original file line number Diff line number Diff line change 2020import re
2121from contextvars import ContextVar
2222from typing import Dict , List , Optional
23-
23+ from pdb import set_trace
2424from pydantic import BaseModel , field_validator , model_validator
2525
2626from .constants_namespace import ConstantsNamespace
@@ -412,9 +412,11 @@ class JApplication(BaseModel):
412412
413413 @field_validator ("symbol_table" , mode = "after" )
414414 @classmethod
415- def validate_source (cls , symbol_table ):
415+ def validate_source (cls , symbol_table ) -> Dict [ str , JCompilationUnit ] :
416416 # Populate the lookup table for callables
417417 for _ , j_compulation_unit in symbol_table .items ():
418418 for type_declaration , jtype in j_compulation_unit .type_declarations .items ():
419419 for __ , j_callable in jtype .callable_declarations .items ():
420420 _CALLABLES_LOOKUP_TABLE [(type_declaration , j_callable .signature )] = j_callable
421+
422+ return symbol_table
Original file line number Diff line number Diff line change 1+ from pdb import set_trace
12from cldk import CLDK
23from typing import List , Tuple
34from cldk .analysis import AnalysisLevel
45from cldk .models .java .models import JMethodDetail
56
67
8+ def test_get_symbol_table_is_not_null (test_fixture , codeanalyzer_jar_path ):
9+ # Initialize the CLDK object with the project directory, language, and analysis_backend.
10+ cldk = CLDK (language = "java" )
11+ analysis = cldk .analysis (
12+ project_path = test_fixture ,
13+ analysis_backend = "codeanalyzer" ,
14+ analysis_backend_path = codeanalyzer_jar_path ,
15+ eager = True ,
16+ analysis_level = AnalysisLevel .call_graph ,
17+ )
18+ assert analysis .get_symbol_table () is not None
19+
20+
721def test_get_class_call_graph (test_fixture , codeanalyzer_jar_path ):
822 # Initialize the CLDK object with the project directory, language, and analysis_backend.
923 cldk = CLDK (language = "java" )
You can’t perform that action at this time.
0 commit comments