Buggy code:
public class ProjectHelper { private static SAXParserFactory parserFactory = null ; private Parser parser ; private Project project ; private File buildFile ; private Locator locator ; public static void configureProject ( Project project , File buildFile ) throws BuildException { } private ProjectHelper ( Project project , File buildFile ) { } private void parse ( ) throws BuildException { } private class AbstractHandler extends HandlerBase { protected DocumentHandler parentHandler ; public AbstractHandler ( DocumentHandler parentHandler ) { } public void startElement ( String tag , AttributeList attrs ) throws SAXParseException { } public void characters ( char [ ] buf , int start , int end ) throws SAXParseException { } public void endElement ( String name ) throws SAXException { } } private class RootHandler extends HandlerBase { public void startElement ( String tag , AttributeList attrs ) throws SAXParseException { } public void setDocumentLocator ( Locator locator ) { } } private class ProjectHandler extends ProjectHelper . AbstractHandler { public ProjectHandler ( DocumentHandler parentHandler ) { } public void init ( String tag , AttributeList attrs ) throws SAXParseException { String def = null ; String name = null ; String id = null ; String baseDir = new File ( buildFile . getAbsolutePath ( ) ) . getParent ( ) ; for ( int i = 0 ; i < ( attrs . getLength ( ) ) ; i ++ ) { String key = attrs . getName ( i ) ; String value = attrs . getValue ( i ) ; if ( key . equals ( "default" ) ) { def = value ; } else if ( key . equals ( "name" ) ) { name = value ; } else if ( key . equals ( "id" ) ) { id = value ; } else if ( key . equals ( "basedir" ) ) { baseDir = value ; } else { throw new SAXParseException ( ( ( "Unexpected<seq2seq4repair_space>attribute<seq2seq4repair_space>\"" + ( attrs . getName ( i ) ) ) + "\"" ) , locator ) ; } } project . setDefaultTarget ( def ) ; project . setName ( name ) ; if ( name != null ) project . addReference ( name , project ) ; if ( id != null ) project . addReference ( id , project ) ; if ( ( project . getProperty ( "basedir" ) ) != null ) { project . setBasedir ( project . getProperty ( "basedir" ) ) ; } else { <START_BUG> project . setBasedir ( baseDir ) ; <END_BUG> } } public void startElement ( String name , AttributeList attrs ) throws SAXParseException { } private void handleTaskdef ( String name , AttributeList attrs ) throws SAXParseException { } private void handleProperty ( String name , AttributeList attrs ) throws SAXParseException { } private void handleTarget ( String tag , AttributeList attrs ) throws SAXParseException { } } private class TargetHandler extends ProjectHelper . AbstractHandler { private Target target ; public TargetHandler ( DocumentHandler parentHandler ) { } public void init ( String tag , AttributeList attrs ) throws SAXParseException { String name = null ; String depends = "" ; String ifCond = null ; String unlessCond = null ; String id = null ; for ( int i = 0 ; i < ( attrs . getLength ( ) ) ; i ++ ) { String key = attrs . getName ( i ) ; String value = attrs . getValue ( i ) ; if ( key . equals ( "name" ) ) { name = value ; } else if ( key . equals ( "depends" ) ) { depends = value ; } else if ( key . equals ( "if" ) ) { ifCond = value ; } else if ( key . equals ( "unless" ) ) { unlessCond = value ; } else if ( key . equals ( "id" ) ) { id = value ; } else { throw new SAXParseException ( ( ( "Unexpected<seq2seq4repair_space>attribute<seq2seq4repair_space>\"" + key ) + "\"" ) , locator ) ; } } if ( name == null ) { throw new SAXParseException ( "target<seq2seq4repair_space>element<seq2seq4repair_space>appears<seq2seq4repair_space>without<seq2seq4repair_space>a<seq2seq4repair_space>name<seq2seq4repair_space>attribute" , locator ) ; } target = new Target ( ) ; target . setName ( name ) ; target . setIf ( ifCond ) ; target . setUnless ( unlessCond ) ; project . addTarget ( name , target ) ; if ( ( id != null ) && ( ! ( id . equals ( "" ) ) ) ) project . addReference ( id , target ) ; if ( ( depends . length ( ) ) > 0 ) { StringTokenizer tok = new StringTokenizer ( depends , "," , false ) ; while ( tok . hasMoreTokens ( ) ) { target . addDependency ( tok . nextToken ( ) . trim ( ) ) ; } } } public void startElement ( String name , AttributeList attrs ) throws SAXParseException { } } private class TaskHandler extends ProjectHelper . AbstractHandler { private Target target ; private Task task ; public TaskHandler ( DocumentHandler parentHandler , Target target ) { } public void init ( String tag , AttributeList attrs ) throws SAXParseException { task = project . createTask ( tag ) ; configure ( task , attrs ) ; task . setLocation ( new Location ( buildFile . toString ( ) , locator . getLineNumber ( ) , locator . getColumnNumber ( ) ) ) ; task . init ( ) ; if ( ( target ) != null ) { task . setOwningTarget ( target ) ; target . addTask ( task ) ; } } public void characters ( char [ ] buf , int start , int end ) throws SAXParseException { } public void startElement ( String name , AttributeList attrs ) throws SAXParseException { } } private class NestedElementHandler extends ProjectHelper . AbstractHandler { private DocumentHandler parentHandler ;

Fix:
project . setBasedir ( new File ( buildFile . getParent ( ) , baseDir ) . getAbsolutePath ( ) ) ;