Author: hardy.ferentschik
Date: 2009-08-27 10:29:06 -0400 (Thu, 27 Aug 2009)
New Revision: 17434
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/metadata/ConstraintDescriptor.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/XmlConfigurationTest.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java
Log:
Changed Set<Class<Payload>> getPayload() to Set<Class<? extends
Payload>> getPayload() in ConstraintDescriptor
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/metadata/ConstraintDescriptor.java
===================================================================
---
beanvalidation/trunk/validation-api/src/main/java/javax/validation/metadata/ConstraintDescriptor.java 2009-08-27
14:10:59 UTC (rev 17433)
+++
beanvalidation/trunk/validation-api/src/main/java/javax/validation/metadata/ConstraintDescriptor.java 2009-08-27
14:29:06 UTC (rev 17434)
@@ -55,7 +55,7 @@
*
* @return payload classes hosted on the constraint or an empty set if none.
*/
- Set<Class<Payload>> getPayload();
+ Set<Class<? extends Payload>> getPayload();
/**
* Immutable list of the constraint validation implementation classes.
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionTest.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionTest.java 2009-08-27
14:10:59 UTC (rev 17433)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionTest.java 2009-08-27
14:29:06 UTC (rev 17434)
@@ -239,11 +239,11 @@
@SpecAssertion(section = "2.3", id = "j"),
@SpecAssertion(section = "2.3", id = "o")
})
- public void testOverridenAttributesMustMatchInType() {
+ public void testOverriddenAttributesMustMatchInType() {
Validator validator = TestUtil.getValidatorUnderTest();
try {
validator.validate( new DummyEntityWithZipCode( "foobar" ) );
- fail( "Wrong atttibute override in composite constraint. An Exception should have
been thrown." );
+ fail( "Wrong attribute override in composite constraint. An Exception should have
been thrown." );
}
catch ( ConstraintDefinitionException e ) {
// success
@@ -275,10 +275,10 @@
assertCorrectConstraintTypes( constraintViolations, NotNull.class );
ConstraintViolation<Friend> constraintViolation =
constraintViolations.iterator().next();
- Set<Class<Payload>> payloads =
constraintViolation.getConstraintDescriptor().getPayload();
+ Set<Class<? extends Payload>> payloads =
constraintViolation.getConstraintDescriptor().getPayload();
assertTrue( payloads.size() == 1, "There should be one payload in the set"
);
- Class<Payload> payload = payloads.iterator().next();
+ Class<? extends Payload> payload = payloads.iterator().next();
assertTrue( payload.getName().equals( Severity.Warn.class.getName() ), "Unexpected
payload" );
}
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorTest.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorTest.java 2009-08-27
14:10:59 UTC (rev 17433)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorTest.java 2009-08-27
14:29:06 UTC (rev 17434)
@@ -68,16 +68,16 @@
@SpecAssertion(section = "5.5", id = "a"),
@SpecAssertion(section = "5.5", id = "c")
})
- public void testAnnotationAndMapParamtersReflectParamterOverriding() {
+ public void testAnnotationAndMapParametersReflectParameterOverriding() {
ConstraintDescriptor<?> descriptor = getConstraintDescriptor( Person.class,
"firstName" );
Set<ConstraintDescriptor<?>> composingDescriptors =
descriptor.getComposingConstraints();
assertEquals( composingDescriptors.size(), 2, "Wrong number of composing
constraints" );
for ( ConstraintDescriptor<?> desc : composingDescriptors ) {
if ( desc.getAnnotation().annotationType().equals( Size.class ) ) {
Size sizeAnn = ( Size ) desc.getAnnotation();
- assertEquals( sizeAnn.min(), 5, "The min parameter should reflect the overriden
parameter" );
+ assertEquals( sizeAnn.min(), 5, "The min parameter should reflect the overridden
parameter" );
assertEquals(
- desc.getAttributes().get( "min" ), 5, "The min parameter should
reflect the overriden parameter"
+ desc.getAttributes().get( "min" ), 5, "The min parameter should
reflect the overridden parameter"
);
}
else if ( desc.getAnnotation().annotationType().equals( NotNull.class ) ) {
@@ -117,7 +117,7 @@
@Test
@SpecAssertion(section = "5.5", id = "d")
- public void testGetGroupsWithImplcitGroup() {
+ public void testGetGroupsWithImplicitGroup() {
ConstraintDescriptor<?> descriptor = getConstraintDescriptor( Man.class,
"lastName" );
Set<Class<?>> groups = descriptor.getGroups();
assertTrue( groups.size() == 2 );
@@ -153,7 +153,7 @@
@SpecAssertion(section = "5.5", id = "g")
public void testPayload() {
ConstraintDescriptor<?> descriptor = getConstraintDescriptor( Person.class,
"firstName" );
- Set<Class<Payload>> payload = descriptor.getPayload();
+ Set<Class<? extends Payload>> payload = descriptor.getPayload();
assertTrue( payload.size() == 1 );
assertEquals( payload.iterator().next(), Severity.Info.class, "Wrong payload"
);
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/XmlConfigurationTest.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/XmlConfigurationTest.java 2009-08-27
14:10:59 UTC (rev 17433)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/XmlConfigurationTest.java 2009-08-27
14:29:06 UTC (rev 17434)
@@ -83,7 +83,7 @@
);
ConstraintViolation<User> constraintViolation =
constraintViolations.iterator().next();
- Set<Class<Payload>> payloads =
constraintViolation.getConstraintDescriptor().getPayload();
+ Set<Class<? extends Payload>> payloads =
constraintViolation.getConstraintDescriptor().getPayload();
assertTrue( payloads.size() == 1, "One one payload class is defined in xml"
);
assertTrue( Error.class.equals( payloads.iterator().next() ) );
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java 2009-08-27
14:10:59 UTC (rev 17433)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/ConstraintDescriptorImpl.java 2009-08-27
14:29:06 UTC (rev 17434)
@@ -83,7 +83,7 @@
*/
private final Map<String, Object> attributes;
- private final Set<Class<Payload>> payloads;
+ private final Set<Class<? extends Payload>> payloads;
/**
* The composing constraints for this constraints.
@@ -120,8 +120,8 @@
this( annotation, constraintHelper, null );
}
- private Set<Class<Payload>> buildPayloadSet(T annotation) {
- Set<Class<Payload>> payloadSet = new
HashSet<Class<Payload>>();
+ private Set<Class<? extends Payload>> buildPayloadSet(T annotation) {
+ Set<Class<? extends Payload>> payloadSet = new HashSet<Class<?
extends Payload>>();
Class<Payload>[] payloadFromAnnotation;
try {
//TODO be extra safe and make sure this is an array of Payload
@@ -216,7 +216,7 @@
return groups;
}
- public Set<Class<Payload>> getPayload() {
+ public Set<Class< ? extends Payload>> getPayload() {
return payloads;
}