Source:
protected void executeQueryCommand() { String volumeName = getParameters().getVolumeName(); if (getParameters().isDetailRequired() || StringUtils.isNotEmpty(volumeName)) { executeAndSetReturnValue(volumeName); return; } VDSReturnValue nfsReturnValue = null; VDSReturnValue replicateReturnValue = null; GlusterVolumeEntity nfsReplicateVolume = getNfsReplicateVolume(getParameters().getClusterId()); if (nfsReplicateVolume != null) { executeAndSetReturnValue(nfsReplicateVolume.getName()); return; } GlusterVolumeEntity nfsVolume = getNfsVolume(getParameters().getClusterId()); GlusterVolumeEntity replicateVolume = getReplicateVolume(getParameters().getClusterId()); if (nfsVolume == null && replicateVolume == null) { log.error("To get service details, no Nfs or Replicated volumes found in the cluster."); getQueryReturnValue().setReturnValue(new GlusterVolumeAdvancedDetails()); return; } if (nfsVolume != null) { nfsReturnValue = executeCommand(nfsVolume.getName()); } if (replicateVolume != null) { replicateReturnValue = executeCommand(replicateVolume.getName()); } if (nfsReturnValue != null && replicateReturnValue != null) { GlusterVolumeAdvancedDetails volumeAdvancedDetailsForNfs = (GlusterVolumeAdvancedDetails) nfsReturnValue.getReturnValue(); GlusterVolumeAdvancedDetails volumeAdvancedDetailsForShd = (GlusterVolumeAdvancedDetails) replicateReturnValue.getReturnValue(); volumeAdvancedDetailsForNfs.getServiceInfo().addAll(volumeAdvancedDetailsForShd.getServiceInfo()); getQueryReturnValue().setReturnValue(volumeAdvancedDetailsForNfs); } else if (nfsReturnValue == null && replicateReturnValue != null) { getQueryReturnValue().setReturnValue(replicateReturnValue.getReturnValue()); } else if (nfsReturnValue != null && replicateVolume == null) { getQueryReturnValue().setReturnValue(nfsReturnValue.getReturnValue()); } }

Target:
protected void executeQueryCommand() { String volumeName = getParameters().getVolumeName(); if (getParameters().isDetailRequired() && StringUtils.isNotEmpty(volumeName)) { executeAndSetReturnValue(volumeName); return; } VDSReturnValue nfsReturnValue = null; VDSReturnValue replicateReturnValue = null; GlusterVolumeEntity nfsReplicateVolume = getNfsReplicateVolume(getParameters().getClusterId()); if (nfsReplicateVolume != null) { executeAndSetReturnValue(nfsReplicateVolume.getName()); return; } GlusterVolumeEntity nfsVolume = getNfsVolume(getParameters().getClusterId()); GlusterVolumeEntity replicateVolume = getReplicateVolume(getParameters().getClusterId()); if (nfsVolume == null && replicateVolume == null) { log.error("To get service details, no Nfs or Replicated volumes found in the cluster."); getQueryReturnValue().setReturnValue(new GlusterVolumeAdvancedDetails()); return; } if (nfsVolume != null) { nfsReturnValue = executeCommand(nfsVolume.getName()); } if (replicateVolume != null) { replicateReturnValue = executeCommand(replicateVolume.getName()); } if (nfsReturnValue != null && replicateReturnValue != null) { GlusterVolumeAdvancedDetails volumeAdvancedDetailsForNfs = (GlusterVolumeAdvancedDetails) nfsReturnValue.getReturnValue(); GlusterVolumeAdvancedDetails volumeAdvancedDetailsForShd = (GlusterVolumeAdvancedDetails) replicateReturnValue.getReturnValue(); volumeAdvancedDetailsForNfs.getServiceInfo().addAll(volumeAdvancedDetailsForShd.getServiceInfo()); getQueryReturnValue().setReturnValue(volumeAdvancedDetailsForNfs); } else if (nfsReturnValue == null && replicateReturnValue != null) { getQueryReturnValue().setReturnValue(replicateReturnValue.getReturnValue()); } else if (nfsReturnValue != null && replicateVolume == null) { getQueryReturnValue().setReturnValue(nfsReturnValue.getReturnValue()); } }