You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bval.apache.org by rm...@apache.org on 2013/07/02 08:42:40 UTC

svn commit: r1498801 - in /bval/branches/bval-11: bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintDescriptorImpl.java bval-tck11/work-tests-suite.xml

Author: rmannibucau
Date: Tue Jul  2 06:42:40 2013
New Revision: 1498801

URL: http://svn.apache.org/r1498801
Log:
consistent equals/hascode for ConstraintDescriptorImpl - create a regression in tck 1.0 but seems the same test in bv 1.1 is a bit different

Modified:
    bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintDescriptorImpl.java
    bval/branches/bval-11/bval-tck11/work-tests-suite.xml

Modified: bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintDescriptorImpl.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintDescriptorImpl.java?rev=1498801&r1=1498800&r2=1498801&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintDescriptorImpl.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintDescriptorImpl.java Tue Jul  2 06:42:40 2013
@@ -148,14 +148,16 @@ public class ConstraintDescriptorImpl<T 
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
 
-        ConstraintDescriptorImpl that = (ConstraintDescriptorImpl) o;
+        final ConstraintDescriptorImpl that = (ConstraintDescriptorImpl) o;
 
         if (reportAsSingleViolation != that.reportAsSingleViolation) return false;
         if (!annotation.annotationType().equals(that.annotation.annotationType())) return false;
+        if (attributes != null ? !attributes.equals(that.attributes) : that.attributes != null) return false;
         if (composingConstraints != null ? !composingConstraints.equals(that.composingConstraints) : that.composingConstraints != null)
             return false;
         if (constraintValidatorClasses != null ? !constraintValidatorClasses.equals(that.constraintValidatorClasses) : that.constraintValidatorClasses != null)
             return false;
+        if (groups != null ? !groups.equals(that.groups) : that.groups != null) return false;
         if (payload != null ? !payload.equals(that.payload) : that.payload != null) return false;
         if (template != null ? !template.equals(that.template) : that.template != null) return false;
         if (validationAppliesTo != that.validationAppliesTo) return false;
@@ -165,9 +167,11 @@ public class ConstraintDescriptorImpl<T 
 
     @Override
     public int hashCode() {
-        int result = annotation != null ? annotation.annotationType().hashCode() : 0;
+        int result = annotation.annotationType().hashCode();
+        result = 31 * result + (groups != null ? groups.hashCode() : 0);
         result = 31 * result + (payload != null ? payload.hashCode() : 0);
         result = 31 * result + (constraintValidatorClasses != null ? constraintValidatorClasses.hashCode() : 0);
+        result = 31 * result + (attributes != null ? attributes.hashCode() : 0);
         result = 31 * result + (composingConstraints != null ? composingConstraints.hashCode() : 0);
         result = 31 * result + (reportAsSingleViolation ? 1 : 0);
         result = 31 * result + (validationAppliesTo != null ? validationAppliesTo.hashCode() : 0);

Modified: bval/branches/bval-11/bval-tck11/work-tests-suite.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-tck11/work-tests-suite.xml?rev=1498801&r1=1498800&r2=1498801&view=diff
==============================================================================
--- bval/branches/bval-11/bval-tck11/work-tests-suite.xml (original)
+++ bval/branches/bval-11/bval-tck11/work-tests-suite.xml Tue Jul  2 06:42:40 2013
@@ -21,7 +21,9 @@ think to add -Dvalidation.provider=org.a
 <suite name="tmp" verbose="1">
     <test name="tmp">
         <classes>
-            <class name="org.hibernate.beanvalidation.tck.tests.constraints.application.ValidationRequirementTest" />
+            <class name="org.hibernate.beanvalidation.tck.tests.constraints.application.ValidationRequirementTest">
+
+            </class>
 
             <!--
             <class name="org.hibernate.beanvalidation.tck.tests.integration.cdi.executable.ExecutableValidationTest">