Source:
<code>public static IStatus xmlValidate(File xmlFile) { URL url = TmfXmlUtils.class.getResource(XSD); List<@NonNull URL> xsdFiles = getExtraXsdFiles(); Validator validator = null; Schema schema = null; Source[] sources = new Source[xsdFiles.size() + 1]; sources[0] = new StreamSource(url.toExternalForm()); for (int i = 0; i < xsdFiles.size(); i++) { sources[i + 1] = new StreamSource(xsdFiles.get(i).toExternalForm()); } SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); try { <START> schemaFactory.setFeature(XSD_SCHEMA_FEATURE_NAME, true); <END> schema = schemaFactory.newSchema(sources); } catch (SAXException e) { String error = NLS.bind(Messages.XmlUtils_XsdValidationError, e.getLocalizedMessage()); Activator.logError(error); try { schema = schemaFactory.newSchema(url); } catch (SAXException e1) { error = NLS.bind(Messages.XmlUtils_XsdValidationError, e1.getLocalizedMessage()); Activator.logError(error); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e1); } } validator = schema.newValidator(); Source xmlSource = new StreamSource(xmlFile); try { validator.validate(xmlSource); } catch (SAXParseException e) { String error = NLS.bind(Messages.XmlUtils_XmlParseError, e.getLineNumber(), e.getLocalizedMessage()); Activator.logError(error); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); } catch (SAXException e) { String error = NLS.bind(Messages.XmlUtils_XmlValidationError, e.getLocalizedMessage()); Activator.logError(error); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); } catch (IOException e) { String error = Messages.XmlUtils_XmlValidateError; Activator.logError(Messages.XmlUtils_ExceptionIO, e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); } return Status.OK_STATUS; }</code><technical_language>related work</technical_language>

Target:
public static IStatus xmlValidate(File xmlFile) { URL url = TmfXmlUtils.class.getResource(XSD); List<@NonNull URL> xsdFiles = getExtraXsdFiles(); Validator validator = null; Schema schema = null; Source[] sources = new Source[xsdFiles.size() + 1]; sources[0] = new StreamSource(url.toExternalForm()); for (int i = 0; i < xsdFiles.size(); i++) { sources[i + 1] = new StreamSource(xsdFiles.get(i).toExternalForm()); } SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); try { schemaFactory.setFeature("<LINK_0>", true); schema = schemaFactory.newSchema(sources); } catch (SAXException e) { String error = NLS.bind(Messages.XmlUtils_XsdValidationError, e.getLocalizedMessage()); Activator.logError(error); try { schema = schemaFactory.newSchema(url); } catch (SAXException e1) { error = NLS.bind(Messages.XmlUtils_XsdValidationError, e1.getLocalizedMessage()); Activator.logError(error); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e1); } } validator = schema.newValidator(); Source xmlSource = new StreamSource(xmlFile); try { validator.validate(xmlSource); } catch (SAXParseException e) { String error = NLS.bind(Messages.XmlUtils_XmlParseError, e.getLineNumber(), e.getLocalizedMessage()); Activator.logError(error); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); } catch (SAXException e) { String error = NLS.bind(Messages.XmlUtils_XmlValidationError, e.getLocalizedMessage()); Activator.logError(error); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); } catch (IOException e) { String error = Messages.XmlUtils_XmlValidateError; Activator.logError(Messages.XmlUtils_ExceptionIO, e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, error, e); } return Status.OK_STATUS; }