Buggy code:
public class WebParsingDeploymentProcessor implements DeploymentUnitProcessor { private static final String WEB_XML = "WEB-INF//web.xml" ; private final boolean schemaValidation ; public WebParsingDeploymentProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ! ( DeploymentTypeMarker . isType ( WAR , deploymentUnit ) ) ) { return ; } final ResourceRoot deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; final VirtualFile alternateDescriptor = deploymentRoot . getAttachment ( ALTERNATE_WEB_DEPLOYMENT_DESCRIPTOR ) ; final VirtualFile webXml ; if ( alternateDescriptor != null ) { webXml = alternateDescriptor ; } else { webXml = deploymentRoot . getRoot ( ) . getChild ( WebParsingDeploymentProcessor . WEB_XML ) ; } final WarMetaData warMetaData = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; assert warMetaData != null ; if ( webXml . exists ( ) ) { InputStream is = null ; try { is = webXml . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; MetaDataElementParser . DTDInfo dtdInfo = new MetaDataElementParser . DTDInfo ( ) ; inputFactory . setXMLResolver ( dtdInfo ) ; final XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; WebMetaData webMetaData = WebMetaDataParser . parse ( xmlReader , dtdInfo ) ; if ( ( schemaValidation ) && ( ( webMetaData . getSchemaLocation ( ) ) != null ) ) { XMLSchemaValidator validator = new XMLSchemaValidator ( new XMLResourceResolver ( ) ) ; InputStream xmlInput = webXml . openStream ( ) ; try { if ( webMetaData . is23 ( ) ) validator . validate ( "-////Sun<seq2seq4repair_space>Microsystems,<seq2seq4repair_space>Inc.////DTD<seq2seq4repair_space>Web<seq2seq4repair_space>Application<seq2seq4repair_space>2.3////EN" , xmlInput ) ; else if ( webMetaData . is24 ( ) ) validator . validate ( "http:////java.sun.com//xml//ns//j2ee//web-app_2_4.xsd" , xmlInput ) ; else if ( webMetaData . is25 ( ) ) <START_BUG> validator . validate ( "http:////java.sun.com//xml//ns//j2ee//web-app_2_5.xsd" , xmlInput ) ; <END_BUG> else if ( webMetaData . is30 ( ) ) validator . validate ( "http:////java.sun.com//xml//ns//javaee//web-app_3_0.xsd" , xmlInput ) ; else validator . validate ( "-////Sun<seq2seq4repair_space>Microsystems,<seq2seq4repair_space>Inc.////DTD<seq2seq4repair_space>Web<seq2seq4repair_space>Application<seq2seq4repair_space>2.2////EN" , xmlInput ) ; } catch ( SAXException e ) { throw new DeploymentUnitProcessingException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>validate<seq2seq4repair_space>" + webXml ) , e ) ; } finally { xmlInput . close ( ) ; } } warMetaData . setWebMetaData ( webMetaData ) ; } catch ( XMLStreamException e ) { throw new DeploymentUnitProcessingException ( ( ( ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + webXml ) + "<seq2seq4repair_space>at<seq2seq4repair_space>[" ) + ( e . getLocation ( ) . getLineNumber ( ) ) ) + "," ) + ( e . getLocation ( ) . getColumnNumber ( ) ) ) + "]" ) ) ; } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + webXml ) , e ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
validator . validate ( "http:////java.sun.com//xml//ns//javaee//web-app_2_5.xsd" , xmlInput ) ;