Source:
public Response injectNodeTemplates(InjectorReplaceData injectorReplaceData, @Context UriInfo uriInfo) throws IOException, ParserConfigurationException, SAXException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = dbf.newDocumentBuilder(); Splitting splitting = new Splitting(); Collection<TNodeTemplate> injectorNodeTemplates = injectorReplaceData.injections.values(); Map<QName, String> tempConvertedOtherAttributes = new HashMap<>(); for (TNodeTemplate injectorNodeTemplate : injectorNodeTemplates) { for (Map.Entry<QName, String> otherAttribute : injectorNodeTemplate.getOtherAttributes().entrySet()) { QName qName = QName.valueOf(otherAttribute.getKey().getLocalPart()); tempConvertedOtherAttributes.put(qName, otherAttribute.getValue()); } injectorNodeTemplate.getOtherAttributes().clear(); injectorNodeTemplate.getOtherAttributes().putAll(tempConvertedOtherAttributes); tempConvertedOtherAttributes.clear(); TEntityTemplate.Properties properties = injectorNodeTemplate.getProperties(); if (properties != null) { Object any = properties.getAny(); if (any instanceof String) { Document doc = documentBuilder.parse(new InputSource(new StringReader((String) any))); injectorNodeTemplate.getProperties().setAny(doc.getDocumentElement()); } } } TTopologyTemplate tTopologyTemplate = splitting.injectNodeTemplates(this.getServiceTemplate().getTopologyTemplate(), injectorReplaceData.injections); this.getServiceTemplate().setTopologyTemplate(null); this.getServiceTemplate().setTopologyTemplate(tTopologyTemplate); LOGGER.debug("Persisting..."); this.persist(); LOGGER.debug("Persisted."); URI url = uriInfo.getBaseUri().resolve(Utils.getAbsoluteURL(id)); LOGGER.debug("URI of the old and new ServiceTemplate: " + url.toString()); return Response.created(url).build(); }

Target:
public Response injectNodeTemplates(InjectorReplaceData injectorReplaceData, @Context UriInfo uriInfo) throws IOException, ParserConfigurationException, SAXException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = dbf.newDocumentBuilder(); Splitting splitting = new Splitting(); Collection<TNodeTemplate> injectorNodeTemplates = injectorReplaceData.injections.values(); Map<QName, String> tempConvertedOtherAttributes = new HashMap<>(); for (TNodeTemplate injectorNodeTemplate : injectorNodeTemplates) { for (Map.Entry<QName, String> otherAttribute : injectorNodeTemplate.getOtherAttributes().entrySet()) { QName qName = QName.valueOf(otherAttribute.getKey().getLocalPart()); tempConvertedOtherAttributes.put(qName, otherAttribute.getValue()); } injectorNodeTemplate.getOtherAttributes().clear(); injectorNodeTemplate.getOtherAttributes().putAll(tempConvertedOtherAttributes); tempConvertedOtherAttributes.clear(); TEntityTemplate.Properties properties = injectorNodeTemplate.getProperties(); if (properties != null) { Object any = properties.getAny(); if (any instanceof String) { Document doc = documentBuilder.parse(new InputSource(new StringReader((String) any))); injectorNodeTemplate.getProperties().setAny(doc.getDocumentElement()); } } } TTopologyTemplate tTopologyTemplate = splitting.injectNodeTemplates(this.getServiceTemplate().getTopologyTemplate(), injectorReplaceData.injections); this.getServiceTemplate().setTopologyTemplate(tTopologyTemplate); LOGGER.debug("Persisting..."); this.persist(); LOGGER.debug("Persisted."); URI url = uriInfo.getBaseUri().resolve(Utils.getAbsoluteURL(id)); LOGGER.debug("URI of the old and new service template {}", url.toString()); return Response.created(url).build(); }