You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bval.apache.org by "Roman Stumm (JIRA)" <ji...@apache.org> on 2010/06/22 15:11:55 UTC

[jira] Resolved: (BVAL-47) Correctly follow GroupSequence definitions when validating

     [ https://issues.apache.org/jira/browse/BVAL-47?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Stumm resolved BVAL-47.
-----------------------------

    Fix Version/s: 0.2-incubating
       Resolution: Fixed

BeanValidator and ClassValidator do not inherit from each other. I moved the common code to a new superclass AbstractBeanValidator, so no method of BeanValidator needs to be overwritten in ClassValidator. I hope it is OK, that I also removed some TODO marks in the code, that were a reminder of this refactoring.

> Correctly follow GroupSequence definitions when validating
> ----------------------------------------------------------
>
>                 Key: BVAL-47
>                 URL: https://issues.apache.org/jira/browse/BVAL-47
>             Project: BeanValidation
>          Issue Type: Bug
>          Components: jsr303
>    Affects Versions: 0.1-incubating
>            Reporter: Carlos Vara
>             Fix For: 0.2-incubating
>
>         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.