You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Rey Dalisay (JIRA)" <de...@myfaces.apache.org> on 2011/02/08 09:01:57 UTC

[jira] Created: (MYFACES-3034) ui:repeat offset and size performs incorrect validation

ui:repeat offset and size performs incorrect validation
-------------------------------------------------------

                 Key: MYFACES-3034
                 URL: https://issues.apache.org/jira/browse/MYFACES-3034
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 2.0.3
         Environment: OpenJDK 1.6.0_20; Tomcat 6.0.20; Ubuntu 10.04 on kernel version 2.6.32-28-generic
            Reporter: Rey Dalisay


The following ui:repeat tag with those values of size and offset throw a FacesException with the message: "iteration offset cannot be greater than collection size."

<ui:repeat var="listing" value="#{myListings.listings}" size="19" offset="20">

It appears that the method _validateAttributes() in the UIRepeat class performs the validation incorrectly.  It seems to assume that the value of size is the size of the collection, rather than the desired iteration size.  Here is the relevant code from _validateAttributes():

        if ((size > -1) && (begin > size)) {
            throw new FacesException ("iteration offset cannot be greater " +
                "than collection size");
        }

The exception is thrown in the above case because begin > size, where begin = offset = 20.


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MYFACES-3034) ui:repeat offset and size performs incorrect validation

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3034.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.2
                   2.0.8
         Assignee: Leonardo Uribe

> ui:repeat offset and size performs incorrect validation
> -------------------------------------------------------
>
>                 Key: MYFACES-3034
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3034
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.3
>         Environment: OpenJDK 1.6.0_20; Tomcat 6.0.20; Ubuntu 10.04 on kernel version 2.6.32-28-generic
>            Reporter: Rey Dalisay
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.8, 2.1.2
>
>
> The following ui:repeat tag with those values of size and offset throw a FacesException with the message: "iteration offset cannot be greater than collection size."
> <ui:repeat var="listing" value="#{myListings.listings}" size="19" offset="20">
> It appears that the method _validateAttributes() in the UIRepeat class performs the validation incorrectly.  It seems to assume that the value of size is the size of the collection, rather than the desired iteration size.  Here is the relevant code from _validateAttributes():
>         if ((size > -1) && (begin > size)) {
>             throw new FacesException ("iteration offset cannot be greater " +
>                 "than collection size");
>         }
> The exception is thrown in the above case because begin > size, where begin = offset = 20.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MYFACES-3034) ui:repeat offset and size performs incorrect validation

Posted by "Rey Dalisay (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991850#comment-12991850 ] 

Rey Dalisay commented on MYFACES-3034:
--------------------------------------

Just to add ... On Mojarra 2.0.4, the size attribute is taken to mean the position of the last element to retrieve, not the number of elements to retrieve.  The following tag performs on Mojarra what was originally intended from the above test case.

<ui:repeat var="listing" value="#{myListings.listings}" size="38" offset="20">


> ui:repeat offset and size performs incorrect validation
> -------------------------------------------------------
>
>                 Key: MYFACES-3034
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3034
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.3
>         Environment: OpenJDK 1.6.0_20; Tomcat 6.0.20; Ubuntu 10.04 on kernel version 2.6.32-28-generic
>            Reporter: Rey Dalisay
>
> The following ui:repeat tag with those values of size and offset throw a FacesException with the message: "iteration offset cannot be greater than collection size."
> <ui:repeat var="listing" value="#{myListings.listings}" size="19" offset="20">
> It appears that the method _validateAttributes() in the UIRepeat class performs the validation incorrectly.  It seems to assume that the value of size is the size of the collection, rather than the desired iteration size.  Here is the relevant code from _validateAttributes():
>         if ((size > -1) && (begin > size)) {
>             throw new FacesException ("iteration offset cannot be greater " +
>                 "than collection size");
>         }
> The exception is thrown in the above case because begin > size, where begin = offset = 20.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (MYFACES-3034) ui:repeat offset and size performs incorrect validation

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe reopened MYFACES-3034:
-------------------------------------


>From users list:

Please help to publish the latest MyFaces 2.0.8-SNAPSHOT

OK, I was thinking that an old MyFaces snapshot is used as I got a failure
in my sample for some changes are done to UIRepeat tag in
MYFACES-3034<https://issues.apache.org/jira/browse/MYFACES-3034> .
After some investigation later, it seems that the changes brought a problem.
If repeat tag is used as :
<ui:repeat var="listing" value="#{myListings.listings}"  offset="20">
An exception is always thrown on line 457,
--->
if (size == -1) {
           size = end;   <-- Should it be size = end - offset ?
       }

       if (end >= 0) {
           if (size < 0) {
               throw new FacesException ("iteration size cannot be less " +
                   "than zero");
           }

           else if ((begin + size) > end) {
               throw new FacesException ("iteration size cannot be greater
" +    <--- Exception is always thrown
                   "than collection size");

> ui:repeat offset and size performs incorrect validation
> -------------------------------------------------------
>
>                 Key: MYFACES-3034
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3034
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.3
>         Environment: OpenJDK 1.6.0_20; Tomcat 6.0.20; Ubuntu 10.04 on kernel version 2.6.32-28-generic
>            Reporter: Rey Dalisay
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.8, 2.1.2
>
>
> The following ui:repeat tag with those values of size and offset throw a FacesException with the message: "iteration offset cannot be greater than collection size."
> <ui:repeat var="listing" value="#{myListings.listings}" size="19" offset="20">
> It appears that the method _validateAttributes() in the UIRepeat class performs the validation incorrectly.  It seems to assume that the value of size is the size of the collection, rather than the desired iteration size.  Here is the relevant code from _validateAttributes():
>         if ((size > -1) && (begin > size)) {
>             throw new FacesException ("iteration offset cannot be greater " +
>                 "than collection size");
>         }
> The exception is thrown in the above case because begin > size, where begin = offset = 20.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MYFACES-3034) ui:repeat offset and size performs incorrect validation

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3034.
-------------------------------------

    Resolution: Fixed

> ui:repeat offset and size performs incorrect validation
> -------------------------------------------------------
>
>                 Key: MYFACES-3034
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3034
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.3
>         Environment: OpenJDK 1.6.0_20; Tomcat 6.0.20; Ubuntu 10.04 on kernel version 2.6.32-28-generic
>            Reporter: Rey Dalisay
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.8, 2.1.2
>
>
> The following ui:repeat tag with those values of size and offset throw a FacesException with the message: "iteration offset cannot be greater than collection size."
> <ui:repeat var="listing" value="#{myListings.listings}" size="19" offset="20">
> It appears that the method _validateAttributes() in the UIRepeat class performs the validation incorrectly.  It seems to assume that the value of size is the size of the collection, rather than the desired iteration size.  Here is the relevant code from _validateAttributes():
>         if ((size > -1) && (begin > size)) {
>             throw new FacesException ("iteration offset cannot be greater " +
>                 "than collection size");
>         }
> The exception is thrown in the above case because begin > size, where begin = offset = 20.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira