Source:
public ConfigurationCheckReport performConfigCheck(BootstrapProperties bootProperties, UnifiedBootstrap bootstrap) { ConfigurationCheckReport report = new ConfigurationCheckReport(); report.setCheckName(this.getFriendlyName()); try { Document xmlDocument = buildXmlDocument(bootProperties); NodeList availableConnections = scanForConnections(xmlDocument, XPATH_AVAILABLE_CONNECTIONS); NodeList referencedConsumeConnections = scanForConnections(xmlDocument, XPATH_REFERENCED_CONSUME_CONNECTIONS); NodeList referencedProduceConnections = scanForConnections(xmlDocument, XPATH_REFERENCED_PRODUCE_CONNECTIONS); NodeList referencedServiceConnections = scanForConnections(xmlDocument, XPATH_REFERENCED_SERVICES); for(int counter = 0; counter < availableConnections.getLength(); counter ++) { if(!this.testReferenceExistsInNodeSets(availableConnections.item(counter).getTextContent(), referencedConsumeConnections)) { report.getWarnings().add("Shared connection unused: " + availableConnections.item(counter).getTextContent()); } } for(int counter = 0; counter < referencedConsumeConnections.getLength(); counter ++) { if(!this.testReferenceExistsInNodeSets(referencedConsumeConnections.item(counter).getTextContent(), availableConnections)) { report.setFailureException(new ConfigurationException("Consume shared connection does not exist in shared connections: " + referencedConsumeConnections.item(counter).getTextContent())); } } for(int counter = 0; counter < referencedProduceConnections.getLength(); counter ++) { if(!this.testReferenceExistsInNodeSets(referencedProduceConnections.item(counter).getTextContent(), availableConnections)) { report.setFailureException(new ConfigurationException("Produce shared connection does not exist in shared connections: " + referencedProduceConnections.item(counter).getTextContent())); } } for(int counter = 0; counter < referencedServiceConnections.getLength(); counter ++) { if(!this.testReferenceExistsInNodeSets(referencedServiceConnections.item(counter).getTextContent(), availableConnections)) { report.setFailureException(new ConfigurationException("Service shared connection does not exist in shared connections: " + referencedServiceConnections.item(counter).getTextContent())); } } } catch (Exception ex) { report.setFailureException(ex); } return report; }

Target:
public ConfigurationCheckReport performConfigCheck(BootstrapProperties bootProperties, UnifiedBootstrap bootstrap) { ConfigurationCheckReport report = new ConfigurationCheckReport(); report.setCheckName(this.getFriendlyName()); try { XmlUtils xmlUtils = new XmlUtils(); xmlUtils.setSource(bootProperties.getConfigurationStream()); List<String> availableConnections = Arrays.asList(xmlUtils.getMultipleTextItems(XPATH_AVAILABLE_CONNECTIONS)); List<String> referencedConnections = Arrays.asList(xmlUtils.getMultipleTextItems(XPATH_REFERENCED_CONNECTIONS)); availableConnections.forEach(connection -> { if(!referencedConnections.contains(connection)) report.getWarnings().add("Shared connection unused: " + connection); }); referencedConnections.forEach(connection -> { if(!availableConnections.contains(connection)) report.getFailureExceptions().add(new ConfigurationException("Shared connection does not exist in shared components: " + connection)); }); } catch (Exception ex) { report.getFailureExceptions().add(ex); } return report; }