@@ -894,7 +894,7 @@ private static List<CallSite> getCallSites(Optional<BlockStmt> callableBody) {
894
894
+ exception .getMessage ());
895
895
}
896
896
// resolve arguments of the method call to types
897
- List <String > arguments = methodCallExpr .getArguments ().stream ().map (SymbolTable ::resolveExpression )
897
+ List <String > argumentTypes = methodCallExpr .getArguments ().stream ().map (SymbolTable ::resolveExpression )
898
898
.collect (Collectors .toList ());
899
899
// Get argument string from the callsite
900
900
List <String > listOfArgumentStrings = methodCallExpr .getArguments ().stream ().map (Expression ::toString )
@@ -930,7 +930,7 @@ private static List<CallSite> getCallSites(Optional<BlockStmt> callableBody) {
930
930
931
931
932
932
callSites .add (createCallSite (methodCallExpr , methodCallExpr .getNameAsString (), receiverName , declaringType ,
933
- arguments , returnType , calleeSignature , isStaticCall , false , crudOperation , crudQuery ,
933
+ argumentTypes , listOfArgumentStrings , returnType , calleeSignature , isStaticCall , false , crudOperation , crudQuery ,
934
934
accessSpecifier ));
935
935
}
936
936
@@ -939,7 +939,11 @@ private static List<CallSite> getCallSites(Optional<BlockStmt> callableBody) {
939
939
String instantiatedType = resolveType (objectCreationExpr .getType ());
940
940
941
941
// resolve arguments of the constructor call to types
942
- List <String > arguments = objectCreationExpr .getArguments ().stream ().map (SymbolTable ::resolveExpression )
942
+ List <String > argumentTypes = objectCreationExpr .getArguments ().stream ().map (SymbolTable ::resolveExpression )
943
+ .collect (Collectors .toList ());
944
+
945
+ // get argument expressions for constructor call
946
+ List <String > argumentExpressions = objectCreationExpr .getArguments ().stream ().map (Expression ::toString )
943
947
.collect (Collectors .toList ());
944
948
945
949
// resolve callee and get signature
@@ -955,7 +959,7 @@ private static List<CallSite> getCallSites(Optional<BlockStmt> callableBody) {
955
959
.add (createCallSite (objectCreationExpr , "<init>" ,
956
960
objectCreationExpr .getScope ().isPresent () ? objectCreationExpr .getScope ().get ().toString ()
957
961
: "" ,
958
- instantiatedType , arguments , instantiatedType , calleeSignature , false , true , null , null ,
962
+ instantiatedType , argumentTypes , argumentExpressions , instantiatedType , calleeSignature , false , true , null , null ,
959
963
AccessSpecifier .NONE ));
960
964
}
961
965
@@ -1006,17 +1010,24 @@ private static Optional<CRUDOperationType> findCRUDOperation(String declaringTyp
1006
1010
* @param calleeName
1007
1011
* @param receiverExpr
1008
1012
* @param receiverType
1009
- * @param arguments
1013
+ * @param argumentTypes
1014
+ * @param argumentExpr
1015
+ * @param returnType
1016
+ * @param calleeSignature
1010
1017
* @param isStaticCall
1011
1018
* @param isConstructorCall
1019
+ * @param crudOperation,
1020
+ * @param crudQuery,
1021
+ * @param accessSpecifier
1012
1022
* @return
1013
1023
*/
1014
1024
private static CallSite createCallSite (
1015
1025
Expression callExpr ,
1016
1026
String calleeName ,
1017
1027
String receiverExpr ,
1018
1028
String receiverType ,
1019
- List <String > arguments ,
1029
+ List <String > argumentTypes ,
1030
+ List <String > argumentExpr ,
1020
1031
String returnType ,
1021
1032
String calleeSignature ,
1022
1033
boolean isStaticCall ,
@@ -1042,7 +1053,8 @@ private static CallSite createCallSite(
1042
1053
callSite .setMethodName (calleeName );
1043
1054
callSite .setReceiverExpr (receiverExpr );
1044
1055
callSite .setReceiverType (receiverType );
1045
- callSite .setArgumentTypes (arguments );
1056
+ callSite .setArgumentTypes (argumentTypes );
1057
+ callSite .setArgumentExpr (argumentExpr );
1046
1058
callSite .setReturnType (returnType );
1047
1059
callSite .setCalleeSignature (calleeSignature );
1048
1060
callSite .setStaticCall (isStaticCall );
0 commit comments