Buggy code:
public abstract class CustomFileList extends LinearLayout implements ICustomView { @ Inject AutoSaveManager autoSaveManager ; @ Inject BeanShellLinker linker ; @ Inject Arch16n arch16n ; private String ref ; private boolean dynamic ; private boolean sync ; protected List < NameValuePair > currentValues ; protected List < String > currentCertainties ; protected List < String > currentAnnotations ; protected List < String > certainties ; protected List < String > annotations ; protected boolean dirty ; protected String dirtyReason ; protected boolean annotationEnabled ; protected boolean certaintyEnabled ; protected FormInputDef inputDef ; private String focusCallback ; private String blurCallback ; protected List < ImageView > annotationIcons ; protected List < ImageView > certaintyIcons ; protected ViewFactory viewFactory ; protected List < NameValuePair > reloadOldPairs ; protected List < NameValuePair > reloadPairs ; protected List < String > reloadAnnotations ; protected List < String > reloadCertainties ; public CustomFileList ( Context context ) { } public CustomFileList ( Context context , FormInputDef inputDef , String ref , boolean dynamic , boolean sync ) { } public boolean getSync ( ) { } @ Override public String getRef ( ) { } @ Override public boolean isDynamic ( ) { } @ Override public String getClickCallback ( ) { } @ Override public void setClickCallback ( String code ) { } @ Override public String getSelectCallback ( ) { } @ Override public void setSelectCallback ( String code ) { } @ Override public String getFocusCallback ( ) { } @ Override public String getBlurCallback ( ) { } @ Override public void setFocusBlurCallbacks ( String focusCode , String blurCode ) { } @ Override public String getAttributeName ( ) { } @ Override public String getAttributeType ( ) { } @ Override public String getValue ( ) { } @ Override public void setValue ( String value ) { } @ Override public float getCertainty ( ) { } @ Override public void setCertainty ( float certainty ) { } @ Override public String getAnnotation ( ) { } @ Override public void setAnnotation ( String annotation ) { } public void setAnnotations ( List < String > annotations ) { } public List < String > getAnnotations ( ) { } public void setAnnotation ( String annotation , int index ) { } private void updateAnnotationIcon ( int index ) { } @ Override public void setAnnotationIcon ( ImageView annotationIcon ) { } public List < String > getCertainties ( ) { } public void setCertainty ( String certainty , int index ) { } private void updateCertaintyIcon ( int index ) { } @ Override public void setCertaintyIcon ( ImageView certaintyIcon ) { } public void setCertainties ( List < String > certainties ) { } @ SuppressWarnings ( "unchecked" ) @ Override public boolean hasChanges ( ) { } protected void notifySave ( ) { } @ Override public boolean hasAttributeChanges ( HashMap < String , ArrayList < Attribute > > attributes ) { } @ Override public void setDirty ( boolean dirty ) { } @ Override public String getDirtyReason ( ) { } @ Override public void setDirtyReason ( String reason ) { } @ SuppressWarnings ( "unchecked" ) @ Override public void save ( ) { } @ Override public void setValues ( List < ? > values ) { } public List < NameValuePair > getPairs ( ) { } public void setPairs ( List < NameValuePair > pairs ) { } protected void populate ( List < NameValuePair > pairs ) { } @ Override public boolean getAnnotationEnabled ( ) { } @ Override public void setAnnotationEnabled ( boolean enabled ) { } @ Override public boolean getCertaintyEnabled ( ) { } @ Override public void setCertaintyEnabled ( boolean enabled ) { } public void addFile ( String value , String annotation , String certainty ) { if ( ( annotations ) == null ) { annotations = new ArrayList < String > ( ) ; } annotation = ( annotation == null ) ? "" : annotation ; annotations . add ( annotation ) ; <START_BUG> updateAnnotationIcon ( annotations . indexOf ( annotation ) ) ; <END_BUG> if ( ( certainties ) == null ) { certainties = new ArrayList < String > ( ) ; } certainties . add ( certainty ) ; updateCertaintyIcon ( certainties . indexOf ( certainty ) ) ; notifySave ( ) ; } public void addFile ( String value ) { } public void setReloadPairs ( List < NameValuePair > pairs , List < NameValuePair > newPairs , List < String > newAnnotations , List < String > newCertainties ) { } public void updateIcons ( ) { } public void reload ( ) { } public boolean hasMultiAttributeChanges ( Module module , HashMap < String , ArrayList < Attribute > > attributes ) { } }

Fix:
updateAnnotationIcon ( ( ( annotations . size ( ) ) - 1 ) ) ;