Change By: Gunnar Morling (05/Feb/13 2:13 AM)
Description: When validating a subtype with a property {{foo}} which extends a superclass which itself has a private constrained field {{foo}}, then constraints from that field in the supertype are evaluated as well, although the shouldn't.

Example:

{code}
public class InheritanceTest {


    private static class Base {

        @Min(5)
        private final int i = 0;
    }

    private static class Sub extends Base {

        private final int i = 0;
    }

@Test
    public void testInheritance() {
        Set<ConstraintViolation<Sub>> violations = Validation
            .buildDefaultValidatorFactory()
            .getValidator()
            .validate( new Sub() );
    
        assertTrue(
            violations.isEmpty(),
            "There should be no violations as the constraints from the supertype field shouldn't apply."
        );
    }
}
{code}
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira