You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bval.apache.org by "Carlos Vara (JIRA)" <ji...@apache.org> on 2010/04/28 12:00:50 UTC

[jira] Created: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

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


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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Vara updated BVAL-28:
----------------------------

    Attachment:     (was: ConstraintValidatorIdentity.java)

> 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
>         Attachments: 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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Vara updated BVAL-28:
----------------------------

    Attachment: bval-core.patch
                bval-jsr303.patch
                ConstraintValidatorIdentity.java

> 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
>         Attachments: 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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Vara updated BVAL-28:
----------------------------

    Attachment: bval-core.patch
                bval-jsr303.patch
                ConstraintValidatorIdentity.java

> 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
>         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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Vara updated BVAL-28:
----------------------------

    Attachment: Continent.java

Last file for the patch.

> 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
>         Attachments: 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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Vara updated BVAL-28:
----------------------------

    Attachment:     (was: bval-core.patch)

> 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
>         Attachments: 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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Roman Stumm (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Stumm updated BVAL-28:
----------------------------

    Fix Version/s: 0.1-incubating

> 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
>             Fix For: 0.1-incubating
>
>         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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Vara updated BVAL-28:
----------------------------

    Attachment: Continent.java

Re-uploaded files as I forgot to grant license.

> 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
>         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.


[jira] Commented: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861794#action_12861794 ] 

Carlos Vara commented on BVAL-28:
---------------------------------

Nice catch Roman, it definitely is a better place for it.

Thanks for reviewing the changes and merging them so promptly!


> 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
>             Fix For: 0.1-incubating
>
>         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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Vara updated BVAL-28:
----------------------------

    Attachment:     (was: Continent.java)

> 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
>         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.


[jira] Assigned: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Roman Stumm (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Stumm reassigned BVAL-28:
-------------------------------

    Assignee: Roman Stumm

> 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.


[jira] Resolved: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Roman Stumm (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Updated: (BVAL-28) Property path for nodes inside iterables that do not implement List should not contain the index

Posted by "Carlos Vara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Vara updated BVAL-28:
----------------------------

    Attachment:     (was: bval-jsr303.patch)

> 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
>         Attachments: 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.