Source:
public static IStatus generateSessionConfigFromRequirements(IPath destination, Iterable<TmfAnalysisRequirement> requirements) { String domainName = null; List<String> eventNames = new ArrayList<>(); for (TmfAnalysisRequirement requirement : requirements) { String requirementType = requirement.getType(); if (requirementType.compareTo(SessionConfigStrings.CONFIG_ELEMENT_EVENT) == 0) { eventNames.addAll(requirement.getValues()); } else if (requirementType.compareTo(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN) == 0) { domainName = requirement.getValues().get(0); } else { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngSessionManager_BadRequirementType); } } if (domainName == null || eventNames.isEmpty()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngSessionManager_BadRequirementType); } try { Document sessionDocument = generateSessionConfig(domainName, eventNames); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(INDENT_AMOUNT_PROPERTY_NAME, INDENT_AMOUNT_PROPERTY_VALUE); DOMSource source = new DOMSource(sessionDocument); StreamResult result = new StreamResult(new File(destination.toString())); transformer.transform(source, result); } catch (TransformerConfigurationException e) { Activator.getDefault().logError("Error generating the session configuration file: " + destination.toString(), e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); } catch (TransformerException e) { Activator.getDefault().logError("Error generating the session configuration file: " + destination.toString(), e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); } return Status.OK_STATUS; }

Target:
public static IStatus generateSessionConfigFromRequirements(IPath destination, Iterable<TmfAnalysisRequirement> requirements) { String domainType = null; List<String> eventNames = new ArrayList<>(); for (TmfAnalysisRequirement requirement : requirements) { String requirementType = requirement.getType(); if (requirementType.equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { eventNames.addAll(requirement.getValues()); } else if (requirementType.equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { domainType = requirement.getValues().get(0); } else { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngSessionManager_BadRequirementType); } } if (domainType == null) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngSessionManager_DomainTypeMissing); } else if (eventNames.isEmpty()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngSessionManager_EventTypeMissing); } try { Document sessionDocument = generateSessionConfig(domainType, eventNames); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(INDENT_AMOUNT_PROPERTY_NAME, INDENT_AMOUNT_PROPERTY_VALUE); DOMSource source = new DOMSource(sessionDocument); StreamResult result = new StreamResult(new File(destination.toString())); transformer.transform(source, result); } catch (TransformerException e) { Activator.getDefault().logError("Error generating the session configuration file: " + destination.toString(), e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); } return Status.OK_STATUS; }