Buggy code:
public class XMLCatalog extends DataType implements Cloneable , URIResolver , EntityResolver { private static FileUtils fileUtils = FileUtils . newFileUtils ( ) ; private Vector elements = new Vector ( ) ; private Path classpath ; private Path catalogPath ; public static final String APACHE_RESOLVER = "org.apache.tools.ant.types.resolver.ApacheCatalogResolver" ; public static final String CATALOG_RESOLVER = "org.apache.xml.resolver.tools.CatalogResolver" ; public XMLCatalog ( ) { } private Vector getElements ( ) { } private Path getClasspath ( ) { } private void setElements ( Vector aVector ) { } public Path createClasspath ( ) { } public void setClasspath ( Path classpath ) { } public void setClasspathRef ( Reference r ) { } public Path createCatalogPath ( ) { } public void setCatalogPathRef ( Reference r ) { } public Path getCatalogPath ( ) { } public void addDTD ( ResourceLocation dtd ) throws BuildException { } public void addEntity ( ResourceLocation entity ) throws BuildException { } public void addConfiguredXMLCatalog ( XMLCatalog catalog ) { } public void setRefid ( Reference r ) throws BuildException { } public InputSource resolveEntity ( String publicId , String systemId ) throws IOException , SAXException { } public Source resolve ( String href , String base ) throws TransformerException { } private XMLCatalog getRef ( ) { } private XMLCatalog . CatalogResolver catalogResolver = null ; private XMLCatalog . CatalogResolver getCatalogResolver ( ) { } private void setEntityResolver ( SAXSource source ) throws TransformerException { } private ResourceLocation findMatchingEntry ( String publicId ) { } private String removeFragment ( String uri ) { } private InputSource filesystemLookup ( ResourceLocation matchingEntry ) { String uri = matchingEntry . getLocation ( ) ; uri = uri . replace ( File . separatorChar , '//' ) ; URL baseURL = null ; if ( ( matchingEntry . getBase ( ) ) != null ) { baseURL = matchingEntry . getBase ( ) ; } else { try { baseURL = XMLCatalog . fileUtils . getFileURL ( getProject ( ) . getBaseDir ( ) ) ; } catch ( MalformedURLException ex ) { throw new BuildException ( "Project<seq2seq4repair_space>basedir<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>converted<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>URL" ) ; } } InputSource source = null ; URL url = null ; try { url = new URL ( baseURL , uri ) ; } catch ( MalformedURLException ex ) { File testFile = new File ( uri ) ; if ( ( testFile . exists ( ) ) && ( testFile . canRead ( ) ) ) { log ( ( ( "uri<seq2seq4repair_space>:<seq2seq4repair_space>'" + uri ) + "'<seq2seq4repair_space>matches<seq2seq4repair_space>a<seq2seq4repair_space>readable<seq2seq4repair_space>file" ) , MSG_DEBUG ) ; try { url = XMLCatalog . fileUtils . getFileURL ( testFile ) ; } catch ( MalformedURLException ex1 ) { throw new BuildException ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>an<seq2seq4repair_space>URL<seq2seq4repair_space>for<seq2seq4repair_space>:" + ( testFile . getAbsolutePath ( ) ) ) ) ; } } else { log ( ( ( "uri<seq2seq4repair_space>:<seq2seq4repair_space>'" + uri ) + "'<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>a<seq2seq4repair_space>readable<seq2seq4repair_space>file" ) , MSG_DEBUG ) ; } } if ( url != null ) { <START_BUG> String fileName = url . getFile ( ) ; <END_BUG> if ( fileName != null ) { log ( ( "fileName<seq2seq4repair_space>" + fileName ) , MSG_DEBUG ) ; File resFile = new File ( fileName ) ; if ( ( resFile . exists ( ) ) && ( resFile . canRead ( ) ) ) { try { source = new InputSource ( new FileInputStream ( resFile ) ) ; String sysid = JAXPUtils . getSystemId ( resFile ) ; source . setSystemId ( sysid ) ; log ( ( ( "catalog<seq2seq4repair_space>entry<seq2seq4repair_space>matched<seq2seq4repair_space>a<seq2seq4repair_space>readable<seq2seq4repair_space>file:<seq2seq4repair_space>'" + sysid ) + "'" ) , MSG_DEBUG ) ; } catch ( IOException ex ) { } } } } return source ; } private InputSource classpathLookup ( ResourceLocation matchingEntry ) { } private InputSource urlLookup ( ResourceLocation matchingEntry ) { } private interface CatalogResolver extends URIResolver , EntityResolver { InputSource resolveEntity ( String publicId , String systemId ) { } Source resolve ( String href , String base ) throws TransformerException { } } private class InternalResolver implements XMLCatalog . CatalogResolver { public InternalResolver ( ) { } public InputSource resolveEntity ( String publicId , String systemId ) { } public Source resolve ( String href , String base ) throws TransformerException { } } private class ExternalResolver implements XMLCatalog . CatalogResolver { private Method setXMLCatalog = null ; private Method parseCatalog = null ; private Method resolveEntity = null ; private Method resolve = null ; private Object resolverImpl = null ; private boolean externalCatalogsProcessed = false ; public ExternalResolver ( Class resolverImplClass , Object resolverImpl ) { } public InputSource resolveEntity ( String publicId , String systemId ) { } public Source resolve ( String href , String base ) throws TransformerException { } private void processExternalCatalogs ( ) { } } }

Fix:
String fileName = XMLCatalog . fileUtils . fromURI ( url . toString ( ) ) ;