Source:
<code>private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { @NonNull List<String> command = prepareStreamedSessionCreationCommand(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() && (sessionInfo.getNetworkUrl() != null)) { 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); sessionInfo.setStreamedTrace(true); if (sessionInfo.getNetworkUrl() != null) { if (!sessionInfo.isSnapshotSession() && (path == null)) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + Messages.TraceControl_UnexpectedPathError + ": " + name); } if (sessionInfo.isSnapshotSession()) { sessionInfo.setStreamedTrace(false); } else { sessionInfo.setSessionPath(path); Matcher matcher = LTTngControlServiceConstants.TRACE_FILE_PROTOCOL_PATTERN.matcher(path); if (matcher.matches()) { sessionInfo.setStreamedTrace(false); } } } return sessionInfo; }</code><technical_language>for(String line: output){</technical_language>

Target:
private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException { @NonNull List<String> command = prepareStreamedSessionCreationCommand(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() && (sessionInfo.getNetworkUrl() != null)) { 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); sessionInfo.setStreamedTrace(true); if (sessionInfo.getNetworkUrl() != null) { if (!sessionInfo.isSnapshotSession() && (path == null)) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + Messages.TraceControl_UnexpectedPathError + ": " + name); } if (sessionInfo.isSnapshotSession()) { sessionInfo.setStreamedTrace(false); } else { sessionInfo.setSessionPath(path); Matcher matcher = LTTngControlServiceConstants.TRACE_FILE_PROTOCOL_PATTERN.matcher(path); if (matcher.matches()) { sessionInfo.setStreamedTrace(false); } } } return sessionInfo; }