} catch (JsonProtocolParseException e) {
throw new RuntimeException(e);
}
ScriptManager scriptManager = debugSession.getScriptManager();
for (int i = 0; i < body.size(); ++i) {
ScriptHandle scriptHandle = body.get(i);
if (V8Helper.JAVASCRIPT_VOID.equals(scriptHandle.source())) {
continue;
}
Long id = V8ProtocolUtil.getScriptIdFromResponse(scriptHandle);
ScriptImpl scriptById = scriptManager.findById(id);
if (scriptById == null) {
scriptManager.addScript(scriptHandle, successResponse.refs());
} else {
// A scrupulous refactoring note:
// do not call setSource in a legacy case, when ids parameter is null.
if (ids != null) {
scriptById.setSource(scriptHandle.source());
}
}
}
if (callback != null) {
callback.success();