Source:
<code>private void UpdateOptionsNonLocalFS() { <START> if (hosts == null || allHosts == null || (getEntity().supportsGlusterService() && isAnyHostUpInCluster == null)) { <END> return; } UICommand addHostAction = new UICommand("AddHost", this); if (hosts.size() > 1) { hosts.remove(0); } if (hosts.isEmpty()) { addHostAction.setTitle(ClusterConfigureHostsAction); getCompulsoryActions().add(addHostAction); } else if (!getEntity().supportsGlusterService() || isAnyHostUpInCluster) { addHostAction.setTitle(ClusterAddAnotherHostAction); getOptionalActions().add(addHostAction); } if (getEntity().getStoragePoolId() == null) { addHostAction.getExecuteProhibitionReasons().add(ConstantsManager.getInstance() .getConstants() .theClusterIsntAttachedToADcClusterGuide()); addHostAction.setIsExecutionAllowed(false); return; } ArrayList<VDS> availableHosts = new ArrayList<VDS>(); for (VDS vds : allHosts) { if (!getEntity().getId().equals(vds.getVdsGroupId()) && (vds.getStatus() == VDSStatus.Maintenance || vds.getStatus() == VDSStatus.PendingApproval) && vds.getSupportedClusterVersionsSet().contains(getEntity().getcompatibility_version())) { availableHosts.add(vds); } } UICommand selectHostAction = new UICommand("SelectHost", this); if (availableHosts.size() > 0) { if (hosts.isEmpty()) { selectHostAction.setTitle(SelectHostsAction); getCompulsoryActions().add(selectHostAction); } else if (!getEntity().supportsGlusterService() || isAnyHostUpInCluster) { selectHostAction.setTitle(SelectHostsAction); getOptionalActions().add(selectHostAction); } } StopProgress(); }</code><technical_language>a single flag (and consider changing name); !support_gluster -> isAnyHost.. = true; create a getter logic</technical_language>

Target:
private void UpdateOptionsNonLocalFS() { if (hosts == null || allHosts == null || !isUpHostCheckCompleted()) { return; } if (getEntity() == null) { StopProgress(); setWindow(null); return; } UICommand addHostAction = new UICommand("AddHost", this); if (hosts.size() > 1) { hosts.remove(0); } if (hosts.isEmpty()) { addHostAction.setTitle(ClusterConfigureHostsAction); getCompulsoryActions().add(addHostAction); } else if (isAnyUpHostInCluster()) { addHostAction.setTitle(ClusterAddAnotherHostAction); getOptionalActions().add(addHostAction); } if (getEntity().getStoragePoolId() == null) { addHostAction.getExecuteProhibitionReasons().add(ConstantsManager.getInstance() .getConstants() .theClusterIsntAttachedToADcClusterGuide()); addHostAction.setIsExecutionAllowed(false); return; } ArrayList<VDS> availableHosts = new ArrayList<VDS>(); for (VDS vds : allHosts) { if (!getEntity().getId().equals(vds.getVdsGroupId()) && (vds.getStatus() == VDSStatus.Maintenance || vds.getStatus() == VDSStatus.PendingApproval) && vds.getSupportedClusterVersionsSet().contains(getEntity().getcompatibility_version())) { availableHosts.add(vds); } } UICommand selectHostAction = new UICommand("SelectHost", this); if (availableHosts.size() > 0) { if (hosts.isEmpty()) { selectHostAction.setTitle(SelectHostsAction); getCompulsoryActions().add(selectHostAction); } else if (isAnyUpHostInCluster()) { selectHostAction.setTitle(SelectHostsAction); getOptionalActions().add(selectHostAction); } } StopProgress(); }