Buggy code:
public abstract class Definer extends DefBase { private static final String ANTLIB_XML = "//antlib.xml" ; private static class ResourceStack extends ThreadLocal { public Object initialValue ( ) { } Map getStack ( ) { } } private static Definer . ResourceStack resourceStack = new Definer . ResourceStack ( ) ; private String name ; private String classname ; private File file ; private String resource ; private boolean restrict = false ; private int format = Definer . Format . PROPERTIES ; private boolean definerSet = false ; private int onError = Definer . OnError . FAIL ; private String adapter ; private String adaptTo ; private Class adapterClass ; private Class adaptToClass ; public static class OnError extends EnumeratedAttribute { public static final int FAIL = 0 ; public static final int REPORT = 1 ; public static final int IGNORE = 2 ; public static final int FAIL_ALL = 3 ; public static final String POLICY_FAIL = "fail" ; public static final String POLICY_REPORT = "report" ; public static final String POLICY_IGNORE = "ignore" ; public static final String POLICY_FAILALL = "failall" ; public OnError ( ) { } public OnError ( String value ) { } public String [ ] getValues ( ) { } } public static class Format extends EnumeratedAttribute { public static final int PROPERTIES = 0 ; public static final int XML = 1 ; public String [ ] getValues ( ) { } } protected void setRestrict ( boolean restrict ) { } public void setOnError ( Definer . OnError onError ) { } public void setFormat ( Definer . Format format ) { } public String getName ( ) { } public File getFile ( ) { } public String getResource ( ) { } public void execute ( ) throws BuildException { ClassLoader al = createLoader ( ) ; if ( ! ( definerSet ) ) { if ( ( getURI ( ) ) == null ) { throw new BuildException ( ( ( "name,<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>resource<seq2seq4repair_space>attribute<seq2seq4repair_space>of<seq2seq4repair_space>" + ( getTaskName ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>undefined" ) , getLocation ( ) ) ; } if ( getURI ( ) . startsWith ( ANTLIB_PREFIX ) ) { String uri1 = getURI ( ) ; setResource ( Definer . makeResourceFromURI ( uri1 ) ) ; } else { throw new BuildException ( ( ( "Only<seq2seq4repair_space>antlib<seq2seq4repair_space>URIs<seq2seq4repair_space>can<seq2seq4repair_space>be<seq2seq4repair_space>located<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>URI<seq2seq4repair_space>alone," + "not<seq2seq4repair_space>the<seq2seq4repair_space>URI<seq2seq4repair_space>" ) + ( getURI ( ) ) ) ) ; } } if ( ( name ) != null ) { if ( ( classname ) == null ) { throw new BuildException ( ( ( ( "classname<seq2seq4repair_space>attribute<seq2seq4repair_space>of<seq2seq4repair_space>" + ( getTaskName ( ) ) ) + "<seq2seq4repair_space>element<seq2seq4repair_space>" ) + "is<seq2seq4repair_space>undefined" ) , getLocation ( ) ) ; } addDefinition ( al , name , classname ) ; } else { if ( ( classname ) != null ) { String msg = "You<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>specify<seq2seq4repair_space>classname<seq2seq4repair_space>" + "together<seq2seq4repair_space>with<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>resource." ; throw new BuildException ( msg , getLocation ( ) ) ; } Enumeration urls = null ; if ( ( file ) != null ) { final URL url = fileToURL ( ) ; if ( url == null ) { return ; } urls = new Enumeration ( ) { private boolean more = true ; public boolean hasMoreElements ( ) { return more ; } public Object nextElement ( ) throws NoSuchElementException { if ( more ) { more = false ; return url ; } else { throw new NoSuchElementException ( ) ; } } } ; } else { urls = resourceToURLs ( al ) ; } while ( urls . hasMoreElements ( ) ) { URL url = ( ( URL ) ( urls . nextElement ( ) ) ) ; int fmt = this . format ; <START_BUG> if ( url . toString ( ) . toLowerCase ( Locale . US ) . endsWith ( ".xml" ) ) { <END_BUG> fmt = Definer . Format . XML ; } if ( fmt == ( Definer . Format . PROPERTIES ) ) { loadProperties ( al , url ) ; break ; } else { if ( ( Definer . resourceStack . getStack ( ) . get ( url ) ) != null ) { log ( ( ( ( ( ( ( "Warning:<seq2seq4repair_space>Recursive<seq2seq4repair_space>loading<seq2seq4repair_space>of<seq2seq4repair_space>" + url ) + "<seq2seq4repair_space>ignored" ) + "<seq2seq4repair_space>at<seq2seq4repair_space>" ) + ( getLocation ( ) ) ) + "<seq2seq4repair_space>originally<seq2seq4repair_space>loaded<seq2seq4repair_space>at<seq2seq4repair_space>" ) + ( Definer . resourceStack . getStack ( ) . get ( url ) ) ) , MSG_WARN ) ; } else { try { Definer . resourceStack . getStack ( ) . put ( url , getLocation ( ) ) ; loadAntlib ( al , url ) ; } finally { Definer . resourceStack . getStack ( ) . remove ( url ) ; } } } } } } public static String makeResourceFromURI ( String uri ) { } private URL fileToURL ( ) { } private Enumeration resourceToURLs ( ClassLoader classLoader ) { } protected void loadProperties ( ClassLoader al , URL url ) { } private void loadAntlib ( ClassLoader classLoader , URL url ) { } public void setFile ( File file ) { } public void setResource ( String res ) { } public void setAntlib ( String antlib ) { } public void setName ( String name ) { } public String getClassname ( ) { } public void setClassname ( String classname ) { } public void setAdapter ( String adapter ) { } protected void setAdapterClass ( Class adapterClass ) { } public void setAdaptTo ( String adaptTo ) { } protected void setAdaptToClass ( Class adaptToClass ) { } protected void addDefinition ( ClassLoader al , String name , String classname ) throws BuildException { } private void tooManyDefinitions ( ) { } }

Fix:
if ( url . toString ( ) . toLowerCase ( Locale . ENGLISH ) . endsWith ( ".xml" ) ) {