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 13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
15
################################################################################
16
-
16
+ from pdb import set_trace
17
17
import re
18
18
import json
19
19
import shlex
Original file line number Diff line number Diff line change 20
20
import re
21
21
from contextvars import ContextVar
22
22
from typing import Dict , List , Optional
23
-
23
+ from pdb import set_trace
24
24
from pydantic import BaseModel , field_validator , model_validator
25
25
26
26
from .constants_namespace import ConstantsNamespace
@@ -412,9 +412,11 @@ class JApplication(BaseModel):
412
412
413
413
@field_validator ("symbol_table" , mode = "after" )
414
414
@classmethod
415
- def validate_source (cls , symbol_table ):
415
+ def validate_source (cls , symbol_table ) -> Dict [ str , JCompilationUnit ] :
416
416
# Populate the lookup table for callables
417
417
for _ , j_compulation_unit in symbol_table .items ():
418
418
for type_declaration , jtype in j_compulation_unit .type_declarations .items ():
419
419
for __ , j_callable in jtype .callable_declarations .items ():
420
420
_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
1
2
from cldk import CLDK
2
3
from typing import List , Tuple
3
4
from cldk .analysis import AnalysisLevel
4
5
from cldk .models .java .models import JMethodDetail
5
6
6
7
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
+
7
21
def test_get_class_call_graph (test_fixture , codeanalyzer_jar_path ):
8
22
# Initialize the CLDK object with the project directory, language, and analysis_backend.
9
23
cldk = CLDK (language = "java" )
You can’t perform that action at this time.
0 commit comments