[ 
https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roman Stumm resolved BVAL-28.
-----------------------------

    Resolution: Fixed

thanks again, i merged the changes and committed. one minor optimization:

in BeanValidator, i moved the statement
          context.setCurrentIndex(null);
before the while() - loop:

   private <VL extends ValidationListener> void 
validateNonPositionalIteratableInContext(ValidationContext<VL> context) {
        Iterator<?> it = ((Iterable<?>) context.getBean()).iterator();
        // jsr303 spec: Each object provided by the iterator is validated.
        context.setCurrentIndex(null);
        final DynamicMetaBean dyn = getDynamicMetaBean(context);
        while (it.hasNext()) { // to Many
            Object each = it.next();
            if (each == null)
                continue; // enhancement: throw IllegalArgumentException? (=> 
spec)
            if (dyn != null) {
                context.setBean(each, dyn.resolveMetaBean(each));
            } else {
                context.setBean(each);
            }
            validateBeanNet(context);
        }
    }

> Property path for nodes inside iterables that do not implement List should 
> not contain the index
> ------------------------------------------------------------------------------------------------
>
>                 Key: BVAL-28
>                 URL: https://issues.apache.org/jira/browse/BVAL-28
>             Project: BeanValidation
>          Issue Type: Bug
>          Components: jsr303
>    Affects Versions: 0.1-incubating
>            Reporter: Carlos Vara
>            Assignee: Roman Stumm
>         Attachments: bval-core.patch, bval-jsr303.patch, 
> ConstraintValidatorIdentity.java, Continent.java
>
>
> Example: if bean Person has a set of addresses, when detecting a violation in 
> one of the addresses it should be reported as:
> []address.*
> instead of:
> [1]address.*
> as the iterating order is not fixed.
> Apart from the modifications in NodeImpl and validateContext, fix involves 
> modifying the method collectValidated(.., ConstraintValidator), as current 
> check relied only on the uniqueness of the path, and the Path/Node interfaces 
> make it cumbersome to store an internal index to keep that uniqueness.
> With the patch applied, one more test passes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to