Revision: 9791
Author: ncha...@google.com
Date: Wed Mar 2 06:09:17 2011
Log: Only validate a constraint annotation once.
[JSR 303 TCK Result] 106 of 257 (41.25%) Pass with 24 Failures and 9 Errors.
Review at http://gwt-code-reviews.appspot.com/1373802
Review by: rchan...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9791
Modified:
/trunk/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/application/ValidationRequirementGwtTest.java
=======================================
---
/trunk/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java
Mon Feb 28 10:45:39 2011
+++
/trunk/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java
Wed Mar 2 06:09:17 2011
@@ -1374,9 +1374,18 @@
sw.println("}");
}
+ // It is possible for an annotation with the exact same values to be
set on
+ // both the field and the getter.
+ // Keep track of the ones we have used to make sure we don't duplicate.
+ // It doesn't matter which one we use because they have exactly the
same
+ // values.
+ Set<Object> includedAnnotations = Sets.newHashSet();
int count = 0;
for (ConstraintDescriptor<?> constraint :
p.getConstraintDescriptors()) {
- if (hasMatchingAnnotation(p, useField, constraint)) {
+ Object annotation = constraint.getAnnotation();
+ if (!includedAnnotations.contains(annotation)
+ && hasMatchingAnnotation(p, useField, constraint)) {
+ includedAnnotations.add(annotation);
String constraintDescriptorVar = constraintDescriptorVar(
p.getPropertyName(), count);
=======================================
---
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/application/ValidationRequirementGwtTest.java
Mon Feb 28 07:12:19 2011
+++
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/application/ValidationRequirementGwtTest.java
Wed Mar 2 06:09:17 2011
@@ -42,7 +42,6 @@
delegate.testClassLevelConstraints();
}
- @Failing(issue = 5798)
public void testConstraintAppliedOnFieldAndProperty() {
delegate.testConstraintAppliedOnFieldAndProperty();
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors