]
Hardy Ferentschik resolved HV-350.
----------------------------------
Resolution: Cannot Reproduce
Fix Version/s: 4.2.0
Inherited Bean validates non-default constraints as default
-----------------------------------------------------------
Key: HV-350
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-350
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.1.0.Final
Environment: Spring 3.0.3
Reporter: Marc Schipperheyn
Assignee: Hardy Ferentschik
Fix For: 4.2.0
Let's say you have 2 beans
public class Vehicle{
@AssertTrue(groups={CheckMaintenance.class,CheckRoad.class})
public boolean oilCheck;
@NotNull(groups={CheckRoad.class})
public String plate;
}
public class Car extends Vehicle{
@Min(value=4)
public int numWheels;
}
validate(car,Class<?>[]{Default.class,CheckMaintenance.class});
If I validate Car, all the Vehicle validations are selected as Defaults as opposed to by
their specific marker interface. In other words, Validator validates plate regardless of
the fact that CheckRoad is not part of the array of marker interfaces specified for this
validation. I assume this has something to do with the inherited nature of the class.
Stepping through the code, I can also see that the groups Descriptor of the
ConstraintDescriptorImpl 'loses' non default groups for the inherited constraints.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: