Buggy code:
public class FixCRLF extends MatchingTask implements ChainableReader { private static final String FIXCRLF_ERROR = "<fixcrlf><seq2seq4repair_space>error:<seq2seq4repair_space>" ; public static final String ERROR_FILE_AND_SRCDIR = ( FixCRLF . FIXCRLF_ERROR ) + "srcdir<seq2seq4repair_space>and<seq2seq4repair_space>file<seq2seq4repair_space>are<seq2seq4repair_space>mutually<seq2seq4repair_space>exclusive" ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private boolean preserveLastModified = false ; private File srcDir ; private File destDir = null ; private File file ; private FixCrLfFilter filter = new FixCrLfFilter ( ) ; private Vector fcv = null ; private String encoding = null ; private String outputEncoding = null ; public final Reader chain ( final Reader rdr ) { } public void setSrcdir ( File srcDir ) { } public void setDestdir ( File destDir ) { } public void setJavafiles ( boolean javafiles ) { } public void setFile ( File file ) { } public void setEol ( FixCRLF . CrLf attr ) { } public void setCr ( FixCRLF . AddAsisRemove attr ) { } public void setTab ( FixCRLF . AddAsisRemove attr ) { } public void setTablength ( int tlength ) throws BuildException { } public void setEof ( FixCRLF . AddAsisRemove attr ) { } public void setEncoding ( String encoding ) { } public void setOutputEncoding ( String outputEncoding ) { } public void setFixlast ( boolean fixlast ) { } public void setPreserveLastModified ( boolean preserve ) { } public void execute ( ) throws BuildException { } private void validate ( ) throws BuildException { } private void processFile ( String file ) throws BuildException { File srcFile = new File ( srcDir , file ) ; long lastModified = srcFile . lastModified ( ) ; File destD = ( ( destDir ) == null ) ? srcDir : destDir ; if ( ( fcv ) == null ) { FilterChain fc = new FilterChain ( ) ; fc . add ( filter ) ; fcv = new Vector ( 1 ) ; fcv . add ( fc ) ; } <START_BUG> File tmpFile = FixCRLF . FILE_UTILS . createTempFileName ( "fixcrlf" , "" , null , true ) ; <END_BUG> try { FixCRLF . FILE_UTILS . copyFile ( srcFile , tmpFile , null , fcv , false , false , encoding , ( ( outputEncoding ) == null ? encoding : outputEncoding ) , getProject ( ) ) ; File destFile = new File ( destD , file ) ; boolean destIsWrong = true ; if ( destFile . exists ( ) ) { log ( "destFile<seq2seq4repair_space>exists" , MSG_DEBUG ) ; destIsWrong = ! ( FixCRLF . FILE_UTILS . contentEquals ( destFile , tmpFile ) ) ; log ( ( destFile + ( destIsWrong ? "<seq2seq4repair_space>is<seq2seq4repair_space>being<seq2seq4repair_space>written" : "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>written,<seq2seq4repair_space>as<seq2seq4repair_space>the<seq2seq4repair_space>contents<seq2seq4repair_space>are<seq2seq4repair_space>identical" ) ) , MSG_DEBUG ) ; } if ( destIsWrong ) { FixCRLF . FILE_UTILS . rename ( tmpFile , destFile ) ; if ( preserveLastModified ) { log ( "preserved<seq2seq4repair_space>lastModified" , MSG_DEBUG ) ; FixCRLF . FILE_UTILS . setFileLastModified ( destFile , lastModified ) ; } tmpFile = null ; } } catch ( IOException e ) { throw new BuildException ( e ) ; } } protected class OneLiner implements Enumeration { private static final int UNDEF = - 1 ; private static final int NOTJAVA = 0 ; private static final int LOOKING = 1 ; private static final int INBUFLEN = 8192 ; private static final int LINEBUFLEN = 200 ; private static final char CTRLZ = '' ; private int state = ( filter . getJavafiles ( ) ) ? FixCRLF . OneLiner . LOOKING : FixCRLF . OneLiner . NOTJAVA ; private StringBuffer eolStr = new StringBuffer ( FixCRLF . OneLiner . LINEBUFLEN ) ; private StringBuffer eofStr = new StringBuffer ( ) ; private BufferedReader reader ; private StringBuffer line = new StringBuffer ( ) ; private boolean reachedEof = false ; private File srcFile ; public OneLiner ( File srcFile ) throws BuildException { } protected void nextLine ( ) throws BuildException { } public String getEofStr ( ) { } public int getState ( ) { } public void setState ( int state ) { } public boolean hasMoreElements ( ) { } public Object nextElement ( ) throws NoSuchElementException { } public void close ( ) throws IOException { } class BufferLine { private int next = 0 ; private int column = 0 ; private int lookahead = FixCRLF . OneLiner . UNDEF ; private String line ; private String eolStr ; public BufferLine ( String line , String eolStr ) throws BuildException { } public int getNext ( ) { } public void setNext ( int next ) { } public int getLookahead ( ) { } public void setLookahead ( int lookahead ) { } public char getChar ( int i ) { } public char getNextChar ( ) { } public char getNextCharInc ( ) { } public int getColumn ( ) { } public void setColumn ( int col ) { } public int incColumn ( ) { } public int length ( ) { } public int getEolLength ( ) { } public String getLineString ( ) { } public String getEol ( ) { } public String substring ( int begin ) { } public String substring ( int begin , int end ) { } public void setState ( int state ) { } public int getState ( ) { } } } public static class AddAsisRemove extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public static class CrLf extends EnumeratedAttribute { public String [ ] getValues ( ) { } } }

Fix:
File tmpFile = FixCRLF . FILE_UTILS . createTempFile ( "fixcrlf" , "" , null , true , false ) ;