Buggy code:
public class GlusterVolumeSnapshotListModel extends SearchableListModel < GlusterVolumeEntity , GlusterVolumeSnapshotEntity > { private UICommand createSnapshotCommand ; public UICommand getCreateSnapshotCommand ( ) { } public void setCreateSnapshotCommand ( UICommand value ) { } private UICommand editSnapshotScheduleCommand ; public UICommand getEditSnapshotScheduleCommand ( ) { } public void setEditSnapshotScheduleCommand ( UICommand command ) { } @ Override public String getListName ( ) { } public GlusterVolumeSnapshotListModel ( ) { } @ Override protected void onEntityChanged ( ) { } @ Override protected void onSelectedItemChanged ( ) { } @ Override protected void selectedItemsChanged ( ) { } private UICommand restoreSnapshotCommand ; private UICommand deleteSnapshotCommand ; private UICommand deleteAllSnapshotsCommand ; private UICommand activateSnapshotCommand ; private UICommand deactivateSnapshotCommand ; public UICommand getRestoreSnapshotCommand ( ) { } public void setRestoreSnapshotCommand ( UICommand restoreSnapshotCommand ) { } public UICommand getDeleteSnapshotCommand ( ) { } public void setDeleteSnapshotCommand ( UICommand deleteSnapshotCommand ) { } public UICommand getDeleteAllSnapshotsCommand ( ) { } public void setDeleteAllSnapshotsCommand ( UICommand deleteAllSnapshotsCommand ) { } public UICommand getActivateSnapshotCommand ( ) { } public void setActivateSnapshotCommand ( UICommand activateSnapshotCommand ) { } public UICommand getDeactivateSnapshotCommand ( ) { } public void setDeactivateSnapshotCommand ( UICommand deactivateSnapshotCommand ) { } private void updateActionAvailability ( ) { boolean allowRestore = false ; boolean allowDelete = true ; <START_BUG> boolean allowDeleteAll = true ; <END_BUG> boolean allowActivate = false ; boolean allowDeactivate = false ; boolean allowCreateSnapshot = true ; boolean allowEditSnapshotSchedule = false ; if ( ( ( getSelectedItems ( ) ) == null ) || ( ( getSelectedItems ( ) . size ( ) ) == 0 ) ) { allowDelete = false ; } else { List < GlusterVolumeSnapshotEntity > snapshots = Linq . < GlusterVolumeSnapshotEntity > cast ( getSelectedItems ( ) ) ; if ( ( snapshots . size ( ) ) == 1 ) { allowRestore = true ; allowActivate = ( snapshots . get ( 0 ) . getStatus ( ) ) == ( GlusterSnapshotStatus . DEACTIVATED ) ; allowDeactivate = ( snapshots . get ( 0 ) . getStatus ( ) ) == ( GlusterSnapshotStatus . ACTIVATED ) ; } } if ( ( ( getEntity ( ) ) == null ) || ( ( getEntity ( ) . getStatus ( ) ) == ( GlusterStatus . DOWN ) ) ) { allowCreateSnapshot = false ; } if ( ( ( ( getEntity ( ) ) != null ) && ( ( getEntity ( ) . getStatus ( ) ) == ( GlusterStatus . UP ) ) ) && ( getEntity ( ) . getSnapshotScheduled ( ) ) ) { allowEditSnapshotSchedule = true ; } getRestoreSnapshotCommand ( ) . setIsExecutionAllowed ( allowRestore ) ; getDeleteSnapshotCommand ( ) . setIsExecutionAllowed ( allowDelete ) ; getDeleteAllSnapshotsCommand ( ) . setIsExecutionAllowed ( allowDeleteAll ) ; getActivateSnapshotCommand ( ) . setIsExecutionAllowed ( allowActivate ) ; getDeactivateSnapshotCommand ( ) . setIsExecutionAllowed ( allowDeactivate ) ; getCreateSnapshotCommand ( ) . setIsExecutionAllowed ( allowCreateSnapshot ) ; getEditSnapshotScheduleCommand ( ) . setIsExecutionAllowed ( allowEditSnapshotSchedule ) ; } @ Override protected void syncSearch ( ) { } @ Override public void executeCommand ( UICommand command ) { } private void restoreSnapshot ( ) { } private void onRestoreSnapshot ( ) { } private void deleteSnapshot ( ) { } private void onDeleteSnapshot ( ) { } private void deleteAllSnapshots ( ) { } private void onDeleteAllSnapshots ( ) { } private void activateSnapshot ( ) { } private void onActivateSnapshot ( ) { } private void deactivateSnapshot ( ) { } private void onDeactivateSnapshot ( ) { } private void runAction ( VdcActionType action , VdcActionParametersBase param ) { } @ Override public GlusterVolumeEntity getEntity ( ) { } public void setEntity ( GlusterVolumeEntity value ) { } private void createSnapshot ( ) { } private void onCreateSnapshot ( ) { } private Time getExecutionTime ( GlusterVolumeSnapshotModel model ) { } private void scheduleSnapshot ( final GlusterVolumeSnapshotModel snapshotModel , boolean reschedule ) { } private void createNewSnapshot ( final GlusterVolumeSnapshotModel snapshotModel ) { } public void postSnapshotAction ( VdcReturnValueBase returnValue ) { } public void editSnapshotSchedule ( ) { } public void onEditSnapshotSchedule ( ) { } }

Fix:
boolean allowDeleteAll = ( ( getItems ( ) ) == null ) ? false : ( getItems ( ) . size ( ) ) > 0 ;