Buggy code:
public class PictureGallery extends HorizontalScrollView implements ICustomView { class PictureGalleryOnClickListener implements OnClickListener { @ Override public void onClick ( View v ) { } } class PictureGalleryInternalOnClickListener implements OnClickListener { @ Override public void onClick ( View v ) { } } @ Inject AutoSaveManager autoSaveManager ; @ Inject BeanShellLinker linker ; protected static final int GALLERY_SIZE = 400 ; private static final int GALLERY_ITEM_PADDING = 10 ; private String ref ; private boolean dynamic ; protected List < NameValuePair > currentValues ; protected float certainty ; protected float currentCertainty ; protected String annotation ; protected String currentAnnotation ; protected boolean isMulti ; protected boolean dirty ; protected String dirtyReason ; protected List < CustomImageView > selectedImages ; protected ArrayList < CustomImageView > galleryImages ; protected LinearLayout galleriesLayout ; protected OnClickListener imageListener ; protected PictureGallery . PictureGalleryInternalOnClickListener internalListener ; protected PictureGallery . PictureGalleryOnClickListener customListener ; private boolean annotationEnabled ; private boolean certaintyEnabled ; private ImageView annotationIcon ; private ImageView certaintyIcon ; private FormInputDef inputDef ; private String selectCallback ; private String focusCallback ; private String blurCallback ; public PictureGallery ( Context context ) { } public PictureGallery ( Context context , FormInputDef inputDef , String ref , boolean dynamic , boolean isMulti ) { } @ Override public String getAttributeName ( ) { } @ Override public String getAttributeType ( ) { } @ Override public String getRef ( ) { } @ Override public boolean isDynamic ( ) { } @ Override public float getCertainty ( ) { } @ Override public void setCertainty ( float certainty ) { } private void updateCertaintyIcon ( float certainty ) { } @ Override public void setCertaintyIcon ( ImageView certaintyIcon ) { } @ Override public String getAnnotation ( ) { } @ Override public void setAnnotation ( String annotation ) { } private void updateAnnotationIcon ( String annotation ) { } @ Override public void setAnnotationIcon ( ImageView annotationIcon ) { } public boolean isMulti ( ) { } @ Override public boolean isDirty ( ) { } @ Override public void setDirty ( boolean value ) { } @ Override public void setDirtyReason ( String value ) { } @ Override public String getDirtyReason ( ) { } @ Override public void reset ( ) { } @ SuppressWarnings ( "unchecked" ) @ Override public boolean hasChanges ( ) { } @ SuppressWarnings ( "unchecked" ) @ Override public void save ( ) { } protected void updateImages ( ) { } protected void updateImageListeners ( ) { } public List < CustomImageView > getSelectedImages ( ) { } public int getSelectionItem ( ) { } public void setSelectionItem ( int position ) { } public void addSelectedImage ( CustomImageView imageView ) { } public void addSelectedImages ( List < CustomImageView > imageViews ) { } public void removeSelectedImage ( CustomImageView imageView ) { } public void removeSelectedImages ( ) { } @ Override public String getValue ( ) { } @ Override public void setValue ( String value ) { } @ Override public List < ? > getValues ( ) { } @ SuppressWarnings ( "unchecked" ) @ Override public void setValues ( List < ? > values ) { } public List < NameValuePair > getPairs ( ) { List < NameValuePair > pairs = new ArrayList < NameValuePair > ( ) ; for ( CustomImageView imageView : galleryImages ) { String name = imageView . getPicture ( ) . getId ( ) ; <START_BUG> String value = name ; <END_BUG> pairs . add ( new NameValuePair ( name , value ) ) ; } return pairs ; } public void setPairs ( List < NameValuePair > pairs ) { } public void populate ( List < Picture > pictures ) { } protected CustomImageView addGallery ( Picture picture ) { } protected void selectImage ( View v ) { } protected void longSelectImage ( View v ) { } protected void setGalleryImage ( CustomImageView gallery , String path ) { } @ Override public boolean getAnnotationEnabled ( ) { } @ Override public void setAnnotationEnabled ( boolean enabled ) { } @ Override public boolean getCertaintyEnabled ( ) { } @ Override public void setCertaintyEnabled ( boolean enabled ) { } public void setImageListener ( OnClickListener imageListener ) { } protected void notifySave ( ) { } @ Override public boolean hasAttributeChanges ( HashMap < String , ArrayList < Attribute > > attributes ) { } @ Override public String getClickCallback ( ) { } @ Override public void setClickCallback ( final 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 ) { } }

Fix:
String value = imageView . getPicture ( ) . getUrl ( ) ;