Buggy code:
public class FSDirectory extends Directory { private static final Hashtable DIRECTORIES = new Hashtable ( ) ; private static boolean disableLocks = false ; public static void setDisableLocks ( boolean doDisableLocks ) { } public static boolean getDisableLocks ( ) { } public static final String LOCK_DIR = System . getProperty ( "org.apache.lucene.lockDir" , System . getProperty ( "java.io.tmpdir" ) ) ; private static Class IMPL ; private static MessageDigest DIGESTER ; private byte [ ] buffer = null ; public static FSDirectory getDirectory ( String path ) throws IOException { } public static FSDirectory getDirectory ( String path , LockFactory lockFactory ) throws IOException { } public static FSDirectory getDirectory ( File file ) throws IOException { } public static FSDirectory getDirectory ( File file , LockFactory lockFactory ) throws IOException { } public static FSDirectory getDirectory ( String path , boolean create ) throws IOException { } public static FSDirectory getDirectory ( File file , boolean create ) throws IOException { } private void create ( ) throws IOException { } private File directory = null ; private int refCount ; protected FSDirectory ( ) { } private void init ( File path , LockFactory lockFactory ) throws IOException { } public String [ ] list ( ) { } public boolean fileExists ( String name ) { } public long fileModified ( String name ) { } public static long fileModified ( File directory , String name ) { } public void touchFile ( String name ) { } public long fileLength ( String name ) { } public void deleteFile ( String name ) throws IOException { } public synchronized void renameFile ( String from , String to ) throws IOException { } public IndexOutput createOutput ( String name ) throws IOException { } public IndexInput openInput ( String name ) throws IOException { <START_BUG> return new FSDirectory . FSIndexInput ( new File ( directory , name ) ) ; <END_BUG> } public IndexInput openInput ( String name , int bufferSize ) throws IOException { } private static final char [ ] HEX_DIGITS = new char [ ] { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' } ; public String getLockID ( ) { } public synchronized void close ( ) { } public File getFile ( ) { } public String toString ( ) { } protected static class FSIndexInput extends BufferedIndexInput { private static class Descriptor extends RandomAccessFile { private boolean isOpen ; long position ; final long length ; public Descriptor ( File file , String mode ) throws IOException { } public void close ( ) throws IOException { } protected void finalize ( ) throws Throwable { } } private final FSDirectory . FSIndexInput . Descriptor file ; boolean isClone ; public FSIndexInput ( File path ) throws IOException { } public FSIndexInput ( File path , int bufferSize ) throws IOException { } protected void readInternal ( byte [ ] b , int offset , int len ) throws IOException { } public void close ( ) throws IOException { } protected void seekInternal ( long position ) { } public long length ( ) { } public Object clone ( ) { } boolean isFDValid ( ) throws IOException { } } protected static class FSIndexOutput extends BufferedIndexOutput { RandomAccessFile file = null ; private boolean isOpen ; public FSIndexOutput ( File path ) throws IOException { } public void flushBuffer ( byte [ ] b , int offset , int size ) throws IOException { } public void close ( ) throws IOException { } public void seek ( long pos ) throws IOException { } public long length ( ) throws IOException { } public void setLength ( long length ) throws IOException { } } }

Fix:
return openInput ( name , BUFFER_SIZE ) ;