public class A{
void methodA(){
add(1, 2);
add(1.2, 2.5);
}
void add(int a, int b){
// add two integers
}
void add(double a, double b){
// add two double numbers
}
}
Now I have used below code to extract method call inside a method
new VoidVisitorAdapter<Object>() {
@Override
public void visit(MethodCallExpr n, Object arg) {
super.visit(n, arg);
System.out.println(n.getNameAsString());
}
}.visit(JavaParser.parse(code), null);
Now here how can I differentiate those two method call add(1, 2) and add(1.2, 2.5) inside methodA using MethodCallExpr ?