}
return null;
}
private static MethodCallStep methodCallTOD(TODSession session, IMethodCallEvent event, boolean forward, boolean live) {
MethodCallStep s = new MethodCallStep();
IBehaviorInfo behavior = event.getOperationBehavior();
IBehaviorInfo calledBehavior = event.getCalledBehavior();
if (calledBehavior == null) {
calledBehavior = event.getExecutedBehavior();
}
// If there is no associated behavior, TOD does not have information
// for the given class. It is likely out of scope.
if (behavior == null || calledBehavior == null || calledBehavior.isStaticInit()) {
return null;
}
MethodInfo methodInfo = session.getClassInformationProvider().getMethodInfo(behavior);
MethodInfo targetMethodInfo = session.getClassInformationProvider().getMethodInfo(calledBehavior);
if (!session.getFilter().acceptMethod(targetMethodInfo)) {
return null;
}
s.setType(StepType.METHOD_CALL);
s.setLive(live);
s.setMethodInfo(methodInfo);
s.setTargetMethodInfo(targetMethodInfo);
int line = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
s.setLineNumber(line); // TODO
s.setTargetLineNumber(0); // TODO
s.setForward(forward);
// Set up the parameters.
Object[] arguments = event.getArguments();
for (int i = 0; i < arguments.length; i++) {
Object arg = arguments[i];
s.addParameter(MirrorFactory.instanceFromTOD(session, arg, calledBehavior.getArgumentTypes()[i].getJvmName()));
}
return s;
}