final boolean isEvent = true;
if (isEvent) {
String event = eventMessage.event();
DebugSession debugSession = getDebugSession();
ContextBuilder contextBuilder = debugSession.getContextBuilder();
ContextBuilder.ExpectingBreakEventStep step1 = contextBuilder.buildNewContext();
InternalContext internalContext = step1.getInternalContext();
BreakEventBody breakEventBody;
try {
breakEventBody = eventMessage.body().asBreakEventBody();
} catch (JsonProtocolParseException e) {
throw new RuntimeException(e);
}
ContextBuilder.ExpectingBacktraceStep step2;
if (V8Protocol.EVENT_BREAK.key.equals(event)) {
Collection<Breakpoint> breakpointsHit = getBreakpointsHit(eventMessage, breakEventBody);
step2 = step1.setContextState(breakpointsHit, null);
} else if (V8Protocol.EVENT_EXCEPTION.key.equals(event)) {
ExceptionData exception = createException(eventMessage, breakEventBody,
internalContext);
step2 = step1.setContextState(Collections.<Breakpoint> emptySet(), exception);
} else {
contextBuilder.buildSequenceFailure();
throw new RuntimeException();
}
processNextStep(step2);
}