Buggy code:
public class List extends Scrollable { String [ ] items ; int itemCount ; int anchorFirst ; int anchorLast ; boolean ignoreSelect ; static final int COLUMN_ID = 1024 ; static final int EXTRA_WIDTH = 25 ; static final int BORDER_INSET = 1 ; public List ( Composite parent , int style ) { } public void add ( String string ) { } public void add ( String string , int index ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } boolean contains ( int shellX , int shellY ) { } void createHandle ( ) { } void createWidget ( ) { } ScrollBar createScrollBar ( int style ) { } Color defaultBackground ( ) { } Color defaultForeground ( ) { } int defaultThemeFont ( ) { } public void deselect ( int index ) { } public void deselect ( int start , int end ) { } public void deselect ( int [ ] indices ) { } void deselect ( int [ ] ids , int count ) { } public void deselectAll ( ) { } void fixSelection ( int index , boolean add ) { } int getBorder ( ) { } public Rectangle getClientArea ( ) { } public int getFocusIndex ( ) { } public String getItem ( int index ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public String [ ] getItems ( ) { } public String [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public int getSelectionIndex ( ) { } public int [ ] getSelectionIndices ( ) { } public int getTopIndex ( ) { } void hookEvents ( ) { } int itemDataProc ( int browser , int id , int property , int itemData , int setValue ) { } int kEventControlGetClickActivation ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetCursor ( int nextHandler , int theEvent , int userData ) { } int kEventUnicodeKeyPressed ( int nextHandler , int theEvent , int userData ) { } int itemNotificationProc ( int browser , int id , int message ) { } public int indexOf ( String item ) { } public int indexOf ( String string , int start ) { } public boolean isSelected ( int index ) { } public void remove ( int index ) { } public void remove ( int start , int end ) { } public void remove ( String string ) { } public void remove ( int [ ] indices ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void select ( int index ) { } public void select ( int start , int end ) { } public void select ( int [ ] indices ) { } void select ( int [ ] ids , int count , boolean clear ) { } void select ( String [ ] items ) { } public void selectAll ( ) { } void setBackground ( float [ ] color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public void setItem ( int index , String string ) { } public void setItems ( String [ ] items ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify ) { } public void setSelection ( int start , int end ) { } public void setSelection ( int [ ] indices ) { } public void setSelection ( String [ ] items ) { } public void setTopIndex ( int index ) { checkWidget ( ) ; int itemHeight = getItemHeight ( ) ; int [ ] top = new int [ 1 ] ; int [ ] left = new int [ 1 ] ; OS . GetDataBrowserScrollPosition ( handle , top , left ) ; <START_BUG> top [ 0 ] = Math . min ( ( ( itemHeight * ( itemCount ) ) - ( getClientArea ( ) . height ) ) , ( index * itemHeight ) ) ; <END_BUG> OS . SetDataBrowserScrollPosition ( handle , top [ 0 ] , left [ 0 ] ) ; } void showIndex ( int index ) { } public void showSelection ( ) { } }

Fix:
top [ 0 ] = Math . max ( 0 , Math . min ( ( ( itemHeight * ( itemCount ) ) - ( getClientArea ( ) . height ) ) , ( index * itemHeight ) ) ) ;