Buggy code:
public class FixCRLF extends MatchingTask { private static final int UNDEF = - 1 ; private static final int NOTJAVA = 0 ; private static final int LOOKING = 1 ; private static final int IN_CHAR_CONST = 2 ; private static final int IN_STR_CONST = 3 ; private static final int IN_SINGLE_COMMENT = 4 ; private static final int IN_MULTI_COMMENT = 5 ; private static final int ASIS = 0 ; private static final int CR = 1 ; private static final int LF = 2 ; private static final int CRLF = 3 ; private static final int ADD = 1 ; private static final int REMOVE = - 1 ; private static final int SPACES = - 1 ; private static final int TABS = 1 ; private static final int INBUFLEN = 8192 ; private static final int LINEBUFLEN = 200 ; private static final char CTRLZ = '' ; private int tablength = 8 ; private String spaces = "<seq2seq4repair_space>" ; private StringBuffer linebuf = new StringBuffer ( 1024 ) ; private StringBuffer linebuf2 = new StringBuffer ( 1024 ) ; private int eol ; private String eolstr ; private int ctrlz ; private int tabs ; private boolean javafiles = false ; private File srcDir ; private File destDir = null ; private FileUtils fileUtils = FileUtils . newFileUtils ( ) ; private String encoding = null ; public FixCRLF ( ) { } public void setSrcdir ( File srcDir ) { } public void setDestdir ( File destDir ) { } public void setJavafiles ( boolean javafiles ) { } 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 execute ( ) throws BuildException { } private Reader getReader ( File f ) throws IOException { } private void processFile ( String file ) throws BuildException { File srcFile = new File ( srcDir , file ) ; File destD = ( ( destDir ) == null ) ? srcDir : destDir ; File tmpFile = null ; BufferedWriter outWriter ; FixCRLF . OneLiner . BufferLine line ; FixCRLF . OneLiner lines = new FixCRLF . OneLiner ( srcFile ) ; try { try { <START_BUG> tmpFile = fileUtils . createTempFile ( "fixcrlf" , "" , destD ) ; <END_BUG> Writer writer = ( ( encoding ) == null ) ? new FileWriter ( tmpFile ) : new OutputStreamWriter ( new FileOutputStream ( tmpFile ) , encoding ) ; outWriter = new BufferedWriter ( writer ) ; } catch ( IOException e ) { throw new BuildException ( e ) ; } while ( lines . hasMoreElements ( ) ) { int endComment ; try { line = ( ( FixCRLF . OneLiner . BufferLine ) ( lines . nextElement ( ) ) ) ; } catch ( NoSuchElementException e ) { throw new BuildException ( e ) ; } String lineString = line . getLineString ( ) ; int linelen = line . length ( ) ; if ( ( tabs ) == ( FixCRLF . ASIS ) ) { try { outWriter . write ( lineString ) ; } catch ( IOException e ) { throw new BuildException ( e ) ; } } else { int ptr ; while ( ( ptr = line . getNext ( ) ) < linelen ) { switch ( lines . getState ( ) ) { case FixCRLF . NOTJAVA : notInConstant ( line , line . length ( ) , outWriter ) ; break ; case FixCRLF . IN_MULTI_COMMENT : endComment = lineString . indexOf ( "*//" , line . getNext ( ) ) ; if ( endComment >= 0 ) { endComment += 2 ; lines . setState ( FixCRLF . LOOKING ) ; } else { endComment = linelen ; } notInConstant ( line , endComment , outWriter ) ; break ; case FixCRLF . IN_SINGLE_COMMENT : notInConstant ( line , line . length ( ) , outWriter ) ; lines . setState ( FixCRLF . LOOKING ) ; break ; case FixCRLF . IN_CHAR_CONST : case FixCRLF . IN_STR_CONST : int begin = line . getNext ( ) ; char terminator = ( ( lines . getState ( ) ) == ( FixCRLF . IN_STR_CONST ) ) ? '\"' : '\'' ; endOfCharConst ( line , terminator ) ; while ( ( line . getNext ( ) ) < ( line . getLookahead ( ) ) ) { if ( ( line . getNextCharInc ( ) ) == '\t' ) { line . setColumn ( ( ( ( line . getColumn ( ) ) + ( tablength ) ) - ( ( line . getColumn ( ) ) % ( tablength ) ) ) ) ; } else { line . incColumn ( ) ; } } try { outWriter . write ( line . substring ( begin , line . getNext ( ) ) ) ; } catch ( IOException e ) { throw new BuildException ( e ) ; } lines . setState ( FixCRLF . LOOKING ) ; break ; case FixCRLF . LOOKING : nextStateChange ( line ) ; notInConstant ( line , line . getLookahead ( ) , outWriter ) ; break ; } } } try { outWriter . write ( eolstr ) ; } catch ( IOException e ) { throw new BuildException ( e ) ; } } try { if ( ( ctrlz ) == ( FixCRLF . ASIS ) ) { outWriter . write ( lines . getEofStr ( ) ) ; }

Fix:
tmpFile = fileUtils . createTempFile ( "fixcrlf" , "" , null ) ;