Buggy code:
public class XMLValidateTask extends Task { public static String DEFAULT_XML_READER_CLASSNAME = "org.apache.crimson.parser.XMLReaderImpl" ; protected static String INIT_FAILED_MSG = "Could<seq2seq4repair_space>not<seq2seq4repair_space>start<seq2seq4repair_space>xml<seq2seq4repair_space>validation:<seq2seq4repair_space>" ; protected boolean failOnError = true ; protected boolean warn = true ; protected boolean lenient = false ; protected String readerClassName = XMLValidateTask . DEFAULT_XML_READER_CLASSNAME ; protected File file = null ; protected Vector filesets = new Vector ( ) ; protected Path classpath ; protected XMLReader xmlReader = null ; protected XMLValidateTask . ValidatorErrorHandler errorHandler = new XMLValidateTask . ValidatorErrorHandler ( ) ; protected Hashtable features = new Hashtable ( ) ; public Vector dtdLocations = new Vector ( ) ; public void setFailOnError ( boolean fail ) { } public void setWarn ( boolean bool ) { } public void setLenient ( boolean bool ) { } public void setClassName ( String className ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public void setFile ( File file ) { } public void addFileset ( FileSet set ) { } public XMLValidateTask . DTDLocation createDTD ( ) { } protected EntityResolver getEntityResolver ( ) { } public void execute ( ) throws BuildException { } private void initValidator ( ) { } private boolean setFeature ( String feature , boolean value , boolean warn ) { } private void doValidate ( File afile ) { } protected class ValidatorErrorHandler implements ErrorHandler { protected File currentFile = null ; protected String lastErrorMessage = null ; protected boolean failed = false ; public void init ( File file ) { } public boolean getFailure ( ) { } public void fatalError ( SAXParseException exception ) { } public void error ( SAXParseException exception ) { } public void warning ( SAXParseException exception ) { } private void doLog ( SAXParseException e , int logLevel ) { } private String getMessage ( SAXParseException e ) { } } public static class DTDLocation extends org . apache . tools . ant . types . DTDLocation { } private class LocalResolver implements EntityResolver { private Hashtable fileDTDs = new Hashtable ( ) ; private Hashtable resourceDTDs = new Hashtable ( ) ; private Hashtable urlDTDs = new Hashtable ( ) ; public LocalResolver ( ) { } public void registerDTD ( String publicId , String location ) { if ( location == null ) { return ; } <START_BUG> File fileDTD = new File ( location ) ; <END_BUG> if ( fileDTD . exists ( ) ) { if ( publicId != null ) { fileDTDs . put ( publicId , fileDTD ) ; log ( ( ( ( "Mapped<seq2seq4repair_space>publicId<seq2seq4repair_space>" + publicId ) + "<seq2seq4repair_space>to<seq2seq4repair_space>file<seq2seq4repair_space>" ) + fileDTD ) , MSG_VERBOSE ) ; } return ; } if ( ( this . getClass ( ) . getResource ( location ) ) != null ) { if ( publicId != null ) { resourceDTDs . put ( publicId , location ) ; log ( ( ( ( "Mapped<seq2seq4repair_space>publicId<seq2seq4repair_space>" + publicId ) + "<seq2seq4repair_space>to<seq2seq4repair_space>resource<seq2seq4repair_space>" ) + location ) , MSG_VERBOSE ) ; } } try { if ( publicId != null ) { URL urldtd = new URL ( location ) ; urlDTDs . put ( publicId , urldtd ) ; } } catch ( MalformedURLException e ) { } } public InputSource resolveEntity ( String publicId , String systemId ) throws SAXException { } public void registerDTD ( XMLValidateTask . DTDLocation location ) { } } }

Fix:
File fileDTD = project . resolveFile ( location ) ;