Buggy code:
public void log ( String message , int msgLevel ) { } public void log ( Task task , String message , int msgLevel ) { } public void log ( Target target , String message , int msgLevel ) { } public FilterSet getGlobalFilterSet ( ) { } public synchronized void setProperty ( String name , String value ) { } public synchronized void setNewProperty ( String name , String value ) { } public synchronized void setUserProperty ( String name , String value ) { } public synchronized void setInheritedProperty ( String name , String value ) { } private void setPropertyInternal ( String name , String value ) { } public String getProperty ( String name ) { } public String replaceProperties ( String value ) throws BuildException { } public String getUserProperty ( String name ) { } public Hashtable getProperties ( ) { } public Hashtable getUserProperties ( ) { } public void copyUserProperties ( Project other ) { } public void copyInheritedProperties ( Project other ) { } public void setDefaultTarget ( String defaultTarget ) { } public String getDefaultTarget ( ) { } public void setDefault ( String defaultTarget ) { } public void setName ( String name ) { } public String getName ( ) { } public void setDescription ( String description ) { } public String getDescription ( ) { } public void addFilter ( String token , String value ) { } public Hashtable getFilters ( ) { } public void setBasedir ( String baseD ) throws BuildException { } public void setBaseDir ( File baseDir ) throws BuildException { } public File getBaseDir ( ) { } public static String getJavaVersion ( ) { } public void setJavaVersionProperty ( ) throws BuildException { } public void setSystemProperties ( ) { } public void addTaskDefinition ( String taskName , Class taskClass ) throws BuildException { } public void checkTaskClass ( final Class taskClass ) throws BuildException { } public Hashtable getTaskDefinitions ( ) { } public void addDataTypeDefinition ( String typeName , Class typeClass ) { } public Hashtable getDataTypeDefinitions ( ) { } public void addTarget ( Target target ) throws BuildException { } public void addTarget ( String targetName , Target target ) throws BuildException { } public void addOrReplaceTarget ( Target target ) { } public void addOrReplaceTarget ( String targetName , Target target ) { } public Hashtable getTargets ( ) { } public Task createTask ( String taskType ) throws BuildException { } private void addCreatedTask ( String type , Task task ) { } private void invalidateCreatedTasks ( String type ) { } public Object createDataType ( String typeName ) throws BuildException { } public void executeTargets ( Vector targetNames ) throws BuildException { } public void demuxOutput ( String line , boolean isError ) { } public void executeTarget ( String targetName ) throws BuildException { } public File resolveFile ( String fileName , File rootDir ) { } public File resolveFile ( String fileName ) { } public static String translatePath ( String toProcess ) { } public void copyFile ( String sourceFile , String destFile ) throws IOException { } public void copyFile ( String sourceFile , String destFile , boolean filtering ) throws IOException { } public void copyFile ( String sourceFile , String destFile , boolean filtering , boolean overwrite ) throws IOException { } public void copyFile ( String sourceFile , String destFile , boolean filtering , boolean overwrite , boolean preserveLastModified ) throws IOException { } public void copyFile ( File sourceFile , File destFile ) throws IOException { } public void copyFile ( File sourceFile , File destFile , boolean filtering ) throws IOException { } public void copyFile ( File sourceFile , File destFile , boolean filtering , boolean overwrite ) throws IOException { } public void copyFile ( File sourceFile , File destFile , boolean filtering , boolean overwrite , boolean preserveLastModified ) throws IOException { } public void setFileLastModified ( File file , long time ) throws BuildException { } public static boolean toBoolean ( String s ) { } public final Vector topoSort ( String root , Hashtable targets ) throws BuildException { } private final void tsort ( String root , Hashtable targets , Hashtable state , Stack visiting , Vector ret ) throws BuildException { } private static BuildException makeCircularException ( String end , Stack stk ) { } public void addReference ( String name , Object value ) { synchronized ( references ) { Object old = references . get ( name ) ; if ( old == value ) { return ; } <START_BUG> if ( old != null ) { <END_BUG> log ( ( "Overriding<seq2seq4repair_space>previous<seq2seq4repair_space>definition<seq2seq4repair_space>of<seq2seq4repair_space>reference<seq2seq4repair_space>to<seq2seq4repair_space>" + name ) , Project . MSG_WARN ) ; } log ( ( ( ( "Adding<seq2seq4repair_space>reference:<seq2seq4repair_space>" + name ) + "<seq2seq4repair_space>-><seq2seq4repair_space>" ) + value ) , Project . MSG_DEBUG ) ; references . put ( name , value ) ; } } public Hashtable getReferences ( ) { } public Object getReference ( String key ) { } public String getElementName ( Object element ) { } public void fireBuildStarted ( ) { } public void fireBuildFinished ( Throwable exception ) { } protected void fireTargetStarted ( Target target ) { } protected void fireTargetFinished ( Target target , Throwable exception ) { } protected void fireTaskStarted ( Task task ) { } protected void fireTaskFinished ( Task task , Throwable exception ) { } private void fireMessageLoggedEvent ( BuildEvent event , String message , int priority ) { } protected void fireMessageLogged ( Project project , String message , int priority ) { } protected void fireMessageLogged ( Target target , String message , int priority ) { } protected void fireMessageLogged ( Task task , String message , int priority ) { } public synchronized void registerThreadTask ( Thread thread , Task task ) { } public Task getThreadTask ( Thread thread ) { } }

Fix:
if ( ( old != null ) && ( ! ( old instanceof UnknownElement ) ) ) {