incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r1043662 - /incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java
Date Wed, 08 Dec 2010 20:33:05 GMT
Author: dwoods
Date: Wed Dec  8 20:33:04 2010
New Revision: 1043662

URL: http://svn.apache.org/viewvc?rev=1043662&view=rev
Log:
BVAL-88 Cascaded validation adds a constraint violation for valid child property.  Original
patch submitted by Chris Ey.

Modified:
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java?rev=1043662&r1=1043661&r2=1043662&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintValidation.java
Wed Dec  8 20:33:04 2010
@@ -171,12 +171,11 @@ public class ConstraintValidation<T exte
             ConstraintValidationListener<?> listener = context.getListener();
             listener.beginReportAsSingle();
 
-            boolean failed = false;
+            boolean failed = listener.hasViolations();
             try {
                 // stop validating when already failed and
                 // ReportAsSingleInvalidConstraint = true ?
-                for (Iterator<ConstraintValidation<?>> composed = getComposingValidations().iterator();
!failed
-                    && composed.hasNext();) {
+                for (Iterator<ConstraintValidation<?>> composed = getComposingValidations().iterator();
!failed && composed.hasNext();) {
                     composed.next().validate(context);
                     failed = listener.hasViolations();
                 }
@@ -190,8 +189,7 @@ public class ConstraintValidation<T exte
                 // TODO RSt - how should the composed constraint error report
                 // look like?
                 ConstraintValidatorContextImpl jsrContext = new ConstraintValidatorContextImpl(context,
this);
-                addErrors(context, jsrContext); // add defaultErrorMessage
-                                                // only*/
+                addErrors(context, jsrContext); // add defaultErrorMessage only
                 return;
             }
         } else {



Mime
View raw message