[hibernate-issues] [Hibernate-JIRA] Commented: (HV-304) Class Validation Constraints Cause Duplicate ConstraintViolations

Marvin Addison (JIRA) noreply at atlassian.com
Wed Apr 7 13:20:42 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36231#action_36231 ] 

Marvin Addison commented on HV-304:
-----------------------------------

Additional investigation shows that the constraint violations are not exactly duplicates; they have different paths.  One has a null path, and the other has a path that was presumably specified via the following usage in the validator:

context.buildConstraintViolationWithTemplate(
		          message).addNode(propertyName).addConstraintViolation();

Perhaps this is a usage problem, but the duplicate behavior seems counterintuitive at best.

> Class Validation Constraints Cause Duplicate ConstraintViolations
> -----------------------------------------------------------------
>
>                 Key: HV-304
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-304
>             Project: Hibernate Validator
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 4.1.0.Beta1
>         Environment: java 1.5.0_16-b02
>            Reporter: Marvin Addison
>            Assignee: Hardy Ferentschik
>
> When a custom constraint applied to a class is evaluated by Hibernate Validator, duplicate validation errors are produced.  My investigation points to ValidatorImpl#validateConstraint() path evaluation as the root cause.  In particular it appears that it has improper handling of constraints that have null paths, which would be the case for a constraint applied to a class.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list