Source:
<code>private void optimizeForVirtStore() { UIConstants constants = ConstantsManager.getInstance().getConstants(); if (getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ArrayList<GlusterVolumeEntity> volumesForOptimiseForVirtStore = new ArrayList<GlusterVolumeEntity>(); <START> ArrayList<GlusterVolumeEntity> discouragedConfigVolumes = new ArrayList<GlusterVolumeEntity>(); <END> StringBuilder discouragedConfigVolumeNamesBuilder = new StringBuilder(); discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreWarning()); for (Object item : getSelectedItems()) { GlusterVolumeEntity volume = (GlusterVolumeEntity) item; volumesForOptimiseForVirtStore.add(volume); if(volume.getReplicaCount() != 3) { discouragedConfigVolumes.add(volume); discouragedConfigVolumeNamesBuilder.append(volume.getName() + "\n"); } } discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreContinueMessage()); if(discouragedConfigVolumes.size() > 0) { ConfirmationModel cModel = new ConfirmationModel(); cModel.setMessage(discouragedConfigVolumeNamesBuilder.toString()); UICommand cancelOptimiseVirtStoreCommand = new UICommand("CancelOptimizeForVirtStore", this); cancelOptimiseVirtStoreCommand.setTitle(constants.doNotOptimiseForVirtStore()); cancelOptimiseVirtStoreCommand.setIsCancel(true); cModel.getCommands().add(cancelOptimiseVirtStoreCommand); UICommand confirmOptimiseForVirtStoreCommand = new UICommand("ConfirmOptimiseForVirtStore", this); confirmOptimiseForVirtStoreCommand.setTitle(constants.continueOptimiseForVirtStore()); confirmOptimiseForVirtStoreCommand.setIsDefault(true); cModel.getCommands().add(confirmOptimiseForVirtStoreCommand); setConfirmWindow(cModel); } else { optimizeVolumesForVirtStore(volumesForOptimiseForVirtStore); } }</code><technical_language>boolean instead list. defaults false</technical_language>

Target:
private void optimizeForVirtStore() { UIConstants constants = ConstantsManager.getInstance().getConstants(); if (getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ArrayList<GlusterVolumeEntity> volumesForOptimiseForVirtStore = new ArrayList<GlusterVolumeEntity>(); Boolean isDiscouragedVolumePresent = false; StringBuilder discouragedConfigVolumeNamesBuilder = new StringBuilder(); discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreWarning()); for (Object item : getSelectedItems()) { GlusterVolumeEntity volume = (GlusterVolumeEntity) item; volumesForOptimiseForVirtStore.add(volume); if(volume.getReplicaCount() != 3) { discouragedConfigVolumeNamesBuilder.append(volume.getName() + "\n"); isDiscouragedVolumePresent = true; } } discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreContinueMessage()); if(isDiscouragedVolumePresent) { ConfirmationModel cModel = new ConfirmationModel(); cModel.setMessage(discouragedConfigVolumeNamesBuilder.toString()); UICommand cancelOptimiseVirtStoreCommand = new UICommand("CancelOptimizeForVirtStore", this); cancelOptimiseVirtStoreCommand.setTitle(constants.doNotOptimiseForVirtStore()); cancelOptimiseVirtStoreCommand.setIsCancel(true); cModel.getCommands().add(cancelOptimiseVirtStoreCommand); UICommand confirmOptimiseForVirtStoreCommand = new UICommand("ConfirmOptimiseForVirtStore", this); confirmOptimiseForVirtStoreCommand.setTitle(constants.continueOptimiseForVirtStore()); confirmOptimiseForVirtStoreCommand.setIsDefault(true); cModel.getCommands().add(confirmOptimiseForVirtStoreCommand); setConfirmWindow(cModel); } else { optimizeVolumesForVirtStore(volumesForOptimiseForVirtStore); } }