[
https://issues.apache.org/jira/browse/TRINIDAD-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Scott O'Bryan updated TRINIDAD-2245:
------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.2-core
Status: Resolved (was: Patch Available)
> ForEach tag throws ArrayIndexOfBoundsException when the end attribute is same
> as the size of the List
> -----------------------------------------------------------------------------------------------------
>
> Key: TRINIDAD-2245
> URL: https://issues.apache.org/jira/browse/TRINIDAD-2245
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Affects Versions: 2.0.1-core
> Reporter: Paresh Kumar Acharya
> Assignee: Scott O'Bryan
> Fix For: 2.0.2-core
>
> Attachments: ForEachTag_trunk.patch
>
>
> While iterating a collection using forEach Tag if the value specified using
> the end attribute matches the size of the collection
> ArrayIndexOutOfBoundsException is thrown.
> The Exception is not thrown if the end attribute is more than or less than
> the size of the list.
> The following sample code can be used to reproduce the bug.
> Ex:-
> Managed Bean:-
> ------------------------
> The Dept class depends on Employee class which just has one field named
> "name" with accessors.
> public class Dept {
> public Dept() {
> super();
> }
>
> public List getEmployees()
> {
> List employees = new ArrayList();
> for(int i=0;i<10;i++) {
> Employee emp = new Employee("Name "+i);
> employees.add(emp);
> }
> return employees;
> }
> }
>
>
> JSf code:-
> --------------
>
> <af:forEach begin="0" end="10" var="item"
> items="#{dept.employees}"
> varStatus="dd">
> <af:outputText
> value="(#{dd.index})--#{item['name']}--"
> inlineStyle="width:132px;
> font-weight:bold;" id="ot3"/>
> </af:forEach>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira