Source:
<code>public ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { if (sessionInfo.isStreamedTrace()) { return createStreamedSession(sessionInfo, monitor); } List<String> command = prepareSessionCreationCommand(sessionInfo); ICommandResult result = executeCommand(command, monitor); List<String> output = result.getOutput(); String name = null; String path = null; int index = 0; <START> while (index < output.size()) { <END> String line = output.get(index); Matcher nameMatcher = LTTngControlServiceConstants.CREATE_SESSION_NAME_PATTERN.matcher(line); Matcher pathMatcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(line); if (nameMatcher.matches()) { name = String.valueOf(nameMatcher.group(1).trim()); } else if (pathMatcher.matches()) { path = String.valueOf(pathMatcher.group(1).trim()); } index++; } if ((name == null) || (!"".equals(sessionInfo.getName()) && !name.equals(sessionInfo.getName()))) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + Messages.TraceControl_UnexpectedNameError + ": " + name); } sessionInfo.setName(name); if (!sessionInfo.isSnapshotSession() && ((path == null) || ((sessionInfo.getSessionPath() != null) && (!path.contains(sessionInfo.getSessionPath()))))) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + Messages.TraceControl_UnexpectedPathError + ": " + name); } if (sessionInfo.isSnapshotSession()) { sessionInfo.setSnapshotInfo(new SnapshotInfo("")); } else { sessionInfo.setSessionPath(path); } return sessionInfo; }</code><technical_language>for(String line: output){</technical_language>

Target:
public ISessionInfo createSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { if (sessionInfo.isStreamedTrace()) { return createStreamedSession(sessionInfo, monitor); } List<String> command = prepareSessionCreationCommand(sessionInfo); ICommandResult result = executeCommand(command, monitor); List<String> output = result.getOutput(); String name = null; String path = null; for (String line : output) { Matcher nameMatcher = LTTngControlServiceConstants.CREATE_SESSION_NAME_PATTERN.matcher(line); Matcher pathMatcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(line); if (nameMatcher.matches()) { name = String.valueOf(nameMatcher.group(1).trim()); } else if (pathMatcher.matches()) { path = String.valueOf(pathMatcher.group(1).trim()); } } if ((name == null) || (!"".equals(sessionInfo.getName()) && !name.equals(sessionInfo.getName()))) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + Messages.TraceControl_UnexpectedNameError + ": " + name); } sessionInfo.setName(name); if (!sessionInfo.isSnapshotSession() && ((path == null) || ((sessionInfo.getSessionPath() != null) && (!path.contains(sessionInfo.getSessionPath()))))) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + Messages.TraceControl_UnexpectedPathError + ": " + name); } if (sessionInfo.isSnapshotSession()) { sessionInfo.setSnapshotInfo(new SnapshotInfo("")); } else { sessionInfo.setSessionPath(path); } return sessionInfo; }