[
http://opensource.atlassian.com/projects/hibernate/browse/HV-463?page=com...
]
Hardy Ferentschik commented on HV-463:
--------------------------------------
The intention and working of _ensureDefaultGroupSequenceIsExpandable_ and
_assertDefaultGroupSequenceIsExpandable_ are quite cryptic and at the very least should be
better documented. the whole idea is to prevent un-expandable sequences due to entities
re-defining the default group sequence.
{code}
@GroupSequence({ A.class, B.class, C.class, Default.class })
public interface ABCSequence {
}
{code}
{code}
@GroupSequence({ MyEntity, A.class })
public class MyEntity{
}
{code}
{code}
...
Set<ConstraintViolation<MyEntity>> constraintViolations = validator.validate(
myEntity, ABCSequence.class );
...
{code}
This really leads to a conflict. _ABCSequence.class_ is requested, but together with the
default group redefinition we would get the following sequence: _A.class, B.class,
C.class, Default.class, A.class_ which is not possible. If the default group sequence on
_MyEntity_ would be _C.class, MyEntity_ it would be ok.
The code in GroupChain tries to evaluate exactly this, but is hard to understand w/o
background. Either we refactor or at least document better.
We might also think about a better name than _Group_, because this class contains the
concept of group and sequence. Maybe _GroupWithSequence_!?
Revisit the class and implementation of GroupChain
--------------------------------------------------
Key: HV-463
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-463
Project: Hibernate Validator
Issue Type: Improvement
Components: engine
Affects Versions: 4.x
Reporter: Kevin Pollet
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira