if (ile instanceof ICallerSideEvent) {
event = (ICallerSideEvent) ile;
if (event.getOperationBehavior() != null) {
lineNum = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
// Generate the program event.
ProgramStep step = ProgramStepFactory.stepFromTOD(getTODSession(), event, true, runningLive);
if (step != null && lineNum == currentLine) {
steps.addFirst(step);
}
if (previousEvent == null && event.getOperationBehavior() != null) {
previousEvent = event;
}
}
}
} while (lineNum == currentLine && events.hasNext()); //&& (isEventOnLine(event, currentLine) || this.isEventBeforeLine(event, currentLine)));
}
if (destinationLine == -1 && event != null) {
result.newLine = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
} else {
result.newLine = destinationLine;
}
if (previousEvent == null) {
result.behavior = this.behavior; // no events were found
result.targetEvent = event;
result.lastEvent = event;
} else {
result.targetEvent = event;
result.behavior = event.getOperationBehavior();
result.lastEvent = previousEvent;
}
if (events.hasNext()) {
result.afterLastEvent = events.next();
}
if (!runningLive && !isLive()) {
runningLive = (result.lastEvent == null) || (result.lastEvent.equals(lastEvent) && !events.hasNext() && result.newLine == liveLine ) || (lineNumber == result.newLine && !events.hasNext());
if (runningLive) {
result.newLine = liveLine;
result.behavior = this.liveBehavior;
}
}
// Generate the conditional test event, if any.
ProgramStep conditionalStep = ProgramStepFactory.conditionalStep(session, event, result.newLine, lastLine, true);
if (conditionalStep != null) {
steps.addLast(conditionalStep);
}
// Generate the loop conditional test event, if any.
ProgramStep loopStep = ProgramStepFactory.loopStep(session, event, result.newLine, lastLine, true);
if (loopStep != null) {
steps.addLast(loopStep);
}
result.steps = steps.iterator();