@Override public ErrorCollection getErrorCollection() { final SimpleErrorCollection copied = new SimpleErrorCollection(); copied.addErrorCollection(errorCollection); return copied; }
/** * Constructs a new ValidationFailureException with an error message, a collection of errors, and a cause. * * @param message a String containing an error message * @param errors an ErrorCollection containing collection of validation errors * @param throwable the Throwable that caused the validation failure */ public ValidationFailureException(String message, ErrorCollection errors, Throwable throwable) { super(message, throwable); SimpleErrorCollection errorsCopy = new SimpleErrorCollection(); if (message != null) { errorsCopy.addErrorMessage(message); } if (errors != null) { errorsCopy.addErrorCollection(errors); } this.errors = errorsCopy; }
@Override public Boolean apply(final E input) { ErrorCollection permissionCheckResults = permissionFunction.apply(user, input); if (permissionCheckResults.hasAnyErrors()) { errorCollection.addErrorCollection(permissionCheckResults); } return !permissionCheckResults.hasAnyErrors(); } }
errors.addErrorCollection(e.parseErrors); reasons.add(CreateVersionValidationResult.Reason.BAD_START_DATE); errors.addErrorCollection(e.parseErrors); reasons.add(CreateVersionValidationResult.Reason.BAD_RELEASE_DATE); if (!validateDatesOutcome.isValid()) errors.addErrorCollection(validateDatesOutcome.getErrorCollection()); reasons.add(CreateVersionValidationResult.Reason.BAD_START_RELEASE_DATE_ORDER);
protected SetPropertyValidationResult validateSetProperty(ApplicationUser user, Option<E> entity, PropertyInput propertyInput, EntityPropertyOptions options) { checkNotNull(propertyInput); SimpleErrorCollection errorCollection = new SimpleErrorCollection(); if (checkEntity(entity, user, getEditPermissionFunction(options), errorCollection)) { if (StringUtils.isEmpty(propertyInput.getPropertyValue())) { errorCollection.addErrorMessage(i18n.getText("jira.properties.service.empty.value"), VALIDATION_FAILED); } else { errorCollection.addErrorCollection(validatePropertyInput(propertyInput)); } } Option<EntityPropertyInput> property = errorCollection.hasAnyErrors() ? Option.<EntityPropertyInput>none() : Option.some(createInputForPropertySet(entity.get(), propertyInput)); return new SetPropertyValidationResult(errorCollection, property); }
createIssueLink(user, issue, issueToLinkTo, remoteIssueLink.getRelationship()); } catch(IssueLinkCreationException e){ errors.addErrorCollection(e.getErrorCollection()); } finally {
errorCollection.addErrorCollection(possibleErrors);