bval-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Vara (JIRA)" <>
Subject [jira] Updated: (BVAL-47) Correctly follow GroupSequence definitions when validating
Date Tue, 18 May 2010 13:33:00 GMT


Carlos Vara updated BVAL-47:

    Attachment: bval-core-47.patch

Patch submitted for review.

3 more tests pass with it applied.

> Correctly follow GroupSequence definitions when validating
> ----------------------------------------------------------
>                 Key: BVAL-47
>                 URL:
>             Project: BeanValidation
>          Issue Type: Bug
>          Components: jsr303
>    Affects Versions: 0.1-incubating
>            Reporter: Carlos Vara
>         Attachments: bval-core-47.patch, bval-jsr303-47.patch
> I'm submitting this here for review as the solution involves many structural changes
in ClassValidator. If you think the patch is fine, I can merge it once I get commit access.
> Basically, when validating the default group in a bean:
> - If a group sequence is defined in the bean class, iterate that sequence and stop if
any violation is found.
> - If no group sequence is defined in the bean class, get the hierarchy of classes in
the bean, and for each class, check the constraints defined in that class or interface according
to the group sequence defined in that class.
> The same algorithm must be applied to related beans (@Valid), and validation starts again
from the default group for them (groups defined in the group sequence of their parent bean
must not be applied to their related beans).
> I added 2 additional tests, those and the TCK tests in GroupSequenceIsolationTest should
help clarify the spec regarding this.
> Resulting ClassValidator is quite decoupled from BeanValidator (the class it inherits
from, in bval-core). Some of the methods are similar in code, but the order in which they
are called differs, so overriding wasn't an option. It could be an option to completely remove
inheritance in the future to obtain a cleaner ClassValidator.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message