Buggy code:
public class Property extends Task { protected String name ; protected String value ; protected File file ; protected URL url ; protected String resource ; protected Path classpath ; protected String env ; protected Reference ref ; protected String prefix ; private Project fallback ; private Object untypedValue ; private boolean valueAttributeUsed = false ; private boolean relative = false ; private File basedir ; private boolean prefixValues = false ; protected boolean userProperty ; public Property ( ) { } protected Property ( boolean userProperty ) { } protected Property ( boolean userProperty , Project fallback ) { } public void setRelative ( boolean relative ) { } public void setBasedir ( File basedir ) { } public void setName ( String name ) { } public String getName ( ) { } public void setLocation ( File location ) { } public void setValue ( Object value ) { } private void internalSetValue ( Object value ) { } public void setValue ( String value ) { } public void addText ( String msg ) { } public String getValue ( ) { } public void setFile ( File file ) { } public File getFile ( ) { } public void setUrl ( URL url ) { } public URL getUrl ( ) { } public void setPrefix ( String prefix ) { } public String getPrefix ( ) { } public void setPrefixValues ( boolean b ) { } public boolean getPrefixValues ( ) { } public void setRefid ( Reference ref ) { } public Reference getRefid ( ) { } public void setResource ( String resource ) { } public String getResource ( ) { } public void setEnvironment ( String env ) { } public String getEnvironment ( ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public Path getClasspath ( ) { } public void setUserProperty ( boolean userProperty ) { } public String toString ( ) { } public void execute ( ) throws BuildException { if ( ( getProject ( ) ) == null ) { throw new IllegalStateException ( "project<seq2seq4repair_space>has<seq2seq4repair_space>not<seq2seq4repair_space>been<seq2seq4repair_space>set" ) ; } if ( ( name ) != null ) { if ( ( ( untypedValue ) == null ) && ( ( ref ) == null ) ) { throw new BuildException ( ( "You<seq2seq4repair_space>must<seq2seq4repair_space>specify<seq2seq4repair_space>value,<seq2seq4repair_space>location<seq2seq4repair_space>or<seq2seq4repair_space>" + "refid<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>name<seq2seq4repair_space>attribute" ) , getLocation ( ) ) ; } } else { if ( ( ( ( ( url ) == null ) && ( ( file ) == null ) ) && ( ( resource ) == null ) ) && ( ( env ) == null ) ) { throw new BuildException ( ( "You<seq2seq4repair_space>must<seq2seq4repair_space>specify<seq2seq4repair_space>url,<seq2seq4repair_space>file,<seq2seq4repair_space>resource<seq2seq4repair_space>or<seq2seq4repair_space>" + ( "environment<seq2seq4repair_space>when<seq2seq4repair_space>not<seq2seq4repair_space>using<seq2seq4repair_space>the<seq2seq4repair_space>" + "name<seq2seq4repair_space>attribute" ) ) , getLocation ( ) ) ; } } if ( ( ( ( ( url ) == null ) && ( ( file ) == null ) ) && ( ( resource ) == null ) ) && ( ( prefix ) != null ) ) { throw new BuildException ( ( "Prefix<seq2seq4repair_space>is<seq2seq4repair_space>only<seq2seq4repair_space>valid<seq2seq4repair_space>when<seq2seq4repair_space>loading<seq2seq4repair_space>from<seq2seq4repair_space>" + "a<seq2seq4repair_space>url,<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>resource" ) , getLocation ( ) ) ; } if ( ( ( name ) != null ) && ( ( untypedValue ) != null ) ) { if ( relative ) { try { File from = ( ( untypedValue ) instanceof File ) ? ( ( File ) ( untypedValue ) ) : new File ( untypedValue . toString ( ) ) ; File to = ( ( basedir ) != null ) ? basedir : getProject ( ) . getBaseDir ( ) ; <START_BUG> String relPath = FileUtils . getFileUtils ( ) . getRelativePath ( to , from ) ; <END_BUG> relPath = relPath . replace ( '//' , File . separatorChar ) ; addProperty ( name , relPath ) ; } catch ( Exception e ) { throw new BuildException ( e , getLocation ( ) ) ; } } else { addProperty ( name , untypedValue ) ; } } if ( ( file ) != null ) { loadFile ( file ) ; } if ( ( url ) != null ) { loadUrl ( url ) ; } if ( ( resource ) != null ) { loadResource ( resource ) ; } if ( ( env ) != null ) { loadEnvironment ( env ) ; } if ( ( ( name ) != null ) && ( ( ref ) != null ) ) { try { addProperty ( name , ref . getReferencedObject ( getProject ( ) ) . toString ( ) ) ; } catch ( BuildException be ) { if ( ( fallback ) != null ) { addProperty ( name , ref . getReferencedObject ( fallback ) . toString ( ) ) ; } else { throw be ; } } } } protected void loadUrl ( URL url ) throws BuildException { } private void loadProperties ( Properties props , InputStream is , boolean isXml ) throws IOException { } protected void loadFile ( File file ) throws BuildException { } protected void loadResource ( String name ) { } protected void loadEnvironment ( String prefix ) { } protected void addProperties ( Properties props ) { } protected void addProperty ( String n , String v ) { } protected void addProperty ( String n , Object v ) { } private void resolveAllProperties ( Map props ) throws BuildException { } }

Fix:
String relPath = FileUtils . getRelativePath ( to , from ) ;