Reverting the changes as per master copy

Signed-off-by: asharani-murugesh <asharani.murugesh@in.bosch.com>
This commit is contained in:
asharani-murugesh
2016-02-15 10:40:30 +01:00
parent 158a9cfa20
commit b498f60392

View File

@@ -342,25 +342,26 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
distributionSet.setRequiredMigrationStep(isMigStepReq); distributionSet.setRequiredMigrationStep(isMigStepReq);
} }
private boolean duplicateCheck(final String name, final String version) { private boolean duplicateCheck(final String name, final String version) {
final DistributionSet existingDs = distributionSetManagement.findDistributionSetByNameAndVersion(name, version); final DistributionSet existingDs = distributionSetManagement.findDistributionSetByNameAndVersion(name, version);
/*
if (existingDs == null) { * Distribution should not exists with the same name & version. Display
return true; * error message, when the "existingDs" is not null and it is add window
} * (or) when the "existingDs" is not null and it is edit window and the
* distribution Id of the edit window is different then the "existingDs"
if (editDistribution && !existingDs.getId().equals(editDistId)) { */
return true; if (existingDs != null && !existingDs.getId().equals(editDistId)) {
}
distNameTextField.addStyleName("v-textfield-error"); distNameTextField.addStyleName("v-textfield-error");
distVersionTextField.addStyleName("v-textfield-error"); distVersionTextField.addStyleName("v-textfield-error");
notificationMessage.displayValidationError( notificationMessage.displayValidationError(
i18n.get("message.duplicate.dist", new Object[] { existingDs.getName(), existingDs.getVersion() })); i18n.get("message.duplicate.dist", new Object[] { existingDs.getName(), existingDs.getVersion() }));
return false; return false;
} else {
return true;
}
} }
/** /**
* Mandatory Check. * Mandatory Check.
* *