Buggy code:
protected void storeDialog ( IDialogSettings settings ) { } private void createHeader ( Composite parent ) { } private void createLabels ( Composite parent ) { } private void createViewMenu ( Composite parent ) { } protected void fillViewMenu ( IMenuManager menuManager ) { } private void showViewMenu ( ) { } private void createPopupMenu ( ) { } protected abstract Control createExtendedContentArea ( Composite parent ) { } protected Control createDialogArea ( Composite parent ) { } protected void handleDoubleClick ( ) { } private void refreshDetails ( ) { } protected void handleSelected ( StructuredSelection selection ) { } protected IDialogSettings getDialogBoundsSettings ( ) { } protected abstract IDialogSettings getDialogSettings ( ) { } public void refresh ( ) { } public void updateProgressLabel ( ) { } public void reloadCache ( boolean checkDuplicates , IProgressMonitor monitor ) { } public void scheduleRefresh ( ) { } public void scheduleProgressMessageRefresh ( ) { } protected void computeResult ( ) { } protected void updateStatus ( IStatus status ) { } protected void okPressed ( ) { } public void setInitialPattern ( String text ) { } public void setInitialPattern ( String text , int selectionMode ) { } protected String getInitialPattern ( ) { } protected StructuredSelection getSelectedItems ( ) { } protected abstract IStatus validateItem ( Object item ) { } protected abstract FilteredItemsSelectionDialog . ItemsFilter createFilter ( ) { } protected void applyFilter ( ) { } protected abstract Comparator getItemsComparator ( ) { } protected abstract void fillContentProvider ( FilteredItemsSelectionDialog . AbstractContentProvider contentProvider , FilteredItemsSelectionDialog . ItemsFilter itemsFilter , IProgressMonitor progressMonitor ) throws CoreException { } private void removeSelectedItems ( List items ) { } protected Object removeHistoryItem ( Object item ) { } protected void accessedHistoryItem ( Object item ) { } private Comparator getHistoryComparator ( ) { } protected FilteredItemsSelectionDialog . SelectionHistory getSelectionHistory ( ) { } protected void setSelectionHistory ( FilteredItemsSelectionDialog . SelectionHistory selectionHistory ) { } public boolean isHistoryElement ( Object item ) { } public boolean isDuplicateElement ( Object item ) { } public void setSeparatorLabel ( String separatorLabel ) { } public abstract String getElementName ( Object item ) { } private class ToggleStatusLineAction extends Action { public ToggleStatusLineAction ( ) { } public void run ( ) { } } private class RefreshJob extends UIJob { public RefreshJob ( ) { } public IStatus runInUIThread ( IProgressMonitor monitor ) { } } private class RefreshProgressMessageJob extends UIJob { private boolean cancelling = false ; public RefreshProgressMessageJob ( ) { } public IStatus runInUIThread ( IProgressMonitor monitor ) { } protected void canceling ( ) { } } private class RefreshCacheJob extends Job { private FilteredItemsSelectionDialog . RefreshJob refreshJob = new FilteredItemsSelectionDialog . RefreshJob ( ) ; public RefreshCacheJob ( ) { } public void cancelAll ( ) { } protected IStatus run ( IProgressMonitor monitor ) { } protected void canceling ( ) { } } private class RemoveHistoryItemAction extends Action { public RemoveHistoryItemAction ( ) { } public void run ( ) { } } private class ItemsListLabelProvider extends LabelProvider implements IColorProvider , ILabelProviderListener { private ILabelProvider provider ; private ILabelDecorator selectionDecorator ; private ListenerList listeners = new ListenerList ( ) ; public ItemsListLabelProvider ( ILabelProvider provider , ILabelDecorator selectionDecorator ) { } public void setSelectionDecorator ( ILabelDecorator newSelectionDecorator ) { } public ILabelDecorator getSelectionDecorator ( ) { } public void setProvider ( ILabelProvider newProvider ) { } public ILabelProvider getProvider ( ) { } public Image getImage ( Object element ) { } public String getText ( Object element ) { if ( element instanceof FilteredItemsSelectionDialog . ItemsListSeparator ) { return getSeparatorLabel ( ( ( FilteredItemsSelectionDialog . ItemsListSeparator ) ( element ) ) . getName ( ) ) ; } String str = provider . getText ( element ) ; if ( ( ( selectionDecorator ) != null ) && ( element != null ) ) { int [ ] selectionIndices = list . getTable ( ) . getSelectionIndices ( ) ; List elements = Arrays . asList ( contentProvider . getElements ( null ) ) ; for ( int i = 0 ; i < ( selectionIndices . length ) ; i ++ ) { <START_BUG> if ( ( ( elements . size ( ) ) > i ) && ( element . equals ( elements . get ( selectionIndices [ i ] ) ) ) ) { <END_BUG> str = selectionDecorator . decorateText ( str , element ) ; break ; } } } return str ; } private String getSeparatorLabel ( String separatorLabel ) { } public void addListener ( ILabelProviderListener listener ) { } public void dispose ( ) { } public boolean isLabelProperty ( Object element , String property ) { } public void removeListener ( ILabelProviderListener listener ) { } public Color getBackground ( Object element ) { } public Color getForeground ( Object element ) { } public void labelProviderChanged ( LabelProviderChangedEvent event ) { } } private class ItemsListSeparator { private String name ; public ItemsListSeparator ( String name ) { } public String getName ( ) { } } private static class GranualProgressMonitor extends ProgressMonitorWrapper { private FilteredItemsSelectionDialog . ContentProvider contentProvider ; private String name ; private String subName ; private int totalWork ; private double worked ; private boolean done ; private boolean isFiltering ; public GranualProgressMonitor ( IProgressMonitor monitor , FilteredItemsSelectionDialog . ContentProvider contentProvider , boolean isFiltering ) { } public void setTaskName ( String name ) { } public void subTask ( String name ) { } public void beginTask ( String name , int totalWork ) { } public void worked ( int work ) { } public void done ( ) { } public void setCanceled ( boolean b ) { } public void internalWorked ( double work ) { } private void updateProgressMessage ( ) { } private String getMessage ( ) { } } private class FilterJob extends Job { protected FilteredItemsSelectionDialog . ItemsFilter itemsFilter ;

Fix:
if ( ( ( elements . size ( ) ) > ( selectionIndices [ i ] ) ) && ( element . equals ( elements . get ( selectionIndices [ i ] ) ) ) ) {