Buggy code:
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 { } private void nextStateChange ( FixCRLF . OneLiner . BufferLine bufline ) throws BuildException { } private void endOfCharConst ( FixCRLF . OneLiner . BufferLine bufline , char terminator ) throws BuildException { } private void notInConstant ( FixCRLF . OneLiner . BufferLine bufline , int end , BufferedWriter outWriter ) { } class OneLiner implements Enumeration { private int state = ( javafiles ) ? FixCRLF . LOOKING : FixCRLF . NOTJAVA ; private StringBuffer eolStr = new StringBuffer ( FixCRLF . LINEBUFLEN ) ; private StringBuffer eofStr = new StringBuffer ( ) ; private BufferedReader reader ; private StringBuffer line = new StringBuffer ( ) ; private boolean reachedEof = false ; public OneLiner ( File srcFile ) throws BuildException { } protected void nextLine ( ) throws BuildException { int ch = - 1 ; int eolcount = 0 ; eolStr . setLength ( 0 ) ; line . setLength ( 0 ) ; try { ch = reader . read ( ) ; while ( ( ( ch != ( - 1 ) ) && ( ch != '\r' ) ) && ( ch != '\n' ) ) { line . append ( ( ( char ) ( ch ) ) ) ; ch = reader . read ( ) ; } if ( ( ch == ( - 1 ) ) && ( ( line . length ( ) ) == 0 ) ) { reachedEof = true ; return ; } switch ( ( ( char ) ( ch ) ) ) { case '\r' : ++ eolcount ; eolStr . append ( '\r' ) ; switch ( ( ( char ) ( ch = reader . read ( ) ) ) ) { case '\r' : if ( ( ( char ) ( ch = reader . read ( ) ) ) == '\n' ) { eolcount += 2 ; eolStr . append ( "\r\n" ) ; } break ; case '\n' : ++ eolcount ; eolStr . append ( '\n' ) ; break ; } break ; case '\n' : ++ eolcount ; eolStr . append ( '\n' ) ; break ; } if ( eolcount == 0 ) { int i = line . length ( ) ; while ( ( ( -- i ) >= 0 ) && ( ( line . charAt ( i ) ) == ( FixCRLF . CTRLZ ) ) ) { } if ( i < ( ( line . length ( ) ) - 1 ) ) { <START_BUG> eofStr . append ( line . substring ( ( i + 1 ) ) ) ; <END_BUG> if ( i < 0 ) { line . setLength ( 0 ) ; reachedEof = true ; } else { line . setLength ( ( i + 1 ) ) ; } } } } catch ( IOException e ) { throw new BuildException ( e ) ; } } 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 . 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 ) { }

Fix:
eofStr . append ( line . toString ( ) . substring ( ( i + 1 ) ) ) ;