Source:
<code>public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException { StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST); command.append(LTTngControlServiceConstants.OPTION_FIELDS); ICommandResult result = executeCommand(command.toString(), monitor, false); List<IUstProviderInfo> allProviders = new ArrayList<>(); if (isError(result) && result.getErrorOutput() != null) { int index = 0; while (index < result.getErrorOutput().length) { String line = result.getErrorOutput()[index]; Matcher matcher = LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN.matcher(line); if (matcher.matches()) { return allProviders; } index++; <START> } <END> throw new ExecutionException(Messages.TraceControl_CommandError + LTTngControlServiceConstants.COMMAND_LIST_UST); } Document document = getDocumentFromStrings(result.getOutput()); NodeList rawProviders = document.getElementsByTagName(MIStrings.PID); IUstProviderInfo providerInfo = null; for (int i = 0; i < rawProviders.getLength(); i++) { Node provider = rawProviders.item(i); Node name = getFirstOf(provider.getChildNodes(), MIStrings.NAME); if (name == null) { throw new ExecutionException(Messages.TraceControl_MiInvalidProviderError); } providerInfo = new UstProviderInfo(name.getTextContent()); NodeList infos = provider.getChildNodes(); for (int j = 0; j < infos.getLength(); j++) { Node info = infos.item(j); switch (info.getNodeName()) { case MIStrings.PID_ID: providerInfo.setPid(Integer.parseInt(info.getTextContent())); break; case MIStrings.EVENTS: List<IBaseEventInfo> events = new ArrayList<>(); NodeList rawEvents = info.getChildNodes(); getBaseEventInfo(rawEvents, events); providerInfo.setEvents(events); break; default: break; } } allProviders.add(providerInfo); } return allProviders; }</code><technical_language>copy</technical_language>

Target:
public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException { StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST); command.append(LTTngControlServiceConstants.OPTION_FIELDS); ICommandResult result = executeCommand(command.toString(), monitor, false); List<IUstProviderInfo> allProviders = new ArrayList<>(); if (isError(result) && result.getErrorOutput() != null) { if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { return allProviders; } throw new ExecutionException(Messages.TraceControl_CommandError + LTTngControlServiceConstants.COMMAND_LIST_UST); } Document document = getDocumentFromStrings(result.getOutput()); NodeList rawProviders = document.getElementsByTagName(MIStrings.PID); IUstProviderInfo providerInfo = null; for (int i = 0; i < rawProviders.getLength(); i++) { Node provider = rawProviders.item(i); Node name = getFirstOf(provider.getChildNodes(), MIStrings.NAME); if (name == null) { throw new ExecutionException(Messages.TraceControl_MiInvalidProviderError); } providerInfo = new UstProviderInfo(name.getTextContent()); NodeList infos = provider.getChildNodes(); for (int j = 0; j < infos.getLength(); j++) { Node info = infos.item(j); switch (info.getNodeName()) { case MIStrings.PID_ID: providerInfo.setPid(Integer.parseInt(info.getTextContent())); break; case MIStrings.EVENTS: List<IBaseEventInfo> events = new ArrayList<>(); NodeList rawEvents = info.getChildNodes(); getBaseEventInfo(rawEvents, events); providerInfo.setEvents(events); break; default: break; } } allProviders.add(providerInfo); } return allProviders; }