Buggy code:
public class Concat extends Task implements ResourceCollection { private static final int BUFFER_SIZE = 8192 ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private static final ResourceSelector EXISTS = new Exists ( ) ; private static final ResourceSelector NOT_EXISTS = new org . apache . tools . ant . types . resources . selectors . Not ( Concat . EXISTS ) ; public static class TextElement extends ProjectComponent { private String value = "" ; private boolean trimLeading = false ; private boolean trim = false ; private boolean filtering = true ; private String encoding = null ; public void setFiltering ( boolean filtering ) { } private boolean getFiltering ( ) { } public void setEncoding ( String encoding ) { } public void setFile ( File file ) throws BuildException { if ( ! ( file . exists ( ) ) ) { throw new BuildException ( ( ( "File<seq2seq4repair_space>" + file ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) ) ; } BufferedReader reader = null ; try { if ( ( this . encoding ) == null ) { reader = new BufferedReader ( new FileReader ( file ) ) ; } else { reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) , this . encoding ) ) ; } <START_BUG> value = FileUtils . readFully ( reader ) ; <END_BUG> } catch ( IOException ex ) { throw new BuildException ( ex ) ; } finally { FileUtils . close ( reader ) ; } } public void addText ( String value ) { } public void setTrimLeading ( boolean strip ) { } public void setTrim ( boolean trim ) { } public String getValue ( ) { } } private interface ReaderFactory { Reader getReader ( Object o ) throws IOException { } } private final class MultiReader extends Reader { private Reader reader = null ; private int lastPos = 0 ; private char [ ] lastChars = new char [ eolString . length ( ) ] ; private boolean needAddSeparator = false ; private Iterator readerSources ; private Concat . ReaderFactory factory ; private MultiReader ( Iterator readerSources , Concat . ReaderFactory factory ) { } private Reader getReader ( ) throws IOException { } private void nextReader ( ) throws IOException { } public int read ( ) throws IOException { } public int read ( char [ ] cbuf , int off , int len ) throws IOException { } public void close ( ) throws IOException { } private void addLastChar ( char ch ) { } private boolean isMissingEndOfLine ( ) { } private boolean isFixLastLine ( ) { } } private final class ConcatResource extends Resource { private ResourceCollection c ; private ConcatResource ( ResourceCollection c ) { } public InputStream getInputStream ( ) throws IOException { } public String getName ( ) { } } private File destinationFile ; private boolean append ; private String encoding ; private String outputEncoding ; private boolean binary ; private StringBuffer textBuffer ; private ResourceCollection rc ; private Vector filterChains ; private boolean forceOverwrite = true ; private Concat . TextElement footer ; private Concat . TextElement header ; private boolean fixLastLine = false ; private String eolString ; private Writer outputWriter = null ; private Concat . ReaderFactory resourceReaderFactory = new Concat . ReaderFactory ( ) { public Reader getReader ( Object o ) throws IOException { } } ; private Concat . ReaderFactory identityReaderFactory = new Concat . ReaderFactory ( ) { public Reader getReader ( Object o ) { } } ; public Concat ( ) { } public void reset ( ) { } public void setDestfile ( File destinationFile ) { } public void setAppend ( boolean append ) { } public void setEncoding ( String encoding ) { } public void setOutputEncoding ( String outputEncoding ) { } public void setForce ( boolean force ) { } public Path createPath ( ) { } public void addFileset ( FileSet set ) { } public void addFilelist ( FileList list ) { } public synchronized void add ( ResourceCollection c ) { } public void addFilterChain ( FilterChain filterChain ) { } public void addText ( String text ) { } public void addHeader ( Concat . TextElement headerToAdd ) { } public void addFooter ( Concat . TextElement footerToAdd ) { } public void setFixLastLine ( boolean fixLastLine ) { } public void setEol ( FixCRLF . CrLf crlf ) { } public void setWriter ( Writer outputWriter ) { } public void setBinary ( boolean binary ) { } public void execute ( ) { } public Iterator iterator ( ) { } public int size ( ) { } public boolean isFilesystemOnly ( ) { } private void validate ( ) { } private ResourceCollection getResources ( ) { } private boolean isUpToDate ( ResourceCollection c ) { } private void sanitizeText ( ) { } private void pump ( InputStream in , OutputStream out ) { } private Reader getFilteredReader ( Reader r ) { } }

Fix:
value = FileUtils . safeReadFully ( reader ) ;