Buggy code:
public class BufMgr { private byte [ ] [ ] bufPool ; private FrameDesc [ ] frDescriptor ; private Queue < Integer > queue ; private int numbufs ; private FrameHashTable frHashTab ; private LIRS rep ; private LinkedList < Integer > emptylist ; public BufMgr ( int numbufs , int lookAheadSize , String replacerArg ) { } public void pinPage ( PageId pageno , Page page , boolean emptyPage ) throws BufferPoolExceededException , DiskMgrException , HashEntryNotFoundException { FPpair fp = new FPpair ( ) ; fp = frHashTab . getPair ( pageno ) ; if ( fp != null ) { int index = fp . getFrame ( ) ; if ( ( frDescriptor [ index ] . getPinCount ( ) ) == 0 ) emptylist . remove ( ( ( Integer ) ( index ) ) ) ; frDescriptor [ index ] . IncrePinCount ( ) ; page . setpage ( bufPool [ index ] ) ; rep . increGlobalOpId ( ) ; rep . setFrameOpId ( index ) ; if ( ( ( frDescriptor [ index ] ) != null ) && ( frDescriptor [ index ] . isDirty ( ) ) ) { flushPage ( frDescriptor [ index ] . getPageId ( ) ) ; } } else { int index = - 1 ; if ( ! ( isFull ( ) ) ) { index = emptylist . get ( 0 ) ; emptylist . remove ( 0 ) ; rep . increGlobalOpId ( ) ; rep . setFrameOpId ( index ) ; if ( ( ( frDescriptor [ index ] ) != null ) && ( frDescriptor [ index ] . isDirty ( ) ) ) { flushPage ( frDescriptor [ index ] . getPageId ( ) ) ; frHashTab . DeleteFromDir ( frDescriptor [ index ] . getPageId ( ) , index ) ; } } else { if ( ( getNumUnpinned ( ) ) != 0 ) { int [ ] LIRSresult = new int [ numbufs ] ; for ( int i = 0 ; i < ( numbufs ) ; i = i + 1 ) { LIRSresult [ i ] = - 1 ; } for ( int i = 0 ; i < ( numbufs ) ; i = i + 1 ) { <START_BUG> LIRSresult [ numbufs ] = rep . result ( numbufs ) ; <END_BUG> } index = hasMaxLIRS ( LIRSresult ) ; rep . increGlobalOpId ( ) ; rep . setFrameOpId ( index ) ; if ( ( ( frDescriptor [ index ] ) != null ) && ( frDescriptor [ index ] . isDirty ( ) ) ) { flushPage ( frDescriptor [ index ] . getPageId ( ) ) ; frHashTab . DeleteFromDir ( frDescriptor [ index ] . getPageId ( ) , index ) ; } } else { throw new BufferPoolExceededException ( null , "No<seq2seq4repair_space>unpinned<seq2seq4repair_space>buffer<seq2seq4repair_space>frame." ) ; } } Page temp = new Page ( ) ; try { DiskManager . read_page ( new PageId ( pageno . pid ) , temp ) ; } catch ( Exception e ) { throw new DiskMgrException ( e , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>a<seq2seq4repair_space>page." ) ; } bufPool [ index ] = temp . getpage ( ) ; page . setpage ( bufPool [ index ] ) ; frDescriptor [ index ] = new FrameDesc ( new PageId ( pageno . pid ) , 1 , false ) ; frHashTab . AddToDir ( pageno , index ) ; } } public void unpinPage ( PageId pageno , boolean dirty ) throws DiskMgrException , FileIOException , HashEntryNotFoundException , InvalidPageNumberException , PageUnpinnedException , IOException { } public PageId newPage ( Page firstpage , int howmany ) throws BufferPoolExceededException , DiskMgrException , HashEntryNotFoundException { } public void freePage ( PageId globalPageId ) throws DiskMgrException , FileIOException , InvalidPageNumberException , InvalidRunSizeException , PagePinnedException , ChainException , IOException { } public void flushPage ( PageId pageid ) throws DiskMgrException , HashEntryNotFoundException { } public void flushAllPages ( ) throws DiskMgrException , HashEntryNotFoundException { } public int getNumBuffers ( ) { } public int getNumUnpinned ( ) { } public boolean isFull ( ) { } private int hasMaxLIRS ( int [ ] a ) { } }

Fix:
LIRSresult [ i ] = rep . result ( i ) ;