Buggy code:
public class EchoProperties extends Task { private static final String PROPERTIES = "properties" ; private static final String PROPERTY = "property" ; private static final String ATTR_NAME = "name" ; private static final String ATTR_VALUE = "value" ; private File inFile = null ; private File destfile = null ; private boolean failonerror = true ; private String prefix = null ; private String format = "text" ; public void setSrcfile ( File file ) { } public void setDestfile ( File destfile ) { } public void setFailOnError ( boolean failonerror ) { } public void setPrefix ( String prefix ) { } public void setFormat ( EchoProperties . FormatAttribute ea ) { } public static class FormatAttribute extends EnumeratedAttribute { private String [ ] formats = new String [ ] { "xml" , "text" } ; public String [ ] getValues ( ) { } } public void execute ( ) throws BuildException { Hashtable allProps = new Hashtable ( ) ; if ( ( inFile ) == null ) { <START_BUG> CollectionUtils . putAll ( allProps , project . getProperties ( ) ) ; <END_BUG> } else { if ( ( inFile . exists ( ) ) && ( inFile . isDirectory ( ) ) ) { String message = "srcfile<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>directory!" ; if ( failonerror ) { throw new BuildException ( message , location ) ; } else { log ( message , MSG_ERR ) ; } return ; } if ( ( inFile . exists ( ) ) && ( ! ( inFile . canRead ( ) ) ) ) { String message = "Can<seq2seq4repair_space>not<seq2seq4repair_space>read<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>specified<seq2seq4repair_space>srcfile!" ; if ( failonerror ) { throw new BuildException ( message , location ) ; } else { log ( message , MSG_ERR ) ; } return ; } FileInputStream in = null ; try { in = new FileInputStream ( inFile ) ; Properties props = new Properties ( ) ; props . load ( in ) ; CollectionUtils . putAll ( allProps , props ) ; } catch ( FileNotFoundException fnfe ) { String message = "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>file<seq2seq4repair_space>" + ( inFile . getAbsolutePath ( ) ) ; if ( failonerror ) { throw new BuildException ( message , fnfe , location ) ; } else { log ( message , MSG_WARN ) ; } return ; } catch ( IOException ioe ) { String message = "Could<seq2seq4repair_space>not<seq2seq4repair_space>read<seq2seq4repair_space>file<seq2seq4repair_space>" + ( inFile . getAbsolutePath ( ) ) ; if ( failonerror ) { throw new BuildException ( message , ioe , location ) ; } else { log ( message , MSG_WARN ) ; } return ; } finally { try { if ( null != in ) { in . close ( ) ; } } catch ( IOException ioe ) { } } } OutputStream os = null ; try { if ( ( destfile ) == null ) { os = new ByteArrayOutputStream ( ) ; saveProperties ( allProps , os ) ; log ( os . toString ( ) , MSG_INFO ) ; } else { if ( ( destfile . exists ( ) ) && ( destfile . isDirectory ( ) ) ) { String message = "destfile<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>directory!" ; if ( failonerror ) { throw new BuildException ( message , location ) ; } else { log ( message , MSG_ERR ) ; } return ; } if ( ( destfile . exists ( ) ) && ( ! ( destfile . canWrite ( ) ) ) ) { String message = "Can<seq2seq4repair_space>not<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>specified<seq2seq4repair_space>destfile!" ; if ( failonerror ) { throw new BuildException ( message , location ) ; } else { log ( message , MSG_ERR ) ; } return ; } os = new FileOutputStream ( this . destfile ) ; saveProperties ( allProps , os ) ; } } catch ( IOException ioe ) { if ( failonerror ) { throw new BuildException ( ioe , location ) ; } else { log ( ioe . getMessage ( ) , MSG_INFO ) ; } } finally { if ( os != null ) { try { os . close ( ) ; } catch ( IOException e ) { } } } } protected void saveProperties ( Hashtable allProps , OutputStream os ) throws IOException , BuildException { } protected void xmlSaveProperties ( Properties props , OutputStream os ) throws IOException { } protected void jdkSaveProperties ( Properties props , OutputStream os , String header ) throws IOException { } protected void jdk10SaveProperties ( Properties props , OutputStream os , String header ) { } private static DocumentBuilder getDocumentBuilder ( ) { } }

Fix:
CollectionUtils . putAll ( allProps , getProject ( ) . getProperties ( ) ) ;